![]() |
![]() |
![]() |
Messaging Menu Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
enum MessagingMenuStatus; typedef MessagingMenuAppClass; MessagingMenuApp * messaging_menu_app_new (const gchar *desktop_id
); void messaging_menu_app_register (MessagingMenuApp *app
); void messaging_menu_app_unregister (MessagingMenuApp *app
); void messaging_menu_app_set_status (MessagingMenuApp *app
,MessagingMenuStatus status
); void messaging_menu_app_insert_source (MessagingMenuApp *app
,gint position
,const gchar *id
,GIcon *icon
,const gchar *label
); void messaging_menu_app_append_source (MessagingMenuApp *app
,const gchar *id
,GIcon *icon
,const gchar *label
); void messaging_menu_app_insert_source_with_count (MessagingMenuApp *app
,gint position
,const gchar *id
,GIcon *icon
,const gchar *label
,guint count
); void messaging_menu_app_append_source_with_count (MessagingMenuApp *app
,const gchar *id
,GIcon *icon
,const gchar *label
,guint count
); void messaging_menu_app_insert_source_with_time (MessagingMenuApp *app
,gint position
,const gchar *id
,GIcon *icon
,const gchar *label
,gint64 time
); void messaging_menu_app_append_source_with_time (MessagingMenuApp *app
,const gchar *id
,GIcon *icon
,const gchar *label
,gint64 time
); void messaging_menu_app_append_source_with_string (MessagingMenuApp *app
,const gchar *id
,GIcon *icon
,const gchar *label
,const gchar *str
); void messaging_menu_app_insert_source_with_string (MessagingMenuApp *app
,gint position
,const gchar *id
,GIcon *icon
,const gchar *label
,const gchar *str
); void messaging_menu_app_remove_source (MessagingMenuApp *app
,const gchar *source_id
); gboolean messaging_menu_app_has_source (MessagingMenuApp *app
,const gchar *source_id
); void messaging_menu_app_set_source_label (MessagingMenuApp *app
,const gchar *source_id
,const gchar *label
); void messaging_menu_app_set_source_icon (MessagingMenuApp *app
,const gchar *source_id
,GIcon *icon
); void messaging_menu_app_set_source_count (MessagingMenuApp *app
,const gchar *source_id
,guint count
); void messaging_menu_app_set_source_time (MessagingMenuApp *app
,const gchar *source_id
,gint64 time
); void messaging_menu_app_set_source_string (MessagingMenuApp *app
,const gchar *source_id
,const gchar *str
); void messaging_menu_app_draw_attention (MessagingMenuApp *app
,const gchar *source_id
); void messaging_menu_app_remove_attention (MessagingMenuApp *app
,const gchar *source_id
); void messaging_menu_app_append_message (MessagingMenuApp *app
,MessagingMenuMessage *msg
,const gchar *source_id
,gboolean notify
); MessagingMenuMessage * messaging_menu_app_get_message (MessagingMenuApp *app
,const gchar *id
); void messaging_menu_app_remove_message (MessagingMenuApp *app
,MessagingMenuMessage *msg
); void messaging_menu_app_remove_message_by_id (MessagingMenuApp *app
,const gchar *id
); MessagingMenuApp;
typedef enum { MESSAGING_MENU_STATUS_AVAILABLE, MESSAGING_MENU_STATUS_AWAY, MESSAGING_MENU_STATUS_BUSY, MESSAGING_MENU_STATUS_INVISIBLE, MESSAGING_MENU_STATUS_OFFLINE } MessagingMenuStatus;
An enumeration for the possible chat statuses the messaging menu can be in.
void messaging_menu_app_register (MessagingMenuApp *app
);
Registers app
with the Messaging Menu.
If the application doesn't already have a section in the Messaging Menu, one will be created for it. The application will also be marked as "running".
The application will be marked as "not running" as soon as app
is
destroyed. The application launcher as well as shortcut actions will
remain in the menu. To completely remove the application section
from the Messaging Menu, call messaging_menu_app_unregister()
.
|
a MessagingMenuApp |
void messaging_menu_app_unregister (MessagingMenuApp *app
);
Completely removes the app
from the Messaging Menu. If the
application's launcher and shortcut actions should remain in the
menu, destroying app
with g_object_unref()
suffices.
Note: app
will remain valid and usable after this call.
|
a MessagingMenuApp |
void messaging_menu_app_set_status (MessagingMenuApp *app
,MessagingMenuStatus status
);
Notify the Messaging Menu that the chat status of app
has changed to
status
.
Connect to the ::status-changed signal to receive notification about the user changing their global chat status through the Messaging Menu.
This function does nothing for applications whose desktop file does not include X-MessagingMenu-UsesChatSection.
|
a MessagingMenuApp |
|
a MessagingMenuStatus |
void messaging_menu_app_insert_source (MessagingMenuApp *app
,gint position
,const gchar *id
,GIcon *icon
,const gchar *label
);
Inserts a new message source into the section representing app
. Equivalent
to calling messaging_menu_app_insert_source_with_time()
with the current
time.
It is an error to insert a source with an id
which already exists. Use
messaging_menu_app_has_source()
to find out whether there is such a source.
|
a MessagingMenuApp |
|
the position at which to insert the source |
|
a unique identifier for the source to be added |
|
the icon associated with the source |
|
a user-visible string best describing the source |
void messaging_menu_app_append_source (MessagingMenuApp *app
,const gchar *id
,GIcon *icon
,const gchar *label
);
Appends a new message source to the end of the section representing app
.
Equivalent to calling messaging_menu_app_append_source_with_time()
with the
current time.
It is an error to add a source with an id
which already exists. Use
messaging_menu_app_has_source()
to find out whether there is such a source.
|
a MessagingMenuApp |
|
a unique identifier for the source to be added |
|
the icon associated with the source. [allow-none] |
|
a user-visible string best describing the source |
void messaging_menu_app_insert_source_with_count (MessagingMenuApp *app
,gint position
,const gchar *id
,GIcon *icon
,const gchar *label
,guint count
);
Inserts a new message source into the section representing app
and
initializes it with count
.
To update the count, use messaging_menu_app_set_source_count()
.
It is an error to insert a source with an id
which already exists. Use
messaging_menu_app_has_source()
to find out whether there is such a source.
|
a MessagingMenuApp |
|
the position at which to insert the source |
|
a unique identifier for the source to be added |
|
the icon associated with the source. [allow-none] |
|
a user-visible string best describing the source |
|
the count for the source |
void messaging_menu_app_append_source_with_count (MessagingMenuApp *app
,const gchar *id
,GIcon *icon
,const gchar *label
,guint count
);
Appends a new message source to the end of the section representing app
and
initializes it with count
.
To update the count, use messaging_menu_app_set_source_count()
.
It is an error to add a source with an id
which already exists. Use
messaging_menu_app_has_source()
to find out whether there is such a source.
|
a MessagingMenuApp |
|
a unique identifier for the source to be added |
|
the icon associated with the source. [allow-none] |
|
a user-visible string best describing the source |
|
the count for the source |
void messaging_menu_app_insert_source_with_time (MessagingMenuApp *app
,gint position
,const gchar *id
,GIcon *icon
,const gchar *label
,gint64 time
);
Inserts a new message source into the section representing app
and
initializes it with time
. Use messaging_menu_app_insert_source()
to
insert a source with the current time.
To change the time, use messaging_menu_app_set_source_time()
.
It is an error to insert a source with an id
which already exists. Use
messaging_menu_app_has_source()
to find out whether there is such a source.
|
a MessagingMenuApp |
|
the position at which to insert the source |
|
a unique identifier for the source to be added |
|
the icon associated with the source. [allow-none] |
|
a user-visible string best describing the source |
|
the time when the source was created, in microseconds |
void messaging_menu_app_append_source_with_time (MessagingMenuApp *app
,const gchar *id
,GIcon *icon
,const gchar *label
,gint64 time
);
Appends a new message source to the end of the section representing
app
and initializes it with time
. Use
messaging_menu_app_append_source()
to append a source with the
current time.
To change the time, use messaging_menu_app_set_source_time()
.
It is an error to insert a source with an id
which already exists. Use
messaging_menu_app_has_source()
to find out whether there is such a source.
|
a MessagingMenuApp |
|
a unique identifier for the source to be added |
|
the icon associated with the source. [allow-none] |
|
a user-visible string best describing the source |
|
the time when the source was created, in microseconds |
void messaging_menu_app_append_source_with_string (MessagingMenuApp *app
,const gchar *id
,GIcon *icon
,const gchar *label
,const gchar *str
);
Appends a new message source to the end of the section representing app
and
initializes it with str
.
To update the string, use messaging_menu_app_set_source_string()
.
It is an error to insert a source with an id
which already exists. Use
messaging_menu_app_has_source()
to find out whether there is such a source.
|
a MessagingMenuApp |
|
a unique identifier for the source to be added |
|
the icon associated with the source. [allow-none] |
|
a user-visible string best describing the source |
|
a string associated with the source |
void messaging_menu_app_insert_source_with_string (MessagingMenuApp *app
,gint position
,const gchar *id
,GIcon *icon
,const gchar *label
,const gchar *str
);
Inserts a new message source into the section representing app
and
initializes it with str
.
To update the string, use messaging_menu_app_set_source_string()
.
It is an error to insert a source with an id
which already exists. Use
messaging_menu_app_has_source()
to find out whether there is such a source.
|
a MessagingMenuApp |
|
the position at which to insert the source |
|
a unique identifier for the source to be added |
|
the icon associated with the source. [allow-none] |
|
a user-visible string best describing the source |
|
a string associated with the source |
void messaging_menu_app_remove_source (MessagingMenuApp *app
,const gchar *source_id
);
Removes the source corresponding to source_id
from the menu.
|
a MessagingMenuApp |
|
the id of the source to remove |
gboolean messaging_menu_app_has_source (MessagingMenuApp *app
,const gchar *source_id
);
|
a MessagingMenuApp |
|
a source id |
Returns : |
TRUE if there is a source associated with source_id
|
void messaging_menu_app_set_source_label (MessagingMenuApp *app
,const gchar *source_id
,const gchar *label
);
Changes the label of source_id
to label
.
|
a MessagingMenuApp |
|
a source id |
|
the new label for the source |
void messaging_menu_app_set_source_icon (MessagingMenuApp *app
,const gchar *source_id
,GIcon *icon
);
Changes the icon of source_id
to icon
.
|
a MessagingMenuApp |
|
a source id |
|
the new icon for the source. [allow-none] |
void messaging_menu_app_set_source_count (MessagingMenuApp *app
,const gchar *source_id
,guint count
);
Updates the count of source_id
to count
.
|
a MessagingMenuApp |
|
a source id |
|
the new count for the source |
void messaging_menu_app_set_source_time (MessagingMenuApp *app
,const gchar *source_id
,gint64 time
);
Updates the time of source_id
to time
.
|
a MessagingMenuApp |
|
a source id |
|
the new time for the source, in microseconds |
void messaging_menu_app_set_source_string (MessagingMenuApp *app
,const gchar *source_id
,const gchar *str
);
Updates the string displayed next to source_id
to str
.
|
a MessagingMenuApp |
|
a source id |
|
the new string for the source |
void messaging_menu_app_draw_attention (MessagingMenuApp *app
,const gchar *source_id
);
Indicates that source_id
has important unread messages. Currently, this
means that the messaging menu's envelope icon will turn blue.
Use messaging_menu_app_remove_attention()
to stop indicating that the source
needs attention.
|
a MessagingMenuApp |
|
a source id |
void messaging_menu_app_remove_attention (MessagingMenuApp *app
,const gchar *source_id
);
Stop indicating that source_id
needs attention.
This function does not need to be called when the source is removed
with messaging_menu_app_remove_source()
or the user has activated the
source.
Use messaging_menu_app_draw_attention()
to make source_id
draw attention
again.
|
a MessagingMenuApp |
|
a source id |
void messaging_menu_app_append_message (MessagingMenuApp *app
,MessagingMenuMessage *msg
,const gchar *source_id
,gboolean notify
);
Appends msg
to the source with id source_id
of app
. The messaging
menu might not display this message immediately if other messages are
queued before this one.
If source_id
has a count associated with it, that count will be
increased by one.
If source_id
is NULL
, msg
won't be associated with a source.
|
a MessagingMenuApp |
|
the MessagingMenuMessage to append |
|
the source id to which msg is added, or NULL. [allow-none]
|
|
whether a notification bubble should be shown for this message |
MessagingMenuMessage * messaging_menu_app_get_message (MessagingMenuApp *app
,const gchar *id
);
Retrieves the message with id
, that was added with
messaging_menu_app_append_message()
.
|
a MessagingMenuApp |
|
id of the message to retrieve |
Returns : |
the MessagingMenuApp with
id , or NULL . [transfer none][allow-none]
|
void messaging_menu_app_remove_message (MessagingMenuApp *app
,MessagingMenuMessage *msg
);
Removes msg
from app
.
If source_id
has a count associated with it, that count will be
decreased by one.
|
a MessagingMenuApp |
|
the MessagingMenuMessage to remove |
void messaging_menu_app_remove_message_by_id (MessagingMenuApp *app
,const gchar *id
);
Removes the message with the id id
from app
.
If source_id
has a count associated with it, that count will be
decreased by one.
|
a MessagingMenuApp |
|
the unique id of msg
|
typedef struct _MessagingMenuApp MessagingMenuApp;
MessagingMenuApp is an opaque structure.
"desktop-id"
property "desktop-id" gchar* : Write / Construct Only
The desktop id of the application associated with this application section. Must be given when the MessagingMenuApp is created.
Default value: NULL
"activate-source"
signalvoid user_function (MessagingMenuApp *mmapp,
gchar *source_id,
gpointer user_data) : Has Details
Emitted when the user has activated the message source with id
source_id
. The source is immediately removed from the menu,
handlers of this signal do not need to call
messaging_menu_app_remove_source()
.
|
the MessagingMenuApp |
|
the source id that was activated |
|
user data set when the signal handler was connected. |
"status-changed"
signalvoid user_function (MessagingMenuApp *mmapp,
gint status,
gpointer user_data) : Run First
Emitted when the chat status is changed through the messaging menu.
Applications which are registered to use the chat status should
change their status to status
upon receiving this signal. Call
messaging_menu_app_set_status()
to acknowledge that the application
changed its status.
|
the MessagingMenuApp |
|
a MessagingMenuStatus |
|
user data set when the signal handler was connected. |