DBusMessage

A type for representing D-Bus messages that can be sent or received on a GDBusConnection

class DBusMessage : ObjectG {}

Constructors

this
this(GDBusMessage* gDBusMessage, bool ownedRef = false)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new empty GDBusMessage

this
this(char[] blob, GDBusCapabilityFlags capabilities)

Creates a new GDBusMessage from the data stored at blob. The byte order that the message was in can be retrieved using g_dbus_message_get_byte_order().

this
this(string name, string path, string interface_, string method)

Creates a new GDBusMessage for a method call.

this
this(string path, string interface_, string signal)

Creates a new GDBusMessage for a signal emission.

Members

Functions

copy
DBusMessage copy()

Copies message. The copy is a deep copy and the returned GDBusMessage is completely identical except that it is guaranteed to not be locked.

getArg0
string getArg0()

Convenience to get the first item in the body of message.

getBody
Variant getBody()

Gets the body of a message.

getByteOrder
GDBusMessageByteOrder getByteOrder()

Gets the byte order of message.

getDBusMessageStruct
GDBusMessage* getDBusMessageStruct(bool transferOwnership = false)

Get the main Gtk struct

getDestination
string getDestination()

Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.

getErrorName
string getErrorName()

Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.

getFlags
GDBusMessageFlags getFlags()

Gets the flags for message.

getHeader
Variant getHeader(GDBusMessageHeaderField headerField)

Gets a header field on message.

getHeaderFields
char[] getHeaderFields()

Gets an array of all header fields on message that are set.

getInterface
string getInterface()

Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.

getLocked
bool getLocked()

Checks whether message is locked. To monitor changes to this value, conncet to the notify signal to listen for changes on the locked property.

getMember
string getMember()

Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.

getMessageType
GDBusMessageType getMessageType()

Gets the type of message.

getNumUnixFds
uint getNumUnixFds()

Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.

getPath
string getPath()

Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.

getReplySerial
uint getReplySerial()

Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.

getSender
string getSender()

Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.

getSerial
uint getSerial()

Gets the serial for message.

getSignature
string getSignature()

Convenience getter for the G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.

getStruct
void* getStruct()

the main Gtk struct as a void*

getUnixFdList
UnixFDList getUnixFdList()

Gets the UNIX file descriptors associated with message, if any.

lock
void lock()

If message is locked, does nothing. Otherwise locks the message.

newMethodErrorLiteral
DBusMessage newMethodErrorLiteral(string errorName, string errorMessage)

Creates a new GDBusMessage that is an error reply to method_call_message.

newMethodErrorValist
DBusMessage newMethodErrorValist(string errorName, string errorMessageFormat, void* varArgs)

Like g_dbus_message_new_method_error() but intended for language bindings.

newMethodReply
DBusMessage newMethodReply()

Creates a new GDBusMessage that is a reply to method_call_message.

print
string print(uint indent)

Produces a human-readable multi-line description of message.

setBody
void setBody(Variant body_)

Sets the body message. As a side-effect the G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the type string of body (or cleared if body is NULL).

setByteOrder
void setByteOrder(GDBusMessageByteOrder byteOrder)

Sets the byte order of message.

setDestination
void setDestination(string value)

Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.

setErrorName
void setErrorName(string value)

Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.

setFlags
void setFlags(GDBusMessageFlags flags)

Sets the flags to set on message.

setHeader
void setHeader(GDBusMessageHeaderField headerField, Variant value)

Sets a header field on message.

setInterface
void setInterface(string value)

Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.

setMember
void setMember(string value)

Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.

setMessageType
void setMessageType(GDBusMessageType type)

Sets message to be of type.

setNumUnixFds
void setNumUnixFds(uint value)

Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.

setPath
void setPath(string value)

Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.

setReplySerial
void setReplySerial(uint value)

Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.

setSender
void setSender(string value)

Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.

setSerial
void setSerial(uint serial)

Sets the serial for message.

setSignature
void setSignature(string value)

Convenience setter for the G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.

setUnixFdList
void setUnixFdList(UnixFDList fdList)

Sets the UNIX file descriptors associated with message. As a side-effect the G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field is set to the number of fds in fd_list (or cleared if fd_list is NULL).

toBlob
char[] toBlob(GDBusCapabilityFlags capabilities)

Serializes message to a blob. The byte order returned by g_dbus_message_get_byte_order() will be used.

toGerror
bool toGerror()

If message is not of type G_DBUS_MESSAGE_TYPE_ERROR does nothing and returns FALSE.

Static functions

bytesNeeded
ptrdiff_t bytesNeeded(char[] blob)

Utility function to calculate how many bytes are needed to completely deserialize the D-Bus message stored at blob.

getType
GType getType()

Variables

gDBusMessage
GDBusMessage* gDBusMessage;

the main Gtk struct

Meta

Since

2.26