![]() |
![]() |
![]() |
libinfinity-0.6 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <libinfinity/client/infc-browser.h> InfcBrowser; struct InfcBrowserClass; InfcBrowser * infc_browser_new (InfIo *io
,InfCommunicationManager *comm_manager
,InfXmlConnection *connection
); InfCommunicationManager * infc_browser_get_communication_manager (InfcBrowser *browser
); InfXmlConnection * infc_browser_get_connection (InfcBrowser *browser
); gboolean infc_browser_add_plugin (InfcBrowser *browser
,const InfcNotePlugin *plugin
); const InfcNotePlugin * infc_browser_lookup_plugin (InfcBrowser *browser
,const gchar *note_type
); InfRequest * infc_browser_iter_save_session (InfcBrowser *browser
,const InfBrowserIter *iter
,InfRequestFunc func
,gpointer user_data
); InfcSessionProxy * infc_browser_iter_get_sync_in (InfcBrowser *browser
,const InfBrowserIter *iter
); GSList * infc_browser_iter_get_sync_in_requests (InfcBrowser *browser
,const InfBrowserIter *iter
); gboolean infc_browser_iter_is_valid (InfcBrowser *browser
,const InfBrowserIter *iter
); InfRequest * infc_browser_subscribe_chat (InfcBrowser *browser
,InfRequestFunc func
,gpointer user_data
); InfRequest * infc_browser_get_subscribe_chat_request (InfcBrowser *browser
); InfcSessionProxy * infc_browser_get_chat_session (InfcBrowser *browser
);
"chat-session" InfcSessionProxy* : Read "communication-manager" InfCommunicationManager* : Read / Write / Construct Only "connection" InfXmlConnection* : Read / Write / Construct Only "io" InfIo* : 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.
typedef struct _InfcBrowser InfcBrowser;
InfcBrowser is an opaque data type. You should only access it via the public API functions.
struct InfcBrowserClass { };
This structure does not contain any public fields.
InfcBrowser * infc_browser_new (InfIo *io
,InfCommunicationManager *comm_manager
,InfXmlConnection *connection
);
Creates a new InfcBrowser.
|
A InfIo object used to schedule timeouts. |
|
A InfCommunicationManager to register the server connection and which forwards incoming data to the browser or running sessions. |
|
Connection to the server. |
Returns : |
A new InfcBrowser. |
InfCommunicationManager * infc_browser_get_communication_manager
(InfcBrowser *browser
);
Returns the communication manager of this browser.
|
A InfcBrowser. |
Returns : |
A InfCommunicationManager. |
InfXmlConnection * infc_browser_get_connection (InfcBrowser *browser
);
Returns the connection to the server.
|
A InfcBrowser. |
Returns : |
A InfXmlConnection. |
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.
|
A InfcBrowser. |
|
A InfcNotePlugin. |
Returns : |
Whether the plugin was added successfully. |
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.
|
A InfcBrowser. |
|
A note type, such as "InfText". |
Returns : |
A InfcNotePlugin, or NULL . |
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.
|
A InfcBrowser. |
|
A InfcBrowserIter pointing to a note in browser . |
|
The function to be called when the request finishes, or NULL . |
|
Additional data to pass to func . |
Returns : |
A InfRequest that may be used to get notified when the request finishes or fails. |
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 InfcBrowser. |
|
A InfcBrowserIter pointing to a note in browser . |
Returns : |
A InfcSessionProxy, or NULL if we are currently not
synchronizing this node to the server. |
GSList * infc_browser_iter_get_sync_in_requests (InfcBrowser *browser
,const InfBrowserIter *iter
);
Returns a list of all InfcNodeRequest 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.
|
A InfcBrowser. |
|
A InfcBrowserIter pointing to a subdirectory node in browser . |
Returns : |
A list of InfcNodeRequests. Free with g_slist_free()
when done. |
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 InfcBrowserIter returned by one of the
InfcBrowser functions, it gets invalid however as soon as the node it
points to is removed.
|
A InfcBrowser. |
|
A InfcBrowserIter. |
Returns : |
Whether iter points to a node in browser . |
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.
|
A InfcBrowser. |
|
The function to be called when the request finishes, or NULL . |
|
Additional data to pass to func . |
Returns : |
A InfRequest that may be used to get notified when the request finishes or fails. |
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()
.
|
A InfcBrowser. |
Returns : |
A InfRequest, or NULL . |
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.
|
A InfcBrowser. |
Returns : |
A InfcSessionProxy for the chat, or NULL . |
"communication-manager"
property"communication-manager" InfCommunicationManager* : Read / Write / Construct Only
The communication manager for the browser.
"connection"
property"connection" InfXmlConnection* : Read / Write / Construct Only
Connection to the server exposing the directory to browse.