MessagingMenu.App¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
w/co |
The desktop id of the associated application |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the user has activated the message source with id source_id. |
|
Emitted when the chat status is changed through the messaging menu. |
Fields¶
- Inherited:
Class Details¶
- class MessagingMenu.App(**kwargs)¶
- Bases:
- Abstract:
No
MessagingMenu.App
is an opaque structure.- append_message(msg, source_id, notify)¶
- Parameters:
msg (
MessagingMenu.Message
) – theMessagingMenu.Message
to appendsource_id (
str
orNone
) – the source id to which msg is added, orNone
notify (
bool
) – whether a notification bubble should be shown for this message
Appends msg to the source with id source_id of self. 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
None
, msg won’t be associated with a source.
- append_source(id, icon, label)¶
- Parameters:
Appends a new message source to the end of the section representing self. Equivalent to calling
MessagingMenu.App.append_source_with_time
() with the current time.It is an error to add a source with an id which already exists. Use
MessagingMenu.App.has_source
() to find out whether there is such a source.
- append_source_with_count(id, icon, label, count)¶
- Parameters:
Appends a new message source to the end of the section representing self and initializes it with count.
To update the count, use
MessagingMenu.App.set_source_count
().It is an error to add a source with an id which already exists. Use
MessagingMenu.App.has_source
() to find out whether there is such a source.
- append_source_with_string(id, icon, label, str)¶
- Parameters:
Appends a new message source to the end of the section representing self and initializes it with str.
To update the string, use
MessagingMenu.App.set_source_string
().It is an error to insert a source with an id which already exists. Use
MessagingMenu.App.has_source
() to find out whether there is such a source.
- append_source_with_time(id, icon, label, time)¶
- Parameters:
Appends a new message source to the end of the section representing self and initializes it with time. Use
MessagingMenu.App.append_source
() to append a source with the current time.To change the time, use
MessagingMenu.App.set_source_time
().It is an error to insert a source with an id which already exists. Use
MessagingMenu.App.has_source
() to find out whether there is such a source.
- draw_attention(source_id)¶
- Parameters:
source_id (
str
) – a source id
Indicates that source_id has important unread messages. Currently, this means that the messaging menu’s envelope icon will turn blue.
Use
MessagingMenu.App.remove_attention
() to stop indicating that the source needs attention.
- get_message(id)¶
- Parameters:
id (
str
) – id of the message to retrieve- Returns:
the
MessagingMenu.App
with id, orNone
- Return type:
Retrieves the message with id, that was added with
MessagingMenu.App.append_message
().
- has_source(source_id)¶
- insert_source(position, id, icon, label)¶
- Parameters:
Inserts a new message source into the section representing self. Equivalent to calling
MessagingMenu.App.insert_source_with_time
() with the current time.It is an error to insert a source with an id which already exists. Use
MessagingMenu.App.has_source
() to find out whether there is such a source.
- insert_source_with_count(position, id, icon, label, count)¶
- Parameters:
Inserts a new message source into the section representing self and initializes it with count.
To update the count, use
MessagingMenu.App.set_source_count
().It is an error to insert a source with an id which already exists. Use
MessagingMenu.App.has_source
() to find out whether there is such a source.
- insert_source_with_string(position, id, icon, label, str)¶
- Parameters:
Inserts a new message source into the section representing self and initializes it with str.
To update the string, use
MessagingMenu.App.set_source_string
().It is an error to insert a source with an id which already exists. Use
MessagingMenu.App.has_source
() to find out whether there is such a source.
- insert_source_with_time(position, id, icon, label, time)¶
- Parameters:
position (
int
) – the position at which to insert the sourceid (
str
) – a unique identifier for the source to be addedicon (
Gio.Icon
orNone
) – the icon associated with the sourcelabel (
str
) – a user-visible string best describing the sourcetime (
int
) – the time when the source was created, in microseconds
Inserts a new message source into the section representing self and initializes it with time. Use
MessagingMenu.App.insert_source
() to insert a source with the current time.To change the time, use
MessagingMenu.App.set_source_time
().It is an error to insert a source with an id which already exists. Use
MessagingMenu.App.has_source
() to find out whether there is such a source.
- register()¶
Registers self 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 self 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
MessagingMenu.App.unregister
().
- remove_attention(source_id)¶
- Parameters:
source_id (
str
) – a source id
Stop indicating that source_id needs attention.
This function does not need to be called when the source is removed with
MessagingMenu.App.remove_source
() or the user has activated the source.Use
MessagingMenu.App.draw_attention
() to make source_id draw attention again.
- remove_message(msg)¶
- Parameters:
msg (
MessagingMenu.Message
) – theMessagingMenu.Message
to remove
Removes msg from self.
If source_id has a count associated with it, that count will be decreased by one.
- remove_message_by_id(id)¶
- Parameters:
id (
str
) – the unique id of msg
Removes the message with the id id from self.
If source_id has a count associated with it, that count will be decreased by one.
- remove_source(source_id)¶
- Parameters:
source_id (
str
) – the id of the source to remove
Removes the source corresponding to source_id from the menu.
- set_source_count(source_id, count)¶
-
Updates the count of source_id to count.
- set_source_icon(source_id, icon)¶
-
Changes the icon of source_id to icon.
- set_source_label(source_id, label)¶
-
Changes the label of source_id to label.
- set_source_string(source_id, str)¶
-
Updates the string displayed next to source_id to str.
- set_source_time(source_id, time)¶
-
Updates the time of source_id to time.
- set_status(status)¶
- Parameters:
status (
MessagingMenu.Status
) – aMessagingMenu.Status
Notify the Messaging Menu that the chat status of self 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.
- unregister()¶
Completely removes the self from the Messaging Menu. If the application’s launcher and shortcut actions should remain in the menu, destroying self with
GObject.Object.unref
() suffices.Note: self will remain valid and usable after this call.
Signal Details¶
- MessagingMenu.App.signals.activate_source(app, source_id)¶
- Signal Name:
activate-source
- Flags:
- Parameters:
app (
MessagingMenu.App
) – The object which received the signalsource_id (
str
) – the source id that was activated
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
MessagingMenu.App.remove_source
().
- MessagingMenu.App.signals.status_changed(app, status)¶
- Signal Name:
status-changed
- Flags:
- Parameters:
app (
MessagingMenu.App
) – The object which received the signalstatus (
int
) – aMessagingMenu.Status
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
MessagingMenu.App.set_status
() to acknowledge that the application changed its status.
Property Details¶
- MessagingMenu.App.props.desktop_id¶
- Name:
desktop-id
- Type:
- Default Value:
- Flags:
The desktop id of the application associated with this application section. Must be given when the
MessagingMenu.App
is created.