~ubuntu-branches/ubuntu/vivid/quassel/vivid-updates

« back to all changes in this revision

Viewing changes to src/uisupport/action.h

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2013-03-06 15:07:41 UTC
  • mfrom: (1.1.49)
  • Revision ID: package-import@ubuntu.com-20130306150741-pys1igw1g8uhja38
Tags: 0.9~beta1-0ubuntu1
* New upstream beta release
  - Remove debian/patches/0001-Support-intermediate-CA-certificates.patch,
    incorporated upstream
  - Remove 0002-Allow-the-core-to-use-expired-certificates.patch,
    incorporated upstream
  - Update kubuntu_02_enable_message_indicator.diff for 0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *   Copyright (C) 2005-09 by the Quassel Project                          *
 
2
 *   Copyright (C) 2005-2013 by the Quassel Project                        *
3
3
 *   devel@quassel-irc.org                                                 *
4
4
 *                                                                         *
5
5
 *   This program is free software; you can redistribute it and/or modify  *
15
15
 *   You should have received a copy of the GNU General Public License     *
16
16
 *   along with this program; if not, write to the                         *
17
17
 *   Free Software Foundation, Inc.,                                       *
18
 
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 
18
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
19
19
 ***************************************************************************
20
20
 * Parts of this API have been shamelessly stolen from KDE's kaction.h     *
21
21
 ***************************************************************************/
32
32
/** This declares/implements a subset of KAction's API (notably we've left out global shortcuts
33
33
 *  for now), which should make it easy to plug in KDE support later on.
34
34
 */
35
 
class Action : public QWidgetAction {
36
 
  Q_OBJECT
37
 
 
38
 
  Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut)
39
 
  Q_PROPERTY(bool shortcutConfigurable READ isShortcutConfigurable WRITE setShortcutConfigurable)
40
 
  Q_FLAGS(ShortcutType)
41
 
 
42
 
  public:
43
 
    enum ShortcutType {
44
 
      ActiveShortcut = 0x01,
45
 
      DefaultShortcut = 0x02
 
35
class Action : public QWidgetAction
 
36
{
 
37
    Q_OBJECT
 
38
 
 
39
    Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut)
 
40
    Q_PROPERTY(bool shortcutConfigurable READ isShortcutConfigurable WRITE setShortcutConfigurable)
 
41
    Q_FLAGS(ShortcutType)
 
42
 
 
43
public :
 
44
        enum ShortcutType {
 
45
        ActiveShortcut = 0x01,
 
46
        DefaultShortcut = 0x02
46
47
    };
47
48
    Q_DECLARE_FLAGS(ShortcutTypes, ShortcutType)
48
49
 
57
58
    bool isShortcutConfigurable() const;
58
59
    void setShortcutConfigurable(bool configurable);
59
60
 
60
 
  signals:
 
61
signals:
61
62
    void triggered(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
62
63
 
63
 
  private:
 
64
private:
64
65
    void init();
65
66
 
66
 
  private slots:
 
67
private slots:
67
68
    void slotTriggered();
68
69
};
69
70
 
 
71
 
70
72
Q_DECLARE_OPERATORS_FOR_FLAGS(Action::ShortcutTypes)
71
73
 
72
74
#else /* HAVE_KDE */
73
75
#include <KAction>
74
76
 
75
 
class Action : public KAction {
76
 
  Q_OBJECT
 
77
class Action : public KAction
 
78
{
 
79
    Q_OBJECT
77
80
 
78
 
  public:
 
81
public:
79
82
    explicit Action(QObject *parent);
80
83
    Action(const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0);
81
84
    Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0);
82
85
 
83
 
  private:
 
86
private:
84
87
    void init();
85
88
};
 
89
 
 
90
 
86
91
#endif
87
92
 
88
93
#endif