dbus_server.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *                         Powersave Daemon                                *
00004  *                                                                         *
00005  *          Copyright (C) 2004,2005 SUSE Linux Products GmbH               *
00006  *                                                                         *
00007  *               Author(s): Holger Macht <hmacht@suse.de>                  *
00008  *                                                                         *
00009  * This program is free software; you can redistribute it and/or modify it *
00010  * under the terms of the GNU General Public License as published by the   *
00011  * Free Software Foundation; either version 2 of the License, or (at you   *
00012  * option) any later version.                                              *
00013  *                                                                         *
00014  * This program is distributed in the hope that it will be useful, but     *
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of              *
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       *
00017  * General Public License for more details.                                *
00018  *                                                                         *
00019  * You should have received a copy of the GNU General Public License along *
00020  * with this program; if not, write to the Free Software Foundation, Inc., *
00021  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA                  *
00022  *                                                                         *
00023  ***************************************************************************/
00024 
00025 #ifndef POWERSAVE_DBUS_SERVER_H
00026 #define POWERSAVE_DBUS_SERVER_H
00027 #define DBUS_API_SUBJECT_TO_CHANGE 1
00028 
00029 #define DBUS_NM_SERVICE                "org.freedesktop.NetworkManager"
00030 #define DBUS_NM_INTERFACE              "org.freedesktop.NetworkManager"
00031 #define DBUS_NM_PATH                   "/org/freedesktop/NetworkManager"
00032 #define DBUS_HAL_MANAGER_INTERFACE     "org.freedesktop.Hal.Manager"
00033 #define DBUS_HAL_DEVICE_INTERFACE      "org.freedesktop.Hal.Device"
00034 
00035 #include "powersave_dbus.h"
00036 
00037 #include <dbus/dbus-glib.h>
00038 #include <dbus/dbus-glib-lowlevel.h>
00039 
00040 #include <string>
00041 
00042 class PM_Interface;
00043 
00051 class DBus_Server {
00052 public:
00053         DBus_Server();
00054         ~DBus_Server();
00055 
00063         static DBusConnection *openSystemConnection();
00064 
00072         static int emitSignal(const char *signal, const char *value);
00073 
00083         static bool sendMethodCall(const char *interface, const char *path,
00084                                    const char *object, const char* method);
00085 
00092         static bool serviceHasOwner(const std::string &service);
00093         
00098         static gboolean dbus_reconnect();
00099         static DBusConnection* _connection;
00100 private:
00101         static DBusHandlerResult filter_function(DBusConnection * conn, DBusMessage * msg, void *data);
00102         
00103         static void sendReply(DBusMessage * reply, int error_id);
00104 };
00105 
00106 #endif // POWERSAVE_DBUS_SERVER_H

Generated on Mon Mar 27 09:27:19 2006 for Powersave Daemon by  doxygen 1.4.6