1 /*
2  * Copyright (C) 2009 - 2011 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 __BROWSER_PAGE_H__
20 #define __BROWSER_PAGE_H__
21 
22 #include <gtk/gtk.h>
23 #include "decl.h"
24 
25 G_BEGIN_DECLS
26 
27 #define BROWSER_PAGE_TYPE            (browser_page_get_type())
28 #define BROWSER_PAGE(obj)            (G_TYPE_CHECK_INSTANCE_CAST (obj, BROWSER_PAGE_TYPE, BrowserPage))
29 #define IS_BROWSER_PAGE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE (obj, BROWSER_PAGE_TYPE))
30 #define BROWSER_PAGE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BROWSER_PAGE_TYPE, BrowserPageIface))
31 
32 /* struct for the interface */
33 struct _BrowserPageIface {
34 	GTypeInterface           g_iface;
35 
36 	/* virtual table */
37 	GtkActionGroup      *(* i_get_actions_group) (BrowserPage *page);
38 	const gchar         *(* i_get_actions_ui) (BrowserPage *page);
39 	GtkWidget           *(* i_get_tab_label) (BrowserPage *page, GtkWidget **out_close_button);
40 };
41 
42 /**
43  * SECTION:browser-page
44  * @short_description: A "page" within a #BrowserPerspective widget
45  * @title: BrowserPage
46  * @stability: Stable
47  * @see_also:
48  *
49  * Some widgets packed within a #BrowserPerspective can implement
50  * the #BrowserPage interface to specify their specific actions and menu and
51  * toolbar customizations. When they are packed in a notebook, they can also
52  * request some specific tab labels.
53  */
54 
55 GType               browser_page_get_type          (void) G_GNUC_CONST;
56 
57 GtkActionGroup     *browser_page_get_actions_group (BrowserPage *page);
58 const gchar        *browser_page_get_actions_ui    (BrowserPage *page);
59 
60 BrowserPerspective *browser_page_get_perspective   (BrowserPage *page);
61 GtkWidget          *browser_page_get_tab_label     (BrowserPage *page, GtkWidget **out_close_button);
62 
63 G_END_DECLS
64 
65 #endif
66