~ubuntu-branches/debian/squeeze/galeon/squeeze

« back to all changes in this revision

Viewing changes to mozilla/GaleonWrapper.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Howard
  • Date: 2004-06-06 09:02:01 UTC
  • Revision ID: james.westby@ubuntu.com-20040606090201-yhx6ruhq8um7ggs2
Tags: upstream-1.3.15
ImportĀ upstreamĀ versionĀ 1.3.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2000 Marco Pesenti Gritti
 
3
 *
 
4
 *  This program is free software; you can redistribute it and/or modify
 
5
 *  it under the terms of the GNU General Public License as published by
 
6
 *  the Free Software Foundation; either version 2, or (at your option)
 
7
 *  any later version.
 
8
 *
 
9
 *  This program is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *  GNU General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU General Public License
 
15
 *  along with this program; if not, write to the Free Software
 
16
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
17
 */
 
18
 
 
19
#ifndef GALEON_WRAPPER_H
 
20
#define GALEON_WRAPPER_H
 
21
 
 
22
#include "nsIDocShell.h"
 
23
#include "nsIWebNavigation.h"
 
24
#include "nsIWebPageDescriptor.h"
 
25
#include "nsISHistory.h"
 
26
#include "nsIWebBrowser.h"
 
27
#include "nsIWebProgressListener.h"
 
28
#include "nsCOMPtr.h"
 
29
#include "nsIDOMEventReceiver.h"
 
30
#include "nsIDOMDocument.h"
 
31
#include "nsPIDOMWindow.h"
 
32
#include "nsIDOMEventListener.h"
 
33
#include "nsIChannel.h"
 
34
#include "nsICacheEntryDescriptor.h"
 
35
#include "nsIStyleSheet.h"
 
36
#include "nsString.h"
 
37
#include <gtkmozembed.h>
 
38
 
 
39
#include "nsIPrintSettings.h"
 
40
 
 
41
#ifdef HAVE_MOZILLA_PSM
 
42
class nsISSLStatus;
 
43
#endif
 
44
 
 
45
class GDOMEventListener : public nsIDOMEventListener
 
46
{
 
47
  public:
 
48
        NS_DECL_ISUPPORTS
 
49
        NS_DECL_NSIDOMEVENTLISTENER
 
50
 
 
51
        GDOMEventListener();
 
52
        virtual ~GDOMEventListener();
 
53
 
 
54
        nsresult Init(GaleonEmbed* aEmbed);
 
55
 
 
56
  protected:
 
57
        GaleonEmbed     *mEmbed;
 
58
};
 
59
 
 
60
class GDOMPopupEventListener : public GDOMEventListener
 
61
{
 
62
  public:
 
63
        NS_DECL_ISUPPORTS
 
64
        NS_DECL_NSIDOMEVENTLISTENER
 
65
        GDOMPopupEventListener() : GDOMEventListener() {}
 
66
        virtual ~GDOMPopupEventListener() {}
 
67
};
 
68
 
 
69
class GaleonWrapper
 
