kmail
snippetitem.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef SNIPPETITEM_H
00015 #define SNIPPETITEM_H
00016
00017 #include <klistview.h>
00018 #include <klocale.h>
00019
00020 #include <tqobject.h>
00021
00022 class TQString;
00023 class KAction;
00024 class SnippetGroup;
00025
00026
00032 class SnippetItem : public TQObject, public TQListViewItem {
00033 friend class SnippetGroup;
00034
00035 Q_OBJECT
00036 public:
00037 SnippetItem(TQListViewItem * parent, TQString name, TQString text);
00038
00039 ~SnippetItem();
00040 TQString getName();
00041 TQString getText();
00042 using TQListViewItem::parent;
00043 int getParent() { return iParent; }
00044 void resetParent();
00045 void setText(TQString text);
00046 void setName(TQString name);
00047 void setAction( KAction* );
00048 KAction* getAction();
00049 static SnippetItem * findItemByName(TQString name, TQPtrList<SnippetItem> &list);
00050 static SnippetGroup * findGroupById(int id, TQPtrList<SnippetItem> &list);
00051 signals:
00052 void execute( TQListViewItem * );
00053 public slots:
00054 void slotExecute();
00055
00056 private:
00057 SnippetItem(TQListView * parent, TQString name, TQString text);
00058 TQString strName;
00059 TQString strText;
00060 int iParent;
00061 KAction *action;
00062 };
00063
00070 class SnippetGroup : public SnippetItem {
00071 public:
00072 SnippetGroup(TQListView * parent, TQString name, int id);
00073 ~SnippetGroup();
00074
00075 int getId() { return iId; }
00076 static int getMaxId() { return iMaxId; }
00077
00078 void setId(int id);
00079
00080 private:
00081 static int iMaxId;
00082 int iId;
00083 };
00084
00085 #endif
|