Initial Import
[profile/ivi/clutter-toys.git] / attic / fluttr / src / fluttr-library.h
1 /*
2  * Copyright (C) 2007 Matthew Allum
3  * Copyright (C) 2007 Neil J. Patel
4  * Copyright (C) 2007 OpenedHand Ltd
5  *
6  * Author: Matthew Allum  <mallum@openedhand.com>
7  */
8 #ifndef _FLUTTR_LIBRARY
9 #define _FLUTTR_LIBRARY
10
11 #include <clutter/clutter.h>
12 //#include <libgnomevfs/gnome-vfs.h>
13 #include <glib-object.h>
14 #include "fluttr-library-row.h"
15 #include "eggsequence.h"
16
17 G_BEGIN_DECLS
18
19 #define FLUTTR_TYPE_LIBRARY fluttr_library_get_type()
20
21 #define FLUTTR_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
22         FLUTTR_TYPE_LIBRARY, \
23         FluttrLibrary))
24
25 #define FLUTTR_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),\
26         FLUTTR_TYPE_LIBRARY, \
27         FluttrLibraryClass))
28
29 #define FLUTTR_IS_LIBRARY(obj) \
30         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
31         FLUTTR_TYPE_LIBRARY))
32
33 #define FLUTTR_IS_LIBRARY_CLASS(klass) \
34         (G_TYPE_CHECK_CLASS_TYPE ((klass), \
35         FLUTTR_TYPE_LIBRARY))
36
37 #define FLUTTR_LIBRARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
38         FLUTTR_TYPE_LIBRARY, \
39         FluttrLibraryClass))
40
41 typedef struct {
42         GObject         parent;
43
44 } FluttrLibrary;
45
46 typedef struct {
47         GObjectClass parent_class;
48
49         void (*reordered) (FluttrLibrary *library);
50         void (*filter_change) (FluttrLibrary *library);
51         void (*library_row_change) (FluttrLibrary *library, FluttrLibraryRow *library_row);
52         void (*library_row_added) (FluttrLibrary *library, FluttrLibraryRow *library_row);
53
54 } FluttrLibraryClass;
55
56 typedef gint (*FluttrCompareRowFunc) (FluttrLibraryRow *a,
57                                      FluttrLibraryRow *b,
58                                      gpointer        data);
59
60 typedef gboolean  (*FluttrFilterRowFunc) (FluttrLibrary    *library,
61                                          FluttrLibraryRow *library_row,
62                                          gpointer         data);
63
64 typedef gboolean (*FluttrForeachRowFunc) (FluttrLibrary    *library,
65                                          FluttrLibraryRow *library_row,
66                                          gpointer         data);
67
68 GType fluttr_library_get_type (void);
69
70 FluttrLibrary*
71 fluttr_library_new ();
72
73 guint
74 fluttr_library_row_count (FluttrLibrary *library);
75
76 FluttrLibraryRow*
77 fluttr_library_get_library_row (FluttrLibrary *library, gint index);
78
79 void
80 fluttr_library_append_library_row (FluttrLibrary *library, FluttrLibraryRow *library_row);
81
82 void
83 fluttr_library_set_filter (FluttrLibrary    *library,
84                           FluttrFilterRowFunc  filter, 
85                           gpointer         data);
86
87 void
88 fluttr_library_set_sort_func (FluttrLibrary     *library, 
89                              FluttrCompareRowFunc  func, 
90                              gpointer          userdata);
91
92 void
93 fluttr_library_foreach (FluttrLibrary      *library, 
94                       FluttrForeachRowFunc   func,
95                       gpointer           data);
96
97 G_END_DECLS
98
99 #endif