synthclone 0.3.0
Loading...
Searching...
No Matches
menuaction.h
Go to the documentation of this file.
1/*
2 * libsynthclone - a plugin API for `synthclone`
3 * Copyright (C) 2011 Devin Anderson
4 *
5 * This library is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU Lesser General Public License as published by the
7 * Free Software Foundation; either version 2.1 of the License, or (at your
8 * option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef __SYNTHCLONE_MENUACTION_H__
21#define __SYNTHCLONE_MENUACTION_H__
22
23#include <QtCore/QString>
24
25#include <synthclone/menuitem.h>
26
27namespace synthclone {
28
32
33 class MenuAction: public MenuItem {
34
35 Q_OBJECT
36
37 public:
38
45
46 explicit
47 MenuAction(QObject *parent=0);
48
58
59 explicit
60 MenuAction(const QString &text, QObject *parent=0);
61
74
75 MenuAction(const QString &text, const QString &description,
76 QObject *parent=0);
77
81
83
90
91 QString
93
100
101 QString
102 getText() const;
103
111
112 bool
113 isEnabled() const;
114
115 public slots:
116
123
124 void
125 setDescription(const QString &description);
126
134
135 void
136 setEnabled(bool enabled);
137
144
145 void
146 setText(const QString &text);
147
152
153 void
155
156 signals:
157
164
165 void
166 descriptionChanged(const QString &description);
167
174
175 void
176 enabledChanged(bool enabled);
177
184
185 void
186 textChanged(const QString &text);
187
191
192 void
194
195 private:
196
197 void
198 initialize(const QString &text, const QString &description);
199
200 QString description;
201 bool enabled;
202 QString text;
203
204 };
205
206}
207
208#endif
MenuAction(QObject *parent=0)
Constructs an new MenuAction object.
void setDescription(const QString &description)
Sets the description.
MenuAction(const QString &text, QObject *parent=0)
Constructs a new MenuAction object.
void enabledChanged(bool enabled)
Emitted when the 'enabled' flag is changed.
void descriptionChanged(const QString &description)
Emitted when the description is changed.
~MenuAction()
Destroys the MenuAction object.
void trigger()
Triggers the action.
QString getText() const
Gets the action text.
void setText(const QString &text)
Sets the action text.
void setEnabled(bool enabled)
Sets a boolean indicating whether or not this action is able to be triggered.
bool isEnabled() const
Gets a boolean indicating whether or not this action is able to be triggered.
MenuAction(const QString &text, const QString &description, QObject *parent=0)
Constructs a new MenuAction object.
void triggered()
Emitted when this action is triggered.
QString getDescription() const
Gets the action description.
void textChanged(const QString &text)
Emitted when the action text is changed.
MenuItem(QObject *parent=0)
Constructs a new MenuItem object.
Definition component.h:26