| 1 |
/* This file is part of lomiri-action-api |
| 2 |
* Copyright 2013 Canonical Ltd. |
| 3 |
* |
| 4 |
* lomiri-action-api is free software: you can redistribute it and/or modify it |
| 5 |
* under the terms of the GNU Lesser General Public License version 3, |
| 6 |
* as published by the Free Software Foundation. |
| 7 |
* |
| 8 |
* lomiri-action-api is distributed in the hope that it will be useful, but |
| 9 |
* WITHOUT ANY WARRANTY; without even the implied warranties of |
| 10 |
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
| 11 |
* PURPOSE. See the GNU Lesser General Public License for more details. |
| 12 |
* |
| 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/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
#ifndef LOMIRI_ACTION_QML_PREVIEW_ACTION |
| 18 |
#define LOMIRI_ACTION_QML_PREVIEW_ACTION |
| 19 |
|
| 20 |
namespace lomiri { |
| 21 |
namespace action { |
| 22 |
namespace qml { |
| 23 |
class PreviewAction; |
| 24 |
} |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
#include <QQmlListProperty> |
| 29 |
#include <lomiri/action/PreviewAction> |
| 30 |
|
| 31 |
# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 32 |
#define QQMLISTPROPERTY_INT qsizetype |
| 33 |
# else |
| 34 |
#define QQMLISTPROPERTY_INT int |
| 35 |
# endif |
| 36 |
|
| 37 |
class Q_DECL_EXPORT lomiri::action::qml::PreviewAction : public lomiri::action::PreviewAction |
| 38 |
{ |
| 39 |
Q_OBJECT |
| 40 |
Q_DISABLE_COPY(PreviewAction) |
| 41 |
|
| 42 |
Q_PROPERTY(QQmlListProperty<lomiri::action::PreviewParameter> parameters |
| 43 |
READ parameters_list) |
| 44 |
|
| 45 |
Q_CLASSINFO("DefaultProperty", "parameters") |
| 46 |
|
| 47 |
public: |
| 48 |
|
| 49 |
explicit PreviewAction(QObject *parent = 0); |
| 50 |
virtual ~PreviewAction(); |
| 51 |
|
| 52 |
QQmlListProperty<lomiri::action::PreviewParameter> parameters_list(); |
| 53 |
|
| 54 |
private: |
| 55 |
static void append(QQmlListProperty<lomiri::action::PreviewParameter> *list, lomiri::action::PreviewParameter *parameter); |
| 56 |
static lomiri::action::PreviewParameter *at(QQmlListProperty<lomiri::action::PreviewParameter> *list, QQMLISTPROPERTY_INT index); |
| 57 |
static void clear(QQmlListProperty<lomiri::action::PreviewParameter> *list); |
| 58 |
static QQMLISTPROPERTY_INT count(QQmlListProperty<lomiri::action::PreviewParameter> *list); |
| 59 |
|
| 60 |
signals: |
| 61 |
|
| 62 |
}; |
| 63 |
|
| 64 |
#endif |