## GalViewCollection

GalViewCollection

## Synopsis

    struct              GalViewCollectionItem;
    struct              GalViewCollection;
    GalViewCollection * gal_view_collection_new             (void);
    void                gal_view_collection_set_title       (GalViewCollection *collection,
                                                             const gchar *title);
    void                gal_view_collection_set_storage_directories
                                                            (GalViewCollection *collection,
                                                             const gchar *system_dir,
                                                             const gchar *local_dir);
    void                gal_view_collection_add_factory     (GalViewCollection *collection,
                                                             GalViewFactory *factory);
    void                gal_view_collection_display_view    (GalViewCollection *collection,
                                                             GalView *view);
    gint                gal_view_collection_get_count       (GalViewCollection *collection);
    GalView *           gal_view_collection_get_view        (GalViewCollection *collection,
                                                             gint n);
    GalViewCollectionItem * gal_view_collection_get_view_item
                                                            (GalViewCollection *collection,
                                                             gint n);
    gint                gal_view_collection_get_view_index_by_id
                                                            (GalViewCollection *collection,
                                                             const gchar *view_id);
    gchar *             gal_view_collection_get_view_id_by_index
                                                            (GalViewCollection *collection,
                                                             gint n);
    void                gal_view_collection_append          (GalViewCollection *collection,
                                                             GalView *view);
    void                gal_view_collection_delete_view     (GalViewCollection *collection,
                                                             gint i);
    void                gal_view_collection_copy_view       (GalViewCollection *collection,
                                                             gint i);
    void                gal_view_collection_load            (GalViewCollection *collection);
    void                gal_view_collection_save            (GalViewCollection *collection);
    gboolean            gal_view_collection_loaded          (GalViewCollection *collection);
    GalView *           gal_view_collection_load_view_from_file
                                                            (GalViewCollection *collection,
                                                             const gchar *type,
                                                             const gchar *filename);
    const gchar *       gal_view_collection_append_with_title
                                                            (GalViewCollection *collection,
                                                             const gchar *title,
                                                             GalView *view);
    const gchar *       gal_view_collection_set_nth_view    (GalViewCollection *collection,
                                                             gint i,
                                                             GalView *view);
    const gchar *       gal_view_collection_get_default_view
                                                            (GalViewCollection *collection);
    void                gal_view_collection_set_default_view
                                                            (GalViewCollection *collection,
                                                             const gchar *id);

## Object Hierarchy

      GObject
       +----GalViewCollection

## Signals

      "changed"                                        : Run Last
      "display-view"                                   : Run Last

## Description

## Details

### struct GalViewCollectionItem

    struct GalViewCollectionItem {
    	GalView *view;
    	gchar *id;
    	guint changed : 1;
    	guint ever_changed : 1;
    	guint built_in : 1;
    	gchar *filename;
    	gchar *title;
    	gchar *type;
    	GalViewCollection *collection;
    	guint view_changed_id;
    };

### struct GalViewCollection

    struct GalViewCollection;

### gal_view_collection_new ()

    GalViewCollection * gal_view_collection_new             (void);

A collection of views and view factories.

### gal_view_collection_set_title ()

    void                gal_view_collection_set_title       (GalViewCollection *collection,
                                                             const gchar *title);

### gal_view_collection_set_storage_directories ()

    void                gal_view_collection_set_storage_directories
                                                            (GalViewCollection *collection,
                                                             const gchar *system_dir,
                                                             const gchar *local_dir);

Sets up the GalViewCollection.

`collection` : | The view collection to initialize
`system_dir` : | The location of the system built in views
`local_dir` : | The location to store the users set up views

### gal_view_collection_add_factory ()

    void                gal_view_collection_add_factory     (GalViewCollection *collection,
                                                             GalViewFactory *factory);

Adds the given factory to this collection. This list is used both when loading views from their xml description as well as when the user tries to create a new view.

`collection` : | The view collection to add a factory to
`factory` : | The factory to add. The `collection` will add a reference to the factory object, so you should unref it after calling this function if you no longer need it.

### gal_view_collection_display_view ()

    void                gal_view_collection_display_view    (GalViewCollection *collection,
                                                             GalView *view);

`collection` : | The GalViewCollection to send the signal on.
`view` : | The view to display.

### gal_view_collection_get_count ()

    gint                gal_view_collection_get_count       (GalViewCollection *collection);

Calculates the number of views in the given collection.

`collection` : | The view collection to count
Returns : | The number of views in the collection.

### gal_view_collection_get_view ()

    GalView *           gal_view_collection_get_view        (GalViewCollection *collection,
                                                             gint n);

`collection` : | The view collection to query
`n` : | The view to get.
Returns : | The nth view in the collection

### gal_view_collection_get_view_item ()

    GalViewCollectionItem * gal_view_collection_get_view_item
                                                            (GalViewCollection *collection,
                                                             gint n);

`collection` : | The view collection to query
`n` : | The view item to get.
Returns : | The nth view item in the collection

### gal_view_collection_get_view_index_by_id ()

    gint                gal_view_collection_get_view_index_by_id
                                                            (GalViewCollection *collection,
                                                             const gchar *view_id);

### gal_view_collection_get_view_id_by_index ()

    gchar *             gal_view_collection_get_view_id_by_index
                                                            (GalViewCollection *collection,
                                                             gint n);

### gal_view_collection_append ()

    void                gal_view_collection_append          (GalViewCollection *collection,
                                                             GalView *view);

### gal_view_collection_delete_view ()

    void                gal_view_collection_delete_view     (GalViewCollection *collection,
                                                             gint i);

### gal_view_collection_copy_view ()

    void                gal_view_collection_copy_view       (GalViewCollection *collection,
                                                             gint i);

### gal_view_collection_load ()

    void                gal_view_collection_load            (GalViewCollection *collection);

Loads the data from the system and user directories specified in set storage directories. This is primarily for internal use by other parts of gal_view.

`collection` : | The view collection to load information for

### gal_view_collection_save ()

    void                gal_view_collection_save            (GalViewCollection *collection);

Saves the data to the user directory specified in set storage directories. This is primarily for internal use by other parts of gal_view.

`collection` : | The view collection to save information for

### gal_view_collection_loaded ()

    gboolean            gal_view_collection_loaded          (GalViewCollection *collection);

### gal_view_collection_load_view_from_file ()

    GalView *           gal_view_collection_load_view_from_file
                                                            (GalViewCollection *collection,
                                                             const gchar *type,
                                                             const gchar *filename);

### gal_view_collection_append_with_title ()

    const gchar *       gal_view_collection_append_with_title
                                                            (GalViewCollection *collection,
                                                             const gchar *title,
                                                             GalView *view);

### gal_view_collection_set_nth_view ()

    const gchar *       gal_view_collection_set_nth_view    (GalViewCollection *collection,
                                                             gint i,
                                                             GalView *view);

### gal_view_collection_get_default_view ()

    const gchar *       gal_view_collection_get_default_view
                                                            (GalViewCollection *collection);

### gal_view_collection_set_default_view ()

    void                gal_view_collection_set_default_view
                                                            (GalViewCollection *collection,
                                                             const gchar *id);

## Signal Details

### The `"changed"` signal

    void                user_function                      (GalViewCollection *galviewcollection,
                                                            gpointer           user_data)              : Run Last

### The `"display-view"` signal

    void                user_function                      (GalViewCollection *galviewcollection,
                                                            GalView           *arg1,
                                                            gpointer           user_data)              : Run Last