1 module awebview.wrapper.cpp.webview;
2 
3 
4 mixin template Awesomium()
5 {
6     enum WebViewType { offscreen, window }
7     enum MouseButton { left, middle, right }
8 
9     interface WebView {}
10 }
11 
12 mixin template Awesomium4D()
13 {
14     interface IWebViewD 
15     {
16         void destroy();
17         Awesomium.WebViewType type();
18         int processId();
19         int routingId();
20         int nextRoutingId();
21         ProcessHandle processHandle();
22         void setParentWindow(NativeWindow parent);
23         NativeWindow parentWindow();
24         NativeWindow window();
25         void setViewListener(Awesomium.WebViewListener.View);
26         void setLoadListener(Awesomium.WebViewListener.Load);
27         void setProcessListener(Awesomium.WebViewListener.Process);
28         void setMenuListener(Awesomium.WebViewListener.Menu);
29         void setDialogListener(Awesomium.WebViewListener.Dialog);
30         void setPrintListener(Awesomium.WebViewListener.Print);
31         void setDonwloadListener(Awesomium.WebViewListener.Download);
32         void setInputMethodEditorListener(Awesomium.WebViewListener.InputMethodEditor);
33         Awesomium.WebViewListener.View viewListener();
34         Awesomium.WebViewListener.Load loadListener();
35         Awesomium.WebViewListener.Process processListener();
36         Awesomium.WebViewListener.Menu menuListener();
37         Awesomium.WebViewListener.Dialog dialogListener();
38         Awesomium.WebViewListener.Print printListener();
39         Awesomium.WebViewListener.Download downloadListener();
40         Awesomium.WebViewListener.InputMethodEditor inputMethodEditorListener();
41         void loadURL(const Awesomium.WebURL);
42         void goBack();
43         void goForward();
44         void goToHistoryOffset(int);
45         void stop();
46         void reload(bool);
47         bool canGoBack();
48         bool canGoForward();
49         Awesomium.Surface surface();
50         void getUrl(Awesomium.WebURL);
51         void getTitle(Awesomium.WebString);
52         WebSession session();
53         bool isLoading();
54         bool isCrashed();
55         void resize(int, int);
56         void setTransparent(bool);
57         bool isTransparent();
58         void pauseRendering();
59         void resumeRendering();
60         void focus();
61         void unfocus();
62         FocusedElementType focusedElementType();
63         void zoomIn();
64         void zoomOut();
65         void setZoom(int);
66         void resetZoom();
67         int getZoom();
68         void injectMouseMove(int, int);
69         void injectMouseDown(MouseButton);
70         void injectMouseUp(MouseButton);
71         void injectMouseWheel(int, int);
72         void injectKeyboardEvent(const WebKeyboardEvent*);
73         void injectTouchEvent(const WebTouchEvent*);
74         void activateIME(bool);
75         void setIMEComposition(const Awesomium.WebString, int, int, int);
76         void confirmIMEComposition(const Awesomium.WebString);
77         void cancelIMEComposition();
78         void undo();
79         void redo();
80         void cut();
81         void copy();
82         void copyImageAt(int, int);
83         void paste();
84         void pasteAndMatchStyle();
85         void selectAll();
86         int printToFile(const Awesomium.WebString, const PrintConfig*);
87         Awesomium.Error lastError() const;
88         void createGlobalJSObject(const Awesomium.WebString, JSValue);
89         void executeJS(const Awesomium.WebString, const Awesomium.WebString);
90         void executeJSWithResult(const Awesomium.WebString, const Awesomium.WebString, Awesomium.JSValue);
91         void setJSMethodHandler(Awesomium.JSMethodHandler);
92         Awesomium.JSMethodHandler jsMethodHandler();
93         void setSyncMessageTimeout(int);
94         int syncMessageTimeout();
95         void didSelectPopupMenuItem(int);
96         void didCancelPopupMenu();
97         void didChooseFiles(const Awesomium.WebStringArray, bool);
98         void didLogin(int, const Awesomium.WebString, const Awesomium.WebString);
99         void didCancelLogin(int);
100         void didChooseDownloadPath(int, const Awesomium.WebString);
101         void didCancelDownload(int);
102         void didOverrideCertificateError();
103         void requestPageInfo();
104         void reduceMemoryUsage();
105     }
106 
107 
108     interface WebViewD2Cpp : Awesomium.WebView {}
109 
110     extern(C++, WebViewD2CppMember)
111     {
112         WebViewD2Cpp newCtor(IWebViewD, ulong);
113         void deleteDtor(WebViewD2Cpp);
114     }
115     extern(C++, WebViewMember)
116     {
117         void Destroy(Awesomium.WebView p);
118         Awesomium.WebViewType type(Awesomium.WebView p);
119         int process_id(Awesomium.WebView p);
120         int routing_id(Awesomium.WebView p);
121         int next_routing_id(Awesomium.WebView p);
122         ProcessHandle process_handle(Awesomium.WebView p);
123         void set_parent_window(Awesomium.WebView p, NativeWindow parent);
124         NativeWindow parent_window(Awesomium.WebView p);
125         NativeWindow window(Awesomium.WebView p);
126         void set_view_listener(Awesomium.WebView p, Awesomium.WebViewListener.View listener);
127         void set_load_listener(Awesomium.WebView p, Awesomium.WebViewListener.Load listener);
128         void set_process_listener(Awesomium.WebView p, Awesomium.WebViewListener.Process listener);
129         void set_menu_listener(Awesomium.WebView p, Awesomium.WebViewListener.Menu listener);
130         void set_dialog_listener(Awesomium.WebView p, Awesomium.WebViewListener.Dialog listener);
131         void set_print_listener(Awesomium.WebView p, Awesomium.WebViewListener.Print listener);
132         void set_download_listener(Awesomium.WebView p, Awesomium.WebViewListener.Download listener);
133         void set_input_method_editor_listener(Awesomium.WebView p, Awesomium.WebViewListener.InputMethodEditor listener);
134         Awesomium.WebViewListener.View view_listener(Awesomium.WebView p);
135         Awesomium.WebViewListener.Load load_listener(Awesomium.WebView p);
136         Awesomium.WebViewListener.Process process_listener(Awesomium.WebView p);
137         Awesomium.WebViewListener.Menu menu_listener(Awesomium.WebView p);
138         Awesomium.WebViewListener.Dialog dialog_listener(Awesomium.WebView p);
139         Awesomium.WebViewListener.Print print_listener(Awesomium.WebView p);
140         Awesomium.WebViewListener.Download download_listener(Awesomium.WebView p);
141         Awesomium.WebViewListener.InputMethodEditor input_method_editor_listener(Awesomium.WebView p);
142         void LoadURL(Awesomium.WebView p, const WebURL url);
143         void GoBack(Awesomium.WebView p);
144         void GoForward(Awesomium.WebView p);
145         void GoToHistoryOffset(Awesomium.WebView p, int offset);
146         void Stop(Awesomium.WebView p);
147         void Reload(Awesomium.WebView p, bool ignore_cache);
148         bool CanGoBack(Awesomium.WebView p);
149         bool CanGoForward(Awesomium.WebView p);
150         Surface surface(Awesomium.WebView p);
151         void url(Awesomium.WebView p, WebURL dst);
152         void title(Awesomium.WebView p, WebString dst);
153         WebSession session(Awesomium.WebView p);
154         bool IsLoading(Awesomium.WebView p);
155         bool IsCrashed(Awesomium.WebView p);
156         void Resize(Awesomium.WebView p, int width, int height);
157         void SetTransparent(Awesomium.WebView p, bool is_transparent);
158         bool IsTransparent(Awesomium.WebView p);
159         void PauseRendering(Awesomium.WebView p);
160         void ResumeRendering(Awesomium.WebView p);
161         void Focus(Awesomium.WebView p);
162         void Unfocus(Awesomium.WebView p);
163         FocusedElementType focused_element_type(Awesomium.WebView p);
164         void ZoomIn(Awesomium.WebView p);
165         void ZoomOut(Awesomium.WebView p);
166         void SetZoom(Awesomium.WebView p, int zoom_percent);
167         void ResetZoom(Awesomium.WebView p);
168         int GetZoom(Awesomium.WebView p);
169         void InjectMouseMove(Awesomium.WebView p, int x, int y);
170         void InjectMouseDown(Awesomium.WebView p, MouseButton button);
171         void InjectMouseUp(Awesomium.WebView p, MouseButton button);
172         void InjectMouseWheel(Awesomium.WebView p, int scroll_vert, int scroll_horz);
173         void InjectKeyboardEvent(Awesomium.WebView p, const(WebKeyboardEvent)* key_event);
174         void InjectTouchEvent(Awesomium.WebView p, const(WebTouchEvent)* touch_event);
175         void ActivateIME(Awesomium.WebView p, bool activate);
176         void SetIMEComposition(Awesomium.WebView p, const WebString input_string,
177                               int cursor_pos, int target_start, int target_end);
178         void ConfirmIMEComposition(Awesomium.WebView p, const WebString input_string);
179         void CancelIMEComposition(Awesomium.WebView p);
180         void Undo(Awesomium.WebView p);
181         void Redo(Awesomium.WebView p);
182         void Cut(Awesomium.WebView p);
183         void Copy(Awesomium.WebView p);
184         void CopyImageAt(Awesomium.WebView p, int x, int y);
185         void Paste(Awesomium.WebView p);
186         void PasteAndMatchStyle(Awesomium.WebView p);
187         void SelectAll(Awesomium.WebView p);
188         int PrintToFile(Awesomium.WebView p,
189                        const Awesomium.WebString  output_direct,
190                        const Awesomium.PrintConfig* config);
191         Awesomium.Error last_error(const Awesomium.WebView p);
192         void CreateGlobalJavascriptObject(Awesomium.WebView p, const Awesomium.WebString name, JSValue dst);
193         void ExecuteJavascript(Awesomium.WebView p, const Awesomium.WebString script,
194                                            const Awesomium.WebString frame_xpath);
195         void ExecuteJavascriptWithResult(Awesomium.WebView p, const Awesomium.WebString script,
196                                                      const Awesomium.WebString frame_xpath,
197                                                      Awesomium.JSValue dst);
198         void set_js_method_handler(Awesomium.WebView p, Awesomium.JSMethodHandler handler);
199         Awesomium.JSMethodHandler js_method_handler(Awesomium.WebView p);
200         void set_sync_message_timeout(Awesomium.WebView p, int timeout_ms);
201         int sync_message_timeout(Awesomium.WebView p);
202         void DidSelectPopupMenuItem(Awesomium.WebView p, int item_index);
203         void DidCancelPopupMenu(Awesomium.WebView p);
204         void DidChooseFiles(Awesomium.WebView p, const Awesomium.WebStringArray files,
205                                         bool should_write_files);
206         void DidLogin(Awesomium.WebView p, int request_id,
207                      const Awesomium.WebString username,
208                      const Awesomium.WebString password);
209         void DidCancelLogin(Awesomium.WebView p, int request_id);
210         void DidChooseDownloadPath(Awesomium.WebView p, int download_id,
211                                   const Awesomium.WebString path);
212         void DidCancelDownload(Awesomium.WebView p, int download_id);
213         void DidOverrideCertificateError(Awesomium.WebView p);
214         void RequestPageInfo(Awesomium.WebView p);
215         void ReduceMemoryUsage(Awesomium.WebView p);
216     }
217 }