\section{KSelection\-Owner Class Reference}
\label{classKSelectionOwner}\index{KSelectionOwner@{KSelectionOwner}}
This class implements claiming and owning manager selections, as described in the ICCCM, section 2.8. ICCCM manager selection owner.  


{\tt \#include $<$kmanagerselection.h$>$}

Inheritance diagram for KSelection\-Owner:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=64pt]{classKSelectionOwner__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KSelection\-Owner:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=64pt]{classKSelectionOwner__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf lost\-Ownership} ()
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KSelection\-Owner} (Atom selection, int screen=-1, {\bf QObject} $\ast${\bf parent}=NULL)
\item 
{\bf KSelection\-Owner} (const char $\ast$selection, int screen=-1, {\bf QObject} $\ast${\bf parent}=NULL)
\item 
virtual {\bf $\sim$KSelection\-Owner} ()
\item 
bool {\bf claim} (bool force, bool force\_\-kill=true)
\item 
void {\bf release} ()
\item 
Window {\bf owner\-Window} () const 
\item 
bool {\bf filter\-Event} (XEvent $\ast$ev\_\-P)\label{classKSelectionOwner_a6}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual bool {\bf handle\-Message} (XEvent $\ast$ev)
\item 
virtual bool {\bf generic\-Reply} (Atom target, Atom {\bf property}, Window requestor)
\item 
virtual void {\bf reply\-Targets} (Atom {\bf property}, Window requestor)
\item 
virtual void {\bf get\-Atoms} ()
\item 
void {\bf set\-Data} (long extra1, long extra2)
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKSelectionOwner_b5}

\end{CompactItemize}


\subsection{Detailed Description}
This class implements claiming and owning manager selections, as described in the ICCCM, section 2.8. ICCCM manager selection owner. 

The selection atom is passed to the constructor, {\bf claim()}{\rm (p.\,\pageref{classKSelectionOwner_a3})} attemps to claim ownership of the selection, {\bf release()}{\rm (p.\,\pageref{classKSelectionOwner_a4})} gives up the selection ownership. Signal {\bf lost\-Ownership()}{\rm (p.\,\pageref{classKSelectionOwner_l0})} is emitted when the selection is claimed by another owner. \begin{Desc}
\item[Since:]3.2 \end{Desc}




Definition at line 46 of file kmanagerselection.h.

\subsection{Constructor \& Destructor Documentation}
\index{KSelectionOwner@{KSelection\-Owner}!KSelectionOwner@{KSelectionOwner}}
\index{KSelectionOwner@{KSelectionOwner}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KSelection\-Owner::KSelection\-Owner (Atom {\em selection}, int {\em screen} = {\tt -1}, {\bf QObject} $\ast$ {\em parent} = {\tt NULL})}\label{classKSelectionOwner_a0}


This constructor initializes the object, but doesn't perform any operation on the selection. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em selection}]atom representing the manager selection \item[{\em screen}]X screen, or -1 for default \item[{\em parent}]parent object, or NULL if there is none \end{description}
\end{Desc}


Definition at line 76 of file kmanagerselection.cpp.\index{KSelectionOwner@{KSelection\-Owner}!KSelectionOwner@{KSelectionOwner}}
\index{KSelectionOwner@{KSelectionOwner}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KSelection\-Owner::KSelection\-Owner (const char $\ast$ {\em selection}, int {\em screen} = {\tt -1}, {\bf QObject} $\ast$ {\em parent} = {\tt NULL})}\label{classKSelectionOwner_a1}


This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This constructor accepts the selection name and creates the appropriate atom for it automatically.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em selection}]name of the manager selection \item[{\em screen}]X screen, or -1 for default \item[{\em parent}]parent object, or NULL if there is none \end{description}
\end{Desc}


Definition at line 87 of file kmanagerselection.cpp.\index{KSelectionOwner@{KSelection\-Owner}!~KSelectionOwner@{$\sim$KSelectionOwner}}
\index{~KSelectionOwner@{$\sim$KSelectionOwner}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KSelection\-Owner::$\sim${\bf KSelection\-Owner} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKSelectionOwner_a2}


Destructor. 

Calls {\bf release()}{\rm (p.\,\pageref{classKSelectionOwner_a4})}. 

Definition at line 98 of file kmanagerselection.cpp.

References release().

