RBPropertyView

## RBPropertyView RBPropertyView — a GtkTreeView backed by a RhythmDBPropertyModel |

## Synopsis

    struct              RBPropertyView;
    struct              RBPropertyViewClass;
    RBPropertyView *    rb_property_view_new                (RhythmDB *db,
                                                             guint propid,
                                                             const char *title);
    void                rb_property_view_append_column_custom
                                                            (RBPropertyView *view,
                                                             GtkTreeViewColumn *column);
    void                rb_property_view_set_selection_mode (RBPropertyView *view,
                                                             GtkSelectionMode mode);
    void                rb_property_view_reset              (RBPropertyView *view);
    void                rb_property_view_set_selection      (RBPropertyView *view,
                                                             const GList *vals);
    GList *             rb_property_view_get_selection      (RBPropertyView *view);
    RhythmDBPropertyModel * rb_property_view_get_model      (RBPropertyView *view);
    void                rb_property_view_set_model          (RBPropertyView *view,
                                                             RhythmDBPropertyModel *model);
    guint               rb_property_view_get_num_properties (RBPropertyView *view);
    void                rb_property_view_set_search_func    (RBPropertyView *view,
                                                             GtkTreeViewSearchEqualFunc func,
                                                             gpointer func_data,
                                                             GDestroyNotify notify);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkWidget
                   +----GtkContainer
                         +----GtkBin
                               +----GtkScrolledWindow
                                     +----RBPropertyView

## Implemented Interfaces

RBPropertyView implements AtkImplementorIface and GtkBuildable.

## Properties

      "db"                       RhythmDB*             : Read / Write / Construct Only
      "draggable"                gboolean              : Read / Write / Construct Only
      "prop"                     RhythmDBPropType      : Read / Write / Construct Only
      "property-model"           RhythmDBPropertyModel*  : Read / Write
      "title"                    gchar*                : Read / Write / Construct Only

## Signals

      "properties-selected"                            : Run Last
      "property-activated"                             : Run Last
      "property-selected"                              : Run Last
      "property-selection-reset"                       : Run Last
      "show-popup"                                     : Run Last

## Description

A simple GtkTreeView that displays the contents of a RhythmDBPropertyModel. The first row in the tree view displays the total number of properties and entries, in the form "All 473 artists (6241)". Each subsequent row in the tree view displays a property value and the number of entries from the RhythmDBQueryModel with that value.

The property view itself creates a single column, but additional columns can be added.

## Details

### struct RBPropertyView

    struct RBPropertyView;

### struct RBPropertyViewClass

    struct RBPropertyViewClass {
    	GtkScrolledWindowClass parent;

    	void (*property_selected) (RBPropertyView *view, const char *name);
    	void (*properties_selected) (RBPropertyView *view, GList *properties);
    	void (*property_activated) (RBPropertyView *view, const char *name);
    	void (*selection_reset)		(RBPropertyView *view);
    	void (*show_popup)		(RBPropertyView *view);
    };

### rb_property_view_new ()

    RBPropertyView *    rb_property_view_new                (RhythmDB *db,
                                                             guint propid,
                                                             const char *title);

Creates a new RBPropertyView displaying the specified property.

`db` : | RhythmDB instance
`propid` : | property ID to be displayed in the property view
`title` : | title of the property view
Returns : | new property view instance

### rb_property_view_append_column_custom ()

    void                rb_property_view_append_column_custom
                                                            (RBPropertyView *view,
                                                             GtkTreeViewColumn *column);

Appends a custom created column to the view.

`view` : | a RBPropertyView
`column` : | a GtkTreeViewColumn to append to the view

### rb_property_view_set_selection_mode ()

    void                rb_property_view_set_selection_mode (RBPropertyView *view,
                                                             GtkSelectionMode mode);

Sets the selection mode (single or multiple) for the property view> The default selection mode is single.

`view` : | a RBPropertyView
`mode` : | the new GtkSelectionMode for the property view

### rb_property_view_reset ()

    void                rb_property_view_reset              (RBPropertyView *view);

Clears the selection in the property view.

`view` : | a RBPropertyView

### rb_property_view_set_selection ()

    void                rb_property_view_set_selection      (RBPropertyView *view,
                                                             const GList *vals);

Replaces the selection in the property view. All values in the list that are present in the view will be selected, and the view will be scrolled to show the last value selected.

