00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <config.h>
00022
00023 #ifndef CUSTOMTEMPLATES_H
00024 #define CUSTOMTEMPLATES_H
00025
00026 #include "customtemplates_base.h"
00027 #include "templatesinsertcommand.h"
00028
00029 #include <tdeshortcut.h>
00030
00031 struct CustomTemplateItem;
00032 typedef TQDict<CustomTemplateItem> CustomTemplateItemList;
00033 class TDEShortcut;
00034
00035 class CustomTemplates : public CustomTemplatesBase
00036 {
00037 Q_OBJECT
00038
00039
00040 public:
00041
00042 enum Type { TUniversal, TReply, TReplyAll, TForward };
00043
00044 public:
00045
00046 CustomTemplates( TQWidget *parent = 0, const char *name = 0 );
00047 ~CustomTemplates();
00048
00049 void load();
00050 void save();
00051
00052 TQString indexToType( int index );
00053
00054 public slots:
00055
00056 void slotInsertCommand( TQString cmd, int adjustCursor = 0 );
00057
00058 void slotTextChanged();
00059
00060 void slotAddClicked();
00061 void slotRemoveClicked();
00062 void slotListSelectionChanged();
00063 void slotTypeActivated( int index );
00064 void slotShortcutCaptured( const TDEShortcut &shortcut );
00065 void slotNameChanged( const TQString& );
00066 signals:
00067
00068 void changed();
00069
00070 protected:
00071
00072 void setRecipientsEditsEnabled( bool enabled );
00073
00074 TQListViewItem *mCurrentItem;
00075 CustomTemplateItemList mItemList;
00076
00078 TQStringList mItemsToDelete;
00079
00080 TQPixmap mReplyPix;
00081 TQPixmap mReplyAllPix;
00082 TQPixmap mForwardPix;
00083
00086 bool mBlockChangeSignal;
00087
00088 };
00089
00090 struct CustomTemplateItem
00091 {
00092 CustomTemplateItem() {}
00093 CustomTemplateItem( const TQString &name,
00094 const TQString &content,
00095 TDEShortcut &shortcut,
00096 CustomTemplates::Type type,
00097 TQString to, TQString cc ) :
00098 mName( name ), mContent( content ), mShortcut(shortcut), mType( type ),
00099 mTo( to ), mCC( cc ) {}
00100
00101 TQString mName, mContent;
00102 TDEShortcut mShortcut;
00103 CustomTemplates::Type mType;
00104 TQString mTo, mCC;
00105 };
00106
00107 #endif // CUSTOMTEMPLATES_H