## PlumaMessage

PlumaMessage — message bus message object

## Functions

void | pluma_message_get ()
void | pluma_message_get_valist ()
void | pluma_message_get_value ()
void | pluma_message_set ()
void | pluma_message_set_valist ()
void | pluma_message_set_value ()
void | pluma_message_set_valuesv ()
const gchar * | pluma_message_get_object_path ()
const gchar * | pluma_message_get_method ()
gboolean | pluma_message_has_key ()
GType | pluma_message_get_key_type ()
gboolean | pluma_message_validate ()

## Properties

char * | method | Read
char * | object-path | Read
PlumaMessageType * | type | Read / Write / Construct Only

## Types and Values

struct | PlumaMessage

## Object Hierarchy

        GObject
        ╰── PlumaMessage

## Includes

    #include <pluma/pluma-message.h>

## 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.

## Functions

### 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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

message | the PlumaMessage |
key | the argument key |
value | value return container. | [out]

### 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.

#### Parameters

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.

#### Parameters

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` .

#### Parameters

message | the PlumaMessage |
key | the argument key |
value | the argument value. | [out]

### pluma_message_set_valuesv ()

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

Set message argument values.

#### Parameters

message | the PlumaMessage |
keys | keys to set values for. | [array length=n_values]
values | values to set. | [array length=n_values]
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.

#### Parameters

message | the PlumaMessage |

#### Returns

the message object path

### pluma_message_get_method ()

    const gchar *
    pluma_message_get_method (PlumaMessage *message);

Get the message method.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

message | the PlumaMessage |

#### Returns

`TRUE` if the message is valid

## Types and Values

### struct PlumaMessage

    struct PlumaMessage;

## Property Details

### The `“method”` property

      “method”                   char *

The messages method.

Owner: PlumaMessage

Flags: Read

Default value: NULL

### The `“object-path”` property

      “object-path”              char *

The message object path.

Owner: PlumaMessage

Flags: Read

Default value: NULL

### The `“type”` property

      “type”                     PlumaMessageType *

The message type.

Owner: PlumaMessage

Flags: Read / Write / Construct Only