2 * Copyright (C) 2006 Dmitry Morozhnikov <dmiceman@ubiz.ru>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
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
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef TEMPLATEPARSER_CUSTOMTEMPLATESMENU_H
20 #define TEMPLATEPARSER_CUSTOMTEMPLATESMENU_H
22 #include "templateparser_export.h"
26 #include <QStringList>
30 class KActionCollection
;
34 namespace TemplateParser
{
36 class TEMPLATEPARSER_EXPORT CustomTemplatesMenu
: public QObject
41 CustomTemplatesMenu( QWidget
*parent
, KActionCollection
*ac
);
42 ~CustomTemplatesMenu();
44 KActionMenu
*replyActionMenu() const { return (mCustomReplyActionMenu
); }
45 KActionMenu
*replyAllActionMenu() const { return (mCustomReplyAllActionMenu
); }
46 KActionMenu
*forwardActionMenu() const { return (mCustomForwardActionMenu
); }
52 void replyTemplateSelected( const QString
&tmpl
);
53 void replyAllTemplateSelected( const QString
&tmpl
);
54 void forwardTemplateSelected( const QString
&tmpl
);
57 void slotReplySelected( int idx
);
58 void slotReplyAllSelected( int idx
);
59 void slotForwardSelected( int idx
);
64 KActionCollection
*mOwnerActionCollection
;
66 QStringList mCustomTemplates
;
67 QList
<KAction
*> mCustomTemplateActions
;
69 // Custom template actions menu
70 KActionMenu
*mCustomReplyActionMenu
, *mCustomReplyAllActionMenu
, *mCustomForwardActionMenu
;
72 // Signal mappers for custom template actions
73 QSignalMapper
*mCustomReplyMapper
, *mCustomReplyAllMapper
, *mCustomForwardMapper
;