### Interface

# Gcr Collection

since: 3

#### Description [src]

    interface Gcr.Collection : GObject.Object

A `GcrCollection` is used to group a set of objects.

This is an abstract interface which can be used to determine which objects show up in a selector or other user interface element.

Use `gcr_simple_collection_new()` to create a concrete implementation of this interface which you can add objects to.

Available since: 3

#### Prerequisite

In order to implement Collection, your type must inherit from`GObject`.

#### Implementations

- GcrFilterCollection
- GcrSimpleCollection
- GcrUnionCollection

#### Instance methods

###### gcr_collection_contains

Check whether the collection contains an object or not.

since: 3

###### gcr_collection_emit_added

Emit the `GcrCollection::added` signal for the given object. This function is used by implementors of this interface.

since: 3

###### gcr_collection_emit_removed

Emit the `GcrCollection::removed` signal for the given object. This function is used by implementors of this interface.

since: 3

###### gcr_collection_get_length

Get the number of objects in this collection.

since: 3

###### gcr_collection_get_objects

Get a list of the objects in this collection.

since: 3

#### Signals

###### Gcr.Collection::added

This signal is emitted when an object is added to the collection.

since: 3

###### Gcr.Collection::removed

This signal is emitted when an object is removed from the collection.

since: 3

#### Interface structure

    struct GcrCollectionIface {
      GTypeInterface parent;
      void (* added) (
        GcrCollection* self,
        GObject* object
      );
      void (* removed) (
        GcrCollection* self,
        GObject* object
      );
      guint (* get_length) (
        GcrCollection* self
      );
      GList* (* get_objects) (
        GcrCollection* self
      );
      gboolean (* contains) (
        GcrCollection* self,
        GObject* object
      );

    }

No description available.

###### Interface members

`parent`

    GTypeInterface

| No description available.

`added`

    void (* added) (
        GcrCollection* self,
        GObject* object
      )

| No description available.

`removed`

    void (* removed) (
        GcrCollection* self,
        GObject* object
      )

| No description available.

`get_length`

    guint (* get_length) (
        GcrCollection* self
      )

| No description available.

`get_objects`

    GList* (* get_objects) (
        GcrCollection* self
      )

| No description available.

`contains`

    gboolean (* contains) (
        GcrCollection* self,
        GObject* object
      )

| No description available.

#### Virtual methods

###### Gcr.Collection.added

No description available.

since: 3

###### Gcr.Collection.contains

Check whether the collection contains an object or not.

since: 3

###### Gcr.Collection.get_length

Get the number of objects in this collection.

since: 3

###### Gcr.Collection.get_objects

Get a list of the objects in this collection.

since: 3

###### Gcr.Collection.removed

No description available.

since: 3