\subsection{Member Function Documentation}
\index{KSelectionOwner@{KSelection\-Owner}!claim@{claim}}
\index{claim@{claim}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSelection\-Owner::claim (bool {\em force}, bool {\em force\_\-kill} = {\tt true})}\label{classKSelectionOwner_a3}


This function attemps to claim ownership of the manager selection, using the current X timestamp. 

If {\tt force} is false, and the selection is already owned, the selection is not claimed, and false is returned. If claiming is forced and the selection is owned by another client, it is waited for up to 1 second for the previous owner to disown the selection, if {\tt force\_\-kill} is true, and the previous owner fails to disown the selection in time, it will be forcibly killed. True is returned after successfully claiming ownership of the selection. 

Definition at line 104 of file kmanagerselection.cpp.

References get\-Atoms(), and release().\index{KSelectionOwner@{KSelection\-Owner}!release@{release}}
\index{release@{release}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSelection\-Owner::release ()}\label{classKSelectionOwner_a4}


If the selection is owned, the ownership is given up. 



Definition at line 182 of file kmanagerselection.cpp.

Referenced by claim(), and $\sim$KSelection\-Owner().\index{KSelectionOwner@{KSelection\-Owner}!ownerWindow@{ownerWindow}}
\index{ownerWindow@{ownerWindow}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Window KSelection\-Owner::owner\-Window () const}\label{classKSelectionOwner_a5}


If the selection is owned, returns the window used internally for owning the selection. 



Definition at line 191 of file kmanagerselection.cpp.\index{KSelectionOwner@{KSelection\-Owner}!lostOwnership@{lostOwnership}}
\index{lostOwnership@{lostOwnership}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSelection\-Owner::lost\-Ownership ()\hspace{0.3cm}{\tt  [signal]}}\label{classKSelectionOwner_l0}


This signal is emitted if the selection was owned and the ownership has been lost due to another client claiming it, this signal is emitted. 

IMPORTANT: It's not safe to delete the instance in a slot connected to this signal. \index{KSelectionOwner@{KSelection\-Owner}!handleMessage@{handleMessage}}
\index{handleMessage@{handleMessage}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSelection\-Owner::handle\-Message (XEvent $\ast$ {\em ev})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKSelectionOwner_b0}


Called for every X event received on the window used for owning the selection. 

If true is returned, the event is filtered out. 

Definition at line 247 of file kmanagerselection.cpp.\index{KSelectionOwner@{KSelection\-Owner}!genericReply@{genericReply}}
\index{genericReply@{genericReply}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSelection\-Owner::generic\-Reply (Atom {\em target}, Atom {\em property}, Window {\em requestor})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKSelectionOwner_b1}


Called when a Selection\-Request event is received. 

A reply should be sent using the selection handling mechanism described in the ICCCM section 2.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em target}]requested target type \item[{\em property}]property to use for the reply data \item[{\em requestor}]requestor window \end{description}
\end{Desc}


Definition at line 339 of file kmanagerselection.cpp.\index{KSelectionOwner@{KSelection\-Owner}!replyTargets@{replyTargets}}
\index{replyTargets@{replyTargets}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSelection\-Owner::reply\-Targets (Atom {\em property}, Window {\em requestor})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKSelectionOwner_b2}


Called to announce the supported targets, as described in the ICCCM section 2.6. 

The default implementation announces the required targets MULTIPLE, TIMESTAMP and TARGETS. 

Definition at line 331 of file kmanagerselection.cpp.\index{KSelectionOwner@{KSelection\-Owner}!getAtoms@{getAtoms}}
\index{getAtoms@{getAtoms}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSelection\-Owner::get\-Atoms ()\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKSelectionOwner_b3}


Called to create atoms needed for claiming the selection and communication using the selection handling mechanism. 

The default implementation must be called if reimplemented. This method may be called repeatedly. 

Definition at line 344 of file kmanagerselection.cpp.

Referenced by claim().\index{KSelectionOwner@{KSelection\-Owner}!setData@{setData}}
\index{setData@{setData}!KSelectionOwner@{KSelection\-Owner}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSelection\-Owner::set\-Data (long {\em extra1}, long {\em extra2})\hspace{0.3cm}{\tt  [protected]}}\label{classKSelectionOwner_b4}


Sets extra data to be sent in the message sent to root window after successfully claiming a selection. 

These extra data are in data.l[3] and data.l[4] fields of the XClient\-Message. 

Definition at line 198 of file kmanagerselection.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kmanagerselection.h\item 
kmanagerselection.cpp\end{CompactItemize}
