1 // FIXME; IID's are not consistant with SWT version
2 
3 module org.eclipse.swt.internal.mozilla.nsIDocShell;
4 
5 import java.lang.all;
6 
7 import org.eclipse.swt.internal.mozilla.Common;
8 import org.eclipse.swt.internal.mozilla.nsID;
9 import org.eclipse.swt.internal.mozilla.nsISupports;
10 
11 import org.eclipse.swt.internal.mozilla.nsIURI;
12 import org.eclipse.swt.internal.mozilla.nsIChannel;
13 import org.eclipse.swt.internal.mozilla.nsIContentViewer;
14 import org.eclipse.swt.internal.mozilla.nsIURIContentListener;
15 import org.eclipse.swt.internal.mozilla.nsIChromeEventHandler;
16 import org.eclipse.swt.internal.mozilla.nsIDocShellLoadInfo;
17 import org.eclipse.swt.internal.mozilla.nsIDocumentCharsetInfo;
18 import org.eclipse.swt.internal.mozilla.nsIWebNavigation;
19 import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
20 import org.eclipse.swt.internal.mozilla.nsIInputStream;
21 import org.eclipse.swt.internal.mozilla.nsIRequest;
22 import org.eclipse.swt.internal.mozilla.nsISHEntry;
23 import org.eclipse.swt.internal.mozilla.nsISecureBrowserUI;
24 import org.eclipse.swt.internal.mozilla.nsIDOMStorage;
25 import org.eclipse.swt.internal.mozilla.nsStringAPI;
26 
27 /******************************************************************************
28 
29 ******************************************************************************/
30 
31 const char[] NS_IDOCSHELL_IID_STR = "69e5de00-7b8b-11d3-af61-00a024ffc08c";
32 
33 const nsIID NS_IDOCSHELL_IID= 
34   { 0x69e5de00, 0x7b8b, 0x11d3, [0xaf,0x61,0x00,0xa0,0x24,0xff,0xc0,0x8c] };
35 interface nsIDocShell : nsISupports {
36 
37   static const char[] IID_STR = NS_IDOCSHELL_IID_STR;
38   static const nsIID IID = NS_IDOCSHELL_IID;
39 
40 extern(System):
41   nsresult LoadURI(nsIURI uri, nsIDocShellLoadInfo loadInfo, PRUint32 aLoadFlags, PRBool firstParty);
42   nsresult LoadStream(nsIInputStream aStream, nsIURI aURI, nsACString * aContentType, nsACString * aContentCharset, nsIDocShellLoadInfo aLoadInfo);
43 
44   enum { INTERNAL_LOAD_FLAGS_NONE = 0 };
45   enum { INTERNAL_LOAD_FLAGS_INHERIT_OWNER = 1 };
46   enum { INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER = 2 };
47   enum { INTERNAL_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 4 };
48   enum { INTERNAL_LOAD_FLAGS_FIRST_LOAD = 8 };
49 
50   nsresult InternalLoad(nsIURI aURI, nsIURI aReferrer, nsISupports aOwner, PRUint32 aFlags, PRUnichar *aWindowTarget, char *aTypeHint, nsIInputStream aPostDataStream, nsIInputStream aHeadersStream, PRUint32 aLoadFlags, nsISHEntry aSHEntry, PRBool firstParty, nsIDocShell *aDocShell, nsIRequest *aRequest);
51 
52   nsresult CreateLoadInfo(nsIDocShellLoadInfo *loadInfo);
53   nsresult PrepareForNewContentModel();
54   nsresult SetCurrentURI(nsIURI aURI);
55   nsresult FirePageHideNotification(PRBool isUnload);
56   nsresult GetPresContext(nsPresContext * *aPresContext);
57   nsresult GetPresShell(nsIPresShell * *aPresShell);
58   nsresult GetEldestPresShell(nsIPresShell * *aEldestPresShell);
59   nsresult GetContentViewer(nsIContentViewer  *aContentViewer);
60   nsresult GetChromeEventHandler(nsIChromeEventHandler  *aChromeEventHandler);
61   nsresult SetChromeEventHandler(nsIChromeEventHandler  aChromeEventHandler);
62   nsresult GetDocumentCharsetInfo(nsIDocumentCharsetInfo  *aDocumentCharsetInfo);
63   nsresult SetDocumentCharsetInfo(nsIDocumentCharsetInfo  aDocumentCharsetInfo);
64   nsresult GetAllowPlugins(PRBool *aAllowPlugins);
65   nsresult SetAllowPlugins(PRBool aAllowPlugins);
66   nsresult GetAllowJavascript(PRBool *aAllowJavascript);
67   nsresult SetAllowJavascript(PRBool aAllowJavascript);
68   nsresult GetAllowMetaRedirects(PRBool *aAllowMetaRedirects);
69   nsresult SetAllowMetaRedirects(PRBool aAllowMetaRedirects);
70   nsresult GetAllowSubframes(PRBool *aAllowSubframes);
71   nsresult SetAllowSubframes(PRBool aAllowSubframes);
72   nsresult GetAllowImages(PRBool *aAllowImages);
73   nsresult SetAllowImages(PRBool aAllowImages);
74 
75   enum { ENUMERATE_FORWARDS = 0 };
76   enum { ENUMERATE_BACKWARDS = 1 };
77 
78   nsresult GetDocShellEnumerator(PRInt32 aItemType, PRInt32 aDirection, nsISimpleEnumerator *_retval);
79 
80   enum { APP_TYPE_UNKNOWN = 0U };
81   enum { APP_TYPE_MAIL = 1U };
82   enum { APP_TYPE_EDITOR = 2U };
83 
84   nsresult GetAppType(PRUint32 *aAppType);
85   nsresult SetAppType(PRUint32 aAppType);
86   nsresult GetAllowAuth(PRBool *aAllowAuth);
87   nsresult SetAllowAuth(PRBool aAllowAuth);
88   nsresult GetZoom(float *aZoom);
89   nsresult SetZoom(float aZoom);
90   nsresult GetMarginWidth(PRInt32 *aMarginWidth);
91   nsresult SetMarginWidth(PRInt32 aMarginWidth);
92   nsresult GetMarginHeight(PRInt32 *aMarginHeight);
93   nsresult SetMarginHeight(PRInt32 aMarginHeight);
94   nsresult GetHasFocus(PRBool *aHasFocus);
95   nsresult SetHasFocus(PRBool aHasFocus);
96   nsresult GetCanvasHasFocus(PRBool *aCanvasHasFocus);
97   nsresult SetCanvasHasFocus(PRBool aCanvasHasFocus);
98   nsresult TabToTreeOwner(PRBool forward, PRBool *tookFocus);
99 
100   enum { BUSY_FLAGS_NONE = 0U };
101   enum { BUSY_FLAGS_BUSY = 1U };
102   enum { BUSY_FLAGS_BEFORE_PAGE_LOAD = 2U };
103   enum { BUSY_FLAGS_PAGE_LOADING = 4U };
104   enum { LOAD_CMD_NORMAL = 1U };
105   enum { LOAD_CMD_RELOAD = 2U };
106   enum { LOAD_CMD_HISTORY = 4U };
107 
108   nsresult GetBusyFlags(PRUint32 *aBusyFlags);
109   nsresult GetLoadType(PRUint32 *aLoadType);
110   nsresult SetLoadType(PRUint32 aLoadType);
111   nsresult IsBeingDestroyed(PRBool *_retval);
112   nsresult GetIsExecutingOnLoadHandler(PRBool *aIsExecutingOnLoadHandler);
113   nsresult GetLayoutHistoryState(nsILayoutHistoryState  *aLayoutHistoryState);
114   nsresult SetLayoutHistoryState(nsILayoutHistoryState  aLayoutHistoryState);
115   nsresult GetShouldSaveLayoutState(PRBool *aShouldSaveLayoutState);
116   nsresult GetSecurityUI(nsISecureBrowserUI  *aSecurityUI);
117   nsresult SetSecurityUI(nsISecureBrowserUI  aSecurityUI);
118   nsresult SuspendRefreshURIs();
119   nsresult ResumeRefreshURIs();
120   nsresult BeginRestore(nsIContentViewer viewer, PRBool top);
121   nsresult FinishRestore();
122   nsresult GetRestoringDocument(PRBool *aRestoringDocument);
123   nsresult GetUseErrorPages(PRBool *aUseErrorPages);
124   nsresult SetUseErrorPages(PRBool aUseErrorPages);
125   nsresult GetPreviousTransIndex(PRInt32 *aPreviousTransIndex);
126   nsresult GetLoadedTransIndex(PRInt32 *aLoadedTransIndex);
127   nsresult HistoryPurged(PRInt32 numEntries);
128 }
129 
130 /******************************************************************************
131 
132 ******************************************************************************/
133 
134 const char[] NS_IDOCSHELL_1_8_IID_STR = "9f0c7461-b9a4-47f6-b88c-421dce1bce66";
135 
136 const nsIID NS_IDOCSHELL_1_8_IID= 
137     { 0x9f0c7461, 0xb9a4, 0x47f6, 
138        [ 0xb8,0x8c,0x42,0x1d,0xce,0x1b,0xce,0x66 ] }; 
139 
140 interface nsIDocShell_1_8 : nsIDocShell {
141 
142   static const char[] IID_STR = NS_IDOCSHELL_1_8_IID_STR;
143   static const nsIID IID = NS_IDOCSHELL_1_8_IID;
144 
145 extern(System):
146   nsresult GetSessionStorageForURI(nsIURI uri, nsIDOMStorage *_retval);
147   nsresult AddSessionStorage(nsACString * aDomain, nsIDOMStorage storage);
148   nsresult GetCurrentDocumentChannel(nsIChannel  *aCurrentDocumentChannel);
149 }
150 
151 /******************************************************************************
152 
153 ******************************************************************************/
154 
155 const char[] NS_IDOCSHELL_1_9_IID_STR = "10ed386d-8598-408c-b571-e75ad18edeb0";
156 
157 const nsIID NS_IDOCSHELL_1_9_IID = 
158     {0x10ed386d, 0x8598, 0x408c, [ 0xb5, 0x71, 0xe7, 0x5a, 0xd1, 0x8e, 0xde, 0xb0 ] };
159 
160 interface nsIDocShell_1_9 : nsIDocShell_1_8 {
161 
162   static const char[] IID_STR = NS_IDOCSHELL_1_9_IID_STR;
163   static const nsIID IID = NS_IDOCSHELL_1_9_IID;
164 
165 extern(System):
166   nsresult GetSessionStorageForURI(nsIURI uri, nsIDOMStorage *_retval);
167   nsresult AddSessionStorage(nsACString * aDomain, nsIDOMStorage storage);
168   nsresult GetCurrentDocumentChannel(nsIChannel  *aCurrentDocumentChannel);
169 }