1 /*
2  * Copyright (C) 2009 - 2011 Vivien Malerba <malerba@gnome-db.org>
3  * Copyright (C) 2011 Murray Cumming <murrayc@murrayc.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA  02110-1301, USA.
19  */
20 
21 #ifndef __GDAUI_CLOUD__
22 #define __GDAUI_CLOUD__
23 
24 #include <gtk/gtk.h>
25 
26 G_BEGIN_DECLS
27 
28 #define GDAUI_TYPE_CLOUD          (gdaui_cloud_get_type())
29 #define GDAUI_CLOUD(obj)          G_TYPE_CHECK_INSTANCE_CAST (obj, gdaui_cloud_get_type(), GdauiCloud)
30 #define GDAUI_CLOUD_CLASS(klass)  G_TYPE_CHECK_CLASS_CAST (klass, gdaui_cloud_get_type (), GdauiCloudClass)
31 #define GDAUI_IS_CLOUD(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, gdaui_cloud_get_type ())
32 #define GDAUI_IS_CLOUD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GDAUI_TYPE_CLOUD))
33 
34 typedef struct _GdauiCloud      GdauiCloud;
35 typedef struct _GdauiCloudClass GdauiCloudClass;
36 typedef struct _GdauiCloudPriv  GdauiCloudPriv;
37 
38 /* struct for the object's data */
39 struct _GdauiCloud
40 {
41 	GtkBox             object;
42 
43 	GdauiCloudPriv     *priv;
44 };
45 
46 /* struct for the object's class */
47 struct _GdauiCloudClass
48 {
49 	GtkBoxClass       parent_class;
50 	void            (* activate) (GdauiCloud *cloud, gint row);
51 };
52 
53 /**
54  * SECTION:gdaui-cloud
55  * @short_description: Cloud widget
56  * @title: GdauiCloud
57  * @stability: Stable
58  * @Image: vi-cloud.png
59  * @see_also:
60  *
61  * The #GdauiCloud widget displays a string for each row in a #GdaDataModel for which the size
62  * is variable (determined either by some data in the data model, or by a function provided by
63  * the programmer).
64  *
65  * Depending on the selection mode of the widget, each string can be selected by the user and
66  * the "selection-changed" signal is emitted.
67  */
68 
69 GType             gdaui_cloud_get_type             (void) G_GNUC_CONST;
70 
71 GtkWidget        *gdaui_cloud_new                  (GdaDataModel *model, gint label_column, gint weight_column);
72 void              gdaui_cloud_set_selection_mode   (GdauiCloud *cloud, GtkSelectionMode mode);
73 
74 void              gdaui_cloud_filter               (GdauiCloud *cloud, const gchar *filter);
75 GtkWidget        *gdaui_cloud_create_filter_widget (GdauiCloud *cloud);
76 
77 typedef gdouble (*GdauiCloudWeightFunc)            (GdaDataModel *model, gint row, gpointer data);
78 void              gdaui_cloud_set_weight_func      (GdauiCloud *cloud, GdauiCloudWeightFunc func, gpointer data);
79 
80 G_END_DECLS
81 
82 #endif
83 
84 
85 
86