2006-11-08 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
[hildon] / hildon-widgets / hildon-appview.h
1 /*
2  * This file is part of hildon-libs
3  *
4  * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
5  *
6  * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; version 2.1 of
11  * the License.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24
25
26 #ifndef __HILDON_APPVIEW_H__
27 #define __HILDON_APPVIEW_H__
28
29 #include <glib.h>
30 #include <glib-object.h>
31 #include <gtk/gtkbin.h>
32 #include <gtk/gtkmenu.h>
33 #include <gtk/gtktoolbar.h>
34 #include <gdk/gdkx.h>
35
36
37 G_BEGIN_DECLS
38 #define HILDON_TYPE_APPVIEW ( hildon_appview_get_type() )
39 #define HILDON_APPVIEW(obj) \
40     (GTK_CHECK_CAST (obj, HILDON_TYPE_APPVIEW, HildonAppView))
41 #define HILDON_APPVIEW_CLASS(klass) \
42     (GTK_CHECK_CLASS_CAST ((klass),\
43      HILDON_TYPE_APPVIEW, HildonAppViewClass))
44 #define HILDON_IS_APPVIEW(obj) (GTK_CHECK_TYPE (obj, HILDON_TYPE_APPVIEW))
45 #define HILDON_IS_APPVIEW_CLASS(klass) \
46     (GTK_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_APPVIEW))
47 typedef struct _HildonAppView HildonAppView;
48 typedef struct _HildonAppViewClass HildonAppViewClass;
49
50 /**
51  * HildonAppViewPrivate:
52  *
53  * This structure contains just internal data. It should not
54  * be accessed directly.
55  */
56 typedef struct _HildonAppViewPrivate HildonAppViewPrivate;
57
58 struct _HildonAppView {
59     GtkBin parent;
60
61     /*public*/
62     GtkWidget *vbox;
63
64     /*private*/
65     HildonAppViewPrivate *priv;
66 };
67
68 struct _HildonAppViewClass {
69     GtkBinClass parent_class;
70     void (*toolbar_changed) (HildonAppView * self);
71     void (*toolbar_toggle_request) (HildonAppView * self);
72     void (*fullscreen_state_change) (HildonAppView * self,
73                                      gboolean is_fullscreen);
74     void (*title_change) (HildonAppView * self);
75     void (*switched_to) (HildonAppView * self);
76     void (*switched_from) (HildonAppView * self);
77     void (*increase_button_event) (HildonAppView * self,
78                                     guint newkeytype);
79     void (*decrease_button_event) (HildonAppView * self,
80                                     guint newkeytype);
81 };
82
83
84 GType hildon_appview_get_type(void) G_GNUC_CONST;
85 GtkWidget *hildon_appview_new(const gchar * title);
86 void hildon_appview_add_with_scrollbar(HildonAppView * self,
87                                        GtkWidget * child);
88 void hildon_appview_set_fullscreen_key_allowed(HildonAppView * self,
89                                                gboolean allow);
90 gboolean hildon_appview_get_fullscreen_key_allowed(HildonAppView * self);
91
92 gboolean hildon_appview_get_fullscreen(HildonAppView * self);
93 void hildon_appview_set_fullscreen(HildonAppView * self,
94                                    gboolean fullscreen);
95 GtkMenu *hildon_appview_get_menu(HildonAppView * self);
96 #ifndef HILDON_DISABLE_DEPRECATED
97 void hildon_appview_set_toolbar(HildonAppView * self,
98                                 GtkToolbar * toolbar);
99 GtkToolbar *hildon_appview_get_toolbar(HildonAppView * self);
100 #endif
101 void hildon_appview_set_title(HildonAppView * self, const gchar * newname);
102 const gchar *hildon_appview_get_title(HildonAppView * self);
103
104 gboolean _hildon_appview_toggle_menu(HildonAppView * self,
105                                  Time button_event_time);
106 gboolean _hildon_appview_menu_visible(HildonAppView * self);
107
108 void hildon_appview_set_connected_adjustment (HildonAppView * self,
109                                               GtkAdjustment * adjustment);
110 GtkAdjustment * hildon_appview_get_connected_adjustment (HildonAppView * self);
111
112 void _hildon_appview_increase_button_state_changed (HildonAppView * self,
113                                                     guint newkeytype);
114 void _hildon_appview_decrease_button_state_changed (HildonAppView * self,
115                                                     guint newkeytype);
116
117 void hildon_appview_set_menu_ui(HildonAppView *self, const gchar *ui_string);
118 const gchar *hildon_appview_get_menu_ui(HildonAppView *self);
119
120 G_END_DECLS
121 #endif /* HILDON_APPVIEW_H */