Framework for looking up contacts directly in nepomuk in addition to going through...
[kdepim.git] / templateparser / customtemplatesmenu.h
blob629a289d22baf31b34d3d15d7f135882ba386cc0
1 /*
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"
24 #include <QList>
25 #include <QObject>
26 #include <QStringList>
28 class QSignalMapper;
30 class KActionCollection;
31 class KAction;
32 class KActionMenu;
34 namespace TemplateParser {
36 class TEMPLATEPARSER_EXPORT CustomTemplatesMenu : public QObject
38 Q_OBJECT
40 public:
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); }
48 public slots:
49 void update();
51 signals:
52 void replyTemplateSelected( const QString &tmpl );
53 void replyAllTemplateSelected( const QString &tmpl );
54 void forwardTemplateSelected( const QString &tmpl );
56 private slots:
57 void slotReplySelected( int idx );
58 void slotReplyAllSelected( int idx );
59 void slotForwardSelected( int idx );
61 private:
62 void clear();
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;
78 #endif