TpBaseCallStream

TpBaseCallStream — base class for TpSvcCallStream implementations

Synopsis

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

                    TpBaseCallStream;
struct              TpBaseCallStreamClass;
GPtrArray *         (*TpBaseCallStreamGetInterfacesFunc)
                                                        (TpBaseCallStream *self);
gboolean            (*TpBaseCallStreamRequestReceivingFunc)
                                                        (TpBaseCallStream *self,
                                                         TpHandle contact,
                                                         gboolean receive,
                                                         GError **error);
gboolean            (*TpBaseCallStreamSetSendingFunc)   (TpBaseCallStream *self,
                                                         gboolean sending,
                                                         GError **error);
TpBaseConnection *  tp_base_call_stream_get_connection  (TpBaseCallStream *self);
const gchar *       tp_base_call_stream_get_object_path (TpBaseCallStream *self);
TpSendingState      tp_base_call_stream_get_local_sending_state
                                                        (TpBaseCallStream *self);
gboolean            tp_base_call_stream_update_local_sending_state
                                                        (TpBaseCallStream *self,
                                                         TpSendingState new_state,
                                                         TpHandle actor_handle,
                                                         TpCallStateChangeReason reason,
                                                         const gchar *dbus_reason,
                                                         const gchar *message);
TpSendingState      tp_base_call_stream_get_remote_sending_state
                                                        (TpBaseCallStream *self,
                                                         TpHandle contact);
gboolean            tp_base_call_stream_update_remote_sending_state
                                                        (TpBaseCallStream *self,
                                                         TpHandle contact,
                                                         TpSendingState new_state,
                                                         TpHandle actor_handle,
                                                         TpCallStateChangeReason reason,
                                                         const gchar *dbus_reason,
                                                         const gchar *message);
gboolean            tp_base_call_stream_remove_member   (TpBaseCallStream *self,
                                                         TpHandle contact,
                                                         TpHandle actor_handle,
                                                         TpCallStateChangeReason reason,
                                                         const gchar *dbus_reason,
                                                         const gchar *message);

Object Hierarchy

  GObject
   +----TpBaseCallStream
         +----TpBaseMediaCallStream

Implemented Interfaces

TpBaseCallStream implements TpSvcDBusProperties and TpSvcCallStream.

Properties

  "can-request-receiving"    gboolean              : Read
  "channel"                  TpBaseCallChannel*    : Read
  "connection"               TpBaseConnection*     : Read / Write / Construct Only
  "content"                  TpBaseCallContent*    : Read / Write / Construct Only
  "interfaces"               GStrv                 : Read
  "local-sending-state"      guint                 : Read / Write / Construct Only
  "object-path"              gchar*                : Read / Write / Construct Only
  "remote-member-identifiers" GHashTable_guint+gchararray_*  : Read
  "remote-members"           GHashTable_guint+guint_*  : Read

Description

This base class makes it easier to write TpSvcCallStream implementations by implementing its properties, and some of its methods.

Subclasses should fill in TpBaseCallStreamClass.get_interfaces, TpBaseCallStreamClass.request_receiving and TpBaseCallStreamClass.set_sending virtual function.

Details

TpBaseCallStream

typedef struct _TpBaseCallStream TpBaseCallStream;

A base class for call stream implementations

Since 0.17.5


struct TpBaseCallStreamClass

struct TpBaseCallStreamClass {
  TpBaseCallStreamRequestReceivingFunc request_receiving;
  TpBaseCallStreamSetSendingFunc set_sending;
  TpBaseCallStreamGetInterfacesFunc get_interfaces;
};

The class structure for TpBaseCallStream

TpBaseCallStreamRequestReceivingFunc request_receiving;

optional (see "can-request-receiving"); virtual method called when user requested receiving from the given remote contact.

TpBaseCallStreamSetSendingFunc set_sending;

mandatory; virtual method called when user requested to start/stop sending to remote contacts.

TpBaseCallStreamGetInterfacesFunc get_interfaces;

extra interfaces provided by this stream (this SHOULD NOT include TP_IFACE_CALL_STREAM itself). Implementation must first chainup on parent class implementation then add extra interfaces into the GPtrArray.

Since 0.17.5


TpBaseCallStreamGetInterfacesFunc ()

GPtrArray *         (*TpBaseCallStreamGetInterfacesFunc)
                                                        (TpBaseCallStream *self);

Signature of an implementation of TpBaseCallStreamClass.get_interfaces.

self :

a TpBaseCallStream

Returns :

a GPtrArray containing static strings.

Since 0.17.5


TpBaseCallStreamRequestReceivingFunc ()

gboolean            (*TpBaseCallStreamRequestReceivingFunc)
                                                        (TpBaseCallStream *self,
                                                         TpHandle contact,
                                                         gboolean receive,
                                                         GError **error);

Signature of an implementation of TpBaseCallStreamClass.request_receiving.

self :

a TpBaseCallStream

contact :

the contact from who user wants to start or stop receiving

receive :

wheter or not user would like to be receiving

error :

a GError to fill

Returns :

TRUE on success, FALSE otherwise.

Since 0.17.5


TpBaseCallStreamSetSendingFunc ()

gboolean            (*TpBaseCallStreamSetSendingFunc)   (TpBaseCallStream *self,
                                                         gboolean sending,
                                                         GError **error);

Signature of an implementation of TpBaseCallStreamClass.set_sending.

self :

a TpBaseCallStream

sending :

whether or not user would like to be sending

error :

