## TpBaseClient

TpBaseClient — base class for Telepathy clients on D-Bus

## Synopsis

    #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_take_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);
    void                tp_base_client_add_account_features (TpBaseClient *self,
                                                             const GQuark *features,
                                                             gssize n);
    void                tp_base_client_add_account_features_varargs
                                                            (TpBaseClient *self,
                                                             GQuark feature,
                                                             ...);
    void                tp_base_client_add_connection_features
                                                            (TpBaseClient *self,
                                                             const GQuark *features,
                                                             gssize n);
    void                tp_base_client_add_connection_features_varargs
                                                            (TpBaseClient *self,
                                                             GQuark feature,
                                                             ...);
    void                tp_base_client_add_channel_features (TpBaseClient *self,
                                                             const GQuark *features,
                                                             gssize n);
    void                tp_base_client_add_channel_features_varargs
                                                            (TpBaseClient *self,
                                                             GQuark feature,
                                                             ...);
    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);
    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);
    TpAccountManager *  tp_base_client_get_account_manager  (TpBaseClient *self);

## Object Hierarchy

      GObject
       +----TpBaseClient
             +----TpSimpleApprover
             +----TpSimpleHandler
             +----TpSimpleObserver

## Implemented Interfaces

TpBaseClient implements TpSvcDBusProperties, TpSvcClient, TpSvcClientObserver, TpSvcClientApprover, TpSvcClientHandler and TpSvcClientInterfaceRequests.

## Properties

      "account-manager"          TpAccountManager*     : Read / Write / Construct Only
      "dbus-daemon"              TpDBusDaemon*         : Read / Write / Construct Only
      "name"                     gchar*                : Read / Write / Construct Only
      "uniquify-name"            gboolean              : Read / Write / Construct Only

## Signals

      "request-added"                                  : Run Last / Has Details
      "request-removed"                                : Run Last / Has Details

## Description

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.

## Details

### TpBaseClient

    typedef struct _TpBaseClient TpBaseClient;

Data structure representing a generic TpSvcClient implementation.

Since 0.11.5

### tp_base_client_add_observer_filter ()

    void                tp_base_client_add_observer_filter  (TpBaseClient *self,
                                                             GHashTable *filter);

Register a new channel class as Observer.ObserverChannelFilter. The TpBaseClientClass.observe_channels virtual method 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 implements TpBaseClientClass.observe_channels.

`self` : | a TpBaseClient
`filter` : | a `TP_HASH_TYPE_CHANNEL_CLASS`. [transfer none][element-type utf8 GObject.Value]

Since 0.11.5

### tp_base_client_take_observer_filter ()

    void                tp_base_client_take_observer_filter (TpBaseClient *self,
                                                             GHashTable *filter);

The same as `tp_base_client_add_observer_filter()`, but ownership of `filter` is taken by `self`. This makes it convenient to call using `tp_asv_new()`:

    1
    2
    3
    4
    5
    6
    7

    tp_base_client_take_observer_filter (client,
       tp_asv_new (
           TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
               TP_IFACE_CHANNEL_TYPE_TEXT,
           TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
               TP_HANDLE_TYPE_CONTACT,
           ...));

`self` : | a client
`filter` : | a `TP_HASH_TYPE_CHANNEL_CLASS`, ownership of which is taken by `self`. [transfer full][element-type utf8 GObject.Value]

Since 0.11.5

### tp_base_client_set_observer_recover ()

    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 implements TpBaseClientClass.observe_channels.

`self` : | a TpBaseClient
`recover` : | the value of the Observer.Recover property

Since 0.11.5

### TpBaseClientClassObserveChannelsImpl ()

    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.

