telepathy-glib Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
#include <telepathy-glib/channel-factory-iface.h> void (*TpChannelFactoryIfaceForeachImpl) (TpChannelFactoryIface *self
,TpChannelFunc func
,gpointer data
); void (*TpChannelFactoryIfaceProc) (TpChannelFactoryIface *self
); TpChannelFactoryRequestStatus (*TpChannelFactoryIfaceRequestImpl) (TpChannelFactoryIface *self
,const gchar *chan_type
,TpHandleType handle_type
,guint handle
,gpointer request
,TpChannelIface **ret
,GError **error
); enum TpChannelFactoryRequestStatus; TpChannelFactoryIface; TpChannelFactoryIfaceClass; void tp_channel_factory_iface_close_all (TpChannelFactoryIface *self
); void tp_channel_factory_iface_connecting (TpChannelFactoryIface *self
); void tp_channel_factory_iface_connected (TpChannelFactoryIface *self
); void tp_channel_factory_iface_disconnected (TpChannelFactoryIface *self
); void tp_channel_factory_iface_foreach (TpChannelFactoryIface *self
,TpChannelFunc func
,gpointer data
); TpChannelFactoryRequestStatus tp_channel_factory_iface_request (TpChannelFactoryIface *self
,const gchar *chan_type
,TpHandleType handle_type
,guint handle
,gpointer request
,TpChannelIface **ret
,GError **error
); void tp_channel_factory_iface_emit_new_channel (gpointer instance
,TpChannelIface *channel
,gpointer request
); void tp_channel_factory_iface_emit_channel_error (gpointer instance
,TpChannelIface *channel
,GError *error
,gpointer request
);
A channel factory is attached to a connection. It carries out channel requests from the connection, and responds to channel-related events on the underlying network connection (e.g. incoming calls).
The connection has an array of channel factories. In a trivial implementation there might be a single channel factory which handles all requests and all incoming events, but in general, there will be multiple channel factories handling different types of channel.
TpChannelManager is a newer interface (introduced in telepathy-glib 0.7.15) for allocating and tracking channels which supports the Requests D-Bus interface introduced in version 0.17.11 of the specification. New connection managers should implement that interface instead, and existing connection managers should migrate to it.
void (*TpChannelFactoryIfaceForeachImpl) (TpChannelFactoryIface *self
,TpChannelFunc func
,gpointer data
);
Signature of an implementation of foreach, which must call func(channel, data) for each channel managed by this factory.
|
An object implementing TpChannelFactoryIface |
|
A function |
|
Arbitrary data to pass to func as the second argument
|
void (*TpChannelFactoryIfaceProc) (TpChannelFactoryIface *self
);
A virtual method on a channel factory that takes no extra parameters and returns nothing.
|
An object implementing TpChannelFactoryIface |
TpChannelFactoryRequestStatus (*TpChannelFactoryIfaceRequestImpl) (TpChannelFactoryIface *self
,const gchar *chan_type
,TpHandleType handle_type
,guint handle
,gpointer request
,TpChannelIface **ret
,GError **error
);
Signature of an implementation of RequestChannel.
|
An object implementing TpChannelFactoryIface |
|
The channel type, e.g. TP_IFACE_CHANNEL_TYPE_TEXT
|
|
The handle type of the channel's associated handle, or 0 if the channel has no associated handle |
|
The channel's associated handle, of type handle_type ,
or 0 if the channel has no associated handle
|
|
An opaque data structure representing the channel request; if this request is satisfied by a newly created channel, this structure MUST be included in the new-channel signal if the newly created channel has handle 0, and MAY be included in the signal if the newly created channel has nonzero handle. |
|
Set to the new channel if it is available immediately, as documented in the description of TpChannelFactoryRequestStatus |
|
Set to the error if the return is
TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR , unset otherwise
|
Returns : |
one of the values of TpChannelFactoryRequestStatus, and behaves as documented for that return value |
typedef enum { TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_IMPLEMENTED = 0, TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_AVAILABLE, TP_CHANNEL_FACTORY_REQUEST_STATUS_INVALID_HANDLE, TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR, TP_CHANNEL_FACTORY_REQUEST_STATUS_CREATED, TP_CHANNEL_FACTORY_REQUEST_STATUS_QUEUED, TP_CHANNEL_FACTORY_REQUEST_STATUS_EXISTING } TpChannelFactoryRequestStatus;
Indicates the result of a channel request.
Same as the Telepathy
error NotImplemented. The connection will try the next factory in its
list; if all return this, the overall result of the request will be
NotImplemented. *ret and *error are not set
|
|
Same as the Telepathy
error NotAvailable. *ret and *error are not set
|
|
Same as the Telepathy
error InvalidHandle. *ret and *error are not set
|
|
An error other than the above.
*ret is not set, *error is set
|
|
A new channel was created
(possibly in response to more than one request). new-channel has already
been emitted and *ret is set to the new channel.
|
|
A new channel will be created,
or was created but is not ready yet. Either new-channel or channel-error
will be emitted later. *ret and *error are not set.
|
|
An existing channel
satisfies the request: new-channel was not emitted. *ret is set to the
existing channel.
|
typedef struct _TpChannelFactoryIface TpChannelFactoryIface;
Opaque typedef representing any channel factory implementation.
typedef struct { GTypeInterface parent_class; TpChannelFactoryIfaceProc close_all; TpChannelFactoryIfaceProc connecting; TpChannelFactoryIfaceProc connected; TpChannelFactoryIfaceProc disconnected; TpChannelFactoryIfaceForeachImpl foreach; TpChannelFactoryIfaceRequestImpl request; } TpChannelFactoryIfaceClass;
The class structure and vtable for a channel factory implementation.
GTypeInterface |
Fields shared with GTypeInterface |
TpChannelFactoryIfaceProc |
Close all channels and shut down the channel factory. It is not
expected to be usable afterwards. This is called when the connection goes
to disconnected state, before emitting the StatusChanged signal or calling
disconnected() . Must be filled in by implementations.
|
TpChannelFactoryIfaceProc |
Called just after the connection goes from disconnected to connecting state. May be NULL if nothing special needs to happen. |
TpChannelFactoryIfaceProc |
Called just after the connection goes from connecting to connected state. May be NULL if nothing special needs to happen. |
TpChannelFactoryIfaceProc |
Called just after the connection goes to disconnected state.
This is always called after close_all() . May be NULL if nothing special
needs to happen.
|
TpChannelFactoryIfaceForeachImpl |
Call func(channel, data) for each channel managed by this factory. Must be filled in by implementations. |
TpChannelFactoryIfaceRequestImpl |
Respond to a request for a channel. Must be filled in by implementations. See TpChannelFactoryIfaceRequestImpl for details. |
void tp_channel_factory_iface_close_all (TpChannelFactoryIface *self
);
Close all channels and shut down the channel factory. It is not expected
to be usable afterwards. This is called when the connection goes to
disconnected state, before either emitting the StatusChanged signal or
calling disconnected()
.
|
An object implementing TpChannelFactoryIface |
void tp_channel_factory_iface_connecting (TpChannelFactoryIface *self
);
Indicate that the connection has gone from disconnected to connecting state.
|
An implementation of the channel factory interface |
void tp_channel_factory_iface_connected (TpChannelFactoryIface *self
);
Indicate that the connection has gone from connecting to connected state.
|
An implementation of the channel factory interface |
void tp_channel_factory_iface_disconnected
(TpChannelFactoryIface *self
);
Indicate that the connection has become disconnected.
|
An implementation of the channel factory interface |
void tp_channel_factory_iface_foreach (TpChannelFactoryIface *self
,TpChannelFunc func
,gpointer data
);
Call func(channel, data) for each channel managed by this factory.
|
An implementation of the channel factory interface |
|
A callback to be called once per channel |
|
Extra data to be passed to func
|
TpChannelFactoryRequestStatus tp_channel_factory_iface_request (TpChannelFactoryIface *self
,const gchar *chan_type
,TpHandleType handle_type
,guint handle
,gpointer request
,TpChannelIface **ret
,GError **error
);
Request a channel.
|
An object implementing TpChannelFactoryIface |
|
The channel type, e.g. TP_IFACE_CHANNEL_TYPE_TEXT
|
|
The handle type of the channel's associated handle, or 0 if the channel has no associated handle |
|
The channel's associated handle, of type handle_type ,
or 0 if the channel has no associated handle
|
|
An opaque data structure representing the channel request; if this request is satisfied by a newly created channel, this structure MUST be included in the new-channel signal if the newly created channel has handle 0, and MAY be included in the signal if the newly created channel has nonzero handle. |
|
Set to the new channel if it is available immediately, as documented in the description of TpChannelFactoryRequestStatus |
|
Set to the error if the return is
TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR , unset otherwise
|
Returns : |
one of the values of TpChannelFactoryRequestStatus, and behaves as documented for that return value |
void tp_channel_factory_iface_emit_new_channel (gpointer instance
,TpChannelIface *channel
,gpointer request
);
Signal that a new channel has been created (new-channel signal).
If the channel was created in response to a channel request, the request
was for a nonzero handle type, and the channel has zero handle type,
request will be the request context passed to
tp_channel_factory_iface_request()
.
Otherwise, request may either be
NULL
or a request that led to the channel's creation; callers are expected
to determine which channels satisfy which requests based on the handle
and handle-type.
|
An object implementing TpChannelFactoryIface |
|
The new channel |
|
A request context as passed to tp_channel_factory_iface_request() ,
or NULL
|
void tp_channel_factory_iface_emit_channel_error (gpointer instance
,TpChannelIface *channel
,GError *error
,gpointer request
);
Signal that a new channel was created, but an error occurred before it could become useful.
request is as for tp_channel_factory_iface_emit_new_channel()
.
|
An object implementing TpChannelFactoryIface |
|
The new channel |
|
The error that made the channel request fail |
|
A request context as passed to tp_channel_factory_iface_request() ,
or NULL
|
"channel-error"
signalvoid user_function (TpChannelFactoryIface *self, GObject *channel, gpointer error, gpointer request_context, gpointer user_data) : Run Last / Has Details
Emitted when a new channel has been created, but an error occurred before it could become useful.
request
is the same as for "new-channel".
|
an object implementing TpChannelFactoryIface |
|
an object implementing TpChannelIface |
|
the GError that made the channel request fail |
|
a request context as passed to
tp_channel_factory_iface_request() , or NULL
|
|
user data set when the signal handler was connected. |
"new-channel"
signalvoid user_function (TpChannelFactoryIface *self, GObject *channel, gpointer request_context, gpointer user_data) : Run Last / Has Details
Emitted when a new channel has been created.
If the channel
was created in response to a channel request, the
request was for a nonzero handle type, and the channel has zero handle
type, request_context
will be the request context passed to
tp_channel_factory_iface_request()
.
Otherwise, request may either be NULL
or a request that led to
channel
's creation; callers are expected to determine which channels
satisfy which requests based on the handle and handle-type.
|
an object implementing TpChannelFactoryIface |
|
a new channel (an object implementing TpChannelIface) |
|
a request context as passed to
tp_channel_factory_iface_request() , or NULL
|
|
user data set when the signal handler was connected. |