Solid
genericinterface.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2006-2007 Kevin Ottens <ervin@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library 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 GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 00018 */ 00019 00020 #ifndef SOLID_GENERICINTERFACE_H 00021 #define SOLID_GENERICINTERFACE_H 00022 00023 #include <QtCore/QMap> 00024 #include <QtCore/QVariant> 00025 00026 #include <solid/solid_export.h> 00027 #include <solid/deviceinterface.h> 00028 00029 namespace Solid 00030 { 00031 class GenericInterfacePrivate; 00032 class Device; 00033 00043 class SOLID_EXPORT GenericInterface : public DeviceInterface 00044 { 00045 Q_OBJECT 00046 Q_ENUMS(PropertyChange) 00047 Q_DECLARE_PRIVATE(GenericInterface) 00048 friend class Device; 00049 00050 public: 00059 enum PropertyChange { PropertyModified, PropertyAdded, PropertyRemoved }; 00060 00061 private: 00070 explicit GenericInterface(QObject *backendObject); 00071 00072 public: 00076 virtual ~GenericInterface(); 00077 00078 00085 static Type deviceInterfaceType() { return DeviceInterface::GenericInterface; } 00086 00099 QVariant property(const QString &key) const; 00100 00111 QMap<QString, QVariant> allProperties() const; 00112 00125 bool propertyExists(const QString &key) const; 00126 00127 Q_SIGNALS: 00136 void propertyChanged(const QMap<QString,int> &changes); 00137 00145 void conditionRaised(const QString &condition, const QString &reason); 00146 }; 00147 } 00148 00149 #endif