`view` : | a RBPropertyView
`vals` : | the values to be selected. [element-type utf8]

### rb_property_view_get_selection ()

    GList *             rb_property_view_get_selection      (RBPropertyView *view);

Returns a GList containing the selected property values. The list must be freed by the caller.

`view` : | a RBPropertyView
Returns : | list of selected values. [element-type utf8][transfer full]

### rb_property_view_get_model ()

    RhythmDBPropertyModel * rb_property_view_get_model      (RBPropertyView *view);

Returns the RhythmDBPropertyModel backing the view; no reference is taken

`view` : | a RBPropertyView
Returns : | property model. [transfer none]

### rb_property_view_set_model ()

    void                rb_property_view_set_model          (RBPropertyView *view,
                                                             RhythmDBPropertyModel *model);

Replaces the model backing the property view.

`view` : | a RBPropertyView
`model` : | the new RhythmDBPropertyModel for the property view

### rb_property_view_get_num_properties ()

    guint               rb_property_view_get_num_properties (RBPropertyView *view);

Returns the number of property values present in the view.

`view` : | a RBPropertyView
Returns : | number of properties

### rb_property_view_set_search_func ()

    void                rb_property_view_set_search_func    (RBPropertyView *view,
                                                             GtkTreeViewSearchEqualFunc func,
                                                             gpointer func_data,
                                                             GDestroyNotify notify);

Sets the compare function for the interactive search capabilities. The function must return FALSE when the search key string matches the row it is passed.

`view` : | a RBPropertyView
`func` : | tree view search function to use for this view
`func_data` : | data to pass to the search function
`notify` : | function to call to dispose of the data

## Property Details

### The `"db"` property

      "db"                       RhythmDB*             : Read / Write / Construct Only

RhythmDB instance

### The `"draggable"` property

      "draggable"                gboolean              : Read / Write / Construct Only

Whether the property view acts as a data source for drag and drop operations.

Default value: TRUE

### The `"prop"` property

      "prop"                     RhythmDBPropType      : Read / Write / Construct Only

The property that is displayed in this view

Default value: RHYTHMDB_PROP_TYPE

### The `"property-model"` property

      "property-model"           RhythmDBPropertyModel*  : Read / Write

The RhythmDBPropertyModel backing the view.

### The `"title"` property

      "title"                    gchar*                : Read / Write / Construct Only

The title displayed in the header of the property view

Default value: ""

## Signal Details

### The `"properties-selected"` signal

    void                user_function                      (RBPropertyView *view,
                                                            gpointer        properties,
                                                            gpointer        user_data)       : Run Last

Emitted when the set of selected property values changes. This is only emitted for multiple selection property views. For single-selection views, use the property-selected signal.

`view` : | the RBPropertyView
`properties` : | a list containing the selected property values. [element-type utf8]
`user_data` : | user data set when the signal handler was connected.

### The `"property-activated"` signal

    void                user_function                      (RBPropertyView *view,
                                                            gchar          *name,
                                                            gpointer        user_data)      : Run Last

Emitted when a row in a property view is activated by double clicking.

`view` : | the RBPropertyView
`name` : | the property value that was activated
`user_data` : | user data set when the signal handler was connected.

### The `"property-selected"` signal

    void                user_function                      (RBPropertyView *view,
                                                            gchar          *name,
                                                            gpointer        user_data)      : Run Last

Emitted when an individual property value becomes selected. This is only emitted for single-selection property views. For multiple-selection views, use the properties-selected signal.

`view` : | the RBPropertyView
`name` : | the property value that has been selected
`user_data` : | user data set when the signal handler was connected.

### The `"property-selection-reset"` signal

    void                user_function                      (RBPropertyView *view,
                                                            gpointer        user_data)      : Run Last

Emitted when the selection is reset. At this point, no property values are selected.

`view` : | the RBPropertyView
`user_data` : | user data set when the signal handler was connected.

### The `"show-popup"` signal

    void                user_function                      (RBPropertyView *view,
                                                            gpointer        user_data)      : Run Last

Emitted when a popup menu should be displayed for the property view. The source containing the property view should connect a handler to this signal that * displays an appropriate popup.

`view` : | the RBPropertyView
`user_data` : | user data set when the signal handler was connected.