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

# Xfc::Atk::Relation Class Reference

An AtkRelation C++ wrapper class. More...

`#include <xfc/atk/relation.hh>`

Inheritance diagram for Xfc::Atk::Relation:

List of all members.

## Public Member Functions

Constructors

- Relation (const std::vector< Atk::Object * > &targets, RelationType relationship)
    Constructs a new relation for the specified relationship and the specified list of targets.
- virtual ~Relation ()
    Destructor.

Accessors

- AtkRelation * atk_relation () const
    Get a pointer to the AtkRelation structure.
- operator AtkRelation * () const
    Conversion operator; safely converts a Relation to an AtkRelation pointer.
- RelationType get_relation_type () const
    Gets the type of the relation.
- bool get_target (std::vector< Atk::Object * > &targets) const
    Gets the target list of the relation.

Methods

- void add_target (Atk::Object &target)
    Adds the specified Atk::Object to the target for the relation, if it is not already present.

## Protected Member Functions

Constructors

- Relation (AtkRelation *relation, bool owns_reference=true)
    Construct a new Relation from an existing AtkRelation.

## Detailed Description

An AtkRelation C++ wrapper class.

A Relation describes a relation between an object and one or more other objects. The actual relations that an object has with other objects are defined as a RelationSet, which is a set of Relations.

Note: dynamically allocated objects must either be unreferenced or assigned to a smart pointer. Stack objects are automatically unreferenced when they go out of scope.

## Constructor & Destructor Documentation

Xfc::Atk::Relation::Relation | ( | AtkRelation * | relation,
|  | bool | owns_reference = `true`
| ) | `[explicit, protected]`

  | Construct a new Relation from an existing AtkRelation. Parameters:
  | relation | A pointer to a AtkRelation.
  | owns_reference | Set false if the initial reference count is floating, set true if it's not.
The relation can be a newly created AtkRelation or an existing AtkRelation. (see G::Object::Object).

Xfc::Atk::Relation::Relation | ( | const std::vector< Atk::Object * > & | targets,
|  | RelationType | relationship
| ) |

  | Constructs a new relation for the specified relationship and the specified list of targets. Parameters:
  | targets | A reference to a vector of Atk::Object* that lists the target objects.
  | relationship | A RelationType with which to create the new Relation.
A Relation object is created with a reference count of 1 that the caller owns.

## Member Function Documentation

void Xfc::Atk::Relation::add_target | ( | Atk::Object & | target | ) |

  | Adds the specified Atk::Object to the target for the relation, if it is not already present. Parameters:
  | target | An Atk::Object.

RelationType Xfc::Atk::Relation::get_relation_type | ( |  | ) | const

| Gets the type of the relation. Returns: The type of the relation.

bool Xfc::Atk::Relation::get_target | ( | std::vector< Atk::Object * > & | targets | ) | const

  | Gets the target list of the relation. Parameters:
  | targets | A reference to a vector of Atk::Object* to hold the target list.
Returns: true if the vector is not empty.

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

- relation.hh

Xfce Foundation Classes

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