Rhythmbox Development Reference Manual: RBPropertyView

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

## Functions

RBPropertyView * | rb_property_view_new ()
void | rb_property_view_append_column_custom ()
void | rb_property_view_set_selection_mode ()
void | rb_property_view_reset ()
void | rb_property_view_set_selection ()
GList * | rb_property_view_get_selection ()
RhythmDBPropertyModel * | rb_property_view_get_model ()
void | rb_property_view_set_model ()
guint | rb_property_view_get_num_properties ()
void | rb_property_view_set_search_func ()

## Properties

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

## Signals

void | properties-selected | Run Last
void | property-activated | Run Last
void | property-selected | Run Last
void | property-selection-reset | Run Last
void | show-popup | Run Last

## Types and Values

struct | RBPropertyView
struct | RBPropertyViewClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkScrolledWindow
                            ╰── RBPropertyView

## Implemented Interfaces

RBPropertyView implements AtkImplementorIface and GtkBuildable.

## 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.

## Functions

### rb_property_view_new ()

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

Creates a new RBPropertyView displaying the specified property.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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 |

## Types and Values

### 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);
    };

## Property Details

### The `“db”` property

      “db”                       RhythmDB *

RhythmDB instance

Flags: Read / Write / Construct Only

### The `“draggable”` property

      “draggable”                gboolean

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

Flags: Read / Write / Construct Only

Default value: TRUE

### The `“prop”` property

      “prop”                     RhythmDBPropType

The property that is displayed in this view

Flags: Read / Write / Construct Only

Default value: RHYTHMDB_PROP_TYPE

### The `“property-model”` property

      “property-model”           RhythmDBPropertyModel *

The RhythmDBPropertyModel backing the view.

Flags: Read / Write

### The `“title”` property

      “title”                    gchar *

The title displayed in the header of the property view

Flags: Read / Write / Construct Only

Default value: ""

## Signal Details

### The `“properties-selected”` signal

    void
    user_function (RBPropertyView *view,
                   gpointer        properties,
                   gpointer        user_data)

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.

#### Parameters

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. |

Flags: Run Last

### The `“property-activated”` signal

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

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

#### Parameters

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

Flags: Run Last

### The `“property-selected”` signal

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

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.

#### Parameters

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

Flags: Run Last

### The `“property-selection-reset”` signal

    void
    user_function (RBPropertyView *view,
                   gpointer        user_data)

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

#### Parameters

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

Flags: Run Last

### The `“show-popup”` signal

    void
    user_function (RBPropertyView *view,
                   gpointer        user_data)

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.

#### Parameters

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

Flags: Run Last