`client` : | a TpBaseClient instance
`account` : | a TpAccount with `TP_ACCOUNT_FEATURE_CORE`, and any other features added via `tp_base_client_add_account_features()`, prepared if possible
`connection` : | a TpConnection with `TP_CONNECTION_FEATURE_CORE`, and any other features added via `tp_base_client_add_connection_features()`, prepared if possible
`channels` : | a GList of TpChannel, each with `TP_CHANNEL_FEATURE_CORE`, and any other features added via `tp_base_client_add_channel_features()`, prepared if possible. [element-type TelepathyGLib.Channel]
`dispatch_operation` : | a TpChannelDispatchOperation or `NULL`; the dispatch_operation is not guaranteed to be prepared. [allow-none]
`requests` : | a GList of TpChannelRequest having their object-path defined but are not guaranteed to be prepared. [element-type TelepathyGLib.ChannelRequest]
`context` : | a TpObserveChannelsContext representing the context of this D-Bus call

Since 0.11.5

### tp_base_client_implement_observe_channels ()

    void                tp_base_client_implement_observe_channels
                                                            (TpBaseClientClass *klass,
                                                             TpBaseClientClassObserveChannelsImpl impl);

Called by subclasses to define the actual implementation of the `ObserveChannels()` D-Bus method.

Since 0.11.13 this is exactly equivalent to setting the TpBaseClientClass.observe_channels function pointer.

`klass` : | the TpBaseClientClass of the object
`impl` : | the TpBaseClientClassObserveChannelsImpl function implementing `ObserveChannels()`

Since 0.11.5

### tp_base_client_add_approver_filter ()

    void                tp_base_client_add_approver_filter  (TpBaseClient *self,
                                                             GHashTable *filter);

Register a new channel class as Approver.ApproverChannelFilter. The TpBaseClientClass.add_dispatch_operation virtual method 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 implements TpBaseClientClass.add_dispatch_operation.

`self` : | a TpBaseClient
`filter` : | a `TP_HASH_TYPE_CHANNEL_CLASS`. [transfer none][element-type utf8 GObject.Value]

Since 0.11.5

### tp_base_client_take_approver_filter ()

    void                tp_base_client_take_approver_filter (TpBaseClient *self,
                                                             GHashTable *filter);

The same as `tp_base_client_add_approver_filter()`, but ownership of `filter` is taken by `self`. This makes it convenient to call using `tp_asv_new()`:

    1
    2
    3
    4
    5
    6
    7

    tp_base_client_take_approver_filter (client,
       tp_asv_new (
           TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
               TP_IFACE_CHANNEL_TYPE_TEXT,
           TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
               TP_HANDLE_TYPE_CONTACT,
           ...));

`self` : | a client
`filter` : | a `TP_HASH_TYPE_CHANNEL_CLASS`, ownership of which is taken by `self`. [transfer full][element-type utf8 GObject.Value]

Since 0.11.5

### TpBaseClientClassAddDispatchOperationImpl ()

    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".

`client` : | a TpBaseClient instance
`account` : | a TpAccount with `TP_ACCOUNT_FEATURE_CORE`, and any other features added via `tp_base_client_add_account_features()`, prepared if possible
`connection` : | a TpConnection with `TP_CONNECTION_FEATURE_CORE`, and any other features added via `tp_base_client_add_connection_features()`, prepared if possible
`channels` : | a GList of TpChannel, each with `TP_CHANNEL_FEATURE_CORE`, and any other features added via `tp_base_client_add_channel_features()`, prepared if possible. [element-type TelepathyGLib.Channel]
`dispatch_operation` : | a TpChannelDispatchOperation having `TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE` prepared if possible
`context` : | a TpObserveChannelsContext representing the context of this D-Bus call

Since 0.11.5

### tp_base_client_implement_add_dispatch_operation ()

    void                tp_base_client_implement_add_dispatch_operation
                                                            (TpBaseClientClass *klass,
                                                             TpBaseClientClassAddDispatchOperationImpl impl);

Called by subclasses to define the actual implementation of the `AddDispatchOperation()` D-Bus method.

Since 0.11.13 this is exactly equivalent to setting the TpBaseClientClass.add_dispatch_operation function pointer.

`klass` : | the TpBaseClientClass of the object
`impl` : | the TpBaseClientClassAddDispatchOperationImpl function implementing `AddDispatchOperation()`

Since 0.11.5

### tp_base_client_add_handler_capabilities ()

    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 implements TpBaseClientClass.handle_channels.

