3 * Authors (alphabetical) :
4 * Marc-Olivier Barre <marco@marcochapeau.org>
5 * Julien Cassignol <ainulindale@gmail.com>
6 * Klaus 'mrmoku' Kurzmann <mok@fluxnetz.de>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Public License as published by
11 * the Free Software Foundation; version 2 of the license.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser Public License for more details.
19 #ifndef FRAMEWORKD_GLIB_DBUS_H
20 #define FRAMEWORKD_GLIB_DBUS_H
23 #include <dbus/dbus-glib.h>
28 #define FSO_INTERFACE "org.freesmartphone"
30 #define DBUS_FSO_ERROR_UNAVAILABLE FSO_INTERFACE ".Unavailable"
31 #define DBUS_FSO_ERROR_UNSUPPORTED FSO_INTERFACE ".Unsupported"
32 #define DBUS_FSO_ERROR_SYSTEM_ERROR FSO_INTERFACE ".SystemError"
33 #define DBUS_FSO_ERROR_INTERNAL_ERROR FSO_INTERFACE ".InternalError"
34 #define DBUS_FSO_ERROR_INVALID_PARAMETER FSO_INTERFACE ".InvalidParameter"
36 #define FRAMEWORKD_GLIB_DBUS_ERROR g_quark_from_static_string("dbus")
37 #define IS_FRAMEWORKD_GLIB_DBUS_ERROR(error, code) g_error_matches(error, FRAMEWORKD_GLIB_DBUS_ERROR, code)
40 FRAMEWORKD_GLIB_DBUS_ERROR_SERVICE_NOT_AVAILABLE
= -1,
41 FRAMEWORKD_GLIB_DBUS_ERROR_NO_REPLY
= -2
42 } FramewordGlibDbusErrors
;
45 void (*networkStatus
) (GHashTable
*);
46 void (*networkSignalStrength
) (const int);
47 void (*simAuthStatus
) (const int);
48 void (*simReadyStatus
) (gboolean
);
49 void (*simIncomingStoredMessage
) (const int);
50 void (*gsmDeviceStatus
) (const int);
51 void (*callCallStatus
) (const int, const int, GHashTable
*);
52 void (*pdpNetworkStatus
) (GHashTable
*);
53 void (*pdpContextStatus
) (const char *, GHashTable
*);
54 void (*deviceIdleNotifierState
) (const int);
55 void (*devicePowerSupplyStatus
) (const char *);
56 void (*devicePowerSupplyCapacity
) (const int energy
);
57 void (*deviceWakeupTimeChanged
) (const int);
58 void (*deviceInputEvent
) (char *, char *, int);
59 void (*incomingUssd
) (int, const char *);
60 void (*incomingMessageReceipt
) (const char *, char *, GHashTable
*);
61 void (*usageResourceAvailable
) (const char *, gboolean
);
62 void (*usageResourceChanged
) (const char *, gboolean
, GHashTable
*);
63 void (*pimNewMessage
) (const char *);
64 void (*pimUpdatedMessage
) (const char *, GHashTable
*);
65 void (*pimDeletedMessage
) (const char *);
66 //void (*pimMovedMessage) (const char *, const char *, const char *);
67 void (*pimIncomingMessage
) (const char *);
68 void (*pimUnreadMessages
) (const int);
69 void (*pimNewContact
) (const char *);
70 void (*pimUpdatedContact
) (const char *, GHashTable
*);
71 void (*pimDeletedContact
) (const char *);
72 void (*pimNewCall
) (char *);
73 void (*pimIncomingCall
) (char *);
74 void (*pimNewMissedCalls
) (const int);
75 void (*pimUnfinishedTasks
) (const int);
76 void (*preferencesNotify
) (const char *);
79 void lose(const char *str
, ...);
80 void lose_gerror(const char *prefix
, GError
* error
);
81 DBusGProxy
*dbus_connect_to_interface(const char *bus_name
, const char *path
,
82 const char *interface
,
83 const char *interface_name
);
84 GType
dbus_get_type_g_string_variant_hashtable();
85 GType
dbus_get_type_g_string_int_int_int_array();
86 GType
dbus_get_type_int_g_string_g_string_variant_hashtable_array();
87 GType
dbus_get_type_int_g_string_g_string_g_string_array();
88 void dbus_free_data(GType type
, gpointer data
);
89 GError
*dbus_handle_errors(GError
* dbus_error
);
90 GError
*dbus_handle_internal_errors(GError
* error
);
92 FrameworkdHandler
*frameworkd_handler_new();
93 void frameworkd_handler_connect(FrameworkdHandler
* frameworkdHandler
);
94 FrameworkdHandler
*fwdHandlers
;