This is a manual merge of branch drop split view intro trunk.
[modest] / src / hildon2 / modest-hildon-includes.h
1 /* Copyright (c) 2006, Nokia Corporation
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  *   notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  *   notice, this list of conditions and the following disclaimer in the
12  *   documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Nokia Corporation nor the names of its
14  *   contributors may be used to endorse or promote products derived from
15  *   this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 #ifndef __MODEST_HILDON_INCLUDES__
30 #define __MODEST_HILDON_INCLUDES__
31
32 #ifdef HAVE_CONFIG_H
33 #include <config.h>
34 #endif
35
36 /* helplib to use */
37 #ifdef MODEST_HAVE_OSSO_HELP
38 #include <osso-helplib.h>
39 #else
40 #ifdef MODEST_HAVE_HILDON_HELP
41 #include <hildon/hildon-help.h>
42 #endif /*MODEST_HAVE_HILDON_HELP*/
43 #endif /*MODEST_HAVE_OSSO_HELP*/
44
45 /* mimelib to use */
46 #ifdef MODEST_HAVE_OSSO_MIME
47 #include <osso-mime.h>
48 #include <osso-uri.h>
49 #else
50 #ifdef MODEST_HAVE_HILDON_MIME
51 #include <hildon-mime.h>
52 #include <hildon-uri.h>
53 #endif /*MODEST_HAVE_HILDON_MIME*/
54 #endif /*MODEST_HAVE_OSSO_MIME*/
55
56
57 #ifdef MODEST_HAVE_HILDON_NOTIFY
58 #include <hildon/hildon-notification.h>
59 #endif /*MODEST_HILDON_NOTIFY*/
60
61 #include <hildon/hildon-helper.h>
62 #include <hildon/hildon-file-chooser-dialog.h>
63 #include <hildon/hildon-color-chooser.h>
64 #include <hildon/hildon-banner.h>
65 #include <hildon/hildon-color-button.h>
66 #include <hildon/hildon-note.h>
67 #include <hildon/hildon-color-button.h>
68 #include <hildon/hildon-font-selection-dialog.h>
69 #include <hildon/hildon-caption.h>
70 #include <hildon/hildon-find-toolbar.h>
71 #include <hildon/hildon-sort-dialog.h>
72 #include <hildon/hildon-number-editor.h>
73 #include <modest-number-editor.h>
74 #include <hildon/hildon-program.h>
75 #include <hildon/hildon-entry.h>
76 #include <hildon/hildon-picker-button.h>
77 #include <hildon/hildon-check-button.h>
78 #include <hildon/hildon-pannable-area.h>
79 #include <hildon/hildon-stackable-window.h>
80 #include <hildon/hildon-text-view.h>
81
82
83 /* backward compatibility... */
84 #ifdef MODEST_HAVE_OSSO_MIME
85 #define hildon_mime_open_file_with_mime_type osso_mime_open_file_with_mime_type 
86 #define hildon_mime_open_file                osso_mime_open_file                
87
88 #define HildonURIAction                      OssoURIAction
89 #define hildon_uri_get_scheme_from_uri       osso_uri_get_scheme_from_uri
90 #define hildon_uri_get_actions               osso_uri_get_actions
91 #define hildon_uri_get_actions_by_uri        osso_uri_get_actions_by_uri
92 #define hildon_uri_action_get_translation    osso_uri_action_get_translation   
93 #define hildon_uri_is_default_action         osso_uri_is_default_action
94 #define hildon_uri_free_actions              osso_uri_free_actions
95
96 /* service->name */
97 #define hildon_uri_action_get_service        osso_uri_action_get_name
98 #define hildon_uri_open                      osso_uri_open
99
100 #define hildon_mime_get_icon_names           osso_mime_get_icon_names 
101 #endif /*MODEST_HAVE_OSSO_MIME*/
102
103 /* helplib to use */
104 #ifdef MODEST_HAVE_OSSO_HELP
105 #define hildon_help_show               ossohelp_show
106 #define hildon_help_dialog_help_enable ossohelp_dialog_help_enable
107 #define HILDON_HELP_SHOW_DIALOG        OSSO_HELP_SHOW_DIALOG
108 #else
109 #ifdef MODEST_HAVE_HILDON_HELP
110 /* nothing */
111 #endif /*MODEST_HAVE_HILDON_HELP*/
112 #endif /*MODEST_HAVE_OSSO_HELP*/
113
114 #ifndef HILDON_CHECK_BUTTON
115 #define HILDON_CHECK_BUTTON GTK_BUTTON
116 #endif
117
118 /* some extra #defines, so it will compile with the 'normal' gtk */
119 #ifndef MODEST_HAVE_HILDON_GTK
120 #define hildon_gtk_entry_set_input_mode(a,b) \
121         g_warning ("%s: hildon_gtk_entry_set_input_mode requires gtk-hildon", __FUNCTION__)
122 #define hildon_gtk_text_view_set_input_mode(a,b) \
123         g_warning ("%s: hildon_gtk_text_view_set_input_mode requires gtk-hildon", __FUNCTION__)
124 #define gtk_widget_tap_and_hold_setup(a,b,c,d)                          \
125         g_warning ("%s: gtk_widget_tap_and_hold_setup requires gtk-hildon", __FUNCTION__)
126
127 typedef enum
128 {
129   GTK_INVALID_INPUT_MAX_CHARS_REACHED,
130   GTK_INVALID_INPUT_MODE_RESTRICTION
131 } GtkInvalidInputType;
132
133 typedef enum
134 {
135   HILDON_GTK_INPUT_MODE_ALPHA        = 1 << 0,
136   HILDON_GTK_INPUT_MODE_NUMERIC      = 1 << 1,
137   HILDON_GTK_INPUT_MODE_SPECIAL      = 1 << 2,
138   HILDON_GTK_INPUT_MODE_HEXA         = 1 << 3,
139   HILDON_GTK_INPUT_MODE_TELE         = 1 << 4,
140   HILDON_GTK_INPUT_MODE_FULL         = (HILDON_GTK_INPUT_MODE_ALPHA | HILDON_GTK_INPUT_MODE_NUMERIC | HILDON_GTK_INPUT_MODE_SPECIAL),
141   HILDON_GTK_INPUT_MODE_MULTILINE    = 1 << 28,
142   HILDON_GTK_INPUT_MODE_INVISIBLE    = 1 << 29,
143   HILDON_GTK_INPUT_MODE_AUTOCAP      = 1 << 30,
144   HILDON_GTK_INPUT_MODE_DICTIONARY   = 1 << 31
145 } HildonGtkInputMode;
146 #endif /* !MODEST_HAVE_HILDON_GTK */
147
148 #endif /*__MODEST_HILDON_INCLUDES__*/