`self` : | a client, which must not have been registered with `tp_base_client_register()` yet
`tokens` : | capability tokens as defined by the Telepathy D-Bus API Specification. [array zero-terminated=1][element-type utf8]

Since 0.11.6

### tp_base_client_add_handler_capabilities_varargs ()

    void                tp_base_client_add_handler_capabilities_varargs
                                                            (TpBaseClient *self,
                                                             const gchar *first_token,
                                                             ...);

Convenience C API equivalent to calling `tp_base_client_add_handler_capability()` for each capability token.

This method may only be called before `tp_base_client_register()` is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channels.

`self` : | a client, which must not have been registered with `tp_base_client_register()` yet
`first_token` : | a capability token from the Telepathy D-Bus API Specification
`...` : | more tokens, ending with `NULL`

Since 0.11.6

### tp_base_client_add_handler_capability ()

    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 implements TpBaseClientClass.handle_channels.

`self` : | a client, which must not have been registered with `tp_base_client_register()` yet
`token` : | a capability token as defined by the Telepathy D-Bus API Specification

Since 0.11.6

### tp_base_client_add_handler_filter ()

    void                tp_base_client_add_handler_filter   (TpBaseClient *self,
                                                             GHashTable *filter);

Register a new channel class as Handler.HandlerChannelFilter. The TpBaseClientClass.handle_channels virtual method 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 implements TpBaseClientClass.handle_channels.

`self` : | a TpBaseClient
`filter` : | a `TP_HASH_TYPE_CHANNEL_CLASS`. [transfer none][element-type utf8 GObject.Value]

Since 0.11.6

### tp_base_client_take_handler_filter ()

    void                tp_base_client_take_handler_filter  (TpBaseClient *self,
                                                             GHashTable *filter);

The same as `tp_base_client_add_handler_filter()`, but ownership of `filter` is taken by `self`. This makes it convenient to call using `tp_asv_new()`:

    1
    2
    3
    4
    5
    6
    7

    tp_base_client_take_handler_filter (client,
       tp_asv_new (
           TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
               TP_IFACE_CHANNEL_TYPE_TEXT,
           TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
               TP_HANDLE_TYPE_CONTACT,
           ...));

`self` : | a TpBaseClient
`filter` : | a `TP_HASH_TYPE_CHANNEL_CLASS`, ownership of which is taken by `self`. [transfer full][element-type utf8 GObject.Value]

Since 0.11.6

### tp_base_client_be_a_handler ()

    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 TpBaseClientClass.handle_channels.

`self` : | a TpBaseClient

Since 0.11.6

### TpBaseClientClassHandleChannelsImpl ()

    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.

`client` : | a TpBaseClient instance
`account` : | a TpAccount with `TP_ACCOUNT_FEATURE_CORE`, and any other features added via `tp_base_client_add_account_features()`, prepared if possible
`connection` : | a TpConnection with `TP_CONNECTION_FEATURE_CORE`, and any other features added via `tp_base_client_add_connection_features()`, prepared if possible
`channels` : | a GList of TpChannel, each with `TP_CHANNEL_FEATURE_CORE`, and any other features added via `tp_base_client_add_channel_features()`, prepared if possible. [element-type TelepathyGLib.Channel]
`requests_satisfied` : | a GList of TpChannelRequest having their object-path defined but are not guaranteed to be prepared. [element-type TelepathyGLib.ChannelRequest]
`user_action_time` : | the time at which user action occurred, or one of the special values `TP_USER_ACTION_TIME_NOT_USER_ACTION` or `TP_USER_ACTION_TIME_CURRENT_TIME` (see "user-action-time" for details)
`context` : | a TpHandleChannelsContext representing the context of this D-Bus call

Since 0.11.6

### tp_base_client_implement_handle_channels ()

    void                tp_base_client_implement_handle_channels
                                                            (TpBaseClientClass *klass,
                                                             TpBaseClientClassHandleChannelsImpl impl);

Called by subclasses to define the actual implementation of the `HandleChannels()` D-Bus method.

Since 0.11.13 this is exactly equivalent to setting the TpBaseClientClass.handle_channels function pointer.

