Release 2.1.94
[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 #define                                         HILDON_WINDOW_LONG_PRESS_TIME 800 /* in ms */
35
36 #define                                         HILDON_TYPE_WINDOW \
37                                                 (hildon_window_get_type())
38
39 #define                                         HILDON_WINDOW(obj) \
40                                                 (G_TYPE_CHECK_INSTANCE_CAST (obj, \
41                                                 HILDON_TYPE_WINDOW, HildonWindow))
42
43 #define                                         HILDON_WINDOW_CLASS(klass) \
44                                                 (G_TYPE_CHECK_CLASS_CAST ((klass),\
45                                                 HILDON_TYPE_WINDOW, HildonWindowClass))
46
47 #define                                         HILDON_IS_WINDOW(obj) \
48                                                 (G_TYPE_CHECK_INSTANCE_TYPE (obj, HILDON_TYPE_WINDOW))
49
50 #define                                         HILDON_IS_WINDOW_CLASS(klass) \
51                                                 (G_TYPE_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_WINDOW))
52
53 #define                                         HILDON_WINDOW_GET_CLASS(obj) \
54                                                 ((HildonWindowClass *) G_OBJECT_GET_CLASS(obj))
55
56 typedef struct                                  _HildonWindow HildonWindow;
57
58 typedef struct                                  _HildonWindowClass HildonWindowClass;
59
60 typedef enum
61 {
62     HILDON_WINDOW_CO_COPY,
63     HILDON_WINDOW_CO_CUT,
64     HILDON_WINDOW_CO_PASTE
65 }                                               HildonWindowClipboardOperation;
66
67 struct                                          _HildonWindow
68 {
69     GtkWindow parent;
70 };
71
72 struct                                          _HildonWindowClass
73 {
74     GtkWindowClass parent_class;
75
76     /* opera hacks for clip board operation */
77     void (*clipboard_operation)(HildonWindow *hwindow, int operation);
78     gboolean (*toggle_menu)(HildonWindow * self, guint button, guint32 time);
79     /* Padding for future extension */
80     void (*_hildon_reserved1)(void);
81     void (*_hildon_reserved2)(void);
82 };
83
84 GType G_GNUC_CONST
85 hildon_window_get_type                          (void);
86
87 GtkWidget*
88 hildon_window_new                               (void);
89
90 void        
91 hildon_window_add_with_scrollbar                (HildonWindow *self,
92                                                  GtkWidget    *child);
93
94 void
95 hildon_window_set_main_menu                     (HildonWindow *self,
96                                                  GtkMenu      *menu);
97
98 GtkMenu*
99 hildon_window_get_main_menu                     (HildonWindow *self);
100
101 void
102 hildon_window_set_app_menu                      (HildonWindow  *self,
103                                                  HildonAppMenu *menu);
104
105 HildonAppMenu *
106 hildon_window_get_app_menu                      (HildonWindow *self);
107
108 #ifndef HILDON_DISABLE_DEPRECATED
109 void        
110 hildon_window_set_menu                          (HildonWindow *self,
111                                                  GtkMenu      *menu);
112
113 GtkMenu*
114 hildon_window_get_menu                          (HildonWindow *self);
115 #endif
116
117 void    
118 hildon_window_add_toolbar                       (HildonWindow *self,
119                                                  GtkToolbar   *toolbar);
120
121 void        
122 hildon_window_remove_toolbar                    (HildonWindow *self,
123                                                  GtkToolbar   *toolbar);
124
125 void
126 hildon_window_set_edit_toolbar                  (HildonWindow      *self,
127                                                  HildonEditToolbar *toolbar);
128
129 gboolean    
130 hildon_window_get_is_topmost                    (HildonWindow *self);
131
132 const gchar *
133 hildon_window_get_markup                        (HildonWindow *window);
134
135 void
136 hildon_window_set_markup                        (HildonWindow *window,
137                                                  const gchar  *markup);
138
139 G_END_DECLS
140
141 #endif                                          /* __HILDON_WINDOW_H__ */