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
class QWidget;
00026
00027
namespace KParts
00028 {
00029
class Part;
00030
00034 class Event :
public QCustomEvent
00035 {
00036
public:
00037
Event(
const char *eventName );
00038
00039
virtual const char *eventName()
const;
00040
00041
static bool test(
const QEvent *event );
00042
static bool test(
const QEvent *event,
const char *name );
00043 };
00044
00052 class GUIActivateEvent :
public Event
00053 {
00054
public:
00055
GUIActivateEvent(
bool activated ) :
Event( s_strGUIActivateEvent ), m_bActivated( activated ) {}
00056
00057
bool activated()
const {
return m_bActivated; }
00058
00059
static bool test(
const QEvent *event ) {
return Event::test( event, s_strGUIActivateEvent ); }
00060
00061
private:
00062
static const char *s_strGUIActivateEvent;
00063
bool m_bActivated;
00064 };
00065
00074 class PartActivateEvent :
public Event
00075 {
00076
public:
00077
PartActivateEvent(
bool activated,
Part *part,
QWidget *widget ) :
Event( s_strPartActivateEvent ), m_bActivated( activated ), m_part( part ), m_widget( widget ) {}
00078
00079
bool activated()
const {
return m_bActivated; }
00080
00081
Part *part()
const {
return m_part; }
00082
QWidget *widget()
const {
return m_widget; }
00083
00084
static bool test(
const QEvent *event ) {
return Event::test( event, s_strPartActivateEvent ); }
00085
00086
private:
00087
static const char *s_strPartActivateEvent;
00088
bool m_bActivated;
00089
Part *m_part;
00090
QWidget *m_widget;
00091 };
00092
00097 class PartSelectEvent :
public Event
00098 {
00099
public:
00100
PartSelectEvent(
bool selected,
Part *part,
QWidget *widget ) :
Event( s_strPartSelectEvent ), m_bSelected( selected ), m_part( part ), m_widget( widget ) {}
00101
00102
bool selected()
const {
return m_bSelected; }
00103
00104
Part *part()
const {
return m_part; }
00105
QWidget *widget()
const {
return m_widget; }
00106
00107
static bool test(
const QEvent *event ) {
return Event::test( event, s_strPartSelectEvent ); }
00108
00109
private:
00110
static const char *s_strPartSelectEvent;
00111
bool m_bSelected;
00112
Part *m_part;
00113
QWidget *m_widget;
00114 };
00115
00116 }
00117
00118
#endif