Library View Models

Library View Models — Library data and property models

Synopsis

#include <rc-ui-library-model.h>

enum                RCUiLibraryListColumns;
struct              RCUiLibraryListStore;
struct              RCUiLibraryListStoreClass;
enum                RCUiLibraryPropColumns;
struct              RCUiLibraryPropStore;
struct              RCUiLibraryPropStoreClass;
GtkTreeModel *      rc_ui_library_list_store_new        (RCLibDbLibraryQueryResult *query_result);
GtkTreeModel *      rc_ui_library_prop_store_new        (RCLibDbLibraryQueryResult *base,
                                                         RCLibDbQueryDataType prop_type);

Object Hierarchy

  GObject
   +----RCUiLibraryListStore
  GObject
   +----RCUiLibraryPropStore

Implemented Interfaces

RCUiLibraryListStore implements GtkTreeModel.

RCUiLibraryPropStore implements GtkTreeModel.

Properties

  "query-result"             RCLibDbLibraryQueryResult*  : Read / Write / Construct Only
  "base"                     RCLibDbLibraryQueryResult*  : Read / Write / Construct Only
  "property-type"            guint                 : Read / Write / Construct Only

Description

This module provides 2 classes: RCUiLibraryListStore and RCUiLibraryPropStore, which implements interface GtkTreeModel. They can be used by GtkTreeView for showing and operating the data inside. RCUiLibraryListStore contains the query result list obtained from the library, and RCUiLibraryPropStore contains the property list of the query result.

Details

enum RCUiLibraryListColumns

typedef enum {
    RC_UI_LIBRARY_LIST_COLUMN_TYPE,
    RC_UI_LIBRARY_LIST_COLUMN_STATE,
    RC_UI_LIBRARY_LIST_COLUMN_FTITLE,
    RC_UI_LIBRARY_LIST_COLUMN_TITLE,
    RC_UI_LIBRARY_LIST_COLUMN_ARTIST,
    RC_UI_LIBRARY_LIST_COLUMN_ALBUM,
    RC_UI_LIBRARY_LIST_COLUMN_FTYPE,
    RC_UI_LIBRARY_LIST_COLUMN_GENRE,
    RC_UI_LIBRARY_LIST_COLUMN_LENGTH,
    RC_UI_LIBRARY_LIST_COLUMN_TRACK,
    RC_UI_LIBRARY_LIST_COLUMN_RATING,
    RC_UI_LIBRARY_LIST_COLUMN_YEAR,
    RC_UI_LIBRARY_LIST_COLUMN_PLAYING_FLAG,
    RC_UI_LIBRARY_LIST_COLUMN_LAST
} RCUiLibraryListColumns;

The enum type for the columns in the library list store.

RC_UI_LIBRARY_LIST_COLUMN_TYPE

the type column

RC_UI_LIBRARY_LIST_COLUMN_STATE

the state column

RC_UI_LIBRARY_LIST_COLUMN_FTITLE

the title column

RC_UI_LIBRARY_LIST_COLUMN_TITLE

the real title column

RC_UI_LIBRARY_LIST_COLUMN_ARTIST

the artist column

RC_UI_LIBRARY_LIST_COLUMN_ALBUM

the album column

RC_UI_LIBRARY_LIST_COLUMN_FTYPE

the file type (format) column

RC_UI_LIBRARY_LIST_COLUMN_GENRE

the genre column

RC_UI_LIBRARY_LIST_COLUMN_LENGTH

the time length column

RC_UI_LIBRARY_LIST_COLUMN_TRACK

the track number column

RC_UI_LIBRARY_LIST_COLUMN_RATING

the rating column

RC_UI_LIBRARY_LIST_COLUMN_YEAR

the year column

RC_UI_LIBRARY_LIST_COLUMN_PLAYING_FLAG

the playing flag column

RC_UI_LIBRARY_LIST_COLUMN_LAST

the last column, do not use it

struct RCUiLibraryListStore

struct RCUiLibraryListStore;

The data structure used for RCUiLibraryListStore class.


struct RCUiLibraryListStoreClass

struct RCUiLibraryListStoreClass {
};

RCUiLibraryListStoreClass class.


enum RCUiLibraryPropColumns

typedef enum {
    RC_UI_LIBRARY_PROP_COLUMN_NAME,
    RC_UI_LIBRARY_PROP_COLUMN_COUNT,
    RC_UI_LIBRARY_PROP_COLUMN_FLAG,
    RC_UI_LIBRARY_PROP_COLUMN_LAST
} RCUiLibraryPropColumns;

The enum type for the columns in the library property store.

RC_UI_LIBRARY_PROP_COLUMN_NAME

the property text

RC_UI_LIBRARY_PROP_COLUMN_COUNT

the number of the property used

RC_UI_LIBRARY_PROP_COLUMN_FLAG

the flag of the property

RC_UI_LIBRARY_PROP_COLUMN_LAST

the last column, do not use it

struct RCUiLibraryPropStore

struct RCUiLibraryPropStore;

The data structure used for RCUiLibraryPropStore class.


struct RCUiLibraryPropStoreClass

struct RCUiLibraryPropStoreClass {
};

RCUiLibraryPropStoreClass class.


rc_ui_library_list_store_new ()

GtkTreeModel *      rc_ui_library_list_store_new        (RCLibDbLibraryQueryResult *query_result);

Create a new library list store.

query_result :

the query result

Returns :

The new library list store, NULL if failed. [transfer full]

rc_ui_library_prop_store_new ()

GtkTreeModel *      rc_ui_library_prop_store_new        (RCLibDbLibraryQueryResult *base,
                                                         RCLibDbQueryDataType prop_type);

Create a new library property store.

base :

the base query result

prop_type :

the property type

Returns :

The new library property store, NULL if failed. [transfer full]

Property Details

The "query-result" property

  "query-result"             RCLibDbLibraryQueryResult*  : Read / Write / Construct Only

Sets the query result object of the library list store.


The "base" property

  "base"                     RCLibDbLibraryQueryResult*  : Read / Write / Construct Only

Sets the base query result object of the library property store.


The "property-type" property

  "property-type"            guint                 : Read / Write / Construct Only

Sets the property type for the library property store.

Allowed values: <= 10

Default value: 3