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

« back to all changes in this revision

Viewing changes to libs/plasmagenericshell/scripting/widget.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 WIDGET
 
21
#define WIDGET
 
22
 
 
23
#include <QWeakPointer>
 
24
 
 
25
#include "applet.h"
 
26
 
 
27
#include "../plasmagenericshell_export.h"
 
28
 
 
29
namespace Plasma
 
30
{
 
31
    class Applet;
 
32
} // namespace Plasma
 
33
 
 
34
namespace WorkspaceScripting
 
35
{
 
36
 
 
37
class PLASMAGENERICSHELL_EXPORT Widget : public Applet
 
38
{
 
39
    Q_OBJECT
 
40
    Q_PROPERTY(QString type READ type)
 
41
    Q_PROPERTY(QString version READ version)
 
42
    Q_PROPERTY(int id READ id)
 
43
    Q_PROPERTY(QStringList configKeys READ configKeys)
 
44
    Q_PROPERTY(QStringList configGroups READ configGroups)
 
45
    Q_PROPERTY(QStringList globalConfigKeys READ globalConfigKeys)
 
46
    Q_PROPERTY(QStringList globalConfigGroups READ globalConfigGroups)
 
47
    Q_PROPERTY(int index WRITE setIndex READ index)
 
48
    Q_PROPERTY(QRectF geometry WRITE setGeometry READ geometry)
 
49
    Q_PROPERTY(QStringList currentConfigGroup WRITE setCurrentConfigGroup READ currentConfigGroup)
 
50
    Q_PROPERTY(QString globalShortcut WRITE setGlobalShortcut READ globalShorcut)
 
51
    Q_PROPERTY(bool locked READ locked WRITE setLocked)
 
52
 
 
53
public:
 
54
    Widget(Plasma::Applet *applet, QObject *parent = 0);
 
55
    ~Widget();
 
56
 
 
57
    uint id() const;
 
58
    QString type() const;
 
59
 
 
60
    int index() const;
 
61
    void setIndex(int index);
 
62
 
 
63
    QRectF geometry() const;
 
64
    void setGeometry(const QRectF &geometry);
 
65
 
 
66
    void setGlobalShortcut(const QString &shortcut);
 
67
    QString globalShorcut() const;
 
68
 
 
69
    Plasma::Applet *applet() const;
 
70
 
 
71
public Q_SLOTS:
 
72
    void remove();
 
73
    void showConfigurationInterface();
 
74
 
 
75
    // from the applet interface
 
76
    QVariant readConfig(const QString &key, const QVariant &def = QString()) const { return Applet::readConfig(key, def); }
 
77
    void writeConfig(const QString &key, const QVariant &value) { Applet::writeConfig(key, value); }
 
78
 
 
79
    QVariant readGlobalConfig(const QString &key, const QVariant &def = QString()) const { return Applet::readGlobalConfig(key, def); }
 
80
    void writeGlobalConfig(const QString &key, const QVariant &value) { Applet::writeGlobalConfig(key, value); }
 
81
 
 
82
    void reloadConfig() { Applet::reloadConfig(); }
 
83
 
 
84
private:
 
85
    class Private;
 
86
    Private * const d;
 
87
};
 
88
 
 
89
}
 
90
 
 
91
#endif
 
92