![]() |
![]() |
![]() |
telepathy-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#include <telepathy-glib/base-client.h> TpBaseClient; void tp_base_client_add_observer_filter (TpBaseClient *self
,GHashTable *filter
); void tp_base_client_take_observer_filter (TpBaseClient *self
,GHashTable *filter
); void tp_base_client_set_observer_recover (TpBaseClient *self
,gboolean recover
); void (*TpBaseClientClassObserveChannelsImpl) (TpBaseClient *client
,TpAccount *account
,TpConnection *connection
,GList *channels
,TpChannelDispatchOperation *dispatch_operation
,GList *requests
,TpObserveChannelsContext *context
); void tp_base_client_implement_observe_channels (TpBaseClientClass *klass
,TpBaseClientClassObserveChannelsImpl impl
); void tp_base_client_add_approver_filter (TpBaseClient *self
,GHashTable *filter
); void tp_base_client_take_approver_filter (TpBaseClient *self
,GHashTable *filter
); void (*TpBaseClientClassAddDispatchOperationImpl) (TpBaseClient *client
,TpAccount *account
,TpConnection *connection
,GList *channels
,TpChannelDispatchOperation *dispatch_operation
,TpAddDispatchOperationContext *context
); void tp_base_client_implement_add_dispatch_operation (TpBaseClientClass *klass
,TpBaseClientClassAddDispatchOperationImpl impl
); void tp_base_client_add_handler_capabilities (TpBaseClient *self
,const gchar * const *tokens
); void tp_base_client_add_handler_capabilities_varargs (TpBaseClient *self
,const gchar *first_token
,...
); void tp_base_client_add_handler_capability (TpBaseClient *self
,const gchar *token
); void tp_base_client_add_handler_filter (TpBaseClient *self
,GHashTable *filter
); void tp_base_client_be_a_handler (TpBaseClient *self
); void (*TpBaseClientClassHandleChannelsImpl) (TpBaseClient *client
,TpAccount *account
,TpConnection *connection
,GList *channels
,GList *requests_satisfied
,gint64 user_action_time
,TpHandleChannelsContext *context
); void tp_base_client_implement_handle_channels (TpBaseClientClass *klass
,TpBaseClientClassHandleChannelsImpl impl
); GList * tp_base_client_get_handled_channels (TpBaseClient *self
); GList * tp_base_client_get_pending_requests (TpBaseClient *self
); void tp_base_client_set_handler_bypass_approval (TpBaseClient *self
,gboolean bypass_approval
); void tp_base_client_set_handler_request_notification (TpBaseClient *self
); void tp_base_client_take_handler_filter (TpBaseClient *self
,GHashTable *filter
); gboolean tp_base_client_register (TpBaseClient *self
,GError **error
); void tp_base_client_unregister (TpBaseClient *self
); const gchar * tp_base_client_get_bus_name (TpBaseClient *self
); const gchar * tp_base_client_get_object_path (TpBaseClient *self
); TpDBusDaemon * tp_base_client_get_dbus_daemon (TpBaseClient *self
); const gchar * tp_base_client_get_name (TpBaseClient *self
); gboolean tp_base_client_get_uniquify_name (TpBaseClient *self
);
GObject +----TpBaseClient +----TpSimpleApprover +----TpSimpleHandler +----TpSimpleObserver
TpBaseClient implements TpSvcDBusProperties, TpSvcClient, TpSvcClientObserver, TpSvcClientApprover, TpSvcClientHandler and TpSvcClientInterfaceRequests.
"dbus-daemon" TpDBusDaemon* : Read / Write / Construct Only "name" gchar* : Read / Write / Construct Only "uniquify-name" gboolean : Read / Write / Construct Only
This base class makes it easier to write TpSvcClient implementations. Subclasses should usually pass the filters they want and override the D-Bus methods they implement.
See TpSimpleObserver for a class implementing a simple observer using TpBaseClient.
typedef struct _TpBaseClient TpBaseClient;
Data structure representing a generic TpSvcClient implementation.
Since 0.11.5
void tp_base_client_add_observer_filter (TpBaseClient *self
,GHashTable *filter
);
Register a new channel class as Observer.ObserverChannelFilter.
The observe_channels
virtual method set up using
tp_base_client_implement_observe_channels()
will be called whenever
a new channel's properties match the ones in filter
.
This method may only be called before tp_base_client_register()
is
called, and may only be called on objects whose class has called
tp_base_client_implement_observe_channels()
.
|
a TpBaseClient |
|
a TP_HASH_TYPE_CHANNEL_CLASS . transfer none. element-type utf8 GObject.Value. |
Since 0.11.5
void tp_base_client_take_observer_filter (TpBaseClient *self
,GHashTable *filter
);
|
|
|
void tp_base_client_set_observer_recover (TpBaseClient *self
,gboolean recover
);
Set whether the channel dispatcher should attempt to recover this Observer if it crashes. (This is implemented by setting the value of its Recover D-Bus property.)
Normally, Observers are only notified when new channels
appear. If an Observer is set to recover, when it registers with
tp_base_client_register()
, it will also be told about any channels
that already existed before it started.
For Observers that are activatable as a D-Bus service, if the Observer exits or crashes while there are any channels that match its filter, it will automatically be restarted by service-activation.
This method may only be called before tp_base_client_register()
is
called, and may only be called on objects whose class has called
tp_base_client_implement_observe_channels()
.
|
a TpBaseClient |
|
the value of the Observer.Recover property |
Since 0.11.5
void (*TpBaseClientClassObserveChannelsImpl) (TpBaseClient *client
,TpAccount *account
,TpConnection *connection
,GList *channels
,TpChannelDispatchOperation *dispatch_operation
,GList *requests
,TpObserveChannelsContext *context
);
Signature of the implementation of the ObserveChannels method.
This function must call either tp_observe_channels_context_accept()
,
tp_observe_channels_context_delay()
or tp_observe_channels_context_fail()
on context
before it returns.
|
a TpBaseClient instance |
|
a TpAccount having TP_ACCOUNT_FEATURE_CORE prepared if possible
|
|
a TpConnection having TP_CONNECTION_FEATURE_CORE prepared
if possible
|
|
a GList of TpChannel,
all having TP_CHANNEL_FEATURE_CORE prepared if possible. element-type TelepathyGLib.Channel. |
|
a TpChannelDispatchOperation or NULL ;
the dispatch_operation is not guaranteed to be prepared. allow-none. |
|
a GList of TpChannelRequest having their object-path defined but are not guaranteed to be prepared.. element-type TelepathyGLib.ChannelRequest. |
|
a TpObserveChannelsContext representing the context of this D-Bus call |
Since 0.11.5
void tp_base_client_implement_observe_channels (TpBaseClientClass *klass
,TpBaseClientClassObserveChannelsImpl impl
);
|
|
|
void tp_base_client_add_approver_filter (TpBaseClient *self
,GHashTable *filter
);
Register a new channel class as Approver.ApproverChannelFilter.
The add_dispatch_operation
virtual method set up using
tp_base_client_implement_add_dispatch_operation()
will be called whenever
a new channel's properties match the ones in filter
.
This method may only be called before tp_base_client_register()
is
called, and may only be called on objects whose class has called
tp_base_client_implement_add_dispatch_operation()
.
|
a TpBaseClient |
|
a TP_HASH_TYPE_CHANNEL_CLASS . transfer none. element-type utf8 GObject.Value. |
Since 0.11.5
void tp_base_client_take_approver_filter (TpBaseClient *self
,GHashTable *filter
);
|
|
|
void (*TpBaseClientClassAddDispatchOperationImpl) (TpBaseClient *client
,TpAccount *account
,TpConnection *connection
,GList *channels
,TpChannelDispatchOperation *dispatch_operation
,TpAddDispatchOperationContext *context
);
Signature of the implementation of the AddDispatchOperation method.
This function must call either tp_add_dispatch_operation_context_accept()
,
tp_add_dispatch_operation_context_delay()
or
tp_add_dispatch_operation_context_fail()
on context
before it returns.
The implementation can then use
tp_channel_dispatch_operation_handle_with_async()
to approve handling of the
channels, or tp_channel_dispatch_operation_claim_async()
to take
responsibility for handling or closing them".
|
a TpBaseClient instance |
|
a TpAccount having TP_ACCOUNT_FEATURE_CORE prepared if possible
|
|
a TpConnection having TP_CONNECTION_FEATURE_CORE prepared
if possible
|
|
a GList of TpChannel,
all having TP_CHANNEL_FEATURE_CORE prepared if possible. element-type TelepathyGLib.Channel. |
|
a TpChannelDispatchOperation having
TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE prepared if possible
|
|
a TpObserveChannelsContext representing the context of this D-Bus call |
Since 0.11.5
void tp_base_client_implement_add_dispatch_operation (TpBaseClientClass *klass
,TpBaseClientClassAddDispatchOperationImpl impl
);
|
|
|
void tp_base_client_add_handler_capabilities (TpBaseClient *self
,const gchar * const *tokens
);
Add several capability tokens to this client. These are used to signal that Telepathy connection managers should advertise certain capabilities to other contacts, such as the ability to receive audio/video calls using particular streaming protocols and codecs.
This method may only be called before tp_base_client_register()
is
called, and may only be called on objects whose class has called
tp_base_client_implement_handle_channels()
.
|
a client, which must not have been registered with
tp_base_client_register() yet
|
|
capability tokens as defined by the Telepathy D-Bus API Specification. array zero-terminated=1. element-type utf8. |
Since 0.11.6
void tp_base_client_add_handler_capabilities_varargs (TpBaseClient *self
,const gchar *first_token
,...
);
|
|
|
|
|
void tp_base_client_add_handler_capability (TpBaseClient *self
,const gchar *token
);
Add one capability token to this client, as if via
tp_base_client_add_handler_capabilities()
.
This method may only be called before tp_base_client_register()
is
called, and may only be called on objects whose class has called
tp_base_client_implement_handle_channels()
.
|
a client, which must not have been registered with
tp_base_client_register() yet
|
|
a capability token as defined by the Telepathy D-Bus API Specification |
Since 0.11.6
void tp_base_client_add_handler_filter (TpBaseClient *self
,GHashTable *filter
);
Register a new channel class as Handler.HandlerChannelFilter.
The handle_channels
virtual method set up using
tp_base_client_implement_handle_channels()
will be called whenever
a new channel's properties match the ones in filter
.
This method may only be called before tp_base_client_register()
is
called, and may only be called on objects whose class has called
tp_base_client_implement_handle_channels()
.
|
a TpBaseClient |
|
a TP_HASH_TYPE_CHANNEL_CLASS . transfer none. element-type utf8 GObject.Value. |
Since 0.11.6
void tp_base_client_be_a_handler (TpBaseClient *self
);
Register self
as a ChannelHandler with an empty list of filter.
This is useful if you want to create a client that only handle channels
for which it's the PreferredHandler.
This method may only be called before tp_base_client_register()
is
called, and may only be called on objects whose class has called
tp_base_client_implement_handle_channels()
.
|
a TpBaseClient |
Since 0.11.6
void (*TpBaseClientClassHandleChannelsImpl) (TpBaseClient *client
,TpAccount *account
,TpConnection *connection
,GList *channels
,GList *requests_satisfied
,gint64 user_action_time
,TpHandleChannelsContext *context
);
Signature of the implementation of the HandleChannels method.
This function must call either tp_handle_channels_context_accept()
,
tp_handle_channels_context_delay()
or tp_handle_channels_context_fail()
on context
before it returns.
|
a TpBaseClient instance |
|
a TpAccount having TP_ACCOUNT_FEATURE_CORE prepared if possible
|
|
a TpConnection having TP_CONNECTION_FEATURE_CORE prepared
if possible
|
|
a GList of TpChannel,
all having TP_CHANNEL_FEATURE_CORE prepared if possible. element-type TelepathyGLib.Channel. |
|
a GList of TpChannelRequest having their object-path defined but are not guaranteed to be prepared.. element-type TelepathyGLib.ChannelRequest. |
|
the time at which user action occurred, or 0 if this channel is to be handled for some reason not involving user action. |
|
a TpHandleChannelsContext representing the context of this D-Bus call |
Since 0.11.6
void tp_base_client_implement_handle_channels (TpBaseClientClass *klass
,TpBaseClientClassHandleChannelsImpl impl
);
|
|
|
GList * tp_base_client_get_handled_channels (TpBaseClient *self
);
Returns the set of channels currently handled by this base client or by any other TpBaseClient with which it shares a unique name.
|
a TpBaseClient |
Returns : |
the handled channels . transfer container. element-type TelepathyGLib.Channel. |
Since 0.11.6
GList * tp_base_client_get_pending_requests (TpBaseClient *self
);
Only works if tp_base_client_set_handler_request_notification()
has been
called.
Returns the list of requests self
is likely be asked to handle.
|
a TpBaseClient |
Returns : |
a GList of TpChannelRequest . transfer container. element-type TelepathyGLib.ChannelRequest. |
Since 0.11.6
void tp_base_client_set_handler_bypass_approval (TpBaseClient *self
,gboolean bypass_approval
);
Set whether the channels destined for this handler are automatically handled, without invoking approvers. (This is implemented by setting the value of its BypassApproval D-Bus property.)
This method may only be called before tp_base_client_register()
is
called, and may only be called on objects whose class has called
tp_base_client_implement_handle_channels()
.
|
a TpBaseClient |
|
the value of the Handler.BypassApproval property |
Since 0.11.6
void tp_base_client_set_handler_request_notification
(TpBaseClient *self
);
Indicate that self
is a Handler willing to be notified about requests for
channels that it is likely to be asked to handle.
That means the TpBaseClient::request-added and TpBaseClient::request-removed:
signals will be fired and tp_base_client_get_pending_requests()
will
return the list of pending requests.
This method may only be called before tp_base_client_register()
is
called, and may only be called on objects whose class has called
tp_base_client_implement_handle_channels()
.
|
a TpBaseClient |
Since 0.11.6
void tp_base_client_take_handler_filter (TpBaseClient *self
,GHashTable *filter
);
|
|
|
gboolean tp_base_client_register (TpBaseClient *self
,GError **error
);
Publish self
as an available client. After this method is called, as long
as it continues to exist, it will receive and process whatever events were
requested via the various filters.
Methods that set the filters and other immutable state, such as
tp_base_client_add_observer_filter()
, cannot be called after this one.
|
a TpBaseClient, which must not have been registered with
tp_base_client_register() yet
|
|
used to indicate the error if FALSE is returned
|
Returns : |
TRUE if the client was registered successfully
|
Since 0.11.5
void tp_base_client_unregister (TpBaseClient *self
);
Remove this client object from D-Bus, if tp_base_client_register()
has already been called.
If the object is not registered, this method may be called, but has no effect.
Releasing the last reference to the object also has the same effect as calling this method, but this method should be preferred, as it has more deterministic behaviour.
If the object still exists, tp_base_client_register()
may be used to
attempt to register it again.
|
a client, which may already have been registered with
tp_base_client_register() , or not
|
Since 0.11.6
const gchar * tp_base_client_get_bus_name (TpBaseClient *self
);
Return the bus name of self
. Note that doesn't mean the client is
actually owning this name; for example if tp_base_client_register()
has not been called yet or failed.
|
a TpBaseClient |
Returns : |
the bus name of the client |
Since 0.11.5
const gchar * tp_base_client_get_object_path (TpBaseClient *self
);
Return the object path of self
. Note that doesn't mean the client is
actually registered on this path; for example if tp_base_client_register()
has not been called yet or failed.
|
a TpBaseClient |
Returns : |
the object path of the client |
Since 0.11.5
TpDBusDaemon * tp_base_client_get_dbus_daemon (TpBaseClient *self
);
|
|
Returns : |
const gchar * tp_base_client_get_name (TpBaseClient *self
);
|
|
Returns : |
gboolean tp_base_client_get_uniquify_name (TpBaseClient *self
);
|
|
Returns : |
"dbus-daemon"
property"dbus-daemon" TpDBusDaemon* : Read / Write / Construct Only
TpDBusDaemon object encapsulating this object's connection to D-Bus. Read-only except during construction.
This property can't be NULL
.
Since 0.11.5
"name"
property"name" gchar* : Read / Write / Construct Only
The name of the client. This is used to register the D-Bus service name and object path of the service.
This property can't be NULL
.
Default value: NULL
Since 0.11.5
"uniquify-name"
property"uniquify-name" gboolean : Read / Write / Construct Only
If TRUE
, tp_base_client_register()
will append an unique token to the
service bus name and object path to ensure they are unique.
Default value: FALSE
Since 0.11.5
"request-added"
signalvoid user_function (TpBaseClient *self, TpAccount *account, TpChannelRequest *request, gpointer user_data) : Run Last / Has Details
Emitted when a channels have been requested, and that if the request is successful, they will probably be handled by this Handler.
This signal is only fired if
tp_base_client_set_handler_request_notification()
has been called
on self
previously.
|
a TpBaseClient |
|
the TpAccount on which the request was made
having TP_ACCOUNT_FEATURE_CORE prepared if possible
|
|
a TpChannelRequest having its object-path defined but is not guaranteed to be prepared. |
|
user data set when the signal handler was connected. |
Since 0.11.6
"request-removed"
signalvoid user_function (TpBaseClient *self, TpChannelRequest *request, gchar *error, gchar *message, gpointer user_data) : Run Last / Has Details
Emitted when a request has failed and should be disregarded.
This signal is only fired if
tp_base_client_set_handler_request_notification()
has been called
on self
previously.
|
a TpBaseClient |
|
the TpChannelRequest being removed |
|
the name of the D-Bus error with which the request failed. |
|
any message supplied with the D-Bus error. |
|
user data set when the signal handler was connected. |
Since 0.11.6