KDEUI
kmanagerselection.h
Go to the documentation of this file.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 #ifndef KMANAGERSELECTION_H
00026 #define KMANAGERSELECTION_H
00027
00028 #include <kdeui_export.h>
00029 #include <QtCore/QObject>
00030
00031 #ifdef Q_WS_X11 // FIXME(E)
00032
00033 #include <X11/Xlib.h>
00034 #include <fixx11h.h>
00035
00036
00045 class KDEUI_EXPORT KSelectionOwner
00046 : public QObject
00047 {
00048 Q_OBJECT
00049 public:
00058 explicit KSelectionOwner( Atom selection, int screen = -1, QObject* parent = NULL );
00068 explicit KSelectionOwner( const char* selection, int screen = -1, QObject* parent = NULL );
00072 virtual ~KSelectionOwner();
00083 bool claim( bool force, bool force_kill = true );
00087 void release();
00092 Window ownerWindow() const;
00096 bool filterEvent( XEvent* ev_P );
00097 Q_SIGNALS:
00104 void lostOwnership();
00105 protected:
00110 virtual bool handleMessage( XEvent* ev );
00120 virtual bool genericReply( Atom target, Atom property, Window requestor );
00126 virtual void replyTargets( Atom property, Window requestor );
00133 virtual void getAtoms();
00139 void setData( long extra1, long extra2 );
00140 private:
00141 void filter_selection_request( XSelectionRequestEvent& ev_P );
00142 bool handle_selection( Atom target_P, Atom property_P, Window requestor_P );
00143
00144 class Private;
00145 Private* const d;
00146 };
00147
00155 class KDEUI_EXPORT KSelectionWatcher
00156 : public QObject
00157 {
00158 Q_OBJECT
00159 public:
00168 explicit KSelectionWatcher( Atom selection, int screen = -1, QObject* parent = NULL );
00178 explicit KSelectionWatcher( const char* selection, int screen = -1, QObject* parent = NULL );
00179 virtual ~KSelectionWatcher();
00183 Window owner();
00187 void filterEvent( XEvent* ev_P );
00188 Q_SIGNALS:
00194 void newOwner( Window owner );
00201 void lostOwner();
00202 private:
00203 void init();
00204
00205 class Private;
00206 Private* const d;
00207 };
00208
00209 #endif
00210 #endif