Add HildonAppMenu::changed signal
[hildon] / hildon / hildon-window.h
1 /*
2  * This file is a part of hildon
3  *
4  * Copyright (C) 2006 Nokia Corporation, all rights reserved.
5  *
6  * Contact: Rodrigo Novo <rodrigo.novo@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, or (at your option) any later version.
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 #ifndef                                         __HILDON_WINDOW_H__
26 #define                                         __HILDON_WINDOW_H__
27
28 #include                                        <gtk/gtk.h>
29 #include                                        "hildon-app-menu.h"
30 #include                                        "hildon-edit-toolbar.h"
31
32 G_BEGIN_DECLS
33
34 #ifndef HILDON_DISABLE_DEPRECATED
35 /**
36  * HILDON_WINDOW_LONG_PRESS_TIME:
37  *
38  * Time (in miliseconds) after which a hardware key press is
39  * considered a long press.
40  *
41  * Deprecated: Hildon 2.2: this value is only meant to be used
42  * internally by Hildon.
43  */
44 #define                                         HILDON_WINDOW_LONG_PRESS_TIME 800
45 #endif
46
47 #define                                         HILDON_TYPE_WINDOW \
48                                                 (hildon_window_get_type())
49
50 #define                                         HILDON_WINDOW(obj) \
51                                                 (G_TYPE_CHECK_INSTANCE_CAST (obj, \
52                                                 HILDON_TYPE_WINDOW, HildonWindow))
53
54 #define                                         HILDON_WINDOW_CLASS(klass) \
55                                                 (G_TYPE_CHECK_CLASS_CAST ((klass),\
56                                                 HILDON_TYPE_WINDOW, HildonWindowClass))
57
58 #define                                         HILDON_IS_WINDOW(obj) \
59                                                 (G_TYPE_CHECK_INSTANCE_TYPE (obj, HILDON_TYPE_WINDOW))
60
61 #define                                         HILDON_IS_WINDOW_CLASS(klass) \
62                                                 (G_TYPE_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_WINDOW))
63
64 #define                                         HILDON_WINDOW_GET_CLASS(obj) \
65                                                 ((HildonWindowClass *) G_OBJECT_GET_CLASS(obj))
66
67 typedef struct                                  _HildonWindow HildonWindow;
68
69 typedef struct                                  _HildonWindowClass HildonWindowClass;
70
71 typedef enum
72 {
73     HILDON_WINDOW_CO_COPY,
74     HILDON_WINDOW_CO_CUT,
75     HILDON_WINDOW_CO_PASTE
76 }                                               HildonWindowClipboardOperation;
77
78 struct                                          _HildonWindow
79 {
80     GtkWindow parent;
81 };
82
83 struct                                          _HildonWindowClass
84 {
85     GtkWindowClass parent_class;
86
87     /* opera hacks for clip board operation */
88     void (*clipboard_operation)(HildonWindow *hwindow, int operation);
89     gboolean (*toggle_menu)(HildonWindow * self, guint button, guint32 time);
90     /* Padding for future extension */
91     void (*_hildon_reserved1)(void);
92     void (*_hildon_reserved2)(void);
93 };
94
95 GType G_GNUC_CONST
96 hildon_window_get_type                          (void);
97
98 GtkWidget*
99 hildon_window_new                               (void);
100
101 void        
102 hildon_window_add_with_scrollbar                (HildonWindow *self,
103                                                  GtkWidget    *child);
104
105 void
106 hildon_window_set_main_menu                     (HildonWindow *self,
107                                                  GtkMenu      *menu);
108
109 GtkMenu*
110 hildon_window_get_main_menu                     (HildonWindow *self);
111
112 void
113 hildon_window_set_app_menu                      (HildonWindow  *self,
114                                                  HildonAppMenu *menu);
115
116 HildonAppMenu *
117 hildon_window_get_app_menu                      (HildonWindow *self);
118
119 #ifndef HILDON_DISABLE_DEPRECATED
120 void        
121 hildon_window_set_menu                          (HildonWindow *self,
122                                                  GtkMenu      *menu);
123
124 GtkMenu*
125 hildon_window_get_menu                          (HildonWindow *self);
126 #endif
127
128 void    
129 hildon_window_add_toolbar                       (HildonWindow *self,
130                                                  GtkToolbar   *toolbar);
131
132 void        
133 hildon_window_remove_toolbar                    (HildonWindow *self,
134                                                  GtkToolbar   *toolbar);
135
136 void
137 hildon_window_set_edit_toolbar                  (HildonWindow      *self,
138                                                  HildonEditToolbar *toolbar);
139
140 gboolean    
141 hildon_window_get_is_topmost                    (HildonWindow *self);
142
143 const gchar *
144 hildon_window_get_markup                        (HildonWindow *window);
145
146 void
147 hildon_window_set_markup                        (HildonWindow *window,
148                                                  const gchar  *markup);
149
150 G_END_DECLS
151
152 #endif                                          /* __HILDON_WINDOW_H__ */