summaryrefslogtreecommitdiffstats
path: root/khelpcenter/scopeitem.h
blob: 9b828a54feeb2b2f8f3a9ddf3cebf3e3dbe7487a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef SCOPEITEM_H
#define SCOPEITEM_H

#include <tqlistview.h>

#include "docmetainfo.h"

namespace KHC {

class ScopeItem : public QCheckListItem
{
  public:
    ScopeItem( TQListView *parent, DocEntry *entry )
      : TQCheckListItem( parent, entry->name(), TQCheckListItem::CheckBox ),
        mEntry( entry ), mObserver( 0 ) {}

    ScopeItem( TQListViewItem *parent, DocEntry *entry )
      : TQCheckListItem( parent, entry->name(), TQCheckListItem::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