summaryrefslogtreecommitdiffstats
path: root/khelpcenter/scopeitem.h
diff options
context:
space:
mode:
Diffstat (limited to 'khelpcenter/scopeitem.h')
-rw-r--r--khelpcenter/scopeitem.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/khelpcenter/scopeitem.h b/khelpcenter/scopeitem.h
new file mode 100644
index 000000000..33152060f
--- /dev/null
+++ b/khelpcenter/scopeitem.h
@@ -0,0 +1,50 @@
+#ifndef SCOPEITEM_H
+#define SCOPEITEM_H
+
+#include <qlistview.h>
+
+#include "docmetainfo.h"
+
+namespace KHC {
+
+class ScopeItem : public QCheckListItem
+{
+ public:
+ ScopeItem( QListView *parent, DocEntry *entry )
+ : QCheckListItem( parent, entry->name(), QCheckListItem::CheckBox ),
+ mEntry( entry ), mObserver( 0 ) {}
+
+ ScopeItem( QListViewItem *parent, DocEntry *entry )
+ : QCheckListItem( parent, entry->name(), QCheckListItem::CheckBox ),
+ mEntry( entry ), mObserver( 0 ) {}
+
+ DocEntry *entry()const { return mEntry; }
+
+ int rtti() const { return rttiId(); }
+
+ static int rttiId() { return 734678; }
+
+ class Observer
+ {
+ public:
+ virtual void scopeItemChanged( ScopeItem * ) = 0;
+ };
+
+ void setObserver( Observer *o ) { mObserver = o; }
+
+ protected:
+ void stateChange ( bool )
+ {
+ if ( mObserver ) mObserver->scopeItemChanged( this );
+ }
+
+ private:
+ DocEntry *mEntry;
+
+ Observer *mObserver;
+};
+
+}
+
+#endif
+// vim:ts=2:sw=2:et