aboutsummaryrefslogtreecommitdiffstats
path: root/embed/xulrunner/src/gecko-embed.h
blob: 8aec90bc2500d8262f1c2535d645f9a6fca7291e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*
 *  Copyright © Christopher Blizzard
 *  Copyright © Ramiro Estrugo 
 *  Copyright © 2006 Christian Persch
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation; either version 2.1, or (at your option)
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 *  ---------------------------------------------------------------------------
 *  Derived from Mozilla.org code, which had the following attributions:
 *
 *  The Original Code is mozilla.org code.
 *
 *  The Initial Developer of the Original Code is
 *  Christopher Blizzard. Portions created by Christopher Blizzard are Copyright © Christopher Blizzard.  All Rights Reserved.
 *  Portions created by the Initial Developer are Copyright © 2001
 *  the Initial Developer. All Rights Reserved.
 *
 *  Contributor(s):
 *    Christopher Blizzard <blizzard@mozilla.org>
 *    Ramiro Estrugo <ramiro@eazel.com>
 *  ---------------------------------------------------------------------------
 *
 *  $Id$
 */

#ifndef gecko_embed_h
#define gecko_embed_h

#include <stddef.h>
#include <gtk/gtk.h>

G_BEGIN_DECLS

#define GECKO_TYPE_EMBED         (gecko_embed_get_type())
#define GECKO_EMBED(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GECKO_TYPE_EMBED, GeckoEmbed))
#define GECKO_EMBED_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GECKO_TYPE_EMBED, GeckoEmbedClass))
#define GECKO_IS_EMBED(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GECKO_TYPE_EMBED))
#define GECKO_IS_EMBED_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GECKO_TYPE_EMBED))
#define GECKO_EMBED_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GECKO_TYPE_EMBED, GeckoEmbedClass))

typedef struct _GeckoEmbed        GeckoEmbed;
typedef struct _GeckoEmbedPrivate GeckoEmbedPrivate;
typedef struct _GeckoEmbedClass   GeckoEmbedClass;

struct _GeckoEmbed
{
  GtkBin parent_instance;

  /*< private >*/
  GeckoEmbedPrivate *priv;
};

struct _GeckoEmbedClass
{
  GtkBinClass parent_class;

  /* Signals */

  /* Network */
  gboolean (* open_uri)            (GeckoEmbed *embed, const char *aURI);
  void     (* net_start)           (GeckoEmbed *embed);
  void     (* net_stop)            (GeckoEmbed *embed);
  void     (* net_state)           (GeckoEmbed *embed, int state, guint status);
  void     (* net_state_all)       (GeckoEmbed *embed, const char *aURI,
                                    int state, guint status);
  void     (* progress)            (GeckoEmbed *embed, int curprogress,
                                    int maxprogress);
  void     (* progress_all)        (GeckoEmbed *embed, const char *aURI,
                                    int curprogress, int maxprogress);
  void     (* security_change)     (GeckoEmbed *embed, gpointer request,
                                    guint state);
  void     (* status_change)       (GeckoEmbed *embed, gpointer request,
                                    int status, gpointer message);

  /* Document */
  void     (* link_message)        (GeckoEmbed *embed);
  void     (* js_status_message)   (GeckoEmbed *embed);
  void     (* location)            (GeckoEmbed *embed);
  void     (* title)               (GeckoEmbed *embed);
  void     (* visibility)          (GeckoEmbed *embed, gboolean visibility);
  void     (* destroy_browser)     (GeckoEmbed *embed);
  void     (* size_to)             (GeckoEmbed *embed, int width, int height);


  /* misc. */
  void (* new_window)          (GeckoEmbed *embed, GeckoEmbed **newEmbed,
                                guint chromemask);

  /* reserved for future use */
  void (* reserved_0) (void);
  void (* reserved_1) (void);
  void (* reserved_2) (void);
  void (* reserved_3) (void);
  void (* reserved_4) (void);
  void (* reserved_5) (void);
  void (* reserved_6) (void);
  void (* reserved_7) (void);
  void (* reserved_8) (void);
  void (* reserved_9) (void);
  void (* reserved_a) (void);
  void (* reserved_b) (void);
  void (* reserved_c) (void);
  void (* reserved_d) (void);
  void (* reserved_e) (void);
  void (* reserved_f) (void);
};

GType      gecko_embed_get_type         (void);
GtkWidget   *gecko_embed_new              (void);
void         gecko_embed_load_url         (GeckoEmbed *embed, 
                         const char *url);
void         gecko_embed_stop_load        (GeckoEmbed *embed);
gboolean     gecko_embed_can_go_back      (GeckoEmbed *embed);
gboolean     gecko_embed_can_go_forward   (GeckoEmbed *embed);
void         gecko_embed_go_back          (GeckoEmbed *embed);
void         gecko_embed_go_forward       (GeckoEmbed *embed);
void         gecko_embed_render_data      (GeckoEmbed *embed, 
                         const char *data,
                         guint32 len,
                         const char *base_uri, 
                         const char *mime_type);
void         gecko_embed_open_stream      (GeckoEmbed *embed,
                         const char *base_uri,
                         const char *mime_type);
void         gecko_embed_append_data      (GeckoEmbed *embed,
                         const char *data, guint32 len);
void         gecko_embed_close_stream     (GeckoEmbed *embed);
char        *gecko_embed_get_link_message (GeckoEmbed *embed);
char        *gecko_embed_get_js_status    (GeckoEmbed *embed);
char        *gecko_embed_get_title        (GeckoEmbed *embed);
char        *gecko_embed_get_location     (GeckoEmbed *embed);
void         gecko_embed_reload           (GeckoEmbed *embed, gint32 flags);
void         gecko_embed_set_chrome_mask  (GeckoEmbed *embed, 
                         guint32 flags);
guint32      gecko_embed_get_chrome_mask  (GeckoEmbed *embed);

G_END_DECLS

#endif /* gecko_embed_h */