`klass` : | the TpBaseClientClass of the object
`impl` : | the TpBaseClientClassHandleChannelsImpl function implementing `HandleCHannels()`

Since 0.11.6

### tp_base_client_add_account_features ()

    void                tp_base_client_add_account_features (TpBaseClient *self,
                                                             const GQuark *features,
                                                             gssize n);

Request that the given features are prepared on each TpAccount (in addition to `TP_ACCOUNT_FEATURE_CORE`) before calling TpBaseClient.observe_channels, TpBaseClient.add_dispatch_operation or TpBaseClient.handle_channels, or emitting "request-added".

`self` : | a client
`features` : | the features. [array length=n]
`n` : | the number of features, or -1 if `features` is 0-terminated

Since 0.11.14

### tp_base_client_add_account_features_varargs ()

    void                tp_base_client_add_account_features_varargs
                                                            (TpBaseClient *self,
                                                             GQuark feature,
                                                             ...);

The same as `tp_base_client_add_account_features()`, but with a more convenient calling convention from C.

`self` : | a client
`feature` : | the first feature
`...` : | the second and subsequent features, if any, ending with 0

Since 0.11.14

### tp_base_client_add_connection_features ()

    void                tp_base_client_add_connection_features
                                                            (TpBaseClient *self,
                                                             const GQuark *features,
                                                             gssize n);

Request that the given features are prepared on each TpConnection (in addition to `TP_CONNECTION_FEATURE_CORE`) before calling TpBaseClient.observe_channels, TpBaseClient.add_dispatch_operation or TpBaseClient.handle_channels.

`self` : | a client
`features` : | the features. [array length=n]
`n` : | the number of features, or -1 if `features` is 0-terminated

Since 0.11.14

### tp_base_client_add_connection_features_varargs ()

    void                tp_base_client_add_connection_features_varargs
                                                            (TpBaseClient *self,
                                                             GQuark feature,
                                                             ...);

The same as `tp_base_client_add_connection_features()`, but with a more convenient calling convention from C.

`self` : | a client
`feature` : | the first feature
`...` : | the second and subsequent features, if any, ending with 0

Since 0.11.14

### tp_base_client_add_channel_features ()

    void                tp_base_client_add_channel_features (TpBaseClient *self,
                                                             const GQuark *features,
                                                             gssize n);

Request that the given features are prepared on each TpChannel (in addition to `TP_CHANNEL_FEATURE_CORE`) before calling TpBaseClient.observe_channels, TpBaseClient.add_dispatch_operation or TpBaseClient.handle_channels.

`self` : | a client
`features` : | the features. [array length=n]
`n` : | the number of features, or -1 if `features` is 0-terminated

Since 0.11.14

### tp_base_client_add_channel_features_varargs ()

    void                tp_base_client_add_channel_features_varargs
                                                            (TpBaseClient *self,
                                                             GQuark feature,
                                                             ...);

The same as `tp_base_client_add_channel_features()`, but with a more convenient calling convention from C.

`self` : | a client
`feature` : | the first feature
`...` : | the second and subsequent features, if any, ending with 0

Since 0.11.14

### tp_base_client_get_handled_channels ()

    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.

`self` : | a TpBaseClient
Returns : | the handled channels. [transfer container][element-type TelepathyGLib.Channel]

Since 0.11.6

### tp_base_client_get_pending_requests ()

    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.

`self` : | a TpBaseClient
Returns : | a GList of TpChannelRequest. [transfer container][element-type TelepathyGLib.ChannelRequest]

Since 0.11.6

### tp_base_client_set_handler_bypass_approval ()

    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 implements TpBaseClientClass.handle_channels.

`self` : | a TpBaseClient
`bypass_approval` : | the value of the Handler.BypassApproval property

Since 0.11.6

### tp_base_client_set_handler_request_notification ()

    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 implements TpBaseClientClass.handle_channels.

`self` : | a TpBaseClient

Since 0.11.6

### tp_base_client_register ()

    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.

`self` : | a TpBaseClient, which must not have been registered with `tp_base_client_register()` yet
`error` : | used to indicate the error if `FALSE` is returned
Returns : | `TRUE` if the client was registered successfully

