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>
32 #include "rhythmdb-query-model.h"
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))
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
61 GType
rb_entry_view_column_get_type (void);
62 #define RB_TYPE_ENTRY_VIEW_COLUMN (rb_entry_view_column_get_type())
65 RB_ENTRY_VIEW_NOT_PLAYING
,
66 RB_ENTRY_VIEW_PLAYING
,
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
;
77 GtkScrolledWindow parent
;
79 RBEntryViewPrivate
*priv
;
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
);
99 GType
rb_entry_view_get_type (void);
101 RBEntryView
* rb_entry_view_new (RhythmDB
*db
, GObject
*shell_player
,
102 const char *sort_key
, gboolean drag_source
,
105 void rb_entry_view_append_column (RBEntryView
*view
,
106 RBEntryViewColumn coltype
, gboolean always_visible
);
108 void rb_entry_view_append_column_custom (RBEntryView
*view
, GtkTreeViewColumn
*column
,
109 const char *title
, const char *key
,
110 GCompareDataFunc sort_func
,
113 void rb_entry_view_set_columns_clickable (RBEntryView
*view
, gboolean clickable
);
115 void rb_entry_view_set_model (RBEntryView
*view
,
116 RhythmDBQueryModel
*model
);
118 void rb_entry_view_set_state (RBEntryView
*view
,
119 RBEntryViewState state
);
121 gboolean
rb_entry_view_have_selection (RBEntryView
*view
);
122 gboolean
rb_entry_view_have_complete_selection (RBEntryView
*view
);
123 GList
* rb_entry_view_get_selected_entries (RBEntryView
*view
);
125 void rb_entry_view_select_all (RBEntryView
*view
);
126 void rb_entry_view_select_none (RBEntryView
*view
);
127 void rb_entry_view_select_entry (RBEntryView
*view
,
128 RhythmDBEntry
*entry
);
130 gboolean
rb_entry_view_get_entry_contained (RBEntryView
*view
,
131 RhythmDBEntry
*entry
);
133 gboolean
rb_entry_view_get_entry_visible (RBEntryView
*view
,
134 RhythmDBEntry
*entry
);
136 void rb_entry_view_scroll_to_entry (RBEntryView
*view
,
137 RhythmDBEntry
*entry
);
139 void rb_entry_view_enable_drag_source (RBEntryView
*view
,
140 const GtkTargetEntry
*targets
,
143 void rb_entry_view_get_sorting_order (RBEntryView
*view
, const char **column_name
, gint
*sort_order
);
144 void rb_entry_view_set_sorting_order (RBEntryView
*view
, const char *column_name
, gint sort_order
);
145 /* deal with the sorting order as a composite string */
146 const char * rb_entry_view_get_sorting_type (RBEntryView
*view
);
147 void rb_entry_view_set_sorting_type (RBEntryView
*view
, const char *sorttype
);
149 void rb_entry_view_set_fixed_column_width (RBEntryView
*view
,
150 GtkTreeViewColumn
*column
,
151 GtkCellRenderer
*renderer
,
152 const gchar
**strings
);
154 const char * rb_entry_view_get_time_date_column_sample (void);
156 /* resort the model with the current sorting order*/
157 void rb_entry_view_resort_model (RBEntryView
*view
);
161 #endif /* __RB_ENTRY_VIEW_H */