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 TQ_OBJECT
00037 public:
00038 SnippetItem(TQListViewItem * parent, TQString name, TQString text);
00039
00040 ~SnippetItem();
00041 TQString getName();
00042 TQString getText();
00043 using TQListViewItem::parent;
00044 int getParent() { return iParent; }
00045 void resetParent();
00046 void setText(TQString text);
00047 void setName(TQString name);
00048 void setAction( KAction* );
00049 KAction* getAction();
00050 static SnippetItem * findItemByName(TQString name, TQPtrList<SnippetItem> &list);
00051 static SnippetGroup * findGroupById(int id, TQPtrList<SnippetItem> &list);
00052 signals:
00053 void execute( TQListViewItem * );
00054 public slots:
00055 void slotExecute();
00056
00057 private:
00058 SnippetItem(TQListView * parent, TQString name, TQString text);
00059 TQString strName;
00060 TQString strText;
00061 int iParent;
00062 KAction *action;
00063 };
00064
00071 class SnippetGroup : public SnippetItem {
00072 public:
00073 SnippetGroup(TQListView * parent, TQString name, int id);
00074 ~SnippetGroup();
00075
00076 int getId() { return iId; }
00077 static int getMaxId() { return iMaxId; }
00078
00079 void setId(int id);
00080
00081 private:
00082 static int iMaxId;
00083 int iId;
00084 };
00085
00086 #endif
|