00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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
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
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
00224
00225 #endif
00226