File: rb-source.h

package info (click to toggle)
rhythmbox 0.8.8-13
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 10,004 kB
  • ctags: 4,769
  • sloc: ansic: 44,295; sh: 8,373; xml: 3,595; makefile: 687
file content (171 lines) | stat: -rw-r--r-- 5,492 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/*
 *  arch-tag: Header for the abstract base class of all sources
 *
 *  Copyright (C) 2002 Jorn Baayen <jorn@nl.linux.org>
 *  Copyright (C) 2003 Colin Walters <walters@gnome.org>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 */

#ifndef __RB_SOURCE_H
#define __RB_SOURCE_H

#include <gtk/gtkhbox.h>
#include <bonobo/bonobo-ui-component.h>

#include "rb-entry-view.h"

G_BEGIN_DECLS

typedef enum {
	RB_SOURCE_EOF_ERROR,
	RB_SOURCE_EOF_NEXT,
} RBSourceEOFType;


#define RB_TYPE_SOURCE         (rb_source_get_type ())
#define RB_SOURCE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_SOURCE, RBSource))
#define RB_SOURCE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_SOURCE, RBSourceClass))
#define RB_IS_SOURCE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_SOURCE))
#define RB_IS_SOURCE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_SOURCE))
#define RB_SOURCE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_SOURCE, RBSourceClass))

typedef struct RBSourcePrivate RBSourcePrivate;

typedef struct
{
	GtkHBox parent;

	RBSourcePrivate *priv;
} RBSource;

typedef struct
{
	GtkHBoxClass parent;
	
	/* signals */
	void (*status_changed)	(RBSource *source);
	void (*filter_changed)	(RBSource *source);
	void (*deleted)		(RBSource *source);

	/* methods */
	const char *	(*impl_get_status)	(RBSource *source);

	const char *	(*impl_get_browser_key)	(RBSource *source);

	const char *	(*impl_get_search_key)	(RBSource *source);

	RBEntryView *	(*impl_get_entry_view)	(RBSource *source);
	GList *		(*impl_get_extra_views)	(RBSource *source);

	GdkPixbuf *	(*impl_get_pixbuf)	(RBSource *source);
	gboolean	(*impl_can_rename)	(RBSource *source);

	gboolean	(*impl_can_search)	(RBSource *source);

	void		(*impl_search)		(RBSource *source, const char *text);
	void		(*impl_reset_filters)	(RBSource *source);
	GtkWidget *	(*impl_get_config_widget)(RBSource *source);

	gboolean	(*impl_can_cut)		(RBSource *source);
	gboolean	(*impl_can_delete)	(RBSource *source);
	gboolean	(*impl_can_copy)	(RBSource *source);
	
	GList *		(*impl_cut)		(RBSource *source);
	GList *		(*impl_copy)		(RBSource *source);
	void		(*impl_paste)		(RBSource *source, GList *entries);
	void		(*impl_delete)		(RBSource *source);

	void		(*impl_song_properties)	(RBSource *source);

	gboolean	(*impl_can_pause)	(RBSource *source);
	RBSourceEOFType	(*impl_handle_eos)	(RBSource *source);
	
	gboolean	(*impl_have_artist_album)(RBSource *source);
	const char *	(*impl_get_artist)	(RBSource *source);
	const char *	(*impl_get_album)	(RBSource *source);
	gboolean	(*impl_have_url)	(RBSource *source);
	void		(*impl_buffering_done)	(RBSource *source);

	gboolean	(*impl_receive_drag)	(RBSource *source, GtkSelectionData *data);
	gboolean	(*impl_show_popup)	(RBSource *source);
				   
	void		(*impl_delete_thyself)	(RBSource *source);
} RBSourceClass;

typedef gboolean (*RBSourceFeatureFunc) (RBSource *source);

GType		rb_source_get_type		(void);

void		rb_source_notify_filter_changed	(RBSource *source);

void		rb_source_notify_status_changed (RBSource *status);

void		rb_source_update_play_statistics(RBSource *source, RhythmDB *db,
						 RhythmDBEntry *entry);

/* general interface */
const char *	rb_source_get_status		(RBSource *source);

const char *	rb_source_get_browser_key	(RBSource *source);

const char *	rb_source_get_search_key	(RBSource *source);

RBEntryView *	rb_source_get_entry_view	(RBSource *source);

GList *		rb_source_get_extra_views	(RBSource *source);

GdkPixbuf *	rb_source_get_pixbuf		(RBSource *source);
gboolean	rb_source_can_rename		(RBSource *source);

gboolean	rb_source_can_search		(RBSource *source);

void		rb_source_search		(RBSource *source,
						 const char *text);

void		rb_source_reset_filters		(RBSource *source);

GtkWidget *	rb_source_get_config_widget	(RBSource *source);

gboolean	rb_source_can_cut		(RBSource *source);
gboolean	rb_source_can_delete		(RBSource *source);
gboolean	rb_source_can_copy		(RBSource *source);

GList *		rb_source_cut			(RBSource *source);
GList *		rb_source_copy			(RBSource *source);
void		rb_source_paste			(RBSource *source, GList *entries);
void		rb_source_delete		(RBSource *source);

void		rb_source_song_properties	(RBSource *source);

gboolean	rb_source_can_pause		(RBSource *source);
RBSourceEOFType	rb_source_handle_eos		(RBSource *source);

gboolean	rb_source_have_artist_album	(RBSource *source);
const char *	rb_source_get_artist		(RBSource *source);
const char *	rb_source_get_album		(RBSource *source);
gboolean	rb_source_have_url		(RBSource *source);
void		rb_source_buffering_done	(RBSource *source);

gboolean	rb_source_receive_drag		(RBSource *source, GtkSelectionData *data);

gboolean	rb_source_show_popup		(RBSource *source);

void		rb_source_delete_thyself	(RBSource *source);

G_END_DECLS

#endif /* __RB_SOURCE_H */