kparts Library API Documentation

event.h

00001 /* This file is part of the KDE project 00002 Copyright (C) 1999 Simon Hausmann <hausmann@kde.org> 00003 (C) 1999 David Faure <faure@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 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 } // namespace 00117 00118 #endif
KDE Logo
This file is part of the documentation for kparts Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 16 17:22:50 2005 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003