TplObserver

## TplObserver TplObserver — TPL Observer main class, used to handle received signals |

## Synopsis

    #define             TPL_OBSERVER_WELL_KNOWN_BUS_NAME
    #define             TPL_OBSERVER_OBJECT_PATH
                        TplObserverPriv;
    TplObserver *       tpl_observer_new                    (void);
    gboolean            tpl_observer_register_channel       (TplObserver *self,
                                                             TplChannel *channel);
    gboolean            tpl_observer_unregister_channel     (TplObserver *self,
                                                             TplChannel *channel);
    gboolean            tpl_observer_register_dbus          (TplObserver *self,
                                                             GError **error);
    void                tpl_observer_set_channel_factory    (TplObserver *self,
                                                             TplChannelFactory factory);

## Description

The Telepathy Logger's Observer implements org.freedesktop.Telepathy.Client.Observer DBus interface and is called by the Channel Dispatcher when a new channel is created, in order to log received signals.

## Details

### TPL_OBSERVER_WELL_KNOWN_BUS_NAME

    #define             TPL_OBSERVER_WELL_KNOWN_BUS_NAME

### TPL_OBSERVER_OBJECT_PATH

    #define             TPL_OBSERVER_OBJECT_PATH

### TplObserverPriv

    typedef struct _TplObserverPriv TplObserverPriv;

### tpl_observer_new ()

    TplObserver *       tpl_observer_new                    (void);

Returns : |

### tpl_observer_register_channel ()

    gboolean            tpl_observer_register_channel       (TplObserver *self,
                                                             TplChannel *channel);

`self` : |
`channel` : |
Returns : |

### tpl_observer_unregister_channel ()

    gboolean            tpl_observer_unregister_channel     (TplObserver *self,
                                                             TplChannel *channel);

Un-registers a TplChannel subclass instance, i.e. TplChannelText instance, as TplChannel instance. It is supposed to be called when the Closed signal for a channel is emitted or when an un-recoverable error during the life or a TplChannel happens.

Every time that a channel is registered or unregistered, a notification is sent for the 'registered-channels' property.

`self` : | TplObserver instance, cannot be `NULL`.
`channel` : | a TplChannel cast of a TplChannel subclass instance
Returns : | `TRUE` if `channel` is registered and can thus be un-registered or `FALSE` if the `channel` is not currently among registered channels and thus cannot be un-registered.

### tpl_observer_register_dbus ()

    gboolean            tpl_observer_register_dbus          (TplObserver *self,
                                                             GError **error);

Registers the object using TPL_OBSERVER_WELL_KNOWN_BUS_NAME well known name.

`self` : | TplObserver instance, cannot be `NULL`.
`error` : | Used to raise an error if DBus registration fails
Returns : | `TRUE` if the registration is successful, `FALSE` with `error` set if it fails.

### tpl_observer_set_channel_factory ()

    void                tpl_observer_set_channel_factory    (TplObserver *self,
                                                             TplChannelFactory factory);

`self` : |
`factory` : |

## See Also

#TpSvcClientObserver