~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/embedding/browser/gtk/src/gtkmozembed.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * The contents of this file are subject to the Mozilla Public
 
3
 * License Version 1.1 (the "License"); you may not use this file
 
4
 * except in compliance with the License. You may obtain a copy of
 
5
 * the License at http://www.mozilla.org/MPL/
 
6
 * 
 
7
 * Software distributed under the License is distributed on an "AS
 
8
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
9
 * implied. See the License for the specific language governing
 
10
 * rights and limitations under the License.
 
11
 * 
 
12
 * The Original Code is mozilla.org code.
 
13
 * 
 
14
 * The Initial Developer of the Original Code is Christopher Blizzard.
 
15
 * Portions created by Christopher Blizzard are Copyright (C)
 
16
 * Christopher Blizzard.  All Rights Reserved.
 
17
 * 
 
18
 * Contributor(s):
 
19
 *   Christopher Blizzard <blizzard@mozilla.org>
 
20
 *   Ramiro Estrugo <ramiro@eazel.com>
 
21
 */
 
22
 
 
23
#ifndef gtkmozembed_h
 
24
#define gtkmozembed_h
 
25
 
 
26
#ifdef __cplusplus
 
27
extern "C" {
 
28
#endif /* __cplusplus */
 
29
 
 
30
#include <stddef.h>
 
31
#include <gtk/gtk.h>
 
32
 
 
33
#define GTK_TYPE_MOZ_EMBED             (gtk_moz_embed_get_type())
 
34
#define GTK_MOZ_EMBED(obj)             GTK_CHECK_CAST((obj), GTK_TYPE_MOZ_EMBED, GtkMozEmbed)
 
35
#define GTK_MOZ_EMBED_CLASS(klass)     GTK_CHECK_CLASS_CAST((klass), GTK_TYPE_MOZ_EMBED, GtkMozEmbedClass)
 
36
#define GTK_IS_MOZ_EMBED(obj)          GTK_CHECK_TYPE((obj), GTK_TYPE_MOZ_EMBED)
 
37
#define GTK_IS_MOZ_EMBED_CLASS(klass)  GTK_CHECK_CLASS_TYPE((klass), GTK_TYPE_MOZ_EMBED)
 
38
 
 
39
typedef struct _GtkMozEmbed      GtkMozEmbed;
 
40
typedef struct _GtkMozEmbedClass GtkMozEmbedClass;
 
41
 
 
42
struct _GtkMozEmbed
 
43
{
 
44
  GtkBin    bin;
 
45
  void     *data;
 
46
};
 
47
 
 
48
struct _GtkMozEmbedClass
 
49
{
 
50
  GtkBinClass parent_class;
 
51
 
 
52
  void (* link_message)        (GtkMozEmbed *embed);
 
53
  void (* js_status)           (GtkMozEmbed *embed);
 
54
  void (* location)            (GtkMozEmbed *embed);
 
55
  void (* title)               (GtkMozEmbed *embed);
 
56
  void (* progress)            (GtkMozEmbed *embed, gint curprogress,
 
57
                                gint maxprogress);
 
58
  void (* progress_all)        (GtkMozEmbed *embed, const char *aURI,
 
59
                                gint curprogress, gint maxprogress);
 
60
  void (* net_state)           (GtkMozEmbed *embed, gint state, guint status);
 
61
  void (* net_state_all)       (GtkMozEmbed *embed, const char *aURI,
 
62
                                gint state, guint status);
 
63
  void (* net_start)           (GtkMozEmbed *embed);
 
64
  void (* net_stop)            (GtkMozEmbed *embed);
 
65
  void (* new_window)          (GtkMozEmbed *embed, GtkMozEmbed **newEmbed,
 
66
                                guint chromemask);
 
67
  void (* visibility)          (GtkMozEmbed *embed, gboolean visibility);
 
68
  void (* destroy_brsr)        (GtkMozEmbed *embed);
 
69
  gint (* open_uri)            (GtkMozEmbed *embed, const char *aURI);
 
70
  void (* size_to)             (GtkMozEmbed *embed, gint width, gint height);
 
71
  gint (* dom_key_down)        (GtkMozEmbed *embed, gpointer dom_event);
 
72
  gint (* dom_key_press)       (GtkMozEmbed *embed, gpointer dom_event);
 
73
  gint (* dom_key_up)          (GtkMozEmbed *embed, gpointer dom_event);
 
74
  gint (* dom_mouse_down)      (GtkMozEmbed *embed, gpointer dom_event);
 
75
  gint (* dom_mouse_up)        (GtkMozEmbed *embed, gpointer dom_event);
 
76
  gint (* dom_mouse_click)     (GtkMozEmbed *embed, gpointer dom_event);
 
77
  gint (* dom_mouse_dbl_click) (GtkMozEmbed *embed, gpointer dom_event);
 
78
  gint (* dom_mouse_over)      (GtkMozEmbed *embed, gpointer dom_event);
 
79
  gint (* dom_mouse_out)       (GtkMozEmbed *embed, gpointer dom_event);
 
80
  void (* security_change)     (GtkMozEmbed *embed, gpointer request,
 
81
                                guint state);
 
82
  void (* status_change)       (GtkMozEmbed *embed, gpointer request,
 
83
                                gint status, gpointer message);
 
84
};
 
85
 
 
86
GtkType      gtk_moz_embed_get_type         (void);
 
87
GtkWidget   *gtk_moz_embed_new              (void);
 
88
void         gtk_moz_embed_push_startup     (void);
 
89
void         gtk_moz_embed_pop_startup      (void);
 
90
void         gtk_moz_embed_set_comp_path    (char *aPath);
 
91
void         gtk_moz_embed_set_profile_path (char *aDir, char *aName);
 
92
void         gtk_moz_embed_load_url         (GtkMozEmbed *embed, 
 
93
                                             const char *url);
 
94
void         gtk_moz_embed_stop_load        (GtkMozEmbed *embed);
 
95
gboolean     gtk_moz_embed_can_go_back      (GtkMozEmbed *embed);
 
96
gboolean     gtk_moz_embed_can_go_forward   (GtkMozEmbed *embed);
 
97
void         gtk_moz_embed_go_back          (GtkMozEmbed *embed);
 
98
void         gtk_moz_embed_go_forward       (GtkMozEmbed *embed);
 
99
void         gtk_moz_embed_render_data      (GtkMozEmbed *embed, 
 
100
                                             const char *data,
 
101
                                             guint32 len,
 
102
                                             const char *base_uri, 
 
103
                                             const char *mime_type);
 
104
void         gtk_moz_embed_open_stream      (GtkMozEmbed *embed,
 
105
                                             const char *base_uri,
 
106
                                             const char *mime_type);
 
107
void         gtk_moz_embed_append_data      (GtkMozEmbed *embed,
 
108
                                             const char *data, guint32 len);
 
109
void         gtk_moz_embed_close_stream     (GtkMozEmbed *embed);
 
110
char        *gtk_moz_embed_get_link_message (GtkMozEmbed *embed);
 
111
char        *gtk_moz_embed_get_js_status    (GtkMozEmbed *embed);
 
112
char        *gtk_moz_embed_get_title        (GtkMozEmbed *embed);
 
113
char        *gtk_moz_embed_get_location     (GtkMozEmbed *embed);
 
114
void         gtk_moz_embed_reload           (GtkMozEmbed *embed, gint32 flags);
 
115
void         gtk_moz_embed_set_chrome_mask  (GtkMozEmbed *embed, 
 
116
                                             guint32 flags);
 
117
guint32      gtk_moz_embed_get_chrome_mask  (GtkMozEmbed *embed);
 
118
 
 
119
/* enum types */
 
120
#define GTK_TYPE_MOZ_EMBED_PROGRESS_FLAGS \
 
121
             (gtk_moz_embed_progress_flags_get_type())
 
122
#define GTK_TYPE_MOZ_EMBED_STATUS_ENUMS \
 
123
             (gtk_moz_embed_status_enums_get_type())
 
124
#define GTK_TYPE_MOZ_EMBED_RELOAD_FLAGS \
 
125
             (gtk_moz_embed_reload_flags_get_type())
 
126
#define GTK_TYPE_MOZ_EMBED_CHROME_FLAGS \
 
127
             (gtk_moz_embed_chrome_flags_get_type())
 
128
 
 
129
GtkType      gtk_moz_embed_progress_flags_get_type (void);
 
130
GtkType      gtk_moz_embed_status_enums_get_type (void);
 
131
GtkType      gtk_moz_embed_reload_flags_get_type (void);
 
132
GtkType      gtk_moz_embed_chrome_flags_get_type (void);
 
133
 
 
134
/* These are straight out of nsIWebProgressListener.h */
 
135
 
 
136
typedef enum
 
137
{
 
138
  GTK_MOZ_EMBED_FLAG_START = 1,
 
139
  GTK_MOZ_EMBED_FLAG_REDIRECTING = 2,
 
140
  GTK_MOZ_EMBED_FLAG_TRANSFERRING = 4,
 
141
  GTK_MOZ_EMBED_FLAG_NEGOTIATING = 8,
 
142
  GTK_MOZ_EMBED_FLAG_STOP = 16,
 
143
  
 
144
  GTK_MOZ_EMBED_FLAG_IS_REQUEST = 65536,
 
145
  GTK_MOZ_EMBED_FLAG_IS_DOCUMENT = 131072,
 
146
  GTK_MOZ_EMBED_FLAG_IS_NETWORK = 262144,
 
147
  GTK_MOZ_EMBED_FLAG_IS_WINDOW = 524288 
 
148
} GtkMozEmbedProgressFlags;
 
149
 
 
150
/* These are from various networking headers */
 
151
 
 
152
typedef enum
 
153
{
 
154
  /* NS_ERROR_UNKNOWN_HOST */
 
155
  GTK_MOZ_EMBED_STATUS_FAILED_DNS     = 2152398878U,
 
156
 /* NS_ERROR_CONNECTION_REFUSED */
 
157
  GTK_MOZ_EMBED_STATUS_FAILED_CONNECT = 2152398861U,
 
158
 /* NS_ERROR_NET_TIMEOUT */
 
159
  GTK_MOZ_EMBED_STATUS_FAILED_TIMEOUT = 2152398862U,
 
160
 /* NS_BINDING_ABORTED */
 
161
  GTK_MOZ_EMBED_STATUS_FAILED_USERCANCELED = 2152398850U
 
162
} GtkMozEmbedStatusFlags;
 
163
 
 
164
/* These used to be straight out of nsIWebNavigation.h until the API
 
165
   changed.  Now there's a mapping table that maps these values to the
 
166
   internal values. */
 
167
 
 
168
typedef enum 
 
169
{
 
170
  GTK_MOZ_EMBED_FLAG_RELOADNORMAL = 0,
 
171
  GTK_MOZ_EMBED_FLAG_RELOADBYPASSCACHE = 1,
 
172
  GTK_MOZ_EMBED_FLAG_RELOADBYPASSPROXY = 2,
 
173
  GTK_MOZ_EMBED_FLAG_RELOADBYPASSPROXYANDCACHE = 3,
 
174
  GTK_MOZ_EMBED_FLAG_RELOADCHARSETCHANGE = 4
 
175
} GtkMozEmbedReloadFlags;
 
176
 
 
177
/* These are straight out of nsIWebBrowserChrome.h */
 
178
 
 
179
typedef enum
 
180
{
 
181
  GTK_MOZ_EMBED_FLAG_DEFAULTCHROME = 1U,
 
182
  GTK_MOZ_EMBED_FLAG_WINDOWBORDERSON = 2U,
 
183
  GTK_MOZ_EMBED_FLAG_WINDOWCLOSEON = 4U,
 
184
  GTK_MOZ_EMBED_FLAG_WINDOWRESIZEON = 8U,
 
185
  GTK_MOZ_EMBED_FLAG_MENUBARON = 16U,
 
186
  GTK_MOZ_EMBED_FLAG_TOOLBARON = 32U,
 
187
  GTK_MOZ_EMBED_FLAG_LOCATIONBARON = 64U,
 
188
  GTK_MOZ_EMBED_FLAG_STATUSBARON = 128U,
 
189
  GTK_MOZ_EMBED_FLAG_PERSONALTOOLBARON = 256U,
 
190
  GTK_MOZ_EMBED_FLAG_SCROLLBARSON = 512U,
 
191
  GTK_MOZ_EMBED_FLAG_TITLEBARON = 1024U,
 
192
  GTK_MOZ_EMBED_FLAG_EXTRACHROMEON = 2048U,
 
193
  GTK_MOZ_EMBED_FLAG_ALLCHROME = 4094U,
 
194
  GTK_MOZ_EMBED_FLAG_WINDOWRAISED = 33554432U,
 
195
  GTK_MOZ_EMBED_FLAG_WINDOWLOWERED = 67108864U,
 
196
  GTK_MOZ_EMBED_FLAG_CENTERSCREEN = 134217728U,
 
197
  GTK_MOZ_EMBED_FLAG_DEPENDENT = 268435456U,
 
198
  GTK_MOZ_EMBED_FLAG_MODAL = 536870912U,
 
199
  GTK_MOZ_EMBED_FLAG_OPENASDIALOG = 1073741824U,
 
200
  GTK_MOZ_EMBED_FLAG_OPENASCHROME = 2147483648U 
 
201
} GtkMozEmbedChromeFlags;
 
202
 
 
203
/* this is a singleton object that you can hook up to to get signals
 
204
   that are not handed out on a per widget basis. */
 
205
 
 
206
typedef struct _GtkMozEmbedSingle      GtkMozEmbedSingle;
 
207
typedef struct _GtkMozEmbedSingleClass GtkMozEmbedSingleClass;
 
208
 
 
209
struct _GtkMozEmbedSingle
 
210
{
 
211
  GtkObject  object;
 
212
  void      *data;
 
213
};
 
214
 
 
215
struct _GtkMozEmbedSingleClass
 
216
{
 
217
  GtkObjectClass parent_class;
 
218
 
 
219
  void (* new_window_orphan)   (GtkMozEmbedSingle *embed,
 
220
                                GtkMozEmbed **newEmbed,
 
221
                                guint chromemask);
 
222
};
 
223
 
 
224
GtkMozEmbedSingle *
 
225
gtk_moz_embed_single_get(void);
 
226
 
 
227
#ifdef __cplusplus
 
228
}
 
229
#endif /* __cplusplus */
 
230
 
 
231
#endif /* gtkmozembed_h */