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

kremotecontrol

  • sources
  • kde-4.12
  • kdeutils
  • kremotecontrol
  • dataengine
kremotecontrolengine.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2010 Frank Scheffold <fscheffold@googlemail.com>
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 #include "kremotecontrolengine.h"
21 
22 #include <QtCore/QDate>
23 #include <QtCore/QTime>
24 
25 #include <KSystemTimeZones>
26 #include <KDateTime>
27 #include <KDebug>
28 
29 #include <Plasma/DataContainer>
30 #include <dbusinterface.h>
31 
32 KRemoteControlEngine::KRemoteControlEngine(QObject* parent, const QVariantList& args) : Plasma::DataEngine(parent, args) {
33  // We ignore any arguments - data engines do not have much use for them
34  Q_UNUSED(args)
35 
36  // This prevents applets from setting an unnecessarily high
37  // update interval and using too much CPU.
38  // In the case of a clock that only has second precision,
39  // a third of a second should be more than enough.
40  setMinimumPollingInterval(333);
41 }
42 
43 bool KRemoteControlEngine::sourceRequestEvent(const QString &name) {
44  // We do not have any special code to execute the
45  // first time a source is requested, so we just call
46  // updateSourceEvent().
47  return updateSourceEvent(name);
48 }
49 
50 bool KRemoteControlEngine::updateSourceEvent(const QString &name) {
51  Q_UNUSED(name)
52  DBusInterface *dBusInterface = DBusInterface::getInstance();
53  QStringList remotes = dBusInterface->configuredRemotes();
54  setData(QLatin1String( "remotes" ), remotes);
55  kDebug() << "remotes" << remotes;
56  foreach(const QString &remote, remotes) {
57  setData(remote, QLatin1String( "modes" ), dBusInterface->modesForRemote(remote));
58  setData(remote, QLatin1String( "currentMode" ), dBusInterface->currentMode(remote));
59  setData(remote, QLatin1String( "eventsIgnored" ), dBusInterface->eventsIgnored(remote));
60  }
61 
62  return true;
63 }
64 
65 // This does the magic that allows Plasma to load
66 // this plugin. The first argument must match
67 // the X-Plasma-EngineName in the .desktop file.
68 K_EXPORT_PLASMA_DATAENGINE(kremotecontrol, KRemoteControlEngine)
69 
70 // this is needed since TestTimeEngine is a QObject
71 #include "kremotecontrolengine.moc"
dbusinterface.h
KRemoteControlEngine::updateSourceEvent
bool updateSourceEvent(const QString &source)
Definition: kremotecontrolengine.cpp:50
DBusInterface::getInstance
static DBusInterface * getInstance()
Definition: dbusinterface.cpp:50
DBusInterface
Definition: dbusinterface.h:36
QObject
KRemoteControlEngine
Definition: kremotecontrolengine.h:29
DBusInterface::modesForRemote
QStringList modesForRemote(const QString &remoteName)
Definition: dbusinterface.cpp:509
KRemoteControlEngine::sourceRequestEvent
bool sourceRequestEvent(const QString &name)
Definition: kremotecontrolengine.cpp:43
DBusInterface::currentMode
QString currentMode(const QString &remoteName)
Definition: dbusinterface.cpp:496
DBusInterface::eventsIgnored
bool eventsIgnored(const QString &remoteName)
Definition: dbusinterface.cpp:537
kremotecontrolengine.h
DBusInterface::configuredRemotes
QStringList configuredRemotes()
Definition: dbusinterface.cpp:257
KRemoteControlEngine::KRemoteControlEngine
KRemoteControlEngine(QObject *parent, const QVariantList &args)
Definition: kremotecontrolengine.cpp:32
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kremotecontrol

Skip menu "kremotecontrol"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal