udapted vi.po
[rhythmbox.git] / widgets / rb-entry-view.h
blobdc7be0b483a56d4384a158fff911182fdf05ef2f
1 /*
2 * arch-tag: Header for widget to display RhythmDB entries
4 * Copyright (C) 2002 Jorn Baayen <jorn@nl.linux.org>
5 * Copyright (C) 2003 Colin Walters <walters@verbum.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 #ifndef __RB_ENTRY_VIEW_H
24 #define __RB_ENTRY_VIEW_H
26 #include <gtk/gtkscrolledwindow.h>
27 #include <gtk/gtktreeviewcolumn.h>
28 #include <gtk/gtkdnd.h>
29 #include <libgnomevfs/gnome-vfs-file-info.h>
31 #include "rhythmdb.h"
32 #include "rhythmdb-query-model.h"
34 G_BEGIN_DECLS
36 #define RB_TYPE_ENTRY_VIEW (rb_entry_view_get_type ())
37 #define RB_ENTRY_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_ENTRY_VIEW, RBEntryView))
38 #define RB_ENTRY_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_ENTRY_VIEW, RBEntryViewClass))
39 #define RB_IS_ENTRY_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_ENTRY_VIEW))
40 #define RB_IS_ENTRY_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_ENTRY_VIEW))
41 #define RB_ENTRY_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_ENTRY_VIEW, RBEntryViewClass))
43 typedef enum {
44 RB_ENTRY_VIEW_COL_TRACK_NUMBER,
45 RB_ENTRY_VIEW_COL_TITLE,
46 RB_ENTRY_VIEW_COL_ARTIST,
47 RB_ENTRY_VIEW_COL_ALBUM,
48 RB_ENTRY_VIEW_COL_GENRE,
49 RB_ENTRY_VIEW_COL_DURATION,
50 RB_ENTRY_VIEW_COL_QUALITY,
51 RB_ENTRY_VIEW_COL_RATING,
52 RB_ENTRY_VIEW_COL_PLAY_COUNT,
53 RB_ENTRY_VIEW_COL_YEAR,
54 RB_ENTRY_VIEW_COL_LAST_PLAYED,
55 RB_ENTRY_VIEW_COL_FIRST_SEEN,
56 RB_ENTRY_VIEW_COL_LAST_SEEN,
57 RB_ENTRY_VIEW_COL_LOCATION,
58 RB_ENTRY_VIEW_COL_ERROR
59 } RBEntryViewColumn;
61 GType rb_entry_view_column_get_type (void);
62 #define RB_TYPE_ENTRY_VIEW_COLUMN (rb_entry_view_column_get_type())
64 typedef enum {
65 RB_ENTRY_VIEW_NOT_PLAYING,
66 RB_ENTRY_VIEW_PLAYING,
67 RB_ENTRY_VIEW_PAUSED
68 } RBEntryViewState;
70 GType rb_entry_view_state_get_type (void);
71 #define RB_TYPE_ENTRY_VIEW_STATE (rb_entry_view_state_get_type())
73 typedef struct RBEntryViewPrivate RBEntryViewPrivate;
75 typedef struct
77 GtkScrolledWindow parent;
79 RBEntryViewPrivate *priv;
80 } RBEntryView;
82 typedef struct
84 GtkScrolledWindowClass parent;
86 void (*entry_added) (RBEntryView *view, RhythmDBEntry *entry);
87 void (*entry_deleted) (RBEntryView *view, RhythmDBEntry *entry);
88 void (*entries_replaced) (RBEntryView *view);
90 void (*entry_activated) (RBEntryView *view, RhythmDBEntry *entry);
92 void (*have_selection_changed) (RBEntryView *view, gboolean have_selection);
93 void (*selection_changed) (RBEntryView *view);
94 void (*sort_order_changed) (RBEntryView *view);
96 void (*show_popup) (RBEntryView *view, gboolean over_entry);
97 } RBEntryViewClass;
99 GType rb_entry_view_get_type (void);
101 RBEntryView * rb_entry_view_new (RhythmDB *db,
102 GObject *shell_player,
103 const char *sort_key,
104 gboolean drag_source,
105 gboolean drag_dest);
107 void rb_entry_view_append_column (RBEntryView *view,
108 RBEntryViewColumn coltype,
109 gboolean always_visible);
111 void rb_entry_view_append_column_custom (RBEntryView *view,
112 GtkTreeViewColumn *column,
113 const char *title,
114 const char *key,
115 GCompareDataFunc sort_func,
116 gpointer data);
118 void rb_entry_view_insert_column_custom (RBEntryView *view,
119 GtkTreeViewColumn *column,
120 const char *title,
121 const char *key,
122 GCompareDataFunc sort_func,
123 gpointer data,
124 gint position);
126 void rb_entry_view_set_columns_clickable (RBEntryView *view,
127 gboolean clickable);
129 void rb_entry_view_set_model (RBEntryView *view,
130 RhythmDBQueryModel *model);
132 void rb_entry_view_set_state (RBEntryView *view,
133 RBEntryViewState state);
135 gboolean rb_entry_view_have_selection (RBEntryView *view);
136 gboolean rb_entry_view_have_complete_selection (RBEntryView *view);
137 GList * rb_entry_view_get_selected_entries (RBEntryView *view);
139 void rb_entry_view_select_all (RBEntryView *view);
140 void rb_entry_view_select_none (RBEntryView *view);
141 void rb_entry_view_select_entry (RBEntryView *view,
142 RhythmDBEntry *entry);
144 gboolean rb_entry_view_get_entry_contained (RBEntryView *view,
145 RhythmDBEntry *entry);
147 gboolean rb_entry_view_get_entry_visible (RBEntryView *view,
148 RhythmDBEntry *entry);
150 void rb_entry_view_scroll_to_entry (RBEntryView *view,
151 RhythmDBEntry *entry);
153 void rb_entry_view_enable_drag_source (RBEntryView *view,
154 const GtkTargetEntry *targets,
155 int n_targets);
157 void rb_entry_view_get_sorting_order (RBEntryView *view,
158 char **column_name,
159 gint *sort_order);
160 void rb_entry_view_set_sorting_order (RBEntryView *view,
161 const char *column_name,
162 gint sort_order);
163 /* deal with the sorting order as a composite string */
164 const char * rb_entry_view_get_sorting_type (RBEntryView *view);
165 void rb_entry_view_set_sorting_type (RBEntryView *view,
166 const char *sorttype);
168 void rb_entry_view_set_fixed_column_width (RBEntryView *view,
169 GtkTreeViewColumn *column,
170 GtkCellRenderer *renderer,
171 const gchar **strings);
173 const char * rb_entry_view_get_time_date_column_sample (void);
175 /* resort the model with the current sorting order*/
176 void rb_entry_view_resort_model (RBEntryView *view);
178 G_END_DECLS
180 #endif /* __RB_ENTRY_VIEW_H */