• 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
  • libkremotecontrol
remotecontrol.cpp
Go to the documentation of this file.
1 /*************************************************************************
2  * Copyright (C) 2011 by Michael Zanetti <mzanetti@gmx.net> *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation; either version 2 of *
7  * the License or (at your option) version 3 or any later version *
8  * accepted by the membership of KDE e.V. (or its successor approved *
9  * by the membership of KDE e.V.), which shall act as a proxy *
10  * defined in Section 14 of version 3 of the license. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  *************************************************************************/
20 
21 #include "remotecontrol.h"
22 
23 #include "ifaces/remotecontrolinterface.h"
24 
25 RemoteControl::RemoteControl(Iface::RemoteControl *backendObject)
26  : QObject(), d_ptr(new RemoteControlPrivate(this))
27 {
28  Q_D(RemoteControl);
29  d->setBackendObject(backendObject);
30 }
31 
32 RemoteControl::~RemoteControl()
33 {
34 
35 }
36 
37 QStringList RemoteControl::allRemoteNames()
38 {
39  QStringList retList;
40  foreach(RemoteControl* rc, allRemotes()) {
41  retList.append(rc->name());
42  }
43  return retList;
44 }
45 
46 QString RemoteControl::name() const
47 {
48  return d_ptr->backendObject()->name();
49 }
50 
51 QList<RemoteControlButton> RemoteControl::buttons() const
52 {
53  return d_ptr->backendObject()->buttons();
54 }
55 
56 
57 RemoteControlPrivate::RemoteControlPrivate(QObject *parent):
58  m_parent(parent)
59 {
60 
61 }
62 
63 void RemoteControlPrivate::setBackendObject(Iface::RemoteControl *object)
64 {
65  m_backendObject = object;
66  if (object) {
67  QObject *tmpObj = dynamic_cast<QObject*>(object);
68  QObject::connect(tmpObj, SIGNAL(buttonPressed(RemoteControlButton)),
69  parent(), SIGNAL(buttonPressed(RemoteControlButton)));
70  }
71 
72 }
73 
74 Iface::RemoteControl* RemoteControlPrivate::backendObject() const
75 {
76  return m_backendObject;
77 }
78 
79 QObject *RemoteControlPrivate::parent() const
80 {
81  return m_parent;
82 }
RemoteControlPrivate::setBackendObject
void setBackendObject(Iface::RemoteControl *object)
Definition: remotecontrol.cpp:63
RemoteControl::allRemoteNames
static QStringList allRemoteNames()
Get the Names of the available remotes in the system.
Definition: remotecontrol.cpp:37
QObject
remotecontrolinterface.h
RemoteControlPrivate::backendObject
Iface::RemoteControl * backendObject() const
Definition: remotecontrol.cpp:74
Iface::RemoteControl
Definition: remotecontrolinterface.h:30
RemoteControl::name
QString name() const
Retrieves the name of the remote.
Definition: remotecontrol.cpp:46
RemoteControl
Definition: remotecontrol.h:35
RemoteControl::d_ptr
RemoteControlPrivate * d_ptr
Definition: remotecontrol.h:106
RemoteControlPrivate::RemoteControlPrivate
RemoteControlPrivate(QObject *parent)
Definition: remotecontrol.cpp:57
RemoteControlPrivate::parent
QObject * parent() const
Definition: remotecontrol.cpp:79
Iface::RemoteControl::buttons
virtual QList< RemoteControlButton > buttons() const =0
RemoteControl::buttons
QList< RemoteControlButton > buttons() const
Retrieves the buttons of the remote.
Definition: remotecontrol.cpp:51
RemoteControl::allRemotes
static QList< RemoteControl * > allRemotes()
Get all RemoteControl's available in the system.
Definition: remotecontrolmanager.cpp:197
remotecontrol.h
RemoteControlPrivate
Definition: remotecontrol_p.h:31
RemoteControl::~RemoteControl
virtual ~RemoteControl()
Destroys a RemoteControl object.
Definition: remotecontrol.cpp:32
RemoteControlButton
Definition: remotecontrolbutton.h:30
Iface::RemoteControl::name
virtual QString name() const =0
RemoteControl::RemoteControl
RemoteControl(const QString &name)
Definition: remotecontrolmanager.cpp:186
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