~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to templateparser/customtemplatesmenu.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*   -*- mode: C++; c-file-style: "gnu" -*-
 
2
 *   kmail: KDE mail client
 
3
 *   Copyright (C) 2006 Dmitry Morozhnikov <dmiceman@ubiz.ru>
 
4
 *
 
5
 *   This program is free software; you can redistribute it and/or modify
 
6
 *   it under the terms of the GNU General Public License as published by
 
7
 *   the Free Software Foundation; either version 2 of the License, or
 
8
 *   (at your option) any later version.
 
9
 *
 
10
 *   This program is distributed in the hope that it will be useful,
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *   GNU General Public License for more details.
 
14
 *
 
15
 *   You should have received a copy of the GNU General Public License along
 
16
 *   with this program; if not, write to the Free Software Foundation, Inc.,
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
18
 */
 
19
 
 
20
#ifndef CUSTOMTEMPLATESMENU_H
 
21
#define CUSTOMTEMPLATESMENU_H
 
22
 
 
23
#include "templateparser_export.h"
 
24
 
 
25
#include <QVector>
 
26
#include <QList>
 
27
#include <QObject>
 
28
 
 
29
class QSignalMapper;
 
30
 
 
31
class KActionCollection;
 
32
class KAction;
 
33
class KActionMenu;
 
34
 
 
35
class TEMPLATEPARSER_EXPORT CustomTemplatesMenu : public QObject
 
36
{
 
37
  Q_OBJECT
 
38
 
 
39
  public:
 
40
    CustomTemplatesMenu( QWidget *parent, KActionCollection *ac );
 
41
    ~CustomTemplatesMenu();
 
42
 
 
43
    KActionMenu *replyActionMenu() const { return (mCustomReplyActionMenu); }
 
44
    KActionMenu *replyAllActionMenu() const { return (mCustomReplyAllActionMenu); }
 
45
    KActionMenu *forwardActionMenu() const { return (mCustomForwardActionMenu); }
 
46
 
 
47
  public slots:
 
48
    void update();
 
49
 
 
50
  signals:
 
51
    void replyTemplateSelected( const QString &tmpl );
 
52
    void replyAllTemplateSelected( const QString &tmpl );
 
53
    void forwardTemplateSelected( const QString &tmpl );
 
54
 
 
55
  private slots:
 
56
    void slotReplySelected( int idx );
 
57
    void slotReplyAllSelected( int idx );
 
58
    void slotForwardSelected( int idx );
 
59
 
 
60
  private:
 
61
    void clear();
 
62
 
 
63
    KActionCollection *mOwnerActionCollection;
 
64
 
 
65
    QVector<QString> mCustomTemplates;
 
66
    QList<KAction*> mCustomTemplateActions;
 
67
 
 
68
    // Custom template actions menu
 
69
    KActionMenu *mCustomReplyActionMenu, *mCustomReplyAllActionMenu, *mCustomForwardActionMenu;
 
70
 
 
71
    // Signal mappers for custom template actions
 
72
    QSignalMapper *mCustomReplyMapper, *mCustomReplyAllMapper, *mCustomForwardMapper;
 
73
};
 
74
 
 
75
#endif // CUSTOMTEMPLATESMENU_H