Updated Finnish translation
[rhythmbox.git] / rhythmdb / rhythmdb-query-model.h
blob93adfd439236d44dcc11ccc7b5be699d0a101d84
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
3 * arch-tag: Header for RhythmDB query result GtkTreeModel impl.
5 * Copyright (C) 2003 Colin Walters <walters@rhythmbox.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "config.h"
24 #include <glib-object.h>
25 #include <glib.h>
26 #include <gtk/gtk.h>
28 #include "rhythmdb.h"
30 #ifndef RHYTHMDB_QUERY_MODEL_H
31 #define RHYTHMDB_QUERY_MODEL_H
33 G_BEGIN_DECLS
35 #define RHYTHMDB_TYPE_QUERY_MODEL (rhythmdb_query_model_get_type ())
36 #define RHYTHMDB_QUERY_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RHYTHMDB_TYPE_QUERY_MODEL, RhythmDBQueryModel))
37 #define RHYTHMDB_QUERY_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), RHYTHMDB_TYPE_QUERY_MODEL, RhythmDBQueryModelClass))
38 #define RHYTHMDB_IS_QUERY_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RHYTHMDB_TYPE_QUERY_MODEL))
39 #define RHYTHMDB_IS_QUERY_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RHYTHMDB_TYPE_QUERY_MODEL))
40 #define RHYTHMDB_QUERY_MODEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RHYTHMDB_TYPE_QUERY_MODEL, RhythmDBQueryModelClass))
42 GType rhythmdb_query_model_limit_type_get_type (void);
43 #define RHYTHMDB_TYPE_QUERY_MODEL_LIMIT_TYPE (rhythmdb_query_model_limit_type_get_type ())
45 typedef enum {
46 RHYTHMDB_QUERY_MODEL_LIMIT_NONE,
47 RHYTHMDB_QUERY_MODEL_LIMIT_COUNT,
48 RHYTHMDB_QUERY_MODEL_LIMIT_SIZE,
49 RHYTHMDB_QUERY_MODEL_LIMIT_TIME,
50 } RhythmDBQueryModelLimitType;
52 typedef struct RhythmDBQueryModelPrivate RhythmDBQueryModelPrivate;
54 #define RHYTHMDB_QUERY_MODEL_SUGGESTED_UPDATE_CHUNK 32
56 typedef struct
58 GObject parent;
60 RhythmDBQueryModelPrivate *priv;
61 } RhythmDBQueryModel;
63 typedef struct
65 GObjectClass parent;
67 /* signals */
68 void (*complete) (RhythmDBQueryModel *model);
69 void (*entry_prop_changed) (RhythmDBQueryModel *model,
70 RhythmDBEntry *entry,
71 RhythmDBPropType prop,
72 const GValue *old,
73 const GValue *new_value);
74 void (*non_entry_dropped) (RhythmDBQueryModel *model,
75 const char *uri,
76 int position);
77 void (*entry_removed) (RhythmDBQueryModel *model,
78 RhythmDBEntry *entry);
79 void (*post_entry_delete) (RhythmDBQueryModel *model,
80 RhythmDBEntry *entry);
82 } RhythmDBQueryModelClass;
84 GType rhythmdb_query_model_get_type (void);
86 RhythmDBQueryModel * rhythmdb_query_model_new (RhythmDB *db,
87 GPtrArray *query,
88 GCompareDataFunc sort_func,
89 gpointer sort_data,
90 GDestroyNotify sort_data_destroy,
91 gboolean sort_reverse);
93 RhythmDBQueryModel * rhythmdb_query_model_new_empty (RhythmDB *db);
95 void rhythmdb_query_model_copy_contents (RhythmDBQueryModel *dest,
96 RhythmDBQueryModel *src);
98 void rhythmdb_query_model_chain (RhythmDBQueryModel *child,
99 RhythmDBQueryModel *base,
100 gboolean import_entries);
102 void rhythmdb_query_model_add_entry (RhythmDBQueryModel *model,
103 RhythmDBEntry *entry,
104 gint index);
106 gboolean rhythmdb_query_model_remove_entry (RhythmDBQueryModel *model,
107 RhythmDBEntry *entry);
109 void rhythmdb_query_model_move_entry (RhythmDBQueryModel *model,
110 RhythmDBEntry *entry,
111 gint index);
113 guint64 rhythmdb_query_model_get_size (RhythmDBQueryModel *model);
115 long rhythmdb_query_model_get_duration (RhythmDBQueryModel *model);
117 gboolean rhythmdb_query_model_entry_to_iter (RhythmDBQueryModel *model,
118 RhythmDBEntry *entry,
119 GtkTreeIter *iter);
121 gboolean rhythmdb_query_model_has_pending_changes (RhythmDBQueryModel *model);
123 RhythmDBEntry * rhythmdb_query_model_tree_path_to_entry (RhythmDBQueryModel *model,
124 GtkTreePath *path);
125 RhythmDBEntry * rhythmdb_query_model_iter_to_entry (RhythmDBQueryModel *model,
126 GtkTreeIter *entry_iter);
127 RhythmDBEntry * rhythmdb_query_model_get_next_from_entry (RhythmDBQueryModel *model,
128 RhythmDBEntry *entry);
129 RhythmDBEntry * rhythmdb_query_model_get_previous_from_entry (RhythmDBQueryModel *model,
130 RhythmDBEntry *entry);
131 char * rhythmdb_query_model_compute_status_normal (RhythmDBQueryModel *model,
132 const char *singular,
133 const char *plural);
135 void rhythmdb_query_model_set_sort_order (RhythmDBQueryModel *model,
136 GCompareDataFunc sort_func,
137 gpointer sort_data,
138 GDestroyNotify sort_data_destroy,
139 gboolean sort_reverse);
141 void rhythmdb_query_model_reapply_query (RhythmDBQueryModel *model,
142 gboolean filter);
144 gint rhythmdb_query_model_location_sort_func (RhythmDBEntry *a,
145 RhythmDBEntry *b,
146 gpointer data);
148 gint rhythmdb_query_model_string_sort_func (RhythmDBEntry *a,
149 RhythmDBEntry *b,
150 gpointer data);
152 gint rhythmdb_query_model_title_sort_func (RhythmDBEntry *a,
153 RhythmDBEntry *b,
154 gpointer data);
156 gint rhythmdb_query_model_album_sort_func (RhythmDBEntry *a,
157 RhythmDBEntry *b,
158 gpointer data);
160 gint rhythmdb_query_model_artist_sort_func (RhythmDBEntry *a,
161 RhythmDBEntry *b,
162 gpointer data);
164 gint rhythmdb_query_model_genre_sort_func (RhythmDBEntry *a,
165 RhythmDBEntry *b,
166 gpointer data);
168 gint rhythmdb_query_model_track_sort_func (RhythmDBEntry *a,
169 RhythmDBEntry *b,
170 gpointer data);
172 gint rhythmdb_query_model_double_ceiling_sort_func (RhythmDBEntry *a,
173 RhythmDBEntry *b,
174 gpointer data);
176 gint rhythmdb_query_model_ulong_sort_func (RhythmDBEntry *a,
177 RhythmDBEntry *b,
178 gpointer data);
180 gint rhythmdb_query_model_date_sort_func (RhythmDBEntry *a,
181 RhythmDBEntry *b,
182 gpointer data);
183 G_END_DECLS
185 #endif /* __RHYTHMDB_QUERY_MODEL_H */