~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to libs/plasmagenericshell/scripting/appinterface.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Copyright 2009 Aaron Seigo <aseigo@kde.org>
 
3
 *
 
4
 *   This program is free software; you can redistribute it and/or modify
 
5
 *   it under the terms of the GNU Library General Public License as
 
6
 *   published by the Free Software Foundation; either version 2, or
 
7
 *   (at your option) any later version.
 
8
 *
 
9
 *   This program is distributed in the hope that it will be useful,
 
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *   GNU General Public License for more details
 
13
 *
 
14
 *   You should have received a copy of the GNU Library General Public
 
15
 *   License along with this program; if not, write to the
 
16
 *   Free Software Foundation, Inc.,
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
 
 
20
#ifndef APPINTERFACE
 
21
#define APPINTERFACE
 
22
 
 
23
#include <QObject>
 
24
#include <QRectF>
 
25
#include <QStringList>
 
26
 
 
27
#include "../plasmagenericshell_export.h"
 
28
 
 
29
namespace Plasma
 
30
{
 
31
    class Applet;
 
32
    class Containment;
 
33
    class Corona;
 
34
} // namespace Plasma
 
35
 
 
36
namespace WorkspaceScripting
 
37
{
 
38
 
 
39
class ScriptEngine;
 
40
 
 
41
class PLASMAGENERICSHELL_EXPORT AppInterface : public QObject
 
42
{
 
43
    Q_OBJECT
 
44
    Q_PROPERTY(bool locked READ coronaLocked WRITE lockCorona)
 
45
    Q_PROPERTY(bool hasBattery READ hasBattery)
 
46
    Q_PROPERTY(int screenCount READ screenCount)
 
47
    Q_PROPERTY(QList<int> activityIds READ activityIds)
 
48
    Q_PROPERTY(QList<int> panelIds READ panelIds)
 
49
    Q_PROPERTY(QStringList knownPanelTypes READ knownPanelTypes)
 
50
    Q_PROPERTY(QStringList knownActivityTypes READ knownActivityTypes)
 
51
    Q_PROPERTY(QStringList knownWidgetTypes READ knownWidgetTypes)
 
52
    Q_PROPERTY(QString theme READ theme WRITE setTheme)
 
53
    Q_PROPERTY(QString applicationVersion READ applicationVersion)
 
54
    Q_PROPERTY(QString platformVersion READ platformVersion)
 
55
    Q_PROPERTY(int scriptingVersion READ scriptingVersion)
 
56
    Q_PROPERTY(bool multihead READ multihead)
 
57
    Q_PROPERTY(bool multiheadScreen READ multihead)
 
58
 
 
59
public:
 
60
    AppInterface(ScriptEngine *env);
 
61
 
 
62
    bool hasBattery() const;
 
63
    int screenCount() const;
 
64
    QList<int> activityIds() const;
 
65
    QList<int> panelIds() const;
 
66
 
 
67
    QStringList knownWidgetTypes() const;
 
68
    QStringList knownActivityTypes() const;
 
69
    QStringList knownPanelTypes() const;
 
70
    QStringList knownContainmentTypes(const QString &type) const;
 
71
 
 
72
    QString applicationVersion() const;
 
73
    QString platformVersion() const;
 
74
    int scriptingVersion() const;
 
75
 
 
76
    QString theme() const;
 
77
    void setTheme(const QString &name);
 
78
 
 
79
    bool multihead() const;
 
80
    int multiheadScreen() const;
 
81
 
 
82
    bool coronaLocked() const;
 
83
 
 
84
public Q_SLOTS:
 
85
    QRectF screenGeometry(int screen) const;
 
86
    void lockCorona(bool locked);
 
87
    void sleep(int ms);
 
88
 
 
89
Q_SIGNALS:
 
90
    void print(const QString &string);
 
91
 
 
92
private:
 
93
    ScriptEngine *m_env;
 
94
    QStringList m_knownWidgets;
 
95
};
 
96
 
 
97
}
 
98
 
 
99
#endif
 
100