PlumaMessage

## PlumaMessage PlumaMessage — message bus message object |

## Synopsis

    #include <pluma/pluma-message.h>

    struct              PlumaMessage;
    void                pluma_message_get                   (PlumaMessage *message,
                                                             ...);
    void                pluma_message_get_valist            (PlumaMessage *message,
                                                             va_list var_args);
    void                pluma_message_get_value             (PlumaMessage *message,
                                                             const gchar *key,
                                                             GValue *value);
    void                pluma_message_set                   (PlumaMessage *message,
                                                             ...);
    void                pluma_message_set_valist            (PlumaMessage *message,
                                                             va_list var_args);
    void                pluma_message_set_value             (PlumaMessage *message,
                                                             const gchar *key,
                                                             GValue *value);
    void                pluma_message_set_valuesv           (PlumaMessage *message,
                                                             const gchar **keys,
                                                             GValue *values,
                                                             gint n_values);
    const gchar *       pluma_message_get_object_path       (PlumaMessage *message);
    const gchar *       pluma_message_get_method            (PlumaMessage *message);
    gboolean            pluma_message_has_key               (PlumaMessage *message,
                                                             const gchar *key);
    GType               pluma_message_get_key_type          (PlumaMessage *message,
                                                             const gchar *key);
    gboolean            pluma_message_validate              (PlumaMessage *message);

## Object Hierarchy

      GObject
       +----PlumaMessage

## Properties

      "method"                   gchar*                : Read
      "object-path"              gchar*                : Read
      "type"                     PlumaMessageType*     : Read / Write / Construct Only

## Description

Communication on a PlumaMessageBus is done through messages. Messages are sent over the bus and received by connecting callbacks on the message bus. A PlumaMessage is an instantiation of a PlumaMessageType, containing values for the arguments as specified in the message type.

A message can be seen as a method call, or signal emission depending on who is the sender and who is the receiver. There is no explicit distinction between methods and signals.

## Details

### struct PlumaMessage

    struct PlumaMessage;

### pluma_message_get ()

    void                pluma_message_get                   (PlumaMessage *message,
                                                             ...);

Get values of message arguments. The supplied `var_args` should contain pairs of keys and pointers to variables which are set to the argument value for the specified key.

`message` : | the PlumaMessage
`...` : | a NULL variable argument list of key/value container pairs

### pluma_message_get_valist ()

    void                pluma_message_get_valist            (PlumaMessage *message,
                                                             va_list var_args);

Get values of message arguments. The supplied `var_args` should contain pairs of keys and pointers to variables which are set to the argument value for the specified key.

`message` : | the PlumaMessage
`var_args` : | a NULL variable argument list of key/value container pairs

### pluma_message_get_value ()

    void                pluma_message_get_value             (PlumaMessage *message,
                                                             const gchar *key,
                                                             GValue *value);

Get the value of a specific message argument. `value` will be initialized with the correct type.

`message` : | the PlumaMessage
`key` : | the argument key
`value` : | value return container

### pluma_message_set ()

    void                pluma_message_set                   (PlumaMessage *message,
                                                             ...);

Set values of message arguments. The supplied `var_args` should contain pairs of keys and argument values.

`message` : | the PlumaMessage
`...` : | a NULL terminated variable list of key/value pairs

### pluma_message_set_valist ()

    void                pluma_message_set_valist            (PlumaMessage *message,
                                                             va_list var_args);

Set values of message arguments. The supplied `var_args` should contain pairs of keys and argument values.

`message` : | the PlumaMessage
`var_args` : | a NULL terminated variable list of key/value pairs

### pluma_message_set_value ()

    void                pluma_message_set_value             (PlumaMessage *message,
                                                             const gchar *key,
                                                             GValue *value);

Set value of message argument `key` to `value`.

`message` : | the PlumaMessage
`key` : | the argument key
`value` : | the argument value

### pluma_message_set_valuesv ()

    void                pluma_message_set_valuesv           (PlumaMessage *message,
                                                             const gchar **keys,
                                                             GValue *values,
                                                             gint n_values);

Set message argument values.

`message` : | the PlumaMessage
`keys` : | keys to set values for
`values` : | values to set
`n_values` : | number of arguments to set values for

### pluma_message_get_object_path ()

    const gchar *       pluma_message_get_object_path       (PlumaMessage *message);

Get the message object path.

`message` : | the PlumaMessage
Returns : | the message object path

### pluma_message_get_method ()

    const gchar *       pluma_message_get_method            (PlumaMessage *message);

Get the message method.

`message` : | the PlumaMessage
Returns : | the message method

### pluma_message_has_key ()

    gboolean            pluma_message_has_key               (PlumaMessage *message,
                                                             const gchar *key);

Check whether the message has a specific key.

`message` : | the PlumaMessage
`key` : | the argument key
Returns : | `TRUE` if `message` has argument `key`

### pluma_message_get_key_type ()

    GType               pluma_message_get_key_type          (PlumaMessage *message,
                                                             const gchar *key);

Get the type of a message argument.

`message` : | the PlumaMessage
`key` : | the argument key
Returns : | the type of `key`

### pluma_message_validate ()

    gboolean            pluma_message_validate              (PlumaMessage *message);

Validates the message arguments according to the message type.

`message` : | the PlumaMessage
Returns : | `TRUE` if the message is valid

## Property Details

### The `"method"` property

      "method"                   gchar*                : Read

The messages method.

Default value: NULL

### The `"object-path"` property

      "object-path"              gchar*                : Read

The message object path.

Default value: NULL

### The `"type"` property

      "type"                     PlumaMessageType*     : Read / Write / Construct Only

The message type.