Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::G::SignalProxy< ObjectType, SignalType > Class Template Reference

A proxy object for manipulating a protected signal (connection, mostly). More...

`#include <xfc/glib/signals.hh>`

List of all members.

## Public Types

- typedef SignalType::SlotType SlotType
    The slot signature for slots connecting to the specified SignalType.

## Public Member Functions

- SignalProxy (ObjectType *object, const SignalType *signal, const char *detail=0)
    Constructs a new signal proxy object.
- sigc::connection connect (const SlotType &slot, bool after=false) const
    Connect a slot to the signal.
- template<typename MethodObjectType, typename MethodType> sigc::connection connect (MethodObjectType *object, MethodType method, bool after=false) const
    Connect a class method to the signal.
- template<typename FunctionType> sigc::connection connect (FunctionType function, bool after=false) const
    Connect a free function to the signal.

## Detailed Description

### template<typename ObjectType, typename SignalType>
class Xfc::G::SignalProxy< ObjectType, SignalType >

A proxy object for manipulating a protected signal (connection, mostly).

SignalProxy is used to access the connection method of a protected signal.

## Constructor & Destructor Documentation

template<typename ObjectType, typename SignalType>
Xfc::G::SignalProxy< ObjectType, SignalType >::SignalProxy | ( | ObjectType * | object,
|  | const SignalType * | signal,
|  | const char * | detail = `0`
| ) | `[inline]`

Constructs a new signal proxy object.

Parameters:

  | object | An object that contains SignalType.
  | signal | The signal object, usually a protected static member of a class.
  | detail | The detail string to append to the signal name.

The detail is set as a filter on one of the following signals: G::Object::notify_signal, Gtk::AccelMap::changed_signal and Gtk::Widget::child_notify_signal. As a result, the signal name at connection time becomes 'name::detail' instead of 'name'. Specifying a detail on a signal, such as a property name for the G::Object::notify_signal, is a way of filtering out unwanted signal emissions on these frequently emitted signals.

## Member Function Documentation

template<typename ObjectType, typename SignalType>
template<typename FunctionType>
sigc::connection Xfc::G::SignalProxy< ObjectType, SignalType >::connect | ( | FunctionType | function,
|  | bool | after = `false`
| ) | const`[inline]`

Connect a free function to the signal.

Parameters:

  | function | The free function to connect to this signal.
  | after | Set true to call the user-defined slot after the signal, or false to let the signal's default behavior preside.

Returns:
  A sigc::connection object.

This is a convenience method that creates the sigc::slot for you. All you need to do is pass a pointer to the function, just as you would when creating a slot. The returned connection object can be used to control the signal connection, either by calling block(), unblock() or disconnect(). You don't need to call discconnect() unless you have good reason to. GTK+ signals are automatically disconnected when an object gets destroyed.

template<typename ObjectType, typename SignalType>
template<typename MethodObjectType, typename MethodType>
sigc::connection Xfc::G::SignalProxy< ObjectType, SignalType >::connect | ( | MethodObjectType * | object,
|  | MethodType | method,
|  | bool | after = `false`
| ) | const`[inline]`

Connect a class method to the signal.

Parameters:

  | object | A pointer to the object that has MethodType as a member.
  | method | The class method in object to connect to this signal.
  | after | Set true to call the user-defined metho after the signal, or false to let the signal's default behavior preside.

Returns:
  A sigc::connection object.

This is a convenience method that creates the sigc::slot for you. All you need to do is pass this function is a pointer to the object and the object method, just as you would when creating a slot. The returned connection object can be used to control the signal connection, either by calling block(), unblock() or disconnect(). You don't need to call discconnect() unless you have good reason to. GTK+ signals are automatically disconnected when an object gets destroyed.

template<typename ObjectType, typename SignalType>
sigc::connection Xfc::G::SignalProxy< ObjectType, SignalType >::connect | ( | const SlotType & | slot,
|  | bool | after = `false`
| ) | const`[inline]`

Connect a slot to the signal.

Parameters:

  | slot | The sigc::slot object to connect to SignalType.
  | after | Set true to call the user-defined slot after the signal, or false to let the signal's default behavior preside.

Returns:
  A sigc::connection object.

The connection object can be used to control the signal connection, either by calling block(), unblock() or disconnect(). You don't need to call discconnect() unless you have good reason to. GTK+ signals are automatically disconnected when an object gets destroyed.

The documentation for this class was generated from the following file:

- signals.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3