Loading...
Searching...
No Matches
lomiri-action-manager.h
/* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef LOMIRI_ACTION_MANAGER
#define LOMIRI_ACTION_MANAGER
namespace lomiri {
namespace action {
class ActionManager;
class ActionContext;
class Action;
}
}
#include <QObject>
#include <QScopedPointer>
class Q_DECL_EXPORT lomiri::action::ActionManager : public QObject
{
Q_OBJECT
Q_DISABLE_COPY(ActionManager)
Q_PROPERTY(lomiri::action::ActionContext *globalContext
READ globalContext)
public:
explicit ActionManager(QObject *parent = 0);
virtual ~ActionManager();
Q_INVOKABLE void addAction(lomiri::action::Action *action);
Q_INVOKABLE void removeAction(lomiri::action::Action *action);
Q_INVOKABLE lomiri::action::ActionContext *globalContext();
Q_INVOKABLE void addLocalContext(lomiri::action::ActionContext *context);
Q_INVOKABLE void removeLocalContext(lomiri::action::ActionContext *context);
QSet<ActionContext *> localContexts() const;
QSet<Action *> actions() const;
signals:
void localContextsChanged();
void actionsChanged();
Q_REVISION(1) void quit();
private:
class Private;
QScopedPointer<Private> d;
};
#endif
lomiri::action::ActionContext
Definition lomiri-action-context.h:32
lomiri::action::ActionManager
Definition lomiri-action-manager.h:32
lomiri::action::ActionManager::addAction
Q_INVOKABLE void addAction(lomiri::action::Action *action)
Definition lomiri-action-manager.cpp:426
lomiri::action::ActionManager::localContextsChanged
void localContextsChanged()
lomiri::action::ActionManager::removeLocalContext
Q_INVOKABLE void removeLocalContext(lomiri::action::ActionContext *context)
Definition lomiri-action-manager.cpp:509
lomiri::action::ActionManager::actions
QSet< Action * > actions() const
Definition lomiri-action-manager.cpp:543
lomiri::action::ActionManager::removeAction
Q_INVOKABLE void removeAction(lomiri::action::Action *action)
Definition lomiri-action-manager.cpp:444
lomiri::action::ActionManager::actionsChanged
void actionsChanged()
lomiri::action::ActionManager::localContexts
QSet< ActionContext * > localContexts() const
Definition lomiri-action-manager.cpp:531
lomiri::action::ActionManager::ActionManager
ActionManager(QObject *parent=0)
Definition lomiri-action-manager.cpp:338
lomiri::action::ActionManager::addLocalContext
Q_INVOKABLE void addLocalContext(lomiri::action::ActionContext *context)
Definition lomiri-action-manager.cpp:473
lomiri::action::ActionManager::globalContext
lomiri::action::ActionContext * globalContext
Definition lomiri-action-manager.h:36
lomiri::action::Action
The main action class.
Definition lomiri-action.h:31