ApplicationInfoInterface.h
/*
* Copyright 2013,2015,2016 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY 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_SHELL_APPLICATION_APPLICATIONINFOINTERFACE_H
#define LOMIRI_SHELL_APPLICATION_APPLICATIONINFOINTERFACE_H
#include <lomiri/SymbolExport.h>
#include <QtCore/QObject>
#include <QtCore/QUrl>
#include <QColor>
#include <QSize>
namespace lomiri
{
namespace shell
{
namespace application
{
class MirSurfaceListInterface;
class LOMIRI_API ApplicationInfoInterface: public QObject
{
Q_OBJECT
Q_PROPERTY(QString appId READ appId CONSTANT)
Q_PROPERTY(QString name READ name NOTIFY nameChanged)
Q_PROPERTY(QString comment READ comment NOTIFY commentChanged)
Q_PROPERTY(QUrl icon READ icon NOTIFY iconChanged)
Q_PROPERTY(State state READ state NOTIFY stateChanged)
Q_PROPERTY(RequestedState requestedState READ requestedState WRITE setRequestedState NOTIFY requestedStateChanged)
Q_PROPERTY(bool focused READ focused NOTIFY focusedChanged)
Q_PROPERTY(QString splashTitle READ splashTitle CONSTANT)
Q_PROPERTY(QUrl splashImage READ splashImage CONSTANT)
Q_PROPERTY(bool splashShowHeader READ splashShowHeader CONSTANT)
Q_PROPERTY(QColor splashColor READ splashColor CONSTANT)
Q_PROPERTY(QColor splashColorHeader READ splashColorHeader CONSTANT)
Q_PROPERTY(QColor splashColorFooter READ splashColorFooter CONSTANT)
Q_PROPERTY(Qt::ScreenOrientations supportedOrientations READ supportedOrientations CONSTANT)
Q_PROPERTY(bool rotatesWindowContents READ rotatesWindowContents CONSTANT)
Q_PROPERTY(bool isTouchApp READ isTouchApp CONSTANT)
Q_PROPERTY(bool exemptFromLifecycle READ exemptFromLifecycle WRITE setExemptFromLifecycle NOTIFY exemptFromLifecycleChanged)
Q_PROPERTY(QSize initialSurfaceSize READ initialSurfaceSize WRITE setInitialSurfaceSize NOTIFY initialSurfaceSizeChanged)
Q_PROPERTY(lomiri::shell::application::MirSurfaceListInterface* surfaceList READ surfaceList CONSTANT)
Q_PROPERTY(lomiri::shell::application::MirSurfaceListInterface* promptSurfaceList READ promptSurfaceList CONSTANT)
Q_PROPERTY(int surfaceCount READ surfaceCount NOTIFY surfaceCountChanged)
protected:
ApplicationInfoInterface(const QString &appId, QObject* parent = 0): QObject(parent) { Q_UNUSED(appId) }
public:
enum Stage {
MainStage,
SideStage
};
Q_ENUM(Stage)
enum State {
Starting,
Running,
Suspended,
Stopped
};
Q_ENUM(State)
enum RequestedState {
RequestedRunning = Running,
RequestedSuspended = Suspended
};
Q_ENUM(RequestedState)
virtual void close() = 0;
virtual ~ApplicationInfoInterface() {}
virtual QString appId() const = 0;
virtual QString name() const = 0;
virtual QString comment() const = 0;
virtual QUrl icon() const = 0;
virtual State state() const = 0;
virtual RequestedState requestedState() const = 0;
virtual void setRequestedState(RequestedState) = 0;
virtual bool focused() const = 0;
virtual QString splashTitle() const = 0;
virtual QUrl splashImage() const = 0;
virtual bool splashShowHeader() const = 0;
virtual QColor splashColor() const = 0;
virtual QColor splashColorHeader() const = 0;
virtual QColor splashColorFooter() const = 0;
virtual Qt::ScreenOrientations supportedOrientations() const = 0;
virtual bool rotatesWindowContents() const = 0;
virtual bool isTouchApp() const = 0;
virtual bool exemptFromLifecycle() const = 0;
virtual void setExemptFromLifecycle(bool) = 0;
virtual QSize initialSurfaceSize() const = 0;
virtual void setInitialSurfaceSize(const QSize &size) = 0;
virtual MirSurfaceListInterface* surfaceList() const = 0;
virtual MirSurfaceListInterface* promptSurfaceList() const = 0;
virtual int surfaceCount() const = 0;
Q_SIGNALS:
void nameChanged(const QString &name);
void commentChanged(const QString &comment);
void iconChanged(const QUrl &icon);
void stateChanged(State state);
void requestedStateChanged(RequestedState value);
void focusedChanged(bool focused);
void exemptFromLifecycleChanged(bool exemptFromLifecycle);
void initialSurfaceSizeChanged(const QSize &size);
void surfaceCountChanged(int surfaceCount);
void focusRequested();
};
} // namespace application
} // namespace shell
} // namespace lomiri
Q_DECLARE_METATYPE(lomiri::shell::application::ApplicationInfoInterface*)
#endif // LOMIRI_SHELL_APPLICATIONMANAGER_APPLICATIONINFOINTERFACE_H
lomiri::shell::application::ApplicationInfoInterface
A class that holds information about applications.
Definition: ApplicationInfoInterface.h:44
lomiri::shell::application::ApplicationInfoInterface::Stage
Stage
A enum that defines a stage.
Definition: ApplicationInfoInterface.h:245
lomiri::shell::application::ApplicationInfoInterface::State
State
An application's state.
Definition: ApplicationInfoInterface.h:263
lomiri::shell::application::ApplicationInfoInterface::RequestedState
RequestedState
The desired state of an application.
Definition: ApplicationInfoInterface.h:278
lomiri::shell::application::ApplicationInfoInterface::focusRequested
void focusRequested()
The application is requesting focus.
lomiri::shell::application::MirSurfaceListInterface
Interface for a list model of MirSurfaces.
Definition: MirSurfaceListInterface.h:32
lomiri
Top-level namespace for all things Lomiri-related.
Definition: Version.h:38