/* This file is part of lomiri-action-api
* Copyright 2013 Canonical Ltd.
*
* lomiri-action-api is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* lomiri-action-api is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#ifndef LOMIRI_ACTION_QML_ACTION_MANAGER
#define LOMIRI_ACTION_QML_ACTION_MANAGER
#include
#include
#include
#include
namespace lomiri {
namespace action {
namespace qml {
class ActionManager;
}
}
}
# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#define QQMLISTPROPERTY_INT qsizetype
# else
#define QQMLISTPROPERTY_INT int
# endif
class lomiri::action::qml::ActionManager : public lomiri::action::ActionManager
{
Q_OBJECT
Q_DISABLE_COPY(ActionManager)
Q_PROPERTY(QQmlListProperty localContexts
READ localContexts_list)
Q_PROPERTY(QQmlListProperty actions
READ actions_list)
Q_CLASSINFO("DefaultProperty", "actions")
public:
ActionManager(QObject *parent = 0);
virtual ~ActionManager();
QQmlListProperty localContexts_list();
QQmlListProperty actions_list();
private:
static void contextAppend(QQmlListProperty *list, ActionContext *context);
static void contextClear(QQmlListProperty *list);
static QQMLISTPROPERTY_INT contextCount(QQmlListProperty *list);
static void actionAppend(QQmlListProperty *list, Action *action);
static void actionClear(QQmlListProperty *list);
static QQMLISTPROPERTY_INT actionCount(QQmlListProperty *list);
};
#endif