WockyPepService

WockyPepService — Object to represent a single PEP service

Synopsis

#include <wocky/wocky-pep-service.h>

                    WockyPepService;
                    WockyPepServiceClass;
                    WockyPepServicePrivate;
WockyPepService *   wocky_pep_service_new               (const gchar *node,
                                                         gboolean subscribe);
void                wocky_pep_service_start             (WockyPepService *self,
                                                         WockySession *session);
void                wocky_pep_service_get_async         (WockyPepService *self,
                                                         WockyBareContact *contact,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
WockyStanza *       wocky_pep_service_get_finish        (WockyPepService *self,
                                                         GAsyncResult *result,
                                                         GError **error);
WockyStanza *       wocky_pep_service_make_publish_stanza
                                                        (WockyPepService *self,
                                                         WockyNode **item);

Object Hierarchy

  GObject
   +----WockyPepService

Properties

  "node"                     gchar*                : Read / Write / Construct Only
  "subscribe"                gboolean              : Read / Write / Construct Only

Signals

  "changed"                                        : Run Last / Has Details

Description

Object to aid with looking up PEP nodes and listening for changes.

Details

WockyPepService

typedef struct _WockyPepService WockyPepService;

Object to aid with looking up PEP nodes and listening for changes.


WockyPepServiceClass

typedef struct {
} WockyPepServiceClass;

The class of a WockyPepService.


WockyPepServicePrivate

typedef struct _WockyPepServicePrivate WockyPepServicePrivate;


wocky_pep_service_new ()

WockyPepService *   wocky_pep_service_new               (const gchar *node,
                                                         gboolean subscribe);

A convenience function to create a new WockyPepService object.

node :

the namespace of the PEP node

subscribe :

TRUE if Wocky is to subscribe to the notifications of the node, otherwise FALSE

Returns :

a new WockyPepService

wocky_pep_service_start ()

void                wocky_pep_service_start             (WockyPepService *self,
                                                         WockySession *session);

Start listening to the PEP node node and signal changes by using "changed".

self :

a WockyPepService object

session :

a WockySession object

wocky_pep_service_get_async ()

void                wocky_pep_service_get_async         (WockyPepService *self,
                                                         WockyBareContact *contact,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Starts an asynchronous operation to get the PEP node, "node".

When the operation is complete, callback will be called and the function should call wocky_pep_service_get_finish().

self :

a WockyPepService object

contact :

a WockyBareContact object

cancellable :

an optional GCancellable object, or NULL

callback :

a function to call when the node is retrieved

user_data :

user data for callback

wocky_pep_service_get_finish ()

WockyStanza *       wocky_pep_service_get_finish        (WockyPepService *self,
                                                         GAsyncResult *result,
                                                         GError **error);

Finishes an asynchronous operation to get the PEP node, "node". For more details, see wocky_pep_service_get_async().

self :

a WockyPepService object

result :

a GAsyncResult

error :

a location to store a GError if an error occurs

Returns :

the WockyStanza retrieved from getting the PEP node.

wocky_pep_service_make_publish_stanza ()

WockyStanza *       wocky_pep_service_make_publish_stanza
                                                        (WockyPepService *self,
                                                         WockyNode **item);

Generates a new IQ type='set' PEP publish stanza.

self :

a WockyPepService

item :

a location to store the item WockyNode, or NULL

Returns :

a new WockyStanza PEP publish stanza; free with g_object_unref()

Property Details

The "node" property

  "node"                     gchar*                : Read / Write / Construct Only

Namespace of the PEP node.

Default value: NULL


The "subscribe" property

  "subscribe"                gboolean              : Read / Write / Construct Only

TRUE if Wocky is to subscribe to the notifications of the node.

Default value: FALSE

Signal Details

The "changed" signal

void                user_function                      (WockyPepService  *self,
                                                        WockyBareContact *contact,
                                                        WockyStanza      *stanza,
                                                        gpointer          user_data)      : Run Last / Has Details

Emitted when the node value changes.

self :

a WockyPepService object

contact :

the WockyBareContact who changed the node

stanza :

the WockyStanza

user_data :

user data set when the signal handler was connected.