| Top |
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 |
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);
Sets whether msg
is drawing attention.
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 |
||
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] |
“body” property “body” char *
First lines of the body of the message.
Owner: MessagingMenuMessage
Flags: Read / Write / Construct Only
Default value: NULL
“draws-attention” property“draws-attention” gboolean
Whether the message should draw attention.
Owner: MessagingMenuMessage
Flags: Read / Write
Default value: TRUE
“icon” property“icon” GIcon *
Icon of the message.
Owner: MessagingMenuMessage
Flags: Read / Write / Construct Only
“id” property “id” char *
Unique id of the message.
Owner: MessagingMenuMessage
Flags: Read / Write / Construct Only
Default value: NULL
“subtitle” property “subtitle” char *
Subtitle of the message.
Owner: MessagingMenuMessage
Flags: Read / Write / Construct Only
Default value: NULL
“time” property“time” gint64
Time the message was sent, in microseconds.
Owner: MessagingMenuMessage
Flags: Read / Write / Construct Only
Allowed values: >= 0
Default value: 0
“activate” signalvoid 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().
Flags: Has Details