1 /*
2  *  Copyright (C) 2008 Jonathan Matthew  <jonathan@d14n.org>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  The Rhythmbox authors hereby grant permission for non-GPL compatible
10  *  GStreamer plugins to be used and distributed together with GStreamer
11  *  and Rhythmbox. This permission is above and beyond the permissions granted
12  *  by the GPL license by which Rhythmbox is covered. If you modify this code
13  *  you may extend this exception to your version of the code, but you are not
14  *  obligated to do so. If you do not wish to do so, delete this exception
15  *  statement from your version.
16  *
17  *  This program is distributed in the hope that it will be useful,
18  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  *  GNU General Public License for more details.
21  *
22  *  You should have received a copy of the GNU General Public License
23  *  along with this program; if not, write to the Free Software
24  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
25  *
26  */
27 
28 #ifndef __RB_SOURCE_SEARCH_BASIC_H
29 #define __RB_SOURCE_SEARCH_BASIC_H
30 
31 /*
32  * Basic source search implementation.
33  */
34 
35 #include <gtk/gtk.h>
36 
37 #include <sources/rb-source-search.h>
38 #include <rhythmdb/rhythmdb.h>
39 
40 G_BEGIN_DECLS
41 
42 #define RB_TYPE_SOURCE_SEARCH_BASIC	(rb_source_search_basic_get_type())
43 #define RB_SOURCE_SEARCH_BASIC(o)     (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_SOURCE_SEARCH_BASIC, RBSourceSearchBasic))
44 #define RB_SOURCE_SEARCH_BASIC_CLASS(o) (G_TYPE_CHECK_CLASS_CAST ((o), RB_TYPE_SOURCE_SEARCH_BASIC, RBSourceSearchBasicClass))
45 #define RB_IS_SOURCE_SEARCH_BASIC(o)  (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_SOURCE_SEARCH_BASIC))
46 #define RB_IS_SOURCE_SEARCH_BASIC_CLASS(o)  (G_TYPE_CHECK_CLASS_TYPE ((o), RB_TYPE_SOURCE_SEARCH_BASIC))
47 #define RB_SOURCE_SEARCH_BASIC_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_SOURCE_SEARCH_BASIC, RBSourceSearchBasicClass))
48 
49 typedef struct _RBSourceSearchBasic RBSourceSearchBasic;
50 typedef struct _RBSourceSearchBasicClass RBSourceSearchBasicClass;
51 
52 struct _RBSourceSearchBasic
53 {
54 	RBSourceSearch parent;
55 	RhythmDBPropType search_prop;
56 	char *description;
57 };
58 
59 struct _RBSourceSearchBasicClass
60 {
61 	RBSourceSearchClass parent_class;
62 };
63 
64 GType		rb_source_search_basic_get_type	(void);
65 
66 RBSourceSearch *rb_source_search_basic_new (RhythmDBPropType prop, const char *description);
67 void		rb_source_search_basic_register (RhythmDBPropType prop, const char *name, const char *description);
68 
69 GAction *	rb_source_create_search_action (RBSource *source);
70 
71 void		rb_source_search_basic_add_to_menu (GMenu *menu,
72 						    const char *action_namespace,
73 						    GAction *search_action,
74 						    RhythmDBPropType prop,
75 						    const char *name,
76 						    const char *label);
77 
78 G_END_DECLS
79 
80 #endif	/* __RB_SOURCE_SEARCH_BASIC_H */
81 
82