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

Solid

  • solid
  • solid
deviceinterface.cpp
Go to the documentation of this file.
1/*
2 Copyright 2006-2007 Kevin Ottens <ervin@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) version 3, or any
8 later version accepted by the membership of KDE e.V. (or its
9 successor approved by the membership of KDE e.V.), which shall
10 act as a proxy defined in Section 6 of version 3 of the license.
11
12 This library 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 GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#include "deviceinterface.h"
22#include "deviceinterface_p.h"
23
24#include <solid/ifaces/deviceinterface.h>
25
26#include <QtCore/QMetaEnum>
27
28
29Solid::DeviceInterface::DeviceInterface(DeviceInterfacePrivate &dd, QObject *backendObject)
30 : d_ptr(&dd)
31{
32 Q_D(DeviceInterface);
33
34 d->setBackendObject(backendObject);
35}
36
37
38Solid::DeviceInterface::~DeviceInterface()
39{
40 delete d_ptr;
41 d_ptr = 0;
42}
43
44bool Solid::DeviceInterface::isValid() const
45{
46 Q_D(const DeviceInterface);
47 return d->backendObject()!=0;
48}
49
50QString Solid::DeviceInterface::typeToString(Type type)
51{
52 int index = staticMetaObject.indexOfEnumerator("Type");
53 QMetaEnum metaEnum = staticMetaObject.enumerator(index);
54 return QString(metaEnum.valueToKey((int)type));
55}
56
57Solid::DeviceInterface::Type Solid::DeviceInterface::stringToType(const QString &type)
58{
59 int index = staticMetaObject.indexOfEnumerator("Type");
60 QMetaEnum metaEnum = staticMetaObject.enumerator(index);
61 return (Type)metaEnum.keyToValue(type.toUtf8());
62}
63
64QString Solid::DeviceInterface::typeDescription(Type type)
65{
66 switch (type)
67 {
68 case Unknown:
69 return QObject::tr("Unknown", "Unknown device type");
70 case GenericInterface:
71 return QObject::tr("Generic Interface", "Generic Interface device type");
72 case Processor:
73 return QObject::tr("Processor", "Processor device type");
74 case Block:
75 return QObject::tr("Block", "Block device type");
76 case StorageAccess:
77 return QObject::tr("Storage Access", "Storage Access device type");
78 case StorageDrive:
79 return QObject::tr("Storage Drive", "Storage Drive device type");
80 case OpticalDrive:
81 return QObject::tr("Optical Drive", "Optical Drive device type");
82 case StorageVolume:
83 return QObject::tr("Storage Volume", "Storage Volume device type");
84 case OpticalDisc:
85 return QObject::tr("Optical Disc", "Optical Disc device type");
86 case Camera:
87 return QObject::tr("Camera", "Camera device type");
88 case PortableMediaPlayer:
89 return QObject::tr("Portable Media Player", "Portable Media Player device type");
90 case NetworkInterface:
91 return QObject::tr("Network Interface", "Network Interface device type");
92 case AcAdapter:
93 return QObject::tr("Ac Adapter", "Ac Adapter device type");
94 case Battery:
95 return QObject::tr("Battery", "Battery device type");
96 case Button:
97 return QObject::tr("Button", "Button device type");
98 case AudioInterface:
99 return QObject::tr("Audio Interface", "Audio Interface device type");
100 case DvbInterface:
101 return QObject::tr("Dvb Interface", "Dvb Interface device type");
102 case Video:
103 return QObject::tr("Video", "Video device type");
104 case SerialInterface:
105 return QObject::tr("Serial Interface", "Serial Interface device type");
106 case SmartCardReader:
107 return QObject::tr("Smart Card Reader", "Smart Card Reader device type");
108 case InternetGateway:
109 return QObject::tr("Internet Gateway Device", "Internet Gateway device type");
110 case NetworkShare:
111 return QObject::tr("Network Share", "Network Share device type");
112 case Last:
113 return QString();
114 }
115 return QString();
116}
117
118Solid::DeviceInterfacePrivate::DeviceInterfacePrivate()
119 : m_devicePrivate(0)
120{
121
122}
123
124Solid::DeviceInterfacePrivate::~DeviceInterfacePrivate()
125{
126
127}
128
129QObject *Solid::DeviceInterfacePrivate::backendObject() const
130{
131 return m_backendObject.data();
132}
133
134void Solid::DeviceInterfacePrivate::setBackendObject(QObject *object)
135{
136 m_backendObject = object;
137}
138
139Solid::DevicePrivate* Solid::DeviceInterfacePrivate::devicePrivate() const
140{
141 return m_devicePrivate;
142}
143
144void Solid::DeviceInterfacePrivate::setDevicePrivate(DevicePrivate *devicePrivate)
145{
146 m_devicePrivate = devicePrivate;
147}
148
149#include "deviceinterface.moc"
QObject
Solid::AcAdapter
This device interface is available on AC adapters.
Definition: acadapter.h:37
Solid::AudioInterface
This device interface is available on interfaces exposed by sound cards.
Definition: audiointerface.h:38
Solid::Battery
This device interface is available on batteries.
Definition: battery.h:37
Solid::Block
This device interface is available on block devices.
Definition: block.h:41
Solid::Button
This device interface is available on button devices.
Definition: button.h:43
Solid::Camera
This device interface is available on digital camera devices.
Definition: camera.h:47
Solid::DeviceInterfacePrivate
Definition: deviceinterface_p.h:29
Solid::DeviceInterfacePrivate::backendObject
QObject * backendObject() const
Definition: deviceinterface.cpp:129
Solid::DeviceInterfacePrivate::setBackendObject
void setBackendObject(QObject *object)
Definition: deviceinterface.cpp:134
Solid::DeviceInterfacePrivate::devicePrivate
DevicePrivate * devicePrivate() const
Definition: deviceinterface.cpp:139
Solid::DeviceInterfacePrivate::~DeviceInterfacePrivate
virtual ~DeviceInterfacePrivate()
Definition: deviceinterface.cpp:124
Solid::DeviceInterfacePrivate::DeviceInterfacePrivate
DeviceInterfacePrivate()
Definition: deviceinterface.cpp:118
Solid::DeviceInterfacePrivate::setDevicePrivate
void setDevicePrivate(DevicePrivate *devicePrivate)
Definition: deviceinterface.cpp:144
Solid::DeviceInterface
Base class of all the device interfaces.
Definition: deviceinterface.h:43
Solid::DeviceInterface::typeToString
static QString typeToString(Type type)
Definition: deviceinterface.cpp:50
Solid::DeviceInterface::~DeviceInterface
virtual ~DeviceInterface()
Destroys a DeviceInterface object.
Definition: deviceinterface.cpp:38
Solid::DeviceInterface::Type
Type
This enum type defines the type of device interface that a Device can have.
Definition: deviceinterface.h:67
Solid::DeviceInterface::isValid
bool isValid() const
Indicates if this device interface is valid.
Definition: deviceinterface.cpp:44
Solid::DeviceInterface::stringToType
static Type stringToType(const QString &type)
Definition: deviceinterface.cpp:57
Solid::DeviceInterface::DeviceInterface
DeviceInterface(DeviceInterfacePrivate &dd, QObject *backendObject)
Definition: deviceinterface.cpp:29
Solid::DeviceInterface::typeDescription
static QString typeDescription(Type type)
Definition: deviceinterface.cpp:64
Solid::DevicePrivate
Definition: device_p.h:36
Solid::DvbInterface
This device interface is available on Digital Video Broadcast (DVB) devices.
Definition: dvbinterface.h:42
Solid::GenericInterface
Generic interface to deal with a device.
Definition: genericinterface.h:45
Solid::InternetGateway
Definition: internetgateway.h:38
Solid::NetworkInterface
This device interface is available on network interfaces.
Definition: networkinterface.h:37
Solid::NetworkShare
NetworkShare interface.
Definition: networkshare.h:45
Solid::OpticalDisc
This device interface is available on optical discs.
Definition: opticaldisc.h:39
Solid::OpticalDrive
This device interface is available on CD-R*,DVD*,Blu-Ray,HD-DVD drives.
Definition: opticaldrive.h:43
Solid::PortableMediaPlayer
This class implements Portable Media Player device interface and represents a portable media player a...
Definition: portablemediaplayer.h:46
Solid::Processor
This device interface is available on processors.
Definition: processor.h:37
Solid::SerialInterface
This device interface is available on serial interfaces.
Definition: serialinterface.h:38
Solid::SmartCardReader
This device interface is available on smart card readers.
Definition: smartcardreader.h:37
Solid::StorageAccess
This device interface is available on volume devices to access them (i.e.
Definition: storageaccess.h:43
Solid::StorageDrive
This device interface is available on storage devices.
Definition: storagedrive.h:40
Solid::StorageVolume
This device interface is available on volume devices.
Definition: storagevolume.h:40
Solid::Video
This device interface is available on video devices.
Definition: video.h:45
deviceinterface.h
deviceinterface_p.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Solid

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • 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
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