70
{
 
71
  public:
 
72
        GaleonWrapper();
 
73
        ~GaleonWrapper();
 
74
 
 
75
        nsresult Init (GtkMozEmbed *mozembed);
 
76
        nsresult Destroy (void);
 
77
 
 
78
        nsresult SetZoom (float aTextZoom, PRBool reflow);
 
79
        nsresult GetZoom (float *aTextZoom);
 
80
 
 
81
        nsresult Print (nsIPrintSettings *options, PRBool preview);
 
82
        nsresult GetPrintSettings (nsIPrintSettings * *options);
 
83
        nsresult PrintPreviewClose (void);
 
84
        nsresult PrintPreviewNumPages (int *numPages);
 
85
        nsresult PrintPreviewNavigate(PRInt16 navType, PRInt32 pageNum);
 
86
 
 
87
        nsresult FindSetProperties (const PRUnichar *search_string,
 
88
                                    PRBool case_sensitive,
 
89
                                    PRBool wrap_around);
 
90
 
 
91
        nsresult Find (PRBool backwards, PRBool *didFind);
 
92
 
 
93
        nsresult GetMainDocumentUrl (nsCString &url);
 
94
        nsresult GetDocumentUrl (nsCString &url);
 
95
 
 
96
        nsresult ReloadDocument ();
 
97
        nsresult LoadDocument(nsISupports *aPageDescriptor, PRUint32 aDisplayType);
 
98
        nsresult GetPageDescriptor(nsISupports **aPageDescriptor);
 
99
 
 
100
        nsresult GetSHInfo (PRInt32 *count, PRInt32 *index);
 
101
        nsresult GetSHTitleAtIndex (PRInt32 index, PRUnichar **title);
 
102
        nsresult GetSHUrlAtIndex (PRInt32 index, nsCString &url);
 
103
 
 
104
        nsresult CopyHistoryTo (GaleonWrapper *embed, PRBool back_history,
 
105
                                PRBool forward_history, PRBool set_current);
 
106
 
 
107
        nsresult GoToHistoryIndex (PRInt16 index);
 
108
 
 
109
        nsresult ClearHistory();
 
110
 
 
111
        nsresult ForceEncoding (const char *encoding);
 
112
        
 
113
        nsresult GetEncodingInfo (GaleonEncodingPageInfo **info);
 
114
        
 
115
        nsresult GetHasModifiedForms (PRBool *modified);
 
116
 
 
117
        nsresult CanCutSelection(PRBool *result);
 
118
 
 
119
        nsresult CanCopySelection(PRBool *result);
 
120
 
 
121
        nsresult CanPaste(PRBool *result);
 
122
 
 
123
        nsresult CutSelection(void);
 
124
 
 
125
        nsresult CopySelection(void);
 
126
 
 
127
        nsresult Paste(void);
 
128
 
 
129
        nsresult GetStyleSheets (nsIDOMStyleSheetList **list);
 
130
 
 
131
        nsresult GetMainDOMDocument (nsIDOMDocument **aDOMDocument);
 
132
 
 
133
        nsresult LoadOverrideStyleSheet (char *css,
 
134
                                         nsIStyleSheet **return_sheet);
 
135
        nsresult RemoveOverrideStyleSheet (nsIStyleSheet *remove);
 
136
 
 
137
        nsresult GetLinkInterfaceItems (GList **list);
 
138
 
 
139
        nsresult GetRealURL (nsCString &ret);
 
140
 
 
141
        nsresult SelectAll (void);
 
142
 
 
143
        nsresult ScrollUp (void);
 
144
        nsresult ScrollDown (void);
 
145
        nsresult ScrollLeft (void);
 
146
        nsresult ScrollRight (void);
 
147
 
 
148
        nsresult FineScroll (int horiz, int vert);
 
149
 
 
150
        nsresult GetPageProperties (EmbedPageProperties *props);
 
151
        nsresult ShowPageCertificate ();
 
152
 
 
153
        nsresult GetSecurityTooltip (char **tooltip);
 
154
 
 
155
        nsresult EvaluateJS (char *script);
 
156
 
 
157
        nsresult PushTargetDocument (nsIDOMDocument *domDoc);
 
158
        nsresult PopTargetDocument ();
 
159
 
 
160
        nsresult GetDOMDocument (nsIDOMDocument **aDOMDocument);
 
161
        nsresult GetDOMWindow (nsIDOMWindow **aDOMWindow);
 
162
 
 
163
        nsresult SetChannel (nsIChannel *channel);
 
164
 
 
165
        nsCOMPtr<nsIWebBrowser>           mWebBrowser;
 
166
  private:
 
167
 
 
168
        nsCOMPtr<nsIDOMDocument> mTargetDocument;
 
169
        nsCOMPtr<nsIChannel> mChannel;
 
170
 
 
171
        nsCOMPtr<nsIDOMEventTarget> mEventTarget;
 
172
        nsCOMPtr<GDOMEventListener> mFaviconEventListener;
 
173
        nsCOMPtr<GDOMEventListener> mPopupEventListener;
 
174
 
 
175
        nsresult SetZoomOnDocshell (float aZoom, nsIDocShell *DocShell);
 
176
        nsresult GetDocShell (nsIDocShell **aDocShell);
 
177
        nsresult GetFocusedDOMWindow (nsIDOMWindow **aDOMWindow);
 
178
        nsresult GetSHistory (nsISHistory **aSHistory);
 
179
        nsresult GetWebNavigation(nsIWebNavigation **aWebNavigation);
 
180
 
 
181
#ifdef HAVE_MOZILLA_PSM
 
182
        nsresult GetSSLStatus (nsISSLStatus **aSSLStatus);
 
183
#endif
 
184
 
 
185
        nsresult GetCacheEntryDescriptor(const nsAString &aKey,
 
186
                                         nsICacheEntryDescriptor **aCacheEntryDescriptor);
 
187
        nsresult GetDocumentHasModifiedForms (nsIDOMDocument *aDomDoc, 
 
188
                                              PRUint32 *aNumTextFields, PRBool *aIsModified);
 
189
 
 
190
        nsresult GetPageSecurityInfo (EmbedPageProperties *props);
 
191
        nsresult GetMetaTags(GList **ret);
 
192
        nsresult GetImages (GList **ret);
 
193
        nsresult GetForms (GList **ret);
 
194
        nsresult GetLinks (GList **ret);
 
195
};
 
196
 
 
197
#endif