Since 0.11.5

### tp_base_client_unregister ()

    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.

`self` : | a client, which may already have been registered with `tp_base_client_register()`, or not

Since 0.11.6

### tp_base_client_get_bus_name ()

    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.

`self` : | a TpBaseClient
Returns : | the bus name of the client

Since 0.11.5

### tp_base_client_get_object_path ()

    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.

`self` : | a TpBaseClient
Returns : | the object path of the client

Since 0.11.5

### tp_base_client_get_dbus_daemon ()

    TpDBusDaemon *      tp_base_client_get_dbus_daemon      (TpBaseClient *self);

Return the "dbus-daemon" construct-only property, which represents the D-Bus connection used to export this client object.

The returned object's reference count is not incremented, so it is not necessarily valid after `self` is destroyed.

`self` : | a TpBaseClient
Returns : | the value of "dbus-daemon". [transfer none]

Since 0.11.11

### tp_base_client_get_name ()

    const gchar *       tp_base_client_get_name             (TpBaseClient *self);

Return the "name" construct-only property, which is used as part of the bus name and object path.

`self` : | a TpBaseClient
Returns : | the value of "name"

Since 0.11.11

### tp_base_client_get_uniquify_name ()

    gboolean            tp_base_client_get_uniquify_name    (TpBaseClient *self);

Return the "uniquify-name" construct-only property; if this is true, the bus name and object path will be made unique by appending a suffix that includes the D-Bus unique name and a per-process counter.

`self` : | a TpBaseClient
Returns : | the value of "uniquify-name"

Since 0.11.11

### tp_base_client_get_account_manager ()

    TpAccountManager *  tp_base_client_get_account_manager  (TpBaseClient *self);

Return the "account-manager" construct-only property, which is the account manager used to look up or create TpAccount objects.

The returned object's reference count is not incremented, so it is not necessarily valid after `self` is destroyed.

It is not guaranteed that any particular features are prepared on this object; enable and wait for features with `tp_proxy_prepare_async()`.

`self` : | a TpBaseClient
Returns : | the value of "account-manager". [transfer none]

Since 0.11.14

## Property Details

### The `"account-manager"` property

      "account-manager"          TpAccountManager*     : Read / Write / Construct Only

Account manager for this base client, used to look up or create TpAccount objects. This may be specified in the constructor in order to get existing TpAccount objects.

It is not guaranteed that any of its features have been prepared, and it is not necessary to wait for any features before specifying this property in the constructor.

Clients that interact with the TpAccount should usually set this property instead of "dbus-daemon". Doing this will ensure that each account, connection or contact is represented by a single TpAccount, TpConnection or TpContact object, shared between all the cooperating modules that have the same TpAccountManager.

If the "dbus-daemon" is set to the result of `tp_dbus_daemon_dup()`, then this property defaults to the result of `tp_account_manager_dup()`.

This property may be `NULL` initially, but will always be non-`NULL` after the TpBaseClient has been constructed.

It is an error to specify both a non-`NULL` account manager, and a non-`NULL` "dbus-daemon" that is not the same as the account manager's "dbus-daemon".

Since 0.11.14

### The `"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` after construction.

Since 0.11.14 this property may be `NULL` or unspecified in `g_object_new()`, but only if "account-manager" is provided instead, in which case its "dbus-daemon" property will be used.

Since 0.11.5

### The `"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

### The `"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

## Signal Details

### The `"request-added"` signal

    void                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.

`self` : | a TpBaseClient
`account` : | the TpAccount on which the request was made, with `TP_ACCOUNT_FEATURE_CORE`, and any other features added via `tp_base_client_add_account_features()`, prepared if possible
`request` : | a TpChannelRequest having its object-path defined but is not guaranteed to be prepared.
`user_data` : | user data set when the signal handler was connected.

Since 0.11.6

### The `"request-removed"` signal

    void                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.

`self` : | a TpBaseClient
`request` : | the TpChannelRequest being removed
`error` : | the name of the D-Bus error with which the request failed.
`message` : | any message supplied with the D-Bus error.
`user_data` : | user data set when the signal handler was connected.

Since 0.11.6