Gio::DBusMessage Class Reference

DBusMessage - D-Bus Message. More...

#include <giomm/dbusmessage.h>

Inheritance diagram for Gio::DBusMessage:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~DBusMessage ()
GDBusMessage* gobj ()
 Provides access to the underlying C GObject.
const GDBusMessage* gobj () const
 Provides access to the underlying C GObject.
GDBusMessage* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::ustring print (guint indent)
 Produces a human-readable multi-line description of message.
DBusMessageType get_message_type () const
 Gets the type of message.
void set_message_type (DBusMessageType type)
 Sets message to be of type.
guint32 get_serial () const
 Gets the serial for message.
void set_serial (guint32 serial)
 Sets the serial for message.
DBusMessageFlags get_flags () const
 Gets the flags for message.
void set_flags (DBusMessageFlags flags)
 Sets the flags to set on message.
void get_body (Glib::VariantBase&value) const
 Gets the body of a message.
void set_body (const Glib::VariantBase& body)
 Sets the body message.
guint32 get_num_unix_fds () const
 Gets the UNIX file descriptors associated with message, if any.
void set_num_unix_fds (guint32 value)
 Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
void get_header (Glib::VariantBase&value, DBusMessageHeaderField header_field) const
 Gets a header field on the message.
void set_header (DBusMessageHeaderField header_field, const Glib::VariantBase&value)
 Sets a header field on message.
Glib::ustring get_destination () const
 Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
void set_destination (const Glib::ustring&value)
 Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
Glib::ustring get_error_name () const
 Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
void set_error_name (const Glib::ustring&value)
 Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
Glib::ustring get_interface () const
 Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
void set_interface (const Glib::ustring&value)
 Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
Glib::ustring get_member () const
 Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
void set_member (const Glib::ustring&value)
 Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
Glib::ustring get_path () const
 Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_PATH header field.
void set_path (const Glib::ustring&value)
 Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_PATH header field.
guint32 get_reply_serial () const
 Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
void set_reply_serial (guint32 value)
 Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
Glib::ustring get_sender () const
 Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
void set_sender (const Glib::ustring&value)
 Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
Glib::ustring get_signature () const
 Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
void set_signature (const Glib::ustring&value)
 Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
Glib::ustring get_arg0 () const
 Convenience to get the first item in the body of message.

Static Public Member Functions

static Glib::RefPtr< DBusMessagecreate ()
 Creates a new empty DBusMessage.
static Glib::RefPtr< DBusMessagecreate_signal (const Glib::ustring& path, const Glib::ustring& interface, const Glib::ustring& signal)
 Creates a new DBusMessage for a signal emission.
static Glib::RefPtr< DBusMessagecreate_method_call (const Glib::ustring& name, const Glib::ustring& path, const Glib::ustring& interface, const Glib::ustring& method)
 Creates a new DBusMessage for a method call.
static Glib::RefPtr< DBusMessagecreate_method_reply (const Glib::RefPtr< DBusMessage >& method_call_message)
 Creates a new DBusMessage that is a reply to method_call_message.
static Glib::RefPtr< DBusMessagecreate_method_error_literal (const Glib::RefPtr< const DBusMessage >& method_call_message, const Glib::ustring& error_name, const Glib::ustring& error_message)
 Creates a new DBusMessage that is an error reply to method_call_message.

Protected Member Functions

 DBusMessage ()

Related Functions

(Note that these are not member functions.)



