konq_events.h
00001 #ifndef __konq_events_h__ 00002 #define __konq_events_h__ 00003 00004 #include <kparts/event.h> 00005 #include <tqptrlist.h> 00006 #include <libkonq_export.h> 00007 00008 namespace KParts 00009 { 00010 class ReadOnlyPart; 00011 } 00012 00013 class KConfig; 00014 class KFileItem; 00015 typedef TQPtrList<KFileItem> KFileItemList; 00016 00017 class LIBKONQ_EXPORT KonqFileSelectionEvent : public KParts::Event 00018 { 00019 public: 00020 KonqFileSelectionEvent( const KFileItemList &selection, KParts::ReadOnlyPart *part ) : KParts::Event( s_fileItemSelectionEventName ), m_selection( selection ), m_part( part ) {} 00021 00022 KFileItemList selection() const { return m_selection; } 00023 KParts::ReadOnlyPart *part() const { return m_part; } 00024 00025 static bool test( const TQEvent *event ) { return KParts::Event::test( event, s_fileItemSelectionEventName ); } 00026 00027 private: 00028 static const char *s_fileItemSelectionEventName; 00029 00030 KFileItemList m_selection; 00031 KParts::ReadOnlyPart *m_part; 00032 }; 00033 00034 class LIBKONQ_EXPORT KonqFileMouseOverEvent : public KParts::Event 00035 { 00036 public: 00037 KonqFileMouseOverEvent( const KFileItem *item, KParts::ReadOnlyPart *part ) : KParts::Event( s_fileItemMouseOverEventName ), m_item( item ), m_part( part ) {} 00038 00039 const KFileItem* item() const { return m_item; } 00040 KParts::ReadOnlyPart *part() const { return m_part; } 00041 00042 static bool test( const TQEvent *event ) { return KParts::Event::test( event, s_fileItemMouseOverEventName ); } 00043 00044 private: 00045 static const char *s_fileItemMouseOverEventName; 00046 00047 const KFileItem* m_item; 00048 KParts::ReadOnlyPart *m_part; 00049 }; 00050 00051 class LIBKONQ_EXPORT KonqConfigEvent : public KParts::Event 00052 { 00053 public: 00054 KonqConfigEvent( KConfig *config, const TQString &prefix, bool save ) : KParts::Event( s_configEventName ), m_config( config ), m_prefix( prefix ), m_save( save ) {} 00055 00056 KConfig * config() const { return m_config; } 00057 TQString prefix() const { return m_prefix; } 00058 bool save() const { return m_save; } 00059 00060 static bool test( const TQEvent *event ) { return KParts::Event::test( event, s_configEventName ); } 00061 00062 private: 00063 static const char *s_configEventName; 00064 00065 KConfig *m_config; 00066 TQString m_prefix; 00067 bool m_save; 00068 }; 00069 00070 #endif