## MessagingMenuMessage

MessagingMenuMessage — A single message in the messaging menu

## Functions

MessagingMenuMessage * | messaging_menu_message_new ()
const gchar * | messaging_menu_message_get_id ()
GIcon * | messaging_menu_message_get_icon ()
const gchar * | messaging_menu_message_get_title ()
const gchar * | messaging_menu_message_get_subtitle ()
const gchar * | messaging_menu_message_get_body ()
gint64 | messaging_menu_message_get_time ()
gboolean | messaging_menu_message_get_draws_attention ()
void | messaging_menu_message_set_draws_attention ()
void | messaging_menu_message_add_action ()

## Properties

char * | body | Read / Write / Construct Only
gboolean | draws-attention | Read / Write
GIcon * | icon | Read / Write / Construct Only
char * | id | Read / Write / Construct Only
char * | subtitle | Read / Write / Construct Only
gint64 | time | Read / Write / Construct Only
char * | title | Read / Write / Construct Only

## Signals

void | activate | Has Details

## Types and Values

| MessagingMenuMessage

## Object Hierarchy

        GObject
        ╰── MessagingMenuMessage

## Includes

    #include <messaging-menu.h>

## Description

## Functions

### messaging_menu_message_new ()

    MessagingMenuMessage *
    messaging_menu_message_new (const gchar *id,
                                GIcon *icon,
                                const gchar *title,
                                const gchar *subtitle,
                                const gchar *body,
                                gint64 time);

Creates a new MessagingMenuMessage.

#### Parameters

id | unique id of the message |
icon | a GIcon representing the message. | [transfer full][allow-none]
title | the title of the message |
subtitle | the subtitle of the message. | [allow-none]
body | the message body. | [allow-none]
time | the time the message was received |

#### Returns

a new MessagingMenuMessage.

[transfer full]

### messaging_menu_message_get_id ()

    const gchar *
    messaging_menu_message_get_id (MessagingMenuMessage *msg);

#### Parameters

msg | a MessagingMenuMessage |

#### Returns

the unique id of `msg`

### messaging_menu_message_get_icon ()

    GIcon *
    messaging_menu_message_get_icon (MessagingMenuMessage *msg);

#### Parameters

msg | a MessagingMenuMessage |

#### Returns

the icon of `msg` .

[transfer none]

### messaging_menu_message_get_title ()

    const gchar *
    messaging_menu_message_get_title (MessagingMenuMessage *msg);

#### Parameters

msg | a MessagingMenuMessage |

#### Returns

the title of `msg`

### messaging_menu_message_get_subtitle ()

    const gchar *
    messaging_menu_message_get_subtitle (MessagingMenuMessage *msg);

#### Parameters

msg | a MessagingMenuMessage |

#### Returns

the subtitle of `msg`

### messaging_menu_message_get_body ()

    const gchar *
    messaging_menu_message_get_body (MessagingMenuMessage *msg);

#### Parameters

msg | a MessagingMenuMessage |

#### Returns

the body of `msg`

### messaging_menu_message_get_time ()

    gint64
    messaging_menu_message_get_time (MessagingMenuMessage *msg);

#### Parameters

msg | a MessagingMenuMessage |

#### Returns

the time at which `msg` was received

### messaging_menu_message_get_draws_attention ()

    gboolean
    messaging_menu_message_get_draws_attention
                                   (MessagingMenuMessage *msg);

#### Parameters

msg | a MessagingMenuMessage |

#### Returns

whether `msg` is drawing attention

### messaging_menu_message_set_draws_attention ()

    void
    messaging_menu_message_set_draws_attention
                                   (MessagingMenuMessage *msg,
                                    gboolean draws_attention);

Sets whether `msg` is drawing attention.

#### Parameters

msg | a MessagingMenuMessage |
draws_attention | whether `msg` should draw attention |

### messaging_menu_message_add_action ()

    void
    messaging_menu_message_add_action (MessagingMenuMessage *msg,
                                       const gchar *id,
                                       const gchar *label,
                                       const GVariantType *parameter_type,
                                       GVariant *parameter_hint);

Adds an action with `id` and `label` to `message` . Actions are an alternative way for users to activate a message. Note that messages can still be activated without an action.

If `parameter_type` is non-`NULL`, the action is able to receive user input in addition to simply activating the action. Currently, only string parameters are supported.

A list of predefined parameters can be supplied as a GVariant array of `parameter_type` in `parameter_hint` . If `parameter_hint` is floating, it will be consumed.

It is recommended to add at most two actions to a message.

#### Parameters

msg | a MessagingMenuMessage |
id | unique id of the action |
label | label of the action. | [allow-none]
parameter_type | a GVariantType. | [allow-none]
parameter_hint | a GVariant suggesting a valid range for parameters. | [allow-none]

## Types and Values

### MessagingMenuMessage

    typedef struct _MessagingMenuMessage MessagingMenuMessage;

## Property Details

### The `“body”` property

      “body”                     char *

First lines of the body of the message.

Owner: MessagingMenuMessage

Flags: Read / Write / Construct Only

Default value: NULL

### The `“draws-attention”` property

      “draws-attention”          gboolean

Whether the message should draw attention.

Owner: MessagingMenuMessage

Flags: Read / Write

Default value: TRUE

### The `“icon”` property

      “icon”                     GIcon *

Icon of the message.

Owner: MessagingMenuMessage

Flags: Read / Write / Construct Only

### The `“id”` property

      “id”                       char *

Unique id of the message.

Owner: MessagingMenuMessage

Flags: Read / Write / Construct Only

Default value: NULL

### The `“subtitle”` property

      “subtitle”                 char *

Subtitle of the message.

Owner: MessagingMenuMessage

Flags: Read / Write / Construct Only

Default value: NULL

### The `“time”` property

      “time”                     gint64

Time the message was sent, in microseconds.

Owner: MessagingMenuMessage

Flags: Read / Write / Construct Only

Allowed values: >= 0

Default value: 0

### The `“title”` property

      “title”                    char *

Title of the message.

Owner: MessagingMenuMessage

Flags: Read / Write / Construct Only

Default value: NULL

## Signal Details

### The `“activate”` signal

    void
    user_function (MessagingMenuMessage *msg,
                   char                 *action,
                   GVariant             *parameter,
                   gpointer              user_data)

Emitted when the user has activated the message. The message is immediately removed from the application's menu, handlers of this signal do not need to call `messaging_menu_app_remove_message()`.

#### Parameters

msg | the MessagingMenuMessage |
action | the id of activated action, or `NULL`. | [allow-none]
parameter | activation parameter, or `NULL`. | [allow-none]
user_data | user data set when the signal handler was connected. |

Flags: Has Details