2 * Copyright 2005 Jacek Caban
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library 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 GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * This file is not an usual idl file. Interfaces in this file are XPCOM interfaces
22 * (NOT MSCOM!), but we generate the header file with WIDL compatibile with XPCOM,
28 typedef HRESULT nsresult;
29 typedef ULONG nsrefcnt;
33 typedef REFIID nsIIDRef;
34 typedef nsIIDRef nsCIDRef;
36 typedef void** nsQIResult;
37 typedef LPSTR nsstring;
38 typedef WCHAR PRUnichar;
39 typedef LPWSTR nswstring;
40 typedef ULONG PRUint32;
44 typedef LARGE_INTEGER PRInt64;
46 typedef int nsAString;
47 typedef struct nsACString nsACString;
49 interface nsIWebBrowserChrome;
53 uuid(00000000-0000-0000-c000-000000000046)
57 nsresult QueryInterface(nsIIDRef riid, nsQIResult result);
62 /* Currently we don't need a full declaration of these interfaces */
63 typedef nsISupports nsIWeakReference;
64 typedef nsISupports nsIURIContentListener;
65 typedef nsISupports nsIDOMWindow;
66 typedef nsISupports nsIInputStream;
67 typedef nsISupports nsIDOMDocument;
68 typedef nsISupports nsISHistory;
69 typedef nsISupports nsISimpleEnumerator;
70 typedef nsISupports nsIWidget;
71 typedef nsISupports nsIProtocolHandler;
72 typedef nsISupports nsIChannel;
76 uuid(8bb35ed9-e332-462d-9155-4a002ab5c958)
78 interface nsIServiceManager : nsISupports
80 nsresult GetService(nsCIDRef aClass, nsIIDRef aIID, void **result);
81 nsresult GetServiceByContactID(nsstring aContactID, nsIIDRef aIID, void **result);
82 nsresult IsServiceInstantiated(nsCIDRef aClass, nsIIDRef aIID, BOOL *_retval);
83 nsresult IsServiceInstantiatedByContractID(nsstring aContractID, nsIIDRef aIID, BOOL *_retval);
88 uuid(db242e01-e4d9-11d2-9dde-000064657374)
90 interface nsIObserver : nsISupports
92 nsresult Observe(nsISupports *aSubject, nsstring aTopic, nswstring aData);
97 uuid(a88e5a60-205a-4bb1-94e1-2628daf51eae)
99 interface nsIComponentManager : nsISupports
101 nsresult GetClassObject(nsCIDRef aClass, nsIIDRef aIID, nsQIResult result);
102 nsresult GetClassObjectByContractID(nsstring aContractID, nsIIDRef aIID, nsQIResult result);
103 nsresult CreateInstance(nsCIDRef aClass, nsISupports *aDelegate, nsIIDRef aIID,
105 nsresult CreateInstanceByContractID(nsstring aContractID, nsISupports *aDelegate,
106 nsIIDRef aIID, nsQIResult result);
111 uuid(07a22cc0-0ce5-11d3-9331-00104ba0fd40)
113 interface nsIURI : nsISupports
115 nsresult GetSpec(nsACString *aSpec);
116 nsresult SetSpec(const nsACString *aSpec);
117 nsresult GetPrePath(nsACString *aPrePath);
118 nsresult GetScheme(nsACString *aScheme);
119 nsresult SetScheme(const nsACString *aScheme);
120 nsresult GetUserPass(nsACString *aUserPass);
121 nsresult SetUserPass(const nsACString *aUserPass);
122 nsresult GetUsername(nsACString *aUsername);
123 nsresult SetUsername(const nsACString *aUsername);
124 nsresult GetPassword(nsACString *aPassword);
125 nsresult SetPassword(const nsACString *aPassword);
126 nsresult GetHostPort(nsACString *aHostPort);
127 nsresult SetHostPort(const nsACString *aHostPort);
128 nsresult GetHost(nsACString *aHost);
129 nsresult SetHost(const nsACString *aHost);
130 nsresult GetPort(PRInt32 *aPort);
131 nsresult SetPort(PRInt32 aPort);
132 nsresult GetPath(nsACString *aPath);
133 nsresult SetPath(const nsACString *aPath);
134 nsresult Equals(nsIURI *other, PRBool *_retval);
135 nsresult SchemeIs(const char *scheme, PRBool *_retval);
136 nsresult Clone(nsIURI **_retval);
137 nsresult Resolve(const nsACString *relativePath, nsACString *_retval);
138 nsresult GetAsciiSpec(nsACString *aAsciiSpec);
139 nsresult GetAsciiHost(nsACString *aAsciiHost);
140 nsresult GetOriginCharset(nsACString *aOriginCharset);
145 uuid(69e5df00-7b8b-11d3-af61-00a024ffc08c)
147 interface nsIWebBrowser : nsISupports
149 nsresult AddWebBrowserListener(nsIWeakReference *aListener, const nsIID *aIID);
150 nsresult RemoveWebBrowserListener(nsIWeakReference *aListener, const nsIID *aIID);
151 nsresult GetContainerWindow(nsIWebBrowserChrome **aContainerWindow);
152 nsresult SetContainerWindow(nsIWebBrowserChrome *aContainerWindow);
153 nsresult GetParentURIContentListener(nsIURIContentListener **aParentURIContentListener);
154 nsresult SetParentURIContentListener(nsIURIContentListener *aParentURIContentListener);
155 nsresult GetContentDOMWindow(nsIDOMWindow **aContentDOMWindow);
158 cpp_quote("#define SETUP_IS_CHROME_WRAPPER 7");
162 uuid(f15398a0-8018-11d3-af70-00a024ffc08c)
164 interface nsIWebBrowserSetup : nsISupports
166 nsresult SetProperty(PRUint32 aId, PRUint32 aValue);
169 typedef void* nativeWindow;
173 uuid(046bc8a0-8015-11d3-af70-00a024ffc08c)
175 interface nsIBaseWindow : nsISupports
177 nsresult InitWindow(nativeWindow parentNativeWindow, nsIWidget *parentWidget, PRInt32 x,
178 PRInt32 y, PRInt32 cx, PRInt32 cy);
181 nsresult SetPosition(PRInt32 x, PRInt32 y);
182 nsresult GetPosition(PRInt32 *x, PRInt32 *y);
183 nsresult SetSize(PRInt32 cx, PRInt32 cy, PRBool fRepaint);
184 nsresult GetSize(PRInt32 *cx, PRInt32 *cy);
185 nsresult SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy, PRBool fRepaint);
186 nsresult GetPositionAndSize(PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy);
187 nsresult Repaint(PRBool force);
188 nsresult GetParentWidget(nsIWidget **aParentWidget);
189 nsresult SetParentWidget(nsIWidget *aParentWidget);
190 nsresult GetParentNativeWindow(nativeWindow *aParentNativeWindow);
191 nsresult SetParentNativeWindow(nativeWindow aParentNativeWindow);
192 nsresult GetVisibility(PRBool *aVisibility);
193 nsresult SetVisibility(PRBool aVisibility);
194 nsresult GetEnabled(PRBool *aEnabled);
195 nsresult SetEnabled(PRBool aEnabled);
196 nsresult GetBlurSuppression(PRBool *aBlurSuppression);
197 nsresult SetBlurSuppression(PRBool aBlurSuppression);
198 nsresult GetMainWidget(nsIWidget **aMainWidget);
200 nsresult GetTitle(PRUnichar **aTitle);
201 nsresult SetTitle(const PRUnichar *aTitle);
204 cpp_quote("#define LOAD_FLAGS_NONE 0");
208 uuid(f5d9e7b0-d930-11d3-b057-00a024ffc08c)
210 interface nsIWebNavigation : nsISupports
212 nsresult GetCanGoBack(PRBool *aCanGoBack);
213 nsresult GetCanGoForward(PRBool *aCanGoForward);
215 nsresult GoForward();
216 nsresult GotoIndex(PRInt32 index);
217 nsresult LoadURI(const PRUnichar *aURI, PRUint32 aLoadFlags, nsIURI *aReferrer,
218 nsIInputStream *aPostData, nsIInputStream *aHeaders);
219 nsresult Reload(PRUint32 aReloadFlags);
220 nsresult Stop(PRUint32 aStopFlags);
221 nsresult GetDocument(nsIDOMDocument **aDocument);
222 nsresult GetCurrentURI(nsIURI **aCurrentURI);
223 nsresult GetReferringURI(nsIURI **aReferringURI);
224 nsresult GetSessionHistory(nsISHistory **aSessionHistory);
225 nsresult SetSessionHistory(nsISHistory *aSessionHistory);
230 uuid(c8c0a080-0868-11d3-915f-d9d889d48e3c)
232 interface nsIFile : nsISupports
234 nsresult Append(const nsAString *node);
235 nsresult AppendNative(const nsAString *node);
236 nsresult Normalize();
237 nsresult Create(PRUint32 type, PRUint32 permission);
238 nsresult GetLeafName(nsAString *aLeafName);
239 nsresult SetLeafName(const nsAString *aLeafName);
240 nsresult GetNativeLeafName(nsAString *aLeafName);
241 nsresult SetNativeLeafName(const nsAString *aLeafName);
242 nsresult CopyTo(nsIFile *newParentDir, const nsAString *newName);
243 nsresult CopyToNative(nsIFile *newParentDir, const nsAString *newName);
244 nsresult CopyToFollowingLinks(nsIFile *newParentDir, const nsAString *newName);
245 nsresult CopyToFollowingLinksNative(nsIFile *newParentDir, const nsAString *newName);
246 nsresult MoveTo(nsIFile *newParentDir, const nsAString *newName);
247 nsresult MoveToNative(nsIFile *newParentDir, const nsAString *newName);
248 nsresult Remove(PRBool recursive);
249 nsresult GetPermissions(PRUint32 *aPermissions);
250 nsresult SetPermissions(PRUint32 pPermissions);
251 nsresult GetPermissionsOfLink(PRUint32 *aPermissions);
252 nsresult SetPermissionsOfLink(PRUint32 pPermissions);
253 nsresult GetLastModifiedTime(PRInt64 *aLastModifiedTime);
254 nsresult SetLastModifiedTime(PRInt64 aLastModifiedTime);
255 nsresult GetFileSize(PRInt64 *aFileSize);
256 nsresult SetFileSize(PRInt64 aFileSize);
257 nsresult GetFileSizeOfLink(PRInt64 *aFileSizeOfLink);
258 nsresult GetTarget(nsAString *aTarget);
259 nsresult GetNativeTarget(nsACString *aNativeTarget);
260 nsresult GetPath(nsAString *aPath);
261 nsresult GetNativePath(nsACString *aNativePath);
262 nsresult Exists(PRBool *_retval);
263 nsresult IsWritable(PRBool *_retval);
264 nsresult IsReadable(PRBool *_retval);
265 nsresult IsExecutable(PRBool *_retval);
266 nsresult IsHidden(PRBool *_retval);
267 nsresult IsDirectory(PRBool *_retval);
268 nsresult IsFile(PRBool *_retval);
269 nsresult IsSymlink(PRBool *_retval);
270 nsresult IsSpecial(PRBool *_retval);
271 nsresult CreateUnique(PRUint32 type, PRUint32 permission);
272 nsresult Clone(nsIFile **_retval);
273 nsresult Equals(nsIFile *inFile, PRBool *_retval);
274 nsresult Contains(nsIFile *inFile, PRBool recir, PRBool *_retval);
275 nsresult GetParent(nsIFile **aParent);
276 nsresult GetDirectoryEntries(nsISimpleEnumerator **aDirectoryEntries);
281 uuid(86d02f0e-219b-4cfc-9c88-bd98d2cce0b8)
283 interface nsIWebBrowserStream : nsISupports
285 nsresult OpenStream(nsIURI *aBaseURI, nsACString *aContentType);
286 nsresult AppendToStream(PRUint8 *aData, PRUint32 aLen);
287 nsresult CloseStream();
292 uuid(bddeda3f-9020-4d12-8c70-984ee9f7935e)
294 interface nsIIOService : nsISupports
296 nsresult GetProtocolHandler(const char *aScheme, nsIProtocolHandler **_retval);
297 nsresult GetProtocolFlags(const char *aScheme, PRUint32 *_retval);
298 nsresult NewURI(const nsACString *aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval);
299 nsresult NewFileURI(nsIFile *aFile, nsIURI **_retval);
300 nsresult NewChannelFromURI(nsIURI *aURI, nsIChannel **_retval);
301 nsresult NewChannel(const nsACString *aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIChannel **_retval);
302 nsresult GetOffline(PRBool *aOffline);
303 nsresult SetOffline(PRBool aOffline);
304 nsresult AllowPort(PRInt32 aPort, const char *aScheme, PRBool *_retval);