2 Copyright (C) 2012 Intel Corporation
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) any later version.
9 This library 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 GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef ABSTRACTDBUSINTERFACE_H
20 #define ABSTRACTDBUSINTERFACE_H
24 #include <unordered_map>
26 #include <boost/any.hpp>
28 class AbstractProperty;
32 class AbstractDBusInterface
36 AbstractDBusInterface(string interfaceName, string objectPath);
39 void registerObject(GDBusConnection* connection);
41 void addProperty(AbstractProperty* property);
42 virtual void updateValue(AbstractProperty* property);
46 static GVariant *getProperty(GDBusConnection * connection, const gchar * sender, const gchar *objectPath,
47 const gchar *interfaceName, const gchar * propertyName, GError** error,
49 static gboolean setProperty(GDBusConnection * connection, const gchar * sender, const gchar *objectPath,
50 const gchar *interfaceName, const gchar * propertyName, GVariant *value,
51 GError** error, gpointer userData);
53 virtual void setProperty(string propertyName, GVariant * value) = 0;
54 virtual GVariant * getProperty(string propertyName) = 0;
56 unordered_map<string, AbstractProperty*> properties;
59 string mInterfaceName;
61 string introspectionXml;
62 GDBusConnection * mConnection;
63 static unordered_map<string, AbstractDBusInterface*> interfaceMap;
66 #endif // ABSTRACTDBUSINTERFACE_H