2
* Copyright (C) 2000 Marco Pesenti Gritti
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)
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.
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.
19
#ifndef GALEON_WRAPPER_H
20
#define GALEON_WRAPPER_H
22
#include "nsIDocShell.h"
23
#include "nsIWebNavigation.h"
24
#include "nsIWebPageDescriptor.h"
25
#include "nsISHistory.h"
26
#include "nsIWebBrowser.h"
27
#include "nsIWebProgressListener.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"
37
#include <gtkmozembed.h>
39
#include "nsIPrintSettings.h"
41
#ifdef HAVE_MOZILLA_PSM
45
class GDOMEventListener : public nsIDOMEventListener
49
NS_DECL_NSIDOMEVENTLISTENER
52
virtual ~GDOMEventListener();
54
nsresult Init(GaleonEmbed* aEmbed);
60
class GDOMPopupEventListener : public GDOMEventListener
64
NS_DECL_NSIDOMEVENTLISTENER
65
GDOMPopupEventListener() : GDOMEventListener() {}
66
virtual ~GDOMPopupEventListener() {}
75
nsresult Init (GtkMozEmbed *mozembed);
76
nsresult Destroy (void);
78
nsresult SetZoom (float aTextZoom, PRBool reflow);
79
nsresult GetZoom (float *aTextZoom);
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);
87
nsresult FindSetProperties (const PRUnichar *search_string,
88
PRBool case_sensitive,
91
nsresult Find (PRBool backwards, PRBool *didFind);
93
nsresult GetMainDocumentUrl (nsCString &url);
94
nsresult GetDocumentUrl (nsCString &url);
96
nsresult ReloadDocument ();
97
nsresult LoadDocument(nsISupports *aPageDescriptor, PRUint32 aDisplayType);
98
nsresult GetPageDescriptor(nsISupports **aPageDescriptor);
100
nsresult GetSHInfo (PRInt32 *count, PRInt32 *index);
101
nsresult GetSHTitleAtIndex (PRInt32 index, PRUnichar **title);
102
nsresult GetSHUrlAtIndex (PRInt32 index, nsCString &url);
104
nsresult CopyHistoryTo (GaleonWrapper *embed, PRBool back_history,
105
PRBool forward_history, PRBool set_current);
107
nsresult GoToHistoryIndex (PRInt16 index);
109
nsresult ClearHistory();
111
nsresult ForceEncoding (const char *encoding);
113
nsresult GetEncodingInfo (GaleonEncodingPageInfo **info);
115
nsresult GetHasModifiedForms (PRBool *modified);
117
nsresult CanCutSelection(PRBool *result);
119
nsresult CanCopySelection(PRBool *result);
121
nsresult CanPaste(PRBool *result);
123
nsresult CutSelection(void);
125
nsresult CopySelection(void);
127
nsresult Paste(void);
129
nsresult GetStyleSheets (nsIDOMStyleSheetList **list);
131
nsresult GetMainDOMDocument (nsIDOMDocument **aDOMDocument);
133
nsresult LoadOverrideStyleSheet (char *css,
134
nsIStyleSheet **return_sheet);
135
nsresult RemoveOverrideStyleSheet (nsIStyleSheet *remove);
137
nsresult GetLinkInterfaceItems (GList **list);
139
nsresult GetRealURL (nsCString &ret);
141
nsresult SelectAll (void);
143
nsresult ScrollUp (void);
144
nsresult ScrollDown (void);
145
nsresult ScrollLeft (void);
146
nsresult ScrollRight (void);
148
nsresult FineScroll (int horiz, int vert);
150
nsresult GetPageProperties (EmbedPageProperties *props);
151
nsresult ShowPageCertificate ();
153
nsresult GetSecurityTooltip (char **tooltip);
155
nsresult EvaluateJS (char *script);
157
nsresult PushTargetDocument (nsIDOMDocument *domDoc);
158
nsresult PopTargetDocument ();
160
nsresult GetDOMDocument (nsIDOMDocument **aDOMDocument);
161
nsresult GetDOMWindow (nsIDOMWindow **aDOMWindow);
163
nsresult SetChannel (nsIChannel *channel);
165
nsCOMPtr<nsIWebBrowser> mWebBrowser;
168
nsCOMPtr<nsIDOMDocument> mTargetDocument;
169
nsCOMPtr<nsIChannel> mChannel;
171
nsCOMPtr<nsIDOMEventTarget> mEventTarget;
172
nsCOMPtr<GDOMEventListener> mFaviconEventListener;
173
nsCOMPtr<GDOMEventListener> mPopupEventListener;
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);
181
#ifdef HAVE_MOZILLA_PSM
182
nsresult GetSSLStatus (nsISSLStatus **aSSLStatus);
185
nsresult GetCacheEntryDescriptor(const nsAString &aKey,
186
nsICacheEntryDescriptor **aCacheEntryDescriptor);
187
nsresult GetDocumentHasModifiedForms (nsIDOMDocument *aDomDoc,
188
PRUint32 *aNumTextFields, PRBool *aIsModified);
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);