TpDebugClient

TpDebugClient — proxy objects for Telepathy debug information

Synopsis

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

                    TpDebugClient;
                    TpDebugClientClass;
TpProxyPendingCall * tp_cli_debug_call_get_messages     (TpDebugClient *proxy,
                                                         gint timeout_ms,
                                                         tp_cli_debug_callback_for_get_messages callback,
                                                         gpointer user_data,
                                                         GDestroyNotify destroy,
                                                         GObject *weak_object);
void                (*tp_cli_debug_callback_for_get_messages)
                                                        (TpDebugClient *proxy,
                                                         const GPtrArray *out_Messages,
                                                         const GError *error,
                                                         gpointer user_data,
                                                         GObject *weak_object);
TpProxySignalConnection * tp_cli_debug_connect_to_new_debug_message
                                                        (TpDebugClient *proxy,
                                                         tp_cli_debug_signal_callback_new_debug_message callback,
                                                         gpointer user_data,
                                                         GDestroyNotify destroy,
                                                         GObject *weak_object,
                                                         GError **error);
void                (*tp_cli_debug_signal_callback_new_debug_message)
                                                        (TpDebugClient *proxy,
                                                         gdouble arg_time,
                                                         const gchar *arg_domain,
                                                         guint arg_level,
                                                         const gchar *arg_message,
                                                         gpointer user_data,
                                                         GObject *weak_object);
void                tp_debug_client_init_known_interfaces
                                                        (void);
TpDebugClient *     tp_debug_client_new                 (TpDBusDaemon *dbus,
                                                         const gchar *unique_name,
                                                         GError **error);