Glib::RefPtr< Gio::DBusMessagewrap (GDBusMessage* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

DBusMessage - D-Bus Message.

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

Since glibmm 2.26:

Constructor & Destructor Documentation

virtual Gio::DBusMessage::~DBusMessage (  )  [virtual]
Gio::DBusMessage::DBusMessage (  )  [protected]

Member Function Documentation

static Glib::RefPtr<DBusMessage> Gio::DBusMessage::create (  )  [static]

Creates a new empty DBusMessage.

Since glibmm 2.26:
Returns:
A DBusMessage. Free with Glib::object_unref().
static Glib::RefPtr<DBusMessage> Gio::DBusMessage::create_method_call ( const Glib::ustring name,
const Glib::ustring path,
const Glib::ustring interface,
const Glib::ustring method 
) [static]

Creates a new DBusMessage for a method call.

Since glibmm 2.26:
Parameters:
name A valid D-Bus name or 0.
path A valid object path.
interface A valid D-Bus interface name or 0.
method A valid method name.
Returns:
A DBusMessage. Free with Glib::object_unref().
static Glib::RefPtr<DBusMessage> Gio::DBusMessage::create_method_error_literal ( const Glib::RefPtr< const DBusMessage >&  method_call_message,
const Glib::ustring error_name,
const Glib::ustring error_message 
) [static]

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

Since glibmm 2.26:
Parameters:
error_name A valid D-Bus error name.
error_message The D-Bus error message.
Returns:
A DBusMessage. Free with Glib::object_unref().
static Glib::RefPtr<DBusMessage> Gio::DBusMessage::create_method_reply ( const Glib::RefPtr< DBusMessage >&  method_call_message  )  [static]

Creates a new DBusMessage that is a reply to method_call_message.

Since glibmm 2.26:
Returns:
A DBusMessage. Free with Glib::object_unref().
static Glib::RefPtr<DBusMessage> Gio::DBusMessage::create_signal ( const Glib::ustring path,
const Glib::ustring interface,
const Glib::ustring signal 
) [static]

Creates a new DBusMessage for a signal emission.

Since glibmm 2.26:
Parameters:
path A valid object path.
interface A valid D-Bus interface name.
signal A valid signal name.
Returns:
A DBusMessage. Free with Glib::object_unref().
Glib::ustring Gio::DBusMessage::get_arg0 (  )  const

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

Since glibmm 2.26:
Returns:
The string item or 0 if the first item in the body of message is not a string.
void Gio::DBusMessage::get_body ( Glib::VariantBase value  )  const

Gets the body of a message.

The body is returned in value.

Parameters:
value Location in which to store the header.
Glib::ustring Gio::DBusMessage::get_destination (  )  const

Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.

Since glibmm 2.26:
Returns:
The value.
Glib::ustring Gio::DBusMessage::get_error_name (  )  const

Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.

Since glibmm 2.26:
Returns:
The value.
DBusMessageFlags Gio::DBusMessage::get_flags (  )  const

Gets the flags for message.

Since glibmm 2.26:
Returns:
Flags that are set (typically values from the DBusMessageFlags enumeration bitwise ORed together).
void Gio::DBusMessage::get_header ( Glib::VariantBase value,
DBusMessageHeaderField  header_field 
) const

Gets a header field on the message.

The header is returned in value.

Parameters:
value Location in which to store the header.
header_field The header field type.
Glib::ustring Gio::DBusMessage::get_interface (  )  const

Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.

Since glibmm 2.26:
Returns:
The value.
Glib::ustring Gio::DBusMessage::get_member (  )  const

Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.

Since glibmm 2.26:
Returns:
The value.
DBusMessageType Gio::DBusMessage::get_message_type (  )  const

Gets the type of message.

Since glibmm 2.26:
Returns:
A 8-bit unsigned integer (typically a value from the DBusMessageType enumeration).
guint32 Gio::DBusMessage::get_num_unix_fds (  )  const

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

This method is only available on UNIX.

Since glibmm 2.26:
Returns:
A UnixFDList or 0 if no file descriptors are associated. Do not free, this object is owned by message. Gets the UNIX file descriptors associated with message, if any.

This method is only available on UNIX.

Since glibmm 2.26:
Returns:
A UnixFDList or 0 if no file descriptors are associated. Do not free, this object is owned by message. Sets the UNIX file descriptors associated with message. As a side-effect the 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 0).

This method is only available on UNIX.

Since glibmm 2.26:
Parameters:
fd_list A UnixFDList or 0. Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
Since glibmm 2.26:
Returns:
The value.
Glib::ustring Gio::DBusMessage::get_path (  )  const

Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_PATH header field.

Since glibmm 2.26:
Returns:
The value.
guint32 Gio::DBusMessage::get_reply_serial (  )  const

Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.

Since glibmm 2.26:
Returns:
The value.
Glib::ustring Gio::DBusMessage::get_sender (  )  const

Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_SENDER header field.

Since glibmm 2.26:
Returns:
The value.
guint32 Gio::DBusMessage::get_serial (  )  const

Gets the serial for message.

Since glibmm 2.26:
Returns:
A guint32.
Glib::ustring Gio::DBusMessage::get_signature (  )  const

