Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / khelpcenter / scopeitem.h
blobe1e0469103622bcd028ab51aced01b5e49a8fd25
1 /* This file is part of the KDE project
2 Copyright 2002 Cornelius Schumacher <schumacher@kde.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License version 2 or at your option version 3 as published
7 by the Free Software Foundation.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef SCOPEITEM_H
21 #define SCOPEITEM_H
23 #include <Qt3Support/Q3CheckListItem>
25 #include "docmetainfo.h"
27 namespace KHC {
29 class ScopeItem : public Q3CheckListItem
31 public:
32 ScopeItem( Q3ListView *parent, DocEntry *entry )
33 : Q3CheckListItem( parent, entry->name(), Q3CheckListItem::CheckBox ),
34 mEntry( entry ), mObserver( 0 ) {}
36 ScopeItem( Q3ListViewItem *parent, DocEntry *entry )
37 : Q3CheckListItem( parent, entry->name(), Q3CheckListItem::CheckBox ),
38 mEntry( entry ), mObserver( 0 ) {}
40 DocEntry *entry()const { return mEntry; }
42 int rtti() const { return rttiId(); }
44 static int rttiId() { return 734678; }
46 class Observer
48 public:
49 virtual ~Observer() {}
50 virtual void scopeItemChanged( ScopeItem * ) = 0;
53 void setObserver( Observer *o ) { mObserver = o; }
55 protected:
56 void stateChange ( bool )
58 if ( mObserver ) mObserver->scopeItemChanged( this );
61 private:
62 DocEntry *mEntry;
64 Observer *mObserver;
69 #endif
70 // vim:ts=2:sw=2:et