From 4aed2c8219774f5d797760606b8489a92ddc5163 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- khelpcenter/scopeitem.h | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 khelpcenter/scopeitem.h (limited to 'khelpcenter/scopeitem.h') 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 + +#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 -- cgit v1.2.1