00001 #ifndef SCOPEITEM_H
00002 #define SCOPEITEM_H
00003
00004 #include <tqlistview.h>
00005
00006 #include "docmetainfo.h"
00007
00008 namespace KHC {
00009
00010 class ScopeItem : public QCheckListItem
00011 {
00012 public:
00013 ScopeItem( TQListView *parent, DocEntry *entry )
00014 : TQCheckListItem( parent, entry->name(), TQCheckListItem::CheckBox ),
00015 mEntry( entry ), mObserver( 0 ) {}
00016
00017 ScopeItem( TQListViewItem *parent, DocEntry *entry )
00018 : TQCheckListItem( parent, entry->name(), TQCheckListItem::CheckBox ),
00019 mEntry( entry ), mObserver( 0 ) {}
00020
00021 DocEntry *entry()const { return mEntry; }
00022
00023 int rtti() const { return rttiId(); }
00024
00025 static int rttiId() { return 734678; }
00026
00027 class Observer
00028 {
00029 public:
00030 virtual void scopeItemChanged( ScopeItem * ) = 0;
00031 };
00032
00033 void setObserver( Observer *o ) { mObserver = o; }
00034
00035 protected:
00036 void stateChange ( bool )
00037 {
00038 if ( mObserver ) mObserver->scopeItemChanged( this );
00039 }
00040
00041 private:
00042 DocEntry *mEntry;
00043
00044 Observer *mObserver;
00045 };
00046
00047 }
00048
00049 #endif
00050