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

« back to all changes in this revision

Viewing changes to plasma/desktop/shell/scripting/panel.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 PANEL
 
21
#define PANEL
 
22
 
 
23
#include <QScriptContext>
 
24
#include <QScriptValue>
 
25
#include <QWeakPointer>
 
26
 
 
27
#include <plasmagenericshell/scripting/containment.h>
 
28
 
 
29
namespace WorkspaceScripting
 
30
{
 
31
 
 
32
class Panel : public Containment
 
33
{
 
34
    Q_OBJECT
 
35
    Q_PROPERTY(QStringList configKeys READ configKeys)
 
36
    Q_PROPERTY(QStringList configGroups READ configGroups)
 
37
    Q_PROPERTY(QStringList currentConfigGroup WRITE setCurrentConfigGroup READ currentConfigGroup)
 
38
 
 
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)
 
48
 
 
49
    // panel properties
 
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)
 
55
 
 
56
public:
 
57
    Panel(Plasma::Containment *containment, QObject *parent = 0);
 
58
    ~Panel();
 
59
 
 
60
    QString location() const;
 
61
    void setLocation(const QString &location);
 
62
 
 
63
    QString alignment() const;
 
64
    void setAlignment(const QString &alignment);
 
65
 
 
66
    int offset() const;
 
67
    void setOffset(int pixels);
 
68
 
 
69
    int length() const;
 
70
    void setLength(int pixels);
 
71
 
 
72
    int height() const;
 
73
    void setHeight(int height);
 
74
 
 
75
    QString hiding() const;
 
76
    void setHiding(const QString &mode);
 
77
 
 
78
public Q_SLOTS:
 
79
    void remove() { Containment::remove(); }
 
80
    void showConfigurationInterface() { Containment::showConfigurationInterface(); }
 
81
 
 
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(); }
 
86
 
 
87
private:
 
88
    PanelView *panel() const;
 
89
};
 
90
 
 
91
}
 
92
 
 
93
#endif
 
94