2
* Copyright 2009 Aaron Seigo <aseigo@kde.org>
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.
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
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.
23
#include <QScriptContext>
24
#include <QScriptValue>
25
#include <QWeakPointer>
27
#include <plasmagenericshell/scripting/containment.h>
29
namespace WorkspaceScripting
32
class Panel : public Containment
35
Q_PROPERTY(QStringList configKeys READ configKeys)
36
Q_PROPERTY(QStringList configGroups READ configGroups)
37
Q_PROPERTY(QStringList currentConfigGroup WRITE setCurrentConfigGroup READ currentConfigGroup)
39
Q_PROPERTY(QString name READ name WRITE setName)
40
Q_PROPERTY(QString version READ version)
41
Q_PROPERTY(QString type READ type)
42
Q_PROPERTY(QString formFactor READ formFactor)
43
Q_PROPERTY(QList<int> widgetIds READ widgetIds)
44
Q_PROPERTY(int screen READ screen WRITE setScreen)
45
Q_PROPERTY(int desktop READ desktop WRITE setDesktop)
46
Q_PROPERTY(QString location READ location WRITE setLocation)
47
Q_PROPERTY(int id READ id)
50
Q_PROPERTY(QString alignment READ alignment WRITE setAlignment)
51
Q_PROPERTY(int offset READ offset WRITE setOffset)
52
Q_PROPERTY(int length READ length WRITE setLength)
53
Q_PROPERTY(int height READ height WRITE setHeight)
54
Q_PROPERTY(QString hiding READ hiding WRITE setHiding)
57
Panel(Plasma::Containment *containment, QObject *parent = 0);
60
QString location() const;
61
void setLocation(const QString &location);
63
QString alignment() const;
64
void setAlignment(const QString &alignment);
67
void setOffset(int pixels);
70
void setLength(int pixels);
73
void setHeight(int height);
75
QString hiding() const;
76
void setHiding(const QString &mode);
79
void remove() { Containment::remove(); }
80
void showConfigurationInterface() { Containment::showConfigurationInterface(); }
82
// from the applet interface
83
QVariant readConfig(const QString &key, const QVariant &def = QString()) const { return Applet::readConfig(key, def); }
84
void writeConfig(const QString &key, const QVariant &value) { Applet::writeConfig(key, value); }
85
void reloadConfig() { Applet::reloadConfig(); }
88
PanelView *panel() const;