Plasma
containment.h
Go to the documentation of this file.00001 /* 00002 * Copyright 2009 Aaron Seigo <aseigo@kde.org> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef CONTAINMENT 00021 #define CONTAINMENT 00022 00023 #include <QObject> 00024 #include <QScriptContext> 00025 #include <QScriptValue> 00026 #include <QWeakPointer> 00027 00028 namespace Plasma 00029 { 00030 class Containment; 00031 } // namespace Plasma 00032 00033 class Widget; 00034 class PanelView; 00035 00036 class Containment : public QObject 00037 { 00038 Q_OBJECT 00039 Q_PROPERTY(QString name READ name WRITE setName) 00040 Q_PROPERTY(QString type READ type) 00041 Q_PROPERTY(QString formFactor READ formFactor) 00042 Q_PROPERTY(QList<int> widgetIds READ widgetIds) 00043 Q_PROPERTY(int screen READ screen WRITE setScreen) 00044 Q_PROPERTY(int desktop READ desktop WRITE setDesktop) 00045 Q_PROPERTY(QString location READ location WRITE setLocation) 00046 Q_PROPERTY(int id READ id) 00047 00048 // panel properties 00049 Q_PROPERTY(QString alignment READ alignment WRITE setAlignment) 00050 Q_PROPERTY(int offset READ offset WRITE setOffset) 00051 Q_PROPERTY(int length READ length WRITE setLength) 00052 Q_PROPERTY(int height READ height WRITE setHeight) 00053 Q_PROPERTY(QString hiding READ hiding WRITE setHiding) 00054 00055 public: 00056 Containment(Plasma::Containment *containment, QObject *parent = 0); 00057 ~Containment(); 00058 00059 uint id() const; 00060 QString type() const; 00061 QString formFactor() const; 00062 QList<int> widgetIds() const; 00063 00064 QString name() const; 00065 void setName(const QString &name); 00066 00067 QString location() const; 00068 void setLocation(const QString &location); 00069 00070 int screen() const; 00071 void setScreen(int screen); 00072 00073 int desktop() const; 00074 void setDesktop(int desktop); 00075 00076 QString alignment() const; 00077 void setAlignment(const QString &alignment); 00078 00079 int offset() const; 00080 void setOffset(int pixels); 00081 00082 int length() const; 00083 void setLength(int pixels); 00084 00085 int height() const; 00086 void setHeight(int height); 00087 00088 QString hiding() const; 00089 void setHiding(const QString &mode); 00090 00091 static QScriptValue widgetById(QScriptContext *context, QScriptEngine *engine); 00092 static QScriptValue addWidget(QScriptContext *context, QScriptEngine *engine); 00093 00094 public Q_SLOTS: 00095 void remove(); 00096 void showConfigurationInterface(); 00097 00098 private: 00099 PanelView *panel() const; 00100 00101 QWeakPointer<Plasma::Containment> m_containment; 00102 bool m_isPanel; 00103 }; 00104 00105 #endif 00106
KDE 4.4 API Reference