Infinityc.Browser¶
- Subclasses:
None
Methods¶
- Inherited:
GObject.Object (37), Infinity.Browser (42), Infinity.CommunicationObject (3)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Active chat session |
||
r/w/co |
The communication manager for the browser |
||
r/w/co |
Connection to the server exposing the directory to browse |
||
r/w/co |
The |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Infinityc.Browser(**kwargs)¶
- Bases:
GObject.Object
,Infinity.Browser
,Infinity.CommunicationObject
- Abstract:
No
- Structure:
Infinityc.Browser
is an opaque data type. You should only access it via the public API functions.- classmethod new(io, comm_manager, connection)¶
- Parameters:
io (
Infinity.Io
) – AInfinity.Io
object used to schedule timeouts.comm_manager (
Infinity.CommunicationManager
) – AInfinity.CommunicationManager
to register the server connection and which forwards incoming data to the browser or running sessions.connection (
Infinity.XmlConnection
) – Connection to the server.
- Returns:
A new
Infinityc.Browser
.- Return type:
Creates a new
Infinityc.Browser
.
- add_plugin(plugin)¶
- Parameters:
plugin (
Infinityc.NotePlugin
) – AInfinityc.NotePlugin
.- Returns:
Whether the plugin was added successfully.
- Return type:
Adds plugin to self. This allows the browser to create sessions of the plugin’s type. Only one plugin of each type can be added to the directory.
- get_chat_session()¶
- Returns:
A
Infinityc.SessionProxy
for the chat, orNone
.- Return type:
Returns the
Infinityc.SessionProxy
representing the running chat session if the local client is subscribed to it, orNone
otherwise.
- get_communication_manager()¶
- Returns:
- Return type:
Returns the communication manager of this browser.
- get_connection()¶
- Returns:
- Return type:
Returns the connection to the server.
- get_subscribe_chat_request()¶
- Returns:
A
Infinity.Request
, orNone
.- Return type:
Returns the
Infinity.Request
that represests the request sent to the server which attempts to subscribe to its chat. If there is no such request running, then the function returnsNone
. After such a request finishes, callInfinityc.Browser.get_chat_session
() to get theInfinityc.SessionProxy
for the chat session. To initiate the request, callInfinityc.Browser.subscribe_chat
().
- iter_get_sync_in(iter)¶
- Parameters:
iter (
Infinity.BrowserIter
) – AInfinity.BrowserIter
pointing to a note in self.- Returns:
A
Infinityc.SessionProxy
, orNone
if we are currently not synchronizing this node to the server.- Return type:
Returns the
Infinityc.SessionProxy
that is used to synchronize the note iter points to to the server. Such a node is created byInfinity.Browser.add_note
() with non-None
session parameter. If the client is subscribed to this note, then this returns the same session asInfinity.Browser.get_session
(). However, it is possible that we synchronize this node to the server without being subscribed to it. In this case, this function returns the session that does the synchronization, whileInfinity.Browser.get_session
() would returnNone
.
- iter_get_sync_in_requests(iter)¶
- Parameters:
iter (
Infinity.BrowserIter
) – AInfinity.BrowserIter
pointing to a subdirectory node in self.- Returns:
A list of
Infinity.Request
s. Free with g_slist_free() when done.- Return type:
Returns a list of all
Infinity.Request
s created withInfinity.Browser.add_note
() with the node iter points to as parent. Such requests begin a synchronization to the server when they have finished.
- iter_is_valid(iter)¶
- Parameters:
iter (
Infinity.BrowserIter
) – AInfinity.BrowserIter
.- Returns:
Whether iter points to a node in self.
- Return type:
Returns whether iter points to a valid node in self. This is generally the case for any
Infinity.BrowserIter
returned by one of theInfinityc.Browser
functions, it gets invalid however as soon as the node it points to is removed.
- iter_save_session(iter, func, *user_data)¶
- Parameters:
iter (
Infinity.BrowserIter
) – AInfinity.BrowserIter
pointing to a note in self.func (
Infinity.RequestFunc
) – The function to be called when the request finishes, orNone
.user_data (
object
orNone
) – Additional data to pass to func.
- Returns:
A
Infinity.Request
that may be used to get notified when the request finishes or fails.- Return type:
Requests that the server saves the note pointed to by iter into its background storage. Normally, the server only does this when it is either shut down or when the there are no more subscriptions to the note. Note that this is merely a request and the server might decide not to save the session for whatever reason.
The request might either finish during the call to this function, in which case func will be called and
None
being returned. If the request does not finish within the function call, aInfinity.Request
object is returned, where func has been installed for theInfinity.Request
::finished
signal, so that it is called as soon as the request finishes.
- lookup_plugin(note_type)¶
- Parameters:
note_type (
str
) – A note type, such as “InfText”.- Returns:
A
Infinityc.NotePlugin
, orNone
.- Return type:
Returns a previously registered plugin (see
Infinityc.Browser.add_plugin
()) for the given note type, orNone
if there is no such plugin.
- subscribe_chat(func, *user_data)¶
- Parameters:
func (
Infinity.RequestFunc
) – The function to be called when the request finishes, orNone
.user_data (
object
orNone
) – Additional data to pass to func.
- Returns:
A
Infinity.Request
that may be used to get notified when the request finishes or fails.- Return type:
Attempts to subscribe to the server’s chat. When the operation finishes
Infinityc.Browser.get_chat_session
() will return aInfinityc.SessionProxy
representing the chat session. It can be used to read the chat’s content. The request can fail in case the server chat is disabled.The request might either finish during the call to this function, in which case func will be called and
None
being returned. If the request does not finish within the function call, aInfinity.Request
object is returned, where func has been installed for theInfinity.Request
::finished
signal, so that it is called as soon as the request finishes.
Property Details¶
- Infinityc.Browser.props.chat_session¶
- Name:
chat-session
- Type:
- Default Value:
- Flags:
Active chat session
- Infinityc.Browser.props.communication_manager¶
- Name:
communication-manager
- Type:
- Default Value:
- Flags:
The communication manager for the browser
- Infinityc.Browser.props.connection¶
- Name:
connection
- Type:
- Default Value:
- Flags:
Connection to the server exposing the directory to browse
- Infinityc.Browser.props.io¶
- Name:
io
- Type:
- Default Value:
- Flags:
The
Infinity.Io
to schedule timeouts