## TpCapabilities TpCapabilities — object representing capabilities |

## Synopsis

    #include <telepathy-glib/capabilities.h>

                        TpCapabilities;
    GPtrArray *         tp_capabilities_get_channel_classes (TpCapabilities *self);
    gboolean            tp_capabilities_is_specific_to_contact
                                                            (TpCapabilities *self);
    gboolean            tp_capabilities_supports_text_chatrooms
                                                            (TpCapabilities *self);
    gboolean            tp_capabilities_supports_text_chats (TpCapabilities *self);
    gboolean            tp_capabilities_supports_audio_call (TpCapabilities *self,
                                                             TpHandleType handle_type);
    gboolean            tp_capabilities_supports_audio_video_call
                                                            (TpCapabilities *self,
                                                             TpHandleType handle_type);
    gboolean            tp_capabilities_supports_file_transfer
                                                            (TpCapabilities *self);
    gboolean            tp_capabilities_supports_stream_tubes
                                                            (TpCapabilities *self,
                                                             TpHandleType handle_type,
                                                             const gchar *service);
    gboolean            tp_capabilities_supports_dbus_tubes (TpCapabilities *self,
                                                             TpHandleType handle_type,
                                                             const gchar *service_name);
    gboolean            tp_capabilities_supports_contact_search
                                                            (TpCapabilities *self,
                                                             gboolean *with_limit,
                                                             gboolean *with_server);
    gboolean            tp_capabilities_supports_room_list  (TpCapabilities *self,
                                                             gboolean *with_server);

## Object Hierarchy

      GObject
       +----TpCapabilities

## Properties

      "channel-classes"          GPtrArray_GValueArray_GHashTable_gchararray+GValue_+GStrv__*  : Read / Write / Construct Only
      "contact-specific"         gboolean              : Read / Write / Construct Only

## Description

TpCapabilities objects represent the capabilities a TpConnection or a TpContact supports.

## Details

### TpCapabilities

    typedef struct _TpCapabilities TpCapabilities;

An object representing capabilities a TpConnection or TpContact supports.

Since 0.11.3

### tp_capabilities_get_channel_classes ()

    GPtrArray *         tp_capabilities_get_channel_classes (TpCapabilities *self);

`self` : | a TpCapabilities object
Returns : | the same GPtrArray as the "channel-classes" property. [transfer none]

Since 0.11.3

### tp_capabilities_is_specific_to_contact ()

    gboolean            tp_capabilities_is_specific_to_contact
                                                            (TpCapabilities *self);

`self` : | a TpCapabilities object
Returns : | the same gboolean as the "contact-specific" property

Since 0.11.3

### tp_capabilities_supports_text_chatrooms ()

    gboolean            tp_capabilities_supports_text_chatrooms
                                                            (TpCapabilities *self);

If the "contact-specific" property is `FALSE`, this function checks if named text chatrooms can be joined by providing a chatroom identifier.

If the "contact-specific" property is `TRUE`, this function checks if the contact associated with this TpCapabilities can be invited to named text chatrooms.

If the protocol is such that chatrooms can be joined or contacts can be invited, but only via a more elaborate D-Bus API than normal (because more information is needed), then this method will return `FALSE`.

`self` : | a TpCapabilities object
Returns : | `TRUE` if a channel request containing Text as ChannelType, HandleTypeRoom as TargetHandleType and a channel identifier can be expected to work, `FALSE` otherwise.

Since 0.11.3

### tp_capabilities_supports_text_chats ()

    gboolean            tp_capabilities_supports_text_chats (TpCapabilities *self);

Return whether private text channels can be established by providing a contact identifier.

If the protocol is such that text chats can be established, but only via a more elaborate D-Bus API than normal (because more information is needed), then this method will return `FALSE`.

`self` : | a TpCapabilities object
Returns : | `TRUE` if a channel request containing Text as ChannelType, HandleTypeContact as TargetHandleType and a contact identifier can be expected to work, `FALSE` otherwise.

Since 0.11.3

### tp_capabilities_supports_audio_call ()

    gboolean            tp_capabilities_supports_audio_call (TpCapabilities *self,
                                                             TpHandleType handle_type);

Return whether audio call can be established.

`self` : | a TpCapabilities object
`handle_type` : | the handle type of the call; TP_HANDLE_TYPE_CONTACT for private, TP_HANDLE_TYPE_ROOM or TP_HANDLE_TYPE_NONE for conference (depending on the protocol)
Returns : | `TRUE` if a channel request containing Call as ChannelType, `handle_type` as TargetHandleType, a True value for InitialAudio and an identifier of the appropriate type can be expected to work, `FALSE` otherwise.

Since 0.17.6

### tp_capabilities_supports_audio_video_call ()

    gboolean            tp_capabilities_supports_audio_video_call
                                                            (TpCapabilities *self,
                                                             TpHandleType handle_type);

Return whether audio/video call can be established.

`self` : | a TpCapabilities object
`handle_type` : | the handle type of the call; TP_HANDLE_TYPE_CONTACT for private, TP_HANDLE_TYPE_ROOM or TP_HANDLE_TYPE_NONE for conference (depending on the protocol)
Returns : | `TRUE` if a channel request containing Call as ChannelType, `handle_type` as TargetHandleType, a True value for InitialAudio/InitialVideo and an identifier of the appropriate type can be expected to work, `FALSE` otherwise.

Since 0.17.6

### tp_capabilities_supports_file_transfer ()

    gboolean            tp_capabilities_supports_file_transfer
                                                            (TpCapabilities *self);

