## rhythmdb-query-model

rhythmdb-query-model

## Synopsis

    enum                RhythmDBQueryModelLimitType;
    typedef             RhythmDBQueryModelPrivate;
    #define             RHYTHMDB_QUERY_MODEL_SUGGESTED_UPDATE_CHUNK
    RhythmDBQueryModel* rhythmdb_query_model_new            (RhythmDB *db,
                                                             GPtrArray *query,
                                                             GCompareDataFunc sort_func,
                                                             gpointer sort_data,
                                                             GDestroyNotify sort_data_destroy,
                                                             gboolean sort_reverse);
    RhythmDBQueryModel* rhythmdb_query_model_new_empty      (RhythmDB *db);
    void                rhythmdb_query_model_copy_contents  (RhythmDBQueryModel *dest,
                                                             RhythmDBQueryModel *src);
    void                rhythmdb_query_model_chain          (RhythmDBQueryModel *child,
                                                             RhythmDBQueryModel *base,
                                                             gboolean import_entries);
    void                rhythmdb_query_model_add_entry      (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry,
                                                             gint index);
    gboolean            rhythmdb_query_model_remove_entry   (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry);
    void                rhythmdb_query_model_shuffle_entries
                                                            (RhythmDBQueryModel *model);
    void                rhythmdb_query_model_move_entry     (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry,
                                                             gint index);
    guint64             rhythmdb_query_model_get_size       (RhythmDBQueryModel *model);
    long                rhythmdb_query_model_get_duration   (RhythmDBQueryModel *model);
    gboolean            rhythmdb_query_model_entry_to_iter  (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry,
                                                             GtkTreeIter *iter);
    gboolean            rhythmdb_query_model_has_pending_changes
                                                            (RhythmDBQueryModel *model);
    RhythmDBEntry*      rhythmdb_query_model_tree_path_to_entry
                                                            (RhythmDBQueryModel *model,
                                                             GtkTreePath *path);
    RhythmDBEntry*      rhythmdb_query_model_iter_to_entry  (RhythmDBQueryModel *model,
                                                             GtkTreeIter *entry_iter);
    RhythmDBEntry*      rhythmdb_query_model_get_next_from_entry
                                                            (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry);
    RhythmDBEntry*      rhythmdb_query_model_get_previous_from_entry
                                                            (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry);
    char*               rhythmdb_query_model_compute_status_normal
                                                            (RhythmDBQueryModel *model,
                                                             const char *singular,
                                                             const char *plural);
    void                rhythmdb_query_model_set_sort_order (RhythmDBQueryModel *model,
                                                             GCompareDataFunc sort_func,
                                                             gpointer sort_data,
                                                             GDestroyNotify sort_data_destroy,
                                                             gboolean sort_reverse);
    void                rhythmdb_query_model_reapply_query  (RhythmDBQueryModel *model,
                                                             gboolean filter);
    gint                rhythmdb_query_model_location_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);
    gint                rhythmdb_query_model_string_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);
    gint                rhythmdb_query_model_title_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);
    gint                rhythmdb_query_model_album_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);
    gint                rhythmdb_query_model_artist_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);
    gint                rhythmdb_query_model_genre_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);
    gint                rhythmdb_query_model_track_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);
    gint                rhythmdb_query_model_double_ceiling_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);
    gint                rhythmdb_query_model_ulong_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);
    gint                rhythmdb_query_model_date_sort_func (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);

## Description

## Details

### enum RhythmDBQueryModelLimitType

    typedef enum {
    	RHYTHMDB_QUERY_MODEL_LIMIT_NONE,
    	RHYTHMDB_QUERY_MODEL_LIMIT_COUNT,
    	RHYTHMDB_QUERY_MODEL_LIMIT_SIZE,
    	RHYTHMDB_QUERY_MODEL_LIMIT_TIME,
    } RhythmDBQueryModelLimitType;

### RhythmDBQueryModelPrivate

    typedef struct RhythmDBQueryModelPrivate RhythmDBQueryModelPrivate;

### RHYTHMDB_QUERY_MODEL_SUGGESTED_UPDATE_CHUNK

    #define RHYTHMDB_QUERY_MODEL_SUGGESTED_UPDATE_CHUNK 1024

### rhythmdb_query_model_new ()

    RhythmDBQueryModel* rhythmdb_query_model_new            (RhythmDB *db,
                                                             GPtrArray *query,
                                                             GCompareDataFunc sort_func,
                                                             gpointer sort_data,
                                                             GDestroyNotify sort_data_destroy,
                                                             gboolean sort_reverse);

`db` : |
`query` : |
`sort_func` : |
`sort_data` : |
`sort_data_destroy` : |
`sort_reverse` : |
Returns : |

### rhythmdb_query_model_new_empty ()

    RhythmDBQueryModel* rhythmdb_query_model_new_empty      (RhythmDB *db);

`db` : |
Returns : |

### rhythmdb_query_model_copy_contents ()

    void                rhythmdb_query_model_copy_contents  (RhythmDBQueryModel *dest,
                                                             RhythmDBQueryModel *src);

`dest` : |
`src` : |

### rhythmdb_query_model_chain ()

    void                rhythmdb_query_model_chain          (RhythmDBQueryModel *child,
                                                             RhythmDBQueryModel *base,
                                                             gboolean import_entries);

