• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

Plasma

dataenginescript.cpp

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 #include "dataenginescript.h"
00021 
00022 #include "package.h"
00023 #include "private/dataengine_p.h"
00024 #include "private/service_p.h"
00025 
00026 namespace Plasma
00027 {
00028 
00029 class DataEngineScriptPrivate
00030 {
00031 public:
00032     DataEngine *dataEngine;
00033 };
00034 
00035 DataEngineScript::DataEngineScript(QObject *parent)
00036     : ScriptEngine(parent),
00037       d(new DataEngineScriptPrivate)
00038 {
00039 }
00040 
00041 DataEngineScript::~DataEngineScript()
00042 {
00043     delete d;
00044 }
00045 
00046 void DataEngineScript::setDataEngine(DataEngine *dataEngine)
00047 {
00048     d->dataEngine = dataEngine;
00049 }
00050 
00051 DataEngine *DataEngineScript::dataEngine() const
00052 {
00053     return d->dataEngine;
00054 }
00055 
00056 QStringList DataEngineScript::sources() const
00057 {
00058     return d->dataEngine->containerDict().keys();
00059 }
00060 
00061 bool DataEngineScript::sourceRequestEvent(const QString &name)
00062 {
00063     Q_UNUSED(name);
00064     return false;
00065 }
00066 
00067 bool DataEngineScript::updateSourceEvent(const QString &source)
00068 {
00069     Q_UNUSED(source);
00070     return false;
00071 }
00072 
00073 Service *DataEngineScript::serviceForSource(const QString &source)
00074 {
00075     Q_ASSERT(d->dataEngine);
00076     return new NullService(source, d->dataEngine);
00077 }
00078 
00079 QString DataEngineScript::mainScript() const
00080 {
00081     Q_ASSERT(d->dataEngine);
00082     return d->dataEngine->package()->filePath("mainscript");
00083 }
00084 
00085 const Package *DataEngineScript::package() const
00086 {
00087     Q_ASSERT(d->dataEngine);
00088     return d->dataEngine->package();
00089 }
00090 
00091 KPluginInfo DataEngineScript::description() const
00092 {
00093     Q_ASSERT(d->dataEngine);
00094     return d->dataEngine->d->dataEngineDescription;
00095 }
00096 
00097 void DataEngineScript::setData(const QString &source, const QString &key,
00098                                const QVariant &value)
00099 {
00100     if (d->dataEngine) {
00101         d->dataEngine->setData(source, key, value);
00102     }
00103 }
00104 
00105 void DataEngineScript::setData(const QString &source, const QVariant &value)
00106 {
00107     if (d->dataEngine) {
00108         d->dataEngine->setData(source, value);
00109     }
00110 }
00111 
00112 void DataEngineScript::setData(const QString &source, const DataEngine::Data &values)
00113 {
00114     if (d->dataEngine) {
00115         d->dataEngine->setData(source, values);
00116     }
00117 }
00118 
00119 void DataEngineScript::removeAllData(const QString &source)
00120 {
00121     if (d->dataEngine) {
00122         d->dataEngine->removeAllData(source);
00123     }
00124 }
00125 
00126 void DataEngineScript::removeData(const QString &source, const QString &key)
00127 {
00128     if (d->dataEngine) {
00129         d->dataEngine->removeData(source, key);
00130     }
00131 }
00132 
00133 void DataEngineScript::setMaxSourceCount(uint limit)
00134 {
00135     if (d->dataEngine) {
00136         d->dataEngine->setMaxSourceCount(limit);
00137     }
00138 }
00139 
00140 void DataEngineScript::setMinimumPollingInterval(int minimumMs)
00141 {
00142     if (d->dataEngine) {
00143         d->dataEngine->setMinimumPollingInterval(minimumMs);
00144     }
00145 }
00146 
00147 int DataEngineScript::minimumPollingInterval() const
00148 {
00149     if (d->dataEngine) {
00150         return d->dataEngine->minimumPollingInterval();
00151     }
00152     return 0;
00153 }
00154 
00155 void DataEngineScript::setPollingInterval(uint frequency)
00156 {
00157     if (d->dataEngine) {
00158         d->dataEngine->setPollingInterval(frequency);
00159     }
00160 }
00161 
00162 void DataEngineScript::removeAllSources()
00163 {
00164     if (d->dataEngine) {
00165         d->dataEngine->removeAllSources();
00166     }
00167 }
00168 
00169 void DataEngineScript::addSource(DataContainer *source)
00170 {
00171     if (d->dataEngine) {
00172         d->dataEngine->addSource(source);
00173     }
00174 }
00175 
00176 DataEngine::SourceDict DataEngineScript::containerDict() const
00177 {
00178     if (d->dataEngine) {
00179         return d->dataEngine->containerDict();
00180     }
00181     return DataEngine::SourceDict();
00182 }
00183 
00184 void DataEngineScript::setName(const QString &name)
00185 {
00186     if (d->dataEngine) {
00187         d->dataEngine->setName(name);
00188     }
00189 }
00190 
00191 void DataEngineScript::setIcon(const QString &icon)
00192 {
00193     if (d->dataEngine) {
00194         d->dataEngine->setIcon(icon);
00195     }
00196 }
00197 
00198 void DataEngineScript::scheduleSourcesUpdated()
00199 {
00200     if (d->dataEngine) {
00201         d->dataEngine->scheduleSourcesUpdated();
00202     }
00203 }
00204 
00205 void DataEngineScript::removeSource(const QString &source)
00206 {
00207     if (d->dataEngine) {
00208         d->dataEngine->removeSource(source);
00209     }
00210 }
00211 
00212 void DataEngineScript::updateAllSources()
00213 {
00214     if (d->dataEngine) {
00215         d->dataEngine->updateAllSources();
00216     }
00217 }
00218 
00219 void DataEngineScript::forceImmediateUpdateOfAllVisualizations()
00220 {
00221     if (d->dataEngine) {
00222         d->dataEngine->forceImmediateUpdateOfAllVisualizations();
00223     }
00224 }
00225 
00226 } // Plasma namespace
00227 
00228 #include "dataenginescript.moc"

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
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
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