1 /* gdict-sidebar.h - sidebar widget
2  *
3  * Copyright (C) 2006  Emmanuele Bassi <ebassi@gmail.com>
4  *
5  * This program 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.1 of the License, or (at your option) any later version.
9  *
10  * This program 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 General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * Based on the equivalent widget from Evince
19  * 	by Jonathan Blandford,
20  * 	Copyright (C) 2004  Red Hat, Inc.
21  */
22 
23 #ifndef __GDICT_SIDEBAR_H__
24 #define __GDICT_SIDEBAR_H__
25 
26 #include <gtk/gtk.h>
27 
28 #define GDICT_TYPE_SIDEBAR		(gdict_sidebar_get_type ())
29 #define GDICT_SIDEBAR(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_SIDEBAR, GdictSidebar))
30 #define GDICT_IS_SIDEBAR(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_SIDEBAR))
31 #define GDICT_SIDEBAR_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_SIDEBAR, GdictSidebarClass))
32 #define GDICT_IS_SIDEBAR_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_SIDEBAR))
33 #define GDICT_SIDEBAR_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_SIDEBAR, GdictSidebarClass))
34 
35 typedef struct _GdictSidebar		GdictSidebar;
36 typedef struct _GdictSidebarPrivate	GdictSidebarPrivate;
37 typedef struct _GdictSidebarClass	GdictSidebarClass;
38 
39 struct _GdictSidebar
40 {
41   GtkVBox parent_instance;
42 
43   GdictSidebarPrivate *priv;
44 };
45 
46 struct _GdictSidebarClass
47 {
48   GtkVBoxClass parent_class;
49 
50   void (*page_changed) (GdictSidebar *sidebar);
51   void (*closed)       (GdictSidebar *sidebar);
52 
53   void (*_gdict_padding_1) (void);
54   void (*_gdict_padding_2) (void);
55   void (*_gdict_padding_3) (void);
56   void (*_gdict_padding_4) (void);
57 };
58 
59 GType                 gdict_sidebar_get_type     (void) G_GNUC_CONST;
60 
61 GtkWidget *           gdict_sidebar_new          (void);
62 void                  gdict_sidebar_add_page     (GdictSidebar *sidebar,
63 						  const gchar  *page_id,
64 						  const gchar  *page_name,
65 						  GtkWidget    *page_widget);
66 void                  gdict_sidebar_remove_page  (GdictSidebar *sidebar,
67 						  const gchar  *page_id);
68 void                  gdict_sidebar_view_page    (GdictSidebar *sidebar,
69 						  const gchar  *page_id);
70 const gchar *         gdict_sidebar_current_page (GdictSidebar *sidebar);
71 gchar **              gdict_sidebar_list_pages   (GdictSidebar *sidebar,
72                                                   gsize        *length) G_GNUC_MALLOC;
73 
74 #endif /* __GDICT_SIDEBAR_H__ */
75