`child` : |
`base` : |
`import_entries` : |

### rhythmdb_query_model_add_entry ()

    void                rhythmdb_query_model_add_entry      (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry,
                                                             gint index);

`model` : |
`entry` : |
`index` : |

### rhythmdb_query_model_remove_entry ()

    gboolean            rhythmdb_query_model_remove_entry   (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry);

`model` : |
`entry` : |
Returns : |

### rhythmdb_query_model_shuffle_entries ()

    void                rhythmdb_query_model_shuffle_entries
                                                            (RhythmDBQueryModel *model);

`model` : |

### rhythmdb_query_model_move_entry ()

    void                rhythmdb_query_model_move_entry     (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry,
                                                             gint index);

`model` : |
`entry` : |
`index` : |

### rhythmdb_query_model_get_size ()

    guint64             rhythmdb_query_model_get_size       (RhythmDBQueryModel *model);

`model` : |
Returns : |

### rhythmdb_query_model_get_duration ()

    long                rhythmdb_query_model_get_duration   (RhythmDBQueryModel *model);

`model` : |
Returns : |

### rhythmdb_query_model_entry_to_iter ()

    gboolean            rhythmdb_query_model_entry_to_iter  (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry,
                                                             GtkTreeIter *iter);

`model` : |
`entry` : |
`iter` : |
Returns : |

### rhythmdb_query_model_has_pending_changes ()

    gboolean            rhythmdb_query_model_has_pending_changes
                                                            (RhythmDBQueryModel *model);

`model` : |
Returns : |

### rhythmdb_query_model_tree_path_to_entry ()

    RhythmDBEntry*      rhythmdb_query_model_tree_path_to_entry
                                                            (RhythmDBQueryModel *model,
                                                             GtkTreePath *path);

`model` : |
`path` : |
Returns : |

### rhythmdb_query_model_iter_to_entry ()

    RhythmDBEntry*      rhythmdb_query_model_iter_to_entry  (RhythmDBQueryModel *model,
                                                             GtkTreeIter *entry_iter);

`model` : |
`entry_iter` : |
Returns : |

### rhythmdb_query_model_get_next_from_entry ()

    RhythmDBEntry*      rhythmdb_query_model_get_next_from_entry
                                                            (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry);

`model` : |
`entry` : |
Returns : |

### rhythmdb_query_model_get_previous_from_entry ()

    RhythmDBEntry*      rhythmdb_query_model_get_previous_from_entry
                                                            (RhythmDBQueryModel *model,
                                                             RhythmDBEntry *entry);

`model` : |
`entry` : |
Returns : |

### rhythmdb_query_model_compute_status_normal ()

    char*               rhythmdb_query_model_compute_status_normal
                                                            (RhythmDBQueryModel *model,
                                                             const char *singular,
                                                             const char *plural);

`model` : |
`singular` : |
`plural` : |
Returns : |

### rhythmdb_query_model_set_sort_order ()

    void                rhythmdb_query_model_set_sort_order (RhythmDBQueryModel *model,
                                                             GCompareDataFunc sort_func,
                                                             gpointer sort_data,
                                                             GDestroyNotify sort_data_destroy,
                                                             gboolean sort_reverse);

`model` : |
`sort_func` : |
`sort_data` : |
`sort_data_destroy` : |
`sort_reverse` : |

### rhythmdb_query_model_reapply_query ()

    void                rhythmdb_query_model_reapply_query  (RhythmDBQueryModel *model,
                                                             gboolean filter);

`model` : |
`filter` : |

### rhythmdb_query_model_location_sort_func ()

    gint                rhythmdb_query_model_location_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);

`a` : |
`b` : |
`data` : |
Returns : |

### rhythmdb_query_model_string_sort_func ()

    gint                rhythmdb_query_model_string_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);

`a` : |
`b` : |
`data` : |
Returns : |

### rhythmdb_query_model_title_sort_func ()

    gint                rhythmdb_query_model_title_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);

`a` : |
`b` : |
`data` : |
Returns : |

### rhythmdb_query_model_album_sort_func ()

    gint                rhythmdb_query_model_album_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);

`a` : |
`b` : |
`data` : |
Returns : |

### rhythmdb_query_model_artist_sort_func ()

    gint                rhythmdb_query_model_artist_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);

`a` : |
`b` : |
`data` : |
Returns : |

### rhythmdb_query_model_genre_sort_func ()

    gint                rhythmdb_query_model_genre_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);

`a` : |
`b` : |
`data` : |
Returns : |

### rhythmdb_query_model_track_sort_func ()

    gint                rhythmdb_query_model_track_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);

`a` : |
`b` : |
`data` : |
Returns : |

### rhythmdb_query_model_double_ceiling_sort_func ()

    gint                rhythmdb_query_model_double_ceiling_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);

`a` : |
`b` : |
`data` : |
Returns : |

### rhythmdb_query_model_ulong_sort_func ()

    gint                rhythmdb_query_model_ulong_sort_func
                                                            (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);

`a` : |
`b` : |
`data` : |
Returns : |

### rhythmdb_query_model_date_sort_func ()

    gint                rhythmdb_query_model_date_sort_func (RhythmDBEntry *a,
                                                             RhythmDBEntry *b,
                                                             gpointer data);

`a` : |
`b` : |
`data` : |
Returns : |