1 /*
2  * Copyright (C) 2009 - 2012 Vivien Malerba <malerba@gnome-db.org>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18 
19 #ifndef ___MGR_FAVORITES_H__
20 #define ___MGR_FAVORITES_H__
21 
22 #include <libgda/gda-tree-manager.h>
23 #include "browser-connection.h"
24 
25 G_BEGIN_DECLS
26 
27 #define MGR_FAVORITES_TYPE            (mgr_favorites_get_type())
28 #define MGR_FAVORITES(obj)            (G_TYPE_CHECK_INSTANCE_CAST (obj, MGR_FAVORITES_TYPE, MgrFavorites))
29 #define MGR_FAVORITES_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST (klass, MGR_FAVORITES_TYPE, MgrFavoritesClass))
30 #define IS_MGR_FAVORITES(obj)         (G_TYPE_CHECK_INSTANCE_TYPE(obj, MGR_FAVORITES_TYPE))
31 #define IS_MGR_FAVORITES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MGR_FAVORITES_TYPE))
32 
33 typedef struct _MgrFavorites MgrFavorites;
34 typedef struct _MgrFavoritesPriv MgrFavoritesPriv;
35 typedef struct _MgrFavoritesClass MgrFavoritesClass;
36 
37 struct _MgrFavorites {
38 	GdaTreeManager      object;
39 	MgrFavoritesPriv     *priv;
40 };
41 
42 struct _MgrFavoritesClass {
43 	GdaTreeManagerClass object_class;
44 };
45 
46 /**
47  * SECTION:mgr-favorites
48  * @short_description: A #GdaTreeManager for the stored favorites
49  * @title: MgrFavorites
50  * @stability: Stable
51  * @see_also:
52  */
53 
54 GType           mgr_favorites_get_type                 (void) G_GNUC_CONST;
55 GdaTreeManager* mgr_favorites_new                      (BrowserConnection *bcnc, ToolsFavoritesType type,
56 							gint order_key);
57 
58 /* name of the attribute which stores the favorite name */
59 #define MGR_FAVORITES_NAME_ATT_NAME "fav_name"
60 /* name of the attribute which stores the favorite's contents */
61 #define MGR_FAVORITES_CONTENTS_ATT_NAME "fav_contents"
62 /* name of the attribute which stores the favorite's id */
63 #define MGR_FAVORITES_ID_ATT_NAME "fav_id"
64 /* name of the attribute which stores the favorite type */
65 #define MGR_FAVORITES_TYPE_ATT_NAME "fav_type"
66 /* name of the attribute which stores the favorite's position */
67 #define MGR_FAVORITES_POSITION_ATT_NAME "fav_pos"
68 
69 G_END_DECLS
70 
71 #endif
72