2
* Copyright 2016 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include <QtQml/QQmlListProperty>
22
#include "ubuntutoolkitglobal.h"
27
class UBUNTUTOOLKIT_EXPORT ActionList : public QObject
30
Q_PROPERTY(QQmlListProperty<UT_PREPEND_NAMESPACE(UCAction)> actions READ actions)
31
Q_CLASSINFO("DefaultProperty", "actions")
33
explicit ActionList(QObject *parent = 0);
35
QQmlListProperty<UCAction> actions();
37
const QList<UCAction*> &list() const;
40
void addAction(UT_PREPEND_NAMESPACE(UCAction) *action);
41
void removeAction(UT_PREPEND_NAMESPACE(UCAction) *action);
44
void added(UCAction *action);
45
void removed(UCAction *action);
48
QList<UCAction*> m_actions;
50
static void append(QQmlListProperty<UCAction> *list, UCAction *action);
51
static void clear(QQmlListProperty<UCAction> *list);
52
static UCAction* at(QQmlListProperty<UCAction> *list, int index);
53
static int count(QQmlListProperty<UCAction> *list);
58
#endif // ACTIONLIST_H