1 /* 2 * Copyright (C) 2003 Colin Walters <walters@gnome.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 #include <gtk/gtk.h> 29 30 #include <rhythmdb/rhythmdb.h> 31 #include <rhythmdb/rhythmdb-query-model.h> 32 33 #ifndef __RB_QUERY_CREATOR_H 34 #define __RB_QUERY_CREATOR_H 35 36 G_BEGIN_DECLS 37 38 #define RB_TYPE_QUERY_CREATOR (rb_query_creator_get_type ()) 39 #define RB_QUERY_CREATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_QUERY_CREATOR, RBQueryCreator)) 40 #define RB_QUERY_CREATOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_QUERY_CREATOR, RBQueryCreatorClass)) 41 #define RB_IS_QUERY_CREATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_QUERY_CREATOR)) 42 #define RB_IS_QUERY_CREATOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_QUERY_CREATOR)) 43 #define RB_QUERY_CREATOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_QUERY_CREATOR, RBQueryCreatorClass)) 44 45 typedef struct _RBQueryCreator RBQueryCreator; 46 typedef struct _RBQueryCreatorClass RBQueryCreatorClass; 47 48 struct _RBQueryCreator 49 { 50 GtkDialog parent; 51 }; 52 53 struct _RBQueryCreatorClass 54 { 55 GtkDialogClass parent_class; 56 }; 57 58 GType rb_query_creator_get_type (void); 59 60 GtkWidget * rb_query_creator_new (RhythmDB *db); 61 62 GtkWidget * rb_query_creator_new_from_query (RhythmDB *db, GPtrArray *query, 63 RhythmDBQueryModelLimitType limit_type, GVariant *limit_value, 64 const char *sort_column, gint sort_direction); 65 66 GPtrArray * rb_query_creator_get_query (RBQueryCreator *creator); 67 68 void rb_query_creator_get_limit (RBQueryCreator *creator, 69 RhythmDBQueryModelLimitType *type, 70 GVariant **limit); 71 72 void rb_query_creator_get_sort_order (RBQueryCreator *creator, const char **sort_key, gint *sort_direction); 73 74 G_END_DECLS 75 76 #endif /* __RB_QUERY_CREATOR_H */ 77