• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Plasma

appletscript.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2007 by 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 PLASMA_APPLETSCRIPT_H
00021 #define PLASMA_APPLETSCRIPT_H
00022 
00023 #include <QtCore/QObject>
00024 #include <QtCore/QRect>
00025 #include <QtCore/QSizeF>
00026 
00027 #include <kgenericfactory.h>
00028 
00029 #include <plasma/plasma_export.h>
00030 #include <plasma/scripting/scriptengine.h>
00031 
00032 class QAction;
00033 class QPainter;
00034 class QStyleOptionGraphicsItem;
00035 class KConfigDialog;
00036 
00037 namespace Plasma
00038 {
00039 
00040 class AppletScriptPrivate;
00041 class Extender;
00042 
00048 class PLASMA_EXPORT AppletScript : public ScriptEngine
00049 {
00050     Q_OBJECT
00051 
00052 public:
00061     explicit AppletScript(QObject *parent = 0);
00062     ~AppletScript();
00063 
00067     void setApplet(Plasma::Applet *applet);
00068 
00072     Plasma::Applet *applet() const;
00073 
00082     virtual void paintInterface(QPainter *painter,
00083                                 const QStyleOptionGraphicsItem *option,
00084                                 const QRect &contentsRect);
00085 
00089     Q_INVOKABLE QSizeF size() const;
00090 
00102     virtual void constraintsEvent(Plasma::Constraints constraints);
00103 
00110     virtual QList<QAction*> contextualActions();
00111 
00115     virtual QPainterPath shape() const;
00116 
00122     void setHasConfigurationInterface(bool hasInterface);
00123 
00127     void setConfigurationRequired(bool req, const QString &reason = QString());
00128 
00132     void setFailedToLaunch(bool failed, const QString &reason = QString());
00133 
00137     void configNeedsSaving() const;
00138 
00142     Extender *extender() const;
00143 
00144 public Q_SLOTS:
00145 
00149     virtual void showConfigurationInterface();
00150 
00154     virtual void configChanged();
00155 
00156 protected:
00161     Q_INVOKABLE DataEngine *dataEngine(const QString &engine) const;
00162 
00166     QString mainScript() const;
00167 
00173     const Package *package() const;
00174 
00181     KConfigDialog *standardConfigurationDialog();
00182 
00189     void addStandardConfigurationPages(KConfigDialog *dialog);
00190 
00191 private:
00192     AppletScriptPrivate *const d;
00193 };
00194 
00195 #define K_EXPORT_PLASMA_APPLETSCRIPTENGINE(libname, classname) \
00196 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
00197 K_EXPORT_PLUGIN(factory("plasma_appletscriptengine_" #libname))
00198 
00199 } //Plasma namespace
00200 
00201 #endif

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal