KParts
event.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 #ifndef __kparts_event_h__
00021 #define __kparts_event_h__
00022
00023 #include <qevent.h>
00024
00025 #include <kdelibs_export.h>
00026
00027 class QWidget;
00028
00029 namespace KParts
00030 {
00031 class Part;
00032
00036 class KPARTS_EXPORT Event : public QCustomEvent
00037 {
00038 public:
00039 Event( const char *eventName );
00040
00041 virtual const char *eventName() const;
00042
00043 static bool test( const QEvent *event );
00044 static bool test( const QEvent *event, const char *name );
00045 };
00046
00054 class KPARTS_EXPORT GUIActivateEvent : public Event
00055 {
00056 public:
00057 GUIActivateEvent( bool activated ) : Event( s_strGUIActivateEvent ), m_bActivated( activated ) {}
00058
00059 bool activated() const { return m_bActivated; }
00060
00061 static bool test( const QEvent *event ) { return Event::test( event, s_strGUIActivateEvent ); }
00062
00063 private:
00064 static const char *s_strGUIActivateEvent;
00065 bool m_bActivated;
00066 };
00067
00076 class KPARTS_EXPORT PartActivateEvent : public Event
00077 {
00078 public:
00079 PartActivateEvent( bool activated, Part *part, QWidget *widget ) : Event( s_strPartActivateEvent ), m_bActivated( activated ), m_part( part ), m_widget( widget ) {}
00080
00081 bool activated() const { return m_bActivated; }
00082
00083 Part *part() const { return m_part; }
00084 QWidget *widget() const { return m_widget; }
00085
00086 static bool test( const QEvent *event ) { return Event::test( event, s_strPartActivateEvent ); }
00087
00088 private:
00089 static const char *s_strPartActivateEvent;
00090 bool m_bActivated;
00091 Part *m_part;
00092 QWidget *m_widget;
00093 };
00094
00099 class KPARTS_EXPORT PartSelectEvent : public Event
00100 {
00101 public:
00102 PartSelectEvent( bool selected, Part *part, QWidget *widget ) : Event( s_strPartSelectEvent ), m_bSelected( selected ), m_part( part ), m_widget( widget ) {}
00103
00104 bool selected() const { return m_bSelected; }
00105
00106 Part *part() const { return m_part; }
00107 QWidget *widget() const { return m_widget; }
00108
00109 static bool test( const QEvent *event ) { return Event::test( event, s_strPartSelectEvent ); }
00110
00111 private:
00112 static const char *s_strPartSelectEvent;
00113 bool m_bSelected;
00114 Part *m_part;
00115 QWidget *m_widget;
00116 };
00117
00118 }
00119
00120 #endif