TpBaseConnectionManager

TpBaseConnectionManager — base class for TpSvcConnectionManager implementations

Functions

Properties

TpDBusDaemon * dbus-daemon Read / Write / Construct Only
GStrv interfaces Read
GHashTable_gchararray+GHashTable_gchararray+GValue__* protocols Read

Signals

void no-more-connections Has Details

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseConnectionManager

Implemented Interfaces

TpBaseConnectionManager implements TpSvcDBusProperties and TpSvcConnectionManager.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This base class makes it easier to write TpSvcConnectionManager implementations by managing the D-Bus object path and bus name, and maintaining a table of active connections. Subclasses should usually only need to override the members of the class data structure.

Functions

TpCMParamFilter ()

gboolean
(*TpCMParamFilter) (const TpCMParamSpec *paramspec,
                    GValue *value,
                    GError **error);

Signature of a callback used to validate and/or normalize user-provided CM parameter values.

Parameters

paramspec

The parameter specification. The filter is likely to use name (for the error message if the value is invalid) and filter_data.

 

value

The value for that parameter provided by the user. May be changed to contain a different value of the same type, if some sort of normalization is required

 

error

Used to raise TP_ERROR_INVALID_ARGUMENT if the given value is rejected

 

Returns

TRUE to accept, FALSE (with error set) to reject


tp_cm_param_filter_string_nonempty ()

gboolean
tp_cm_param_filter_string_nonempty (const TpCMParamSpec *paramspec,
                                    GValue *value,
                                    GError **error);

A TpCMParamFilter which rejects empty strings.

Parameters

paramspec

The parameter specification for a string parameter

 

value

A GValue containing a string, which will not be altered

 

error

Used to return an error if the string is empty

 

Returns

TRUE to accept, FALSE (with error set) to reject


tp_cm_param_filter_uint_nonzero ()

gboolean
tp_cm_param_filter_uint_nonzero (const TpCMParamSpec *paramspec,
                                 GValue *value,
                                 GError **error);

A TpCMParamFilter which rejects zero, useful for server port numbers.

Parameters

paramspec

The parameter specification for a guint parameter

 

value

A GValue containing a guint, which will not be altered

 

error

Used to return an error if the guint is 0

 

Returns

TRUE to accept, FALSE (with error set) to reject


TpCMParamSetter ()

void
(*TpCMParamSetter) (const TpCMParamSpec *paramspec,
                    const GValue *value,
                    gpointer params);

The signature of a callback used to set a parameter within the opaque data structure used for a protocol.

Parameters

paramspec

The parameter specification. The setter is likely to use some combination of the name, offset and setter_data fields.

 

value

The value for that parameter provided by the user.

 

params

An opaque data structure, created by TpCMProtocolSpec.params_new.

 

Since: 0.7.0


tp_cm_param_setter_offset ()

void
tp_cm_param_setter_offset (const TpCMParamSpec *paramspec,
                           const GValue *value,
                           gpointer params);

A TpCMParamSetter which sets parameters by dereferencing an offset from params . If paramspec->offset is G_MAXSIZE, the parameter is deemed obsolete, and is accepted but ignored.

Parameters

paramspec

A parameter specification with offset set to some meaningful value.

 

value

The value for that parameter, either provided by the user or constructed from the parameter's default.

 

params

An opaque data structure such that the address at (params + paramspec->offset ) is a valid pointer to a variable of the appropriate type.

 

Since: 0.7.0


TpBaseConnectionManagerNewConnFunc ()

TpBaseConnection *
(*TpBaseConnectionManagerNewConnFunc) (TpBaseConnectionManager *self,
                                       const gchar *proto,
                                       TpIntset *params_present,
                                       void *parsed_params,
                                       GError **error);

A function that will return a new connection according to the parsed parameters; used to implement RequestConnection.

The connection manager base class will register the bus name for the new connection, and place a reference to it in its table of connections until the connection's shutdown process finishes.

Parameters

self

The connection manager implementation

 

proto

The protocol name from the D-Bus request

 

params_present

A set of integers representing the indexes into the array of TpCMParamSpec of those parameters that were present in the request

 

parsed_params

An opaque data structure as returned by the protocol's params_new function, populated according to the parameter specifications

 

error

if not NULL, used to indicate the error if NULL is returned

 

Returns

the new connection object, or NULL on error.


TpBaseConnectionManagerGetInterfacesFunc ()

GPtrArray *
(*TpBaseConnectionManagerGetInterfacesFunc)
                               (TpBaseConnectionManager *self);

Signature of an implementation of TpBaseConnectionManagerClass.get_interfaces virtual function.

Implementation must first chainup on parent class implementation and then add extra interfaces into the GPtrArray.

1
2
3
4
5
6
7
8
9
10
11
12
static GPtrArray *
my_connection_manager_get_interfaces (TpBaseConnectionManager *self)
{
  GPtrArray *interfaces;

  interfaces = TP_BASE_CONNECTION_MANAGER_CLASS (
      my_connection_manager_parent_class)->get_interfaces (self);

  g_ptr_array_add (interfaces, TP_IFACE_BADGERS);

  return interfaces;
}

Parameters

Returns

a GPtrArray of static strings for D-Bus interfaces implemented by this client.

[transfer container]

Since: 0.19.4


tp_base_connection_manager_get_dbus_daemon ()

TpDBusDaemon *
tp_base_connection_manager_get_dbus_daemon
                               (TpBaseConnectionManager *self);

Parameters

self

the connection manager

 

Returns

the value of the “dbus-daemon” property. The caller must reference the returned object with g_object_ref() if it will be kept.

[transfer none]

Since: 0.11.3


tp_base_connection_manager_register ()

gboolean
tp_base_connection_manager_register (TpBaseConnectionManager *self);

Register the connection manager with an appropriate object path as determined from its cm_dbus_name , and register the appropriate well-known bus name.

Parameters

self

The connection manager implementation