messaging-menu-message

messaging-menu-message

Synopsis

MessagingMenuMessage * messaging_menu_message_new       (const gchar *id,
                                                         GIcon *icon,
                                                         const gchar *title,
                                                         const gchar *subtitle,
                                                         const gchar *body,
                                                         gint64 time);
const gchar *       messaging_menu_message_get_id       (MessagingMenuMessage *msg);
GIcon *             messaging_menu_message_get_icon     (MessagingMenuMessage *msg);
const gchar *       messaging_menu_message_get_title    (MessagingMenuMessage *msg);
const gchar *       messaging_menu_message_get_subtitle (MessagingMenuMessage *msg);
const gchar *       messaging_menu_message_get_body     (MessagingMenuMessage *msg);
gint64              messaging_menu_message_get_time     (MessagingMenuMessage *msg);
gboolean            messaging_menu_message_get_draws_attention
                                                        (MessagingMenuMessage *msg);
void                messaging_menu_message_set_draws_attention
                                                        (MessagingMenuMessage *msg,
                                                         gboolean draws_attention);
void                messaging_menu_message_add_action   (MessagingMenuMessage *msg,
                                                         const gchar *id,
                                                         const gchar *label,
                                                         const GVariantType *parameter_type,
                                                         GVariant *parameter_hint);
                    MessagingMenuMessage;

Object Hierarchy

  GObject
   +----MessagingMenuMessage

Properties

  "body"                     gchar*                : Read / Write / Construct Only
  "draws-attention"          gboolean              : Read / Write
  "icon"                     GIcon*                : Read / Write / Construct Only
  "id"                       gchar*                : Read / Write / Construct Only
  "subtitle"                 gchar*                : Read / Write / Construct Only
  "time"                     gint64                : Read / Write / Construct Only
  "title"                    gchar*                : Read / Write / Construct Only

Signals

  "activate"                                       : Has Details

Description

Details

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.

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);

msg :

a MessagingMenuMessage

Returns :

the unique id of msg

messaging_menu_message_get_icon ()

GIcon *             messaging_menu_message_get_icon     (MessagingMenuMessage *msg);

msg :

a MessagingMenuMessage

Returns :

the icon of msg. [transfer none]

messaging_menu_message_get_title ()

const gchar *       messaging_menu_message_get_title    (MessagingMenuMessage *msg);

msg :

a MessagingMenuMessage

Returns :

the title of msg

messaging_menu_message_get_subtitle ()

const gchar *       messaging_menu_message_get_subtitle (MessagingMenuMessage *msg);

msg :

a MessagingMenuMessage

Returns :

the subtitle of msg

messaging_menu_message_get_body ()

const gchar *       messaging_menu_message_get_body     (MessagingMenuMessage *msg);

msg :

a MessagingMenuMessage

Returns :

the body of msg

messaging_menu_message_get_time ()

gint64              messaging_menu_message_get_time     (MessagingMenuMessage *msg);

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);

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.

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.

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]

MessagingMenuMessage

typedef struct _MessagingMenuMessage MessagingMenuMessage;

Property Details

The "body" property

  "body"                     gchar*                : Read / Write / Construct Only

First lines of the body of the message.

Default value: NULL


The "draws-attention" property

  "draws-attention"          gboolean              : Read / Write

Whether the message should draw attention.

Default value: TRUE


The "icon" property

  "icon"                     GIcon*                : Read / Write / Construct Only

Icon of the message.


The "id" property

  "id"                       gchar*                : Read / Write / Construct Only

Unique id of the message.

Default value: NULL


The "subtitle" property

  "subtitle"                 gchar*                : Read / Write / Construct Only

Subtitle of the message.

Default value: NULL


The "time" property

  "time"                     gint64                : Read / Write / Construct Only

Time the message was sent, in microseconds.

Allowed values: >= 0

Default value: 0


The "title" property

  "title"                    gchar*                : Read / Write / Construct Only

Title of the message.

Default value: NULL

Signal Details

The "activate" signal

void                user_function                      (MessagingMenuMessage *msg,
                                                        gchar                *action,
                                                        GVariant             *parameter,
                                                        gpointer              user_data)      : Has Details

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().

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.