Return whether private file transfer can be established by providing a contact identifier.

`self` : | a TpCapabilities object
Returns : | `TRUE` if a channel request containing FileTransfer as ChannelType, HandleTypeContact as TargetHandleType and a contact identifier can be expected to work, `FALSE` otherwise.

Since 0.17.6

### tp_capabilities_supports_stream_tubes ()

    gboolean            tp_capabilities_supports_stream_tubes
                                                            (TpCapabilities *self,
                                                             TpHandleType handle_type,
                                                             const gchar *service);

If the "contact-specific" property is `TRUE`, this function checks if the contact associated with this TpCapabilities supports stream tubes with `handle_type` as TargetHandleType. If `service` is not `NULL`, it also checks if it supports stream tubes with `service` as TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE.

If the "contact-specific" property is `FALSE`, this function checks if the connection supports requesting stream tube channels with `handle_type` as ChannelType. The `service` argument is unused in this case.

`self` : | a TpCapabilities object
`handle_type` : | the handle type of the tube (either TP_HANDLE_TYPE_CONTACT or TP_HANDLE_TYPE_ROOM)
`service` : | the service of the tube, or `NULL`
Returns : | `TRUE` if the contact or connection supports this type of stream tubes.

Since 0.13.0

### tp_capabilities_supports_dbus_tubes ()

    gboolean            tp_capabilities_supports_dbus_tubes (TpCapabilities *self,
                                                             TpHandleType handle_type,
                                                             const gchar *service_name);

If the "contact-specific" property is `TRUE`, this function checks if the contact associated with this TpCapabilities supports D-Bus tubes with `handle_type` as TargetHandleType. If `service_name` is not `NULL`, it also checks if it supports stream tubes with `service` as TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME.

If the "contact-specific" property is `FALSE`, this function checks if the connection supports requesting D-Bus tube channels with `handle_type` as ChannelType. The `service_name` argument is unused in this case.

`self` : | a TpCapabilities object
`handle_type` : | the handle type of the tube (either TP_HANDLE_TYPE_CONTACT or TP_HANDLE_TYPE_ROOM)
`service_name` : | the service name of the tube, or `NULL`
Returns : | `TRUE` if the contact or connection supports this type of D-Bus tubes.

Since 0.13.0

### tp_capabilities_supports_contact_search ()

    gboolean            tp_capabilities_supports_contact_search
                                                            (TpCapabilities *self,
                                                             gboolean *with_limit,
                                                             gboolean *with_server);

Return whether this protocol or connection can perform contact searches. Optionally, also return whether a limited number of results can be specified, and whether alternative servers can be searched.

`self` : | a TpCapabilities object
`with_limit` : | if not `NULL`, used to return `TRUE` if the limit parameter to `tp_contact_search_new_async()` and `tp_contact_search_reset_async()` can be nonzero. [out]
`with_server` : | if not `NULL`, used to return `TRUE` if the server parameter to `tp_contact_search_new_async()` and `tp_contact_search_reset_async()` can be non-`NULL`. [out]
Returns : | `TRUE` if TpContactSearch can be used.

Since 0.13.11

### tp_capabilities_supports_room_list ()

    gboolean            tp_capabilities_supports_room_list  (TpCapabilities *self,
                                                             gboolean *with_server);

Discovers whether this protocol or connection supports listing rooms. Specifically, if this function returns `TRUE`, a room list channel can be requested as follows:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    GHashTable *request;
    TpAccountChannelRequest *req;

    request = tp_asv_new (
        TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
          TP_IFACE_CHANNEL_TYPE_ROOM_LIST,
        TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE,
        NULL);

    req = tp_account_channel_request_new (account, request,
       TP_USER_ACTION_TIME_CURRENT_TIME);

    tp_account_channel_request_create_and_handle_channel_async (req, NULL,
        create_channel_cb, NULL);

    g_object_unref (req);
    g_hash_table_unref (request);

If `with_server` is set to `TRUE`, a list of rooms on a particular server can be requested as follows:

    1
    2
    3
    4
    5
    6
    7
    8
    /\* Same code as above but with request defined using: *\/
    request = tp_asv_new (
        TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
          TP_IFACE_CHANNEL_TYPE_ROOM_LIST,
        TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE,
        TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER, G_TYPE_STRING,
          "characters.shakespeare.lit",
        NULL);

`self` : | a TpCapabilities object
`with_server` : | if not `NULL`, used to return `TRUE` if the TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER property can be defined when requesting a RoomList channel. [out]
Returns : | `TRUE` if a channel request containing RoomList as ChannelType, HandleTypeNone as TargetHandleType can be expected to work, `FALSE` otherwise.

Since 0.13.14

## Property Details

### The `"channel-classes"` property

      "channel-classes"          GPtrArray_GValueArray_GHashTable_gchararray+GValue_+GStrv__*  : Read / Write / Construct Only

The underlying data structure used by Telepathy to represent the requests that can succeed.

This can be used by advanced clients to determine whether an unusually complex request would succeed. See the Telepathy D-Bus API Specification for details of how to interpret the returned GPtrArray of TP_STRUCT_TYPE_REQUESTABLE_CHANNEL_CLASS.

The higher-level methods like `tp_capabilities_supports_text_chats()` are likely to be more useful to the majority of clients.

### The `"contact-specific"` property

      "contact-specific"         gboolean              : Read / Write / Construct Only

Whether this object accurately describes the capabilities of a particular contact, or if it's only a guess based on the capabilities of the underlying connection.

Default value: FALSE