Convenience getter for the DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.

Since glibmm 2.26:
Returns:
The value.
const GDBusMessage* Gio::DBusMessage::gobj (  )  const [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GDBusMessage* Gio::DBusMessage::gobj (  )  [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GDBusMessage* Gio::DBusMessage::gobj_copy (  ) 

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Glib::ustring Gio::DBusMessage::print ( guint  indent  ) 

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

The contents of the description has no ABI guarantees, the contents and formatting is subject to change at any time. Typical output looks something like this: <programlisting> Type: method-call Flags: none Version: 0 Serial: 4 Headers: path -> objectpath '/org/gtk/GDBus/TestObject' interface -> 'org.gtk.GDBus.TestInterface' member -> 'GimmeStdout' destination -> ':1.146' Body: () UNIX File Descriptors: (none) </programlisting> or <programlisting> Type: method-return Flags: no-reply-expected Version: 0 Serial: 477 Headers: reply-serial -> uint32 4 destination -> ':1.159' sender -> ':1.146' num-unix-fds -> uint32 1 Body: () UNIX File Descriptors: fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635 </programlisting>

Since glibmm 2.26:
Parameters:
indent Indentation level.
Returns:
A string that should be freed with Glib::free().
void Gio::DBusMessage::set_body ( const Glib::VariantBase body  ) 

Sets the body message.

As a side-effect the DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the type string of body (or cleared if body is 0).

If body is floating, message assumes ownership of body.

Since glibmm 2.26:
Parameters:
body Either 0 or a Variant that is a tuple.
void Gio::DBusMessage::set_destination ( const Glib::ustring value  ) 

Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.

Since glibmm 2.26:
Parameters:
value The value to set.
void Gio::DBusMessage::set_error_name ( const Glib::ustring value  ) 

Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.

Since glibmm 2.26:
Parameters:
value The value to set.
void Gio::DBusMessage::set_flags ( DBusMessageFlags  flags  ) 

Sets the flags to set on message.

Since glibmm 2.26:
Parameters:
flags Flags for message that are set (typically values from the DBusMessageFlags enumeration bitwise ORed together).
void Gio::DBusMessage::set_header ( DBusMessageHeaderField  header_field,
const Glib::VariantBase value 
)

Sets a header field on message.

If value is floating, message assumes ownership of value.

Since glibmm 2.26:
Parameters:
header_field A 8-bit unsigned integer (typically a value from the DBusMessageHeaderField enumeration).
value A Variant to set the header field or 0 to clear the header field.
void Gio::DBusMessage::set_interface ( const Glib::ustring value  ) 

Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.

Since glibmm 2.26:
Parameters:
value The value to set.
void Gio::DBusMessage::set_member ( const Glib::ustring value  ) 

Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.

Since glibmm 2.26:
Parameters:
value The value to set.
void Gio::DBusMessage::set_message_type ( DBusMessageType  type  ) 

Sets message to be of type.

Since glibmm 2.26:
Parameters:
type A 8-bit unsigned integer (typically a value from the DBusMessageType enumeration).
void Gio::DBusMessage::set_num_unix_fds ( guint32  value  ) 

Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.

Since glibmm 2.26:
Parameters:
value The value to set.
void Gio::DBusMessage::set_path ( const Glib::ustring value  ) 

Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_PATH header field.

Since glibmm 2.26:
Parameters:
value The value to set.
void Gio::DBusMessage::set_reply_serial ( guint32  value  ) 

Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.

Since glibmm 2.26:
Parameters:
value The value to set.
void Gio::DBusMessage::set_sender ( const Glib::ustring value  ) 

Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_SENDER header field.

Since glibmm 2.26:
Parameters:
value The value to set.
void Gio::DBusMessage::set_serial ( guint32  serial  ) 

Sets the serial for message.

Since glibmm 2.26:
Parameters:
serial A guint32.
void Gio::DBusMessage::set_signature ( const Glib::ustring value  ) 

Convenience setter for the DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.

Since glibmm 2.26:
Parameters:
value The value to set.

Friends And Related Function Documentation

Glib::RefPtr< Gio::DBusMessage > wrap ( GDBusMessage *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
object The C instance.
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.
Generated on Wed Sep 1 22:22:11 2010 for glibmm by  doxygen 1.6.3