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

Engines

devicesignalmapper.cpp

Go to the documentation of this file.
00001 /*
00002  *   Copyright (C) 2007 Christopher Blauvelt <cblauvelt@gmail.com>
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 version 2 as
00006  *   published by the Free Software Foundation
00007  *
00008  *   This program is distributed in the hope that it will be useful,
00009  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  *   GNU General Public License for more details
00012  *
00013  *   You should have received a copy of the GNU Library General Public
00014  *   License along with this program; if not, write to the
00015  *   Free Software Foundation, Inc.,
00016  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00017  */
00018 
00019 #include "devicesignalmapper.h"
00020 
00021 DeviceSignalMapper::DeviceSignalMapper(QObject *parent) : QSignalMapper(parent)
00022 {
00023 }
00024 
00025 DeviceSignalMapper::~DeviceSignalMapper()
00026 {
00027 }
00028 
00029 void DeviceSignalMapper::setMapping(QObject* device, const QString &udi)
00030 {
00031     signalmap[device] = udi;
00032 }
00033 
00034 AcAdapterSignalMapper::AcAdapterSignalMapper(QObject *parent) : DeviceSignalMapper(parent)
00035 {
00036 }
00037 
00038 AcAdapterSignalMapper::~AcAdapterSignalMapper()
00039 {
00040 }
00041 
00042 void AcAdapterSignalMapper::plugStateChanged(bool newState)
00043 {
00044     emit(deviceChanged(signalmap[sender()], "Plugged In", newState));
00045 }
00046 
00047 
00048 ButtonSignalMapper::ButtonSignalMapper(QObject *parent) : DeviceSignalMapper(parent)
00049 {
00050 }
00051 
00052 ButtonSignalMapper::~ButtonSignalMapper()
00053 {
00054 }
00055 
00056 void ButtonSignalMapper::pressed(Solid::Button::ButtonType type)
00057 {
00058     Q_UNUSED(type)
00059     emit(deviceChanged(signalmap[sender()], "Pressed", true));
00060 }
00061 
00062 BatterySignalMapper::BatterySignalMapper(QObject *parent) : DeviceSignalMapper(parent)
00063 {
00064 }
00065 
00066 BatterySignalMapper::~BatterySignalMapper()
00067 {
00068 }
00069 
00070 void BatterySignalMapper::chargePercentChanged(int value)
00071 {
00072     emit(deviceChanged(signalmap[sender()], "Charge Percent", value));
00073 }
00074 
00075 void BatterySignalMapper::chargeStateChanged(int newState)
00076 {
00077     QStringList chargestate;
00078     chargestate << "Fully Charged" << "Charging" << "Discharging";
00079     emit(deviceChanged(signalmap[sender()], "Charge State", chargestate.at(newState)));
00080 }
00081 
00082 void BatterySignalMapper::plugStateChanged(bool newState)
00083 {
00084     emit(deviceChanged(signalmap[sender()], "Plugged In", newState));
00085 }
00086 
00087 StorageAccessSignalMapper::StorageAccessSignalMapper(QObject *parent) : DeviceSignalMapper(parent)
00088 {
00089 }
00090 
00091 StorageAccessSignalMapper::~StorageAccessSignalMapper()
00092 {
00093 }
00094 
00095 void StorageAccessSignalMapper::accessibilityChanged(bool accessible)
00096 {
00097     emit(deviceChanged(signalmap[sender()], "Accessible", accessible));
00098 }
00099 
00100 #include "devicesignalmapper.moc"

Engines

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

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
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