53 #include <nsStringGlue.h>
56 #include <dbus/dbus.h>
91 const char* aDestination,
93 const char* aInterface,
102 nsresult
GetArgs(
int aFirstArgType,
111 void Assign(DBusMessage* aMessage);
118 DBusMessage*
get()
const
147 DBusMessage* mBaseMessage;
178 DBusBusType aBusType,
179 const char* aDestination,
181 const char* aInterface);
205 DBusConnection*
get()
const
207 return mBaseConnection;
231 static const PRUint32 sMethodCallTimeoutMS = 1000;
243 DBusConnection* mBaseConnection;
244 nsCString mDestination;
246 nsCString mInterface;
258 nsresult Initialize(DBusBusType aBusType,
259 const char* aDestination,
261 const char* aInterface);
300 #define SB_DBUS_ENSURE_SUCCESS_BODY(aError, aReturnValue) \
301 char* msg = PR_smprintf("SB_DBUS_ENSURE_SUCCESS(%s, %s) failed with " \
307 PR_smprintf_free(msg);
311 #define SB_DBUS_ENSURE_SUCCESS_BODY(aError, aReturnValue) \
312 NS_WARNING("SB_DBUS_ENSURE_SUCCESS(" #aError ", " #aReturnValue ") failed");
326 #define SB_DBUS_ENSURE_SUCCESS(aError, aReturnValue) \
328 if (dbus_error_is_set(&aError)) { \
329 SB_DBUS_ENSURE_SUCCESS_BODY(aError, aReturnValue) \
330 return aReturnValue; \
335 #endif // _SB_DBUS_H_
nsresult GetArgs(int aFirstArgType,...)
static nsresult New(sbDBusConnection **aConnection, DBusBusType aBusType, const char *aDestination, const char *aPath, const char *aInterface)
nsresult InvokeMethod(const char *aMethod, sbDBusMessage **aReply, int aFirstArgType,...)
static nsresult NewMethodCall(sbDBusMessage **aMessage, const char *aDestination, const char *aPath, const char *aInterface, const char *aMethod)
sbDBusMessage(DBusMessage *aMessage=NULL)
void Assign(DBusMessage *aMessage)
virtual ~sbDBusConnection()