powersave_dbus.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *                         Powersave Daemon                                *
00004  *                                                                         *
00005  *           Copyright (C) 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_H
00026 #define POWERSAVE_DBUS_H
00027 #define DBUS_API_SUBJECT_TO_CHANGE 1
00028 
00029 #include <dbus-1.0/dbus/dbus.h>
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif /* __cplusplus */
00034 
00040 #define PS_DBUS_SERVICE                "com.novell.powersave"
00041 #define PS_DBUS_ACTION_INTERFACE       "com.novell.powersave.action"
00042 #define PS_DBUS_ADMIN_INTERFACE        "com.novell.powersave.admin"
00043 #define PS_DBUS_REQUEST_INTERFACE      "com.novell.powersave.request"
00044 #define PS_DBUS_MANAGER_INTERFACE      "com.novell.powersave.manager"
00045 #define PS_DBUS_SCRIPTS_INTERFACE      "com.novell.powersave.scripts"
00046 #define PS_DBUS_CLIENT_INTERFACE       "com.novell.kpowersave"
00047 #define PS_DBUS_PATH                   "/com/novell/powersave"
00048 
00056 #define CAPABILITY_NOTIFICATIONS 1
00057 
00058 #define CAPABILITY_SCREENLOCK 2
00059 
00060 #define CAPABILITY_BRIGHTNESS 4
00061 // end of client_modes group
00062         
00066         enum DBUS_ERROR { REPLY_SUCCESS,
00067                 REPLY_NO_CONNECTION,
00068                 REPLY_NO_RIGHTS,
00069                 REPLY_INVALID_PARAM,
00070                 REPLY_INVALID_METHOD,
00071                 REPLY_INVALID_INTERFACE,
00072                 REPLY_HW_NOT_SUPPORTED,
00073                 REPLY_DISABLED,
00074                 REPLY_ALREADY_SET,
00075                 REPLY_DBUS_ERROR,
00076                 REPLY_GENERAL_ERROR,
00077                 REPLY_INVALID_MESSAGE_TYPE,
00078                 REPLY_ERROR_MAX
00079         };
00080 
00081         extern char *DBus_Error_Array[REPLY_ERROR_MAX];
00082 
00084         enum POWERSAVE_MESSAGE_TYPE { MANAGER_MESSAGE,
00085                                       REQUEST_MESSAGE,
00086                                       ACTION_MESSAGE,
00087                                       SCRIPTS_MESSAGE,
00088                                       ADMIN_MESSAGE,
00089                                       CLIENT_MESSAGE };
00090 
00096         void dbusFree(void);
00097 
00111         int dbusGetMessageString(DBusMessage *msg, char **s, int no);
00112 
00127         int dbusGetMessageInteger(DBusMessage *msg, int *i, int no);
00128 
00141         int dbusGetMessageErrorID(DBusMessage *msg, unsigned *error_id);
00142 
00177         unsigned dbusSendSimpleMessage(int msg_type, const char *method);
00178 
00187         unsigned dbusSendSimpleMessageWithReply(int msg_type, DBusMessage **reply, const char *method);
00188 
00197         unsigned dbusSendMessage(int msg_type, const char *method, int first_arg_type, ...);
00198 
00208         unsigned dbusSendMessageWithReply(int msg_type,
00209                                           DBusMessage **reply, const char *method, int first_arg_type, ...);
00210 
00219         dbus_int32_t establishConnection(int capabilities, DBusConnection * connection);
00220 
00221 #ifdef __cplusplus
00222 }
00223 #endif /* __cplusplus */
00224 
00225 #endif /*  POWERSAVE_DBUS_H */
00226 // end of libpowersave_dbus

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