kmanagerselection.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __KMANAGERSELECTION_H
00028 #define __KMANAGERSELECTION_H
00029
00030 #include <qobject.h>
00031 #include <kdelibs_export.h>
00032
00033 #ifdef Q_WS_X11 // FIXME(E)
00034
00035 #include <X11/Xlib.h>
00036
00037 class KSelectionOwnerPrivate;
00038
00048 class KDECORE_EXPORT KSelectionOwner
00049 : public QObject
00050 {
00051 Q_OBJECT
00052 public:
00059 KSelectionOwner( Atom selection, int screen = -1, QObject* parent = NULL );
00067 KSelectionOwner( const char* selection, int screen = -1, QObject* parent = NULL );
00071 virtual ~KSelectionOwner();
00082 bool claim( bool force, bool force_kill = true );
00086 void release();
00091 Window ownerWindow() const;
00095 bool filterEvent( XEvent* ev_P );
00096 signals:
00103 void lostOwnership();
00104 protected:
00109 virtual bool handleMessage( XEvent* ev );
00119 virtual bool genericReply( Atom target, Atom property, Window requestor );
00125 virtual void replyTargets( Atom property, Window requestor );
00132 virtual void getAtoms();
00138 void setData( long extra1, long extra2 );
00139 private:
00140 void filter_selection_request( XSelectionRequestEvent& ev_P );
00141 bool handle_selection( Atom target_P, Atom property_P, Window requestor_P );
00142 const Atom selection;
00143 const int screen;
00144 Window window;
00145 Time timestamp;
00146 long extra1, extra2;
00147 static Atom manager_atom;
00148 static Atom xa_multiple;
00149 static Atom xa_targets;
00150 static Atom xa_timestamp;
00151 protected:
00152 virtual void virtual_hook( int id, void* data );
00153 private:
00154 KSelectionOwnerPrivate* d;
00155 };
00156
00157 class KSelectionWatcherPrivate;
00158
00167 class KDECORE_EXPORT KSelectionWatcher
00168 : public QObject
00169 {
00170 Q_OBJECT
00171 public:
00178 KSelectionWatcher( Atom selection_P, int screen_P = -1, QObject* parent = NULL );
00186 KSelectionWatcher( const char* selection_P, int screen_P = -1, QObject* parent = NULL );
00187 virtual ~KSelectionWatcher();
00191 Window owner();
00195 void filterEvent( XEvent* ev_P );
00196 signals:
00202 void newOwner( Window owner );
00209 void lostOwner();
00210 private:
00211 void init();
00212 const Atom selection;
00213 const int screen;
00214 Window selection_owner;
00215 static Atom manager_atom;
00216 protected:
00217 virtual void virtual_hook( int id, void* data );
00218 private:
00219 KSelectionWatcherPrivate* d;
00220 };
00221
00222 #endif
00223 #endif
This file is part of the documentation for kdecore Library Version 3.3.90.