void                tp_debug_client_set_enabled_async   (TpDebugClient *self,
                                                         gboolean enabled,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            tp_debug_client_set_enabled_finish  (TpDebugClient *self,
                                                         GAsyncResult *result,
                                                         GError **error);
gboolean            tp_debug_client_is_enabled          (TpDebugClient *self);

Object Hierarchy

  GObject
   +----TpProxy
         +----TpDebugClient

Properties

  "enabled"                  gboolean              : Read

Signals

  "new-debug-message"                              : Run Last

Description

This module provides access to the auxiliary objects used to implement TpSvcDebug.

Details

TpDebugClient

typedef struct _TpDebugClient TpDebugClient;

A proxy object for the debug interface of a Telepathy component.

Since 0.19.0


TpDebugClientClass

typedef struct _TpDebugClientClass TpDebugClientClass;

The class of a TpDebugClient.

Since 0.19.0


tp_cli_debug_call_get_messages ()

TpProxyPendingCall * tp_cli_debug_call_get_messages     (TpDebugClient *proxy,
                                                         gint timeout_ms,
                                                         tp_cli_debug_callback_for_get_messages callback,
                                                         gpointer user_data,
                                                         GDestroyNotify destroy,
                                                         GObject *weak_object);

Start a GetMessages method call.

Retrieve buffered debug messages. An implementation could have a limit on how many message it keeps and so the array returned from this method should not be assumed to be all of the messages in the lifetime of the service.

proxy :

the TpProxy

timeout_ms :

the timeout in milliseconds, or -1 to use the default

callback :

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

user_data :

user-supplied data passed to the callback; must be NULL if callback is NULL

destroy :

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

weak_object :

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

Returns :

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.

tp_cli_debug_callback_for_get_messages ()

void                (*tp_cli_debug_callback_for_get_messages)
                                                        (TpDebugClient *proxy,
                                                         const GPtrArray *out_Messages,
                                                         const GError *error,
                                                         gpointer user_data,
                                                         GObject *weak_object);

Signature of the callback called when a GetMessages method call succeeds or fails.

proxy :

the proxy on which the call was made

out_Messages :

Used to return an 'out' argument if error is NULL: A list of debug messages.

error :

NULL on success, or an error on failure

user_data :

user-supplied data

weak_object :

user-supplied object

tp_cli_debug_connect_to_new_debug_message ()

TpProxySignalConnection * tp_cli_debug_connect_to_new_debug_message
                                                        (TpDebugClient *proxy,
                                                         tp_cli_debug_signal_callback_new_debug_message callback,
                                                         gpointer user_data,
                                                         GDestroyNotify destroy,
                                                         GObject *weak_object,
                                                         GError **error);

Connect a handler to the signal NewDebugMessage.

Emitted when a debug messages is generated if the <tp:member-ref>Enabled</tp:member-ref> property is set to TRUE.

proxy :

A TpDebugClient or subclass

callback :

Callback to be called when the signal is received

user_data :

User-supplied data for the callback

destroy :

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

weak_object :

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

error :

If not NULL, used to raise an error if NULL is returned

Returns :

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.

tp_cli_debug_signal_callback_new_debug_message ()

void                (*tp_cli_debug_signal_callback_new_debug_message)
                                                        (TpDebugClient *proxy,
                                                         gdouble arg_time,
                                                         const gchar *arg_domain,
                                                         guint arg_level,
                                                         const gchar *arg_message,
                                                         gpointer user_data,
                                                         GObject *weak_object);

Represents the signature of a callback for the signal NewDebugMessage.

proxy :

The proxy on which tp_cli_debug_connect_to_new_debug_message() was called

arg_time :

Timestamp of the debug message.

arg_domain :

Domain of the debug message, as described in the Debug_Message struct.

arg_level :

Level of the debug message. (TpDebugLevel)

arg_message :

The text of the debug message.

user_data :

User-supplied data

weak_object :

User-supplied weakly referenced object

tp_debug_client_init_known_interfaces ()

void                tp_debug_client_init_known_interfaces
                                                        (void);

Ensure that the known interfaces for TpDebugClient have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_DEBUG_CLIENT.

Since 0.19.0


tp_debug_client_new ()

TpDebugClient *     tp_debug_client_new                 (TpDBusDaemon *dbus,
                                                         const gchar *unique_name,
                                                         GError **error);

dbus :

a D-Bus daemon; may not be NULL

unique_name :

the unique name of the process to be debugged; may not be NULL or a well-known name

error :

used to raise an error if unique_name is not valid

Returns :

a new debug client proxy, or NULL on invalid arguments

Since 0.19.0


tp_debug_client_set_enabled_async ()

void                tp_debug_client_set_enabled_async   (TpDebugClient *self,
                                                         gboolean enabled,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Enable or disable publishing of debug messages on the bus by the component owning self's bus name.

self :

a TpDebugClient

enabled :

TRUE if debug messages should be published on the bus, FALSE otherwise

callback :

a callback to call when the request is satisfied

user_data :

data to pass to callback

Since 0.19.0


tp_debug_client_set_enabled_finish ()

gboolean            tp_debug_client_set_enabled_finish  (TpDebugClient *self,
                                                         GAsyncResult *result,
                                                         GError **error);

Finishes tp_debug_client_set_enabled_async().

self :

a TpDebugClient

result :

a GAsyncResult

error :

a GError to fill

Returns :

TRUE, if the operation suceeded, FALSE otherwise

Since 0.19.0


tp_debug_client_is_enabled ()

gboolean            tp_debug_client_is_enabled          (TpDebugClient *self);

Return the "enabled" property

self :

a TpDebugClient

Returns :

the value of "enabled" property

Since 0.19.0

Property Details

The "enabled" property

  "enabled"                  gboolean              : Read

TRUE if debug messages are published on the bus.

This property is meaningless until the TP_DEBUG_CLIENT_FEATURE_CORE feature has been prepared.

Default value: FALSE

Since 0.19.0

Signal Details

The "new-debug-message" signal

void                user_function                      (TpDebugClient  *self,
                                                        TpDebugMessage *message,
                                                        gpointer        user_data)      : Run Last

Emitted when a TpDebugMessage is generated if the TpDebugMessage:enabled property is set to TRUE.

self :

a TpDebugClient

message :

a TpDebugMessage

user_data :

user data set when the signal handler was connected.

Since 0.19.0

See Also

TpProxy