2006-09-12 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
[hildon] / hildon-widgets / hildon-window.h
1 /*
2  * This file is part of hildon-libs
3  *
4  * Copyright (C) 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 or 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
26 #ifndef __HILDON_WINDOW_H__
27 #define __HILDON_WINDOW_H__
28
29 #include <glib.h>
30 #include <glib-object.h>
31 #include <gtk/gtkwindow.h>
32 #include <gtk/gtkmenu.h>
33 #include <gtk/gtktoolbar.h>
34 #include <gdk/gdkx.h>
35
36 #include "hildon-defines.h"
37
38 G_BEGIN_DECLS
39
40 #define HILDON_WINDOW_LONG_PRESS_TIME 1500 /* in ms */
41
42 #define HILDON_TYPE_WINDOW ( hildon_window_get_type() )
43 #define HILDON_WINDOW(obj) \
44     (GTK_CHECK_CAST (obj, HILDON_TYPE_WINDOW, HildonWindow))
45 #define HILDON_WINDOW_CLASS(klass) \
46     (GTK_CHECK_CLASS_CAST ((klass),\
47      HILDON_TYPE_WINDOW, HildonWindowClass))
48 #define HILDON_IS_WINDOW(obj) (GTK_CHECK_TYPE (obj, HILDON_TYPE_WINDOW))
49 #define HILDON_IS_WINDOW_CLASS(klass) \
50     (GTK_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_WINDOW))
51
52 typedef struct _HildonWindow      HildonWindow;
53 typedef struct _HildonWindowClass HildonWindowClass;
54
55 /**
56  * HildonWindowPrivate:
57  *
58  * This structure contains just internal data.
59  * It should not be accessed directly.
60  */
61 typedef struct _HildonWindowPrivate HildonWindowPrivate;
62
63 struct _HildonWindow
64 {
65     GtkWindow parent;
66
67     /*private*/
68     HildonWindowPrivate *priv;
69 };
70
71 enum
72 {
73   HILDON_WINDOW_CO_COPY,
74   HILDON_WINDOW_CO_CUT,
75   HILDON_WINDOW_CO_PASTE
76 };
77
78 struct _HildonWindowClass
79 {
80     GtkWindowClass parent_class;
81
82     /* opera hacks for clip board operation */
83     void (*clipboard_operation)(HildonWindow *hwindow, int operation);
84     /* Padding for future extension */
85     void (*_hildon_reserved1)(void);
86     void (*_hildon_reserved2)(void);
87     void (*_hildon_reserved3)(void);
88 };
89
90
91 GType       hildon_window_get_type          (void);
92
93 GtkWidget * hildon_window_new               (void);
94
95 void        hildon_window_add_with_scrollbar(HildonWindow *self,
96                                              GtkWidget    *child);
97
98 GtkMenu *   hildon_window_get_menu          (HildonWindow *self);
99 void        hildon_window_set_menu          (HildonWindow *self,
100                                              GtkMenu      *menu);
101
102 void        hildon_window_add_toolbar       (HildonWindow *self,
103                                              GtkToolbar   *toolbar);
104
105 void        hildon_window_remove_toolbar    (HildonWindow *self,
106                                              GtkToolbar   *toolbar);
107
108 gboolean    hildon_window_get_is_topmost    (HildonWindow *self);
109
110
111 G_END_DECLS
112 #endif /* __HILDON_WINDOW_H__ */