a GError to fill

Returns :

TRUE on success, FALSE otherwise.

Since 0.17.5


tp_base_call_stream_get_connection ()

TpBaseConnection *  tp_base_call_stream_get_connection  (TpBaseCallStream *self);

self :

a TpBaseCallStream

Returns :

the value of "connection"

Since 0.17.5


tp_base_call_stream_get_object_path ()

const gchar *       tp_base_call_stream_get_object_path (TpBaseCallStream *self);

self :

a TpBaseCallStream

Returns :

the value of "object-path"

Since 0.17.5


tp_base_call_stream_get_local_sending_state ()

TpSendingState      tp_base_call_stream_get_local_sending_state
                                                        (TpBaseCallStream *self);

self :

a TpBaseCallStream

Returns :

the value of "local-sending-state"

Since 0.17.5


tp_base_call_stream_update_local_sending_state ()

gboolean            tp_base_call_stream_update_local_sending_state
                                                        (TpBaseCallStream *self,
                                                         TpSendingState new_state,
                                                         TpHandle actor_handle,
                                                         TpCallStateChangeReason reason,
                                                         const gchar *dbus_reason,
                                                         const gchar *message);

Update the local sending state, emitting LocalSendingStateChanged DBus signal if needed.

self :

a TpBaseCallStream

new_state :

the new local TpSendingState

actor_handle :

the contact responsible for the change, or 0 if no contact was responsible.

reason :

the TpCallStateChangeReason of the change

dbus_reason :

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

message :

an optional debug message, to expediate debugging the potentially many processes involved in a call.

Returns :

TRUE if state was updated, FALSE if it was already set to new_state.

Since 0.17.5


tp_base_call_stream_get_remote_sending_state ()

TpSendingState      tp_base_call_stream_get_remote_sending_state
                                                        (TpBaseCallStream *self,
                                                         TpHandle contact);

self :

a TpBaseCallStream

contact :

the TpHandle of a member contact

Returns :

the TpSendingState of contact.

Since 0.17.5


tp_base_call_stream_update_remote_sending_state ()

gboolean            tp_base_call_stream_update_remote_sending_state
                                                        (TpBaseCallStream *self,
                                                         TpHandle contact,
                                                         TpSendingState new_state,
                                                         TpHandle actor_handle,
                                                         TpCallStateChangeReason reason,
                                                         const gchar *dbus_reason,
                                                         const gchar *message);

If contact is not member, add it. Otherwise update its sending state. Emits RemoteMemberChanged DBus signal if needed.

self :

a TpBaseCallStream

contact :

the TpHandle to update or add to members

new_state :

the new sending state of contact

actor_handle :

the contact responsible for the change, or 0 if no contact was responsible.

reason :

the TpCallStateChangeReason of the change

dbus_reason :

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

message :

an optional debug message, to expediate debugging the potentially many processes involved in a call.

Returns :

TRUE if state was updated, FALSE if it was already set to new_state.

Since 0.17.5


tp_base_call_stream_remove_member ()

gboolean            tp_base_call_stream_remove_member   (TpBaseCallStream *self,
                                                         TpHandle contact,
                                                         TpHandle actor_handle,
                                                         TpCallStateChangeReason reason,
                                                         const gchar *dbus_reason,
                                                         const gchar *message);

Remove contact from stream members, emitting RemoteMembersChanged DBus signal if needed. Do nothing if contact is not member.

self :

a TpBaseCallStream

contact :

the TpHandle to remove from members

actor_handle :

the contact responsible for the change, or 0 if no contact was responsible.

reason :

the TpCallStateChangeReason of the change

dbus_reason :

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

message :

an optional debug message, to expediate debugging the potentially many processes involved in a call.

Returns :

TRUE if contact was removed, FALSE if it was not member.

Since 0.17.5

Property Details

The "can-request-receiving" property

  "can-request-receiving"    gboolean              : Read

Whether or not user can request receiving from remote contact using the RequestSending DBus method call. The value is determined by whether or not TpBaseCallStreamClass.request_receiving is implemented.

Default value: FALSE

Since 0.17.5


The "channel" property

  "channel"                  TpBaseCallChannel*    : Read

TpBaseChannel object that owns this call stream.

Since 0.17.5


The "connection" property

  "connection"               TpBaseConnection*     : Read / Write / Construct Only

TpBaseConnection object that owns this call stream.

Since 0.17.5


The "content" property

  "content"                  TpBaseCallContent*    : Read / Write / Construct Only

TpBaseCallContent object that owns this call stream.

Since 0.17.6


The "interfaces" property

  "interfaces"               GStrv                 : Read

Additional interfaces implemented by this stream.

Since 0.17.5


The "local-sending-state" property

  "local-sending-state"      guint                 : Read / Write / Construct Only

The local TpSendingState.

Allowed values: <= 4

Default value: 0

Since 0.17.5


The "object-path" property

  "object-path"              gchar*                : Read / Write / Construct Only

The D-Bus object path used for this object on the bus.

Default value: NULL

Since 0.17.5


The "remote-member-identifiers" property

  "remote-member-identifiers" GHashTable_guint+gchararray_*  : Read

GHashTable mapping contact TpHandle to their identifies.

Since 0.17.5


The "remote-members" property

  "remote-members"           GHashTable_guint+guint_*  : Read

GHashTable mapping contact TpHandle to their TpSendingState.

Since 0.17.5

See Also

TpSvcCallStream, TpBaseCallChannel and TpBaseCallContent