Top | ![]() |
![]() |
![]() |
![]() |
InfcSessionProxy * | chat-session | Read |
InfCommunicationManager * | communication-manager | Read / Write / Construct Only |
InfXmlConnection * | connection | Read / Write / Construct Only |
InfIo * | io | Read / Write / Construct Only |
The InfcBrowser is used to browse a remote directory and can be used to subscribe to sessions. InfcBrowser implements the InfBrowser interface, through which most operations are performed.
InfcBrowser * infc_browser_new (InfIo *io
,InfCommunicationManager *comm_manager
,InfXmlConnection *connection
);
Creates a new InfcBrowser.
[constructor]
io |
A InfIo object used to schedule timeouts. |
|
comm_manager |
A InfCommunicationManager to register the server connection and which forwards incoming data to the browser or running sessions. |
|
connection |
Connection to the server. |
InfCommunicationManager *
infc_browser_get_communication_manager
(InfcBrowser *browser
);
Returns the communication manager of this browser.
InfXmlConnection *
infc_browser_get_connection (InfcBrowser *browser
);
Returns the connection to the server.
gboolean infc_browser_add_plugin (InfcBrowser *browser
,const InfcNotePlugin *plugin
);
Adds plugin
to browser
. This allows the browser to create sessions of
the plugin's type. Only one plugin of each type can be added to the
directory.
const InfcNotePlugin * infc_browser_lookup_plugin (InfcBrowser *browser
,const gchar *note_type
);
Returns a previously registered plugin (see infc_browser_add_plugin()
) for
the given note type, or NULL
if there is no such plugin.
InfRequest * infc_browser_iter_save_session (InfcBrowser *browser
,const InfBrowserIter *iter
,InfRequestFunc func
,gpointer user_data
);
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 NULL
being returned. If the request does not
finish within the function call, a InfRequest object is returned,
where func
has been installed for the “finished” signal,
so that it is called as soon as the request finishes.
browser |
A InfcBrowser. |
|
iter |
A InfBrowserIter pointing to a note in |
|
func |
The function to be called when the request finishes,
or |
[scope async] |
user_data |
Additional data to pass to |
A InfRequest that may be used to get notified when the request finishes or fails.
[transfer none][allow-none]
InfcSessionProxy * infc_browser_iter_get_sync_in (InfcBrowser *browser
,const InfBrowserIter *iter
);
Returns the InfcSessionProxy that is used to synchronize the note iter
points to to the server. Such a node is created by
inf_browser_add_note()
with non-NULL
session
parameter. If the client is
subscribed to this note, then this returns the same session as
inf_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,
while inf_browser_get_session()
would return NULL
.
A InfcSessionProxy, or NULL
if we
are currently not synchronizing this node to the server.
[transfer none][allow-none]
GSList * infc_browser_iter_get_sync_in_requests (InfcBrowser *browser
,const InfBrowserIter *iter
);
Returns a list of all InfRequests created with
inf_browser_add_note()
with the node iter
points to as
parent. Such requests begin a synchronization to the server when they
have finished.
browser |
A InfcBrowser. |
|
iter |
A InfBrowserIter pointing to a subdirectory node in |
A list of
InfRequests. Free with g_slist_free()
when done.
[transfer container][element-type InfRequest]
gboolean infc_browser_iter_is_valid (InfcBrowser *browser
,const InfBrowserIter *iter
);
Returns whether iter
points to a valid node in browser
. This is
generally the case for any InfBrowserIter returned by one of the
InfcBrowser functions, it gets invalid however as soon as the node it
points to is removed.
InfRequest * infc_browser_subscribe_chat (InfcBrowser *browser
,InfRequestFunc func
,gpointer user_data
);
Attempts to subscribe to the server's chat. When the operation finishes
infc_browser_get_chat_session()
will return a InfcSessionProxy
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 NULL
being returned. If the request does not
finish within the function call, a InfRequest object is returned,
where func
has been installed for the “finished” signal,
so that it is called as soon as the request finishes.
browser |
A InfcBrowser. |
|
func |
The function to be called when the request
finishes, or |
[scope async] |
user_data |
Additional data to pass to |
A InfRequest that may be used to get notified when the request finishes or fails.
[transfer none][allow-none]
InfRequest *
infc_browser_get_subscribe_chat_request
(InfcBrowser *browser
);
Returns the InfRequest 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 returns NULL
. After such a request finishes,
call infc_browser_get_chat_session()
to get the InfcSessionProxy for the
chat session. To initiate the request, call infc_browser_subscribe_chat()
.
InfcSessionProxy *
infc_browser_get_chat_session (InfcBrowser *browser
);
Returns the InfcSessionProxy representing the running chat session if the
local client is subscribed to it, or NULL
otherwise.
struct InfcBrowser;
InfcBrowser is an opaque data type. You should only access it via the public API functions.
“chat-session”
property“chat-session” InfcSessionProxy *
Active chat session.
Owner: InfcBrowser
Flags: Read
“communication-manager”
property“communication-manager” InfCommunicationManager *
The communication manager for the browser.
Owner: InfcBrowser
Flags: Read / Write / Construct Only
“connection”
property“connection” InfXmlConnection *
Connection to the server exposing the directory to browse.
Owner: InfcBrowser
Flags: Read / Write / Construct Only
“io”
property“io” InfIo *
The InfIo to schedule timeouts.
Owner: InfcBrowser
Flags: Read / Write / Construct Only