tizen beta release
[framework/web/webkit-efl.git] / DerivedSources / WebKitDOM_HTMLDocument.cpp
1 /*
2     This file is part of the WebKit open source project.
3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5     Copyright (C) 2011 Samsung Electronics
6
7     This library is free software; you can redistribute it and/or
8     modify it under the terms of the GNU Lesser General Public
9     License as published by the Free Software Foundation; either
10     version 2.1 of the License, or (at your option) any later version.
11
12     This library is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15     Lesser General Public License for more details.
16
17     You should have received a copy of the GNU Lesser General Public
18     License along with this library; if not, write to the Free Software
19     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20 */
21
22 #include "config.h"
23 #include "WebKitDOM_HTMLDocument.h"
24 #include "WebKitDOM_HTMLDocument_Private.h"
25
26 #include "Element.h"
27 #include "HTMLCollection.h"
28 #include "HTMLDocument.h"
29 #include "KURL.h"
30 #include "WebKitDOM_Element.h"
31 #include "WebKitDOM_Element_Private.h"
32 #include "WebKitDOM_HTMLCollection.h"
33 #include "WebKitDOM_HTMLCollection_Private.h"
34 #include "WebKitDOM_String.h"
35 #include "WebKitDOM_String_Private.h"
36 #include "wtf/text/AtomicString.h"
37 #include <wtf/text/CString.h>
38 #include <wtf/GetPtr.h>
39 #include <wtf/RefPtr.h>
40
41 void ewk_webkitdom_htmldocument_get_embeds(WebKitDOM_HTMLDocument* self, WebKitDOM_HTMLCollection* ret)
42 {
43     if (!self)
44         return;
45
46     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
47     RefPtr<WebCore::HTMLCollection> result = WTF::getPtr(coreObj->embeds());
48     _to_webkit_htmlcollection(result.get(), ret);
49 }
50
51 void ewk_webkitdom_htmldocument_get_plugins(WebKitDOM_HTMLDocument* self, WebKitDOM_HTMLCollection* ret)
52 {
53     if (!self)
54         return;
55
56     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
57     RefPtr<WebCore::HTMLCollection> result = WTF::getPtr(coreObj->plugins());
58     _to_webkit_htmlcollection(result.get(), ret);
59 }
60
61 void ewk_webkitdom_htmldocument_get_scripts(WebKitDOM_HTMLDocument* self, WebKitDOM_HTMLCollection* ret)
62 {
63     if (!self)
64         return;
65
66     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
67     RefPtr<WebCore::HTMLCollection> result = WTF::getPtr(coreObj->scripts());
68     _to_webkit_htmlcollection(result.get(), ret);
69 }
70
71 void ewk_webkitdom_htmldocument_get_dir(WebKitDOM_HTMLDocument* self, WebKitDOM_String* ret)
72 {
73     if (!self)
74         return;
75
76     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
77     WTF::String result = coreObj->dir();
78     _to_webkit_string(&result, ret);
79 }
80
81 void ewk_webkitdom_htmldocument_set_dir(WebKitDOM_HTMLDocument* self, WebKitDOM_String* newDir)
82 {
83     if (!self)
84         return;
85
86     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
87     coreObj->setDir(_to_webcore_string_value(newDir));
88 }
89
90 void ewk_webkitdom_htmldocument_get_design_mode(WebKitDOM_HTMLDocument* self, WebKitDOM_String* ret)
91 {
92     if (!self)
93         return;
94
95     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
96     WTF::String result = coreObj->designMode();
97     _to_webkit_string(&result, ret);
98 }
99
100 void ewk_webkitdom_htmldocument_set_design_mode(WebKitDOM_HTMLDocument* self, WebKitDOM_String* newDesignMode)
101 {
102     if (!self)
103         return;
104
105     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
106     coreObj->setDesignMode(_to_webcore_string_value(newDesignMode));
107 }
108
109 void ewk_webkitdom_htmldocument_get_compat_mode(WebKitDOM_HTMLDocument* self, WebKitDOM_String* ret)
110 {
111     if (!self)
112         return;
113
114     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
115     WTF::String result = coreObj->compatMode();
116     _to_webkit_string(&result, ret);
117 }
118
119 void ewk_webkitdom_htmldocument_get_active_element(WebKitDOM_HTMLDocument* self, WebKitDOM_Element* ret)
120 {
121     if (!self)
122         return;
123
124     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
125     RefPtr<WebCore::Element> result = WTF::getPtr(coreObj->activeElement());
126     _to_webkit_element(result.get(), ret);
127 }
128
129 void ewk_webkitdom_htmldocument_get_bg_color(WebKitDOM_HTMLDocument* self, WebKitDOM_String* ret)
130 {
131     if (!self)
132         return;
133
134     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
135     WTF::String result = coreObj->bgColor();
136     _to_webkit_string(&result, ret);
137 }
138
139 void ewk_webkitdom_htmldocument_set_bg_color(WebKitDOM_HTMLDocument* self, WebKitDOM_String* newBgColor)
140 {
141     if (!self)
142         return;
143
144     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
145     coreObj->setBgColor(_to_webcore_string_value(newBgColor));
146 }
147
148 void ewk_webkitdom_htmldocument_get_fg_color(WebKitDOM_HTMLDocument* self, WebKitDOM_String* ret)
149 {
150     if (!self)
151         return;
152
153     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
154     WTF::String result = coreObj->fgColor();
155     _to_webkit_string(&result, ret);
156 }
157
158 void ewk_webkitdom_htmldocument_set_fg_color(WebKitDOM_HTMLDocument* self, WebKitDOM_String* newFgColor)
159 {
160     if (!self)
161         return;
162
163     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
164     coreObj->setFgColor(_to_webcore_string_value(newFgColor));
165 }
166
167 void ewk_webkitdom_htmldocument_get_alink_color(WebKitDOM_HTMLDocument* self, WebKitDOM_String* ret)
168 {
169     if (!self)
170         return;
171
172     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
173     WTF::String result = coreObj->alinkColor();
174     _to_webkit_string(&result, ret);
175 }
176
177 void ewk_webkitdom_htmldocument_set_alink_color(WebKitDOM_HTMLDocument* self, WebKitDOM_String* newAlinkColor)
178 {
179     if (!self)
180         return;
181
182     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
183     coreObj->setAlinkColor(_to_webcore_string_value(newAlinkColor));
184 }
185
186 void ewk_webkitdom_htmldocument_get_link_color(WebKitDOM_HTMLDocument* self, WebKitDOM_String* ret)
187 {
188     if (!self)
189         return;
190
191     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
192     WTF::String result = coreObj->linkColor();
193     _to_webkit_string(&result, ret);
194 }
195
196 void ewk_webkitdom_htmldocument_set_link_color(WebKitDOM_HTMLDocument* self, WebKitDOM_String* newLinkColor)
197 {
198     if (!self)
199         return;
200
201     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
202     coreObj->setLinkColor(_to_webcore_string_value(newLinkColor));
203 }
204
205 void ewk_webkitdom_htmldocument_get_vlink_color(WebKitDOM_HTMLDocument* self, WebKitDOM_String* ret)
206 {
207     if (!self)
208         return;
209
210     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
211     WTF::String result = coreObj->vlinkColor();
212     _to_webkit_string(&result, ret);
213 }
214
215 void ewk_webkitdom_htmldocument_set_vlink_color(WebKitDOM_HTMLDocument* self, WebKitDOM_String* newVlinkColor)
216 {
217     if (!self)
218         return;
219
220     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
221     coreObj->setVlinkColor(_to_webcore_string_value(newVlinkColor));
222 }
223
224 void ewk_webkitdom_htmldocument_open(WebKitDOM_HTMLDocument* self)
225 {
226     if (!self)
227         return;
228
229     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
230     coreObj->open();
231 }
232
233 void ewk_webkitdom_htmldocument_close(WebKitDOM_HTMLDocument* self)
234 {
235     if (!self)
236         return;
237
238     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
239     coreObj->close();
240 }
241
242 void ewk_webkitdom_htmldocument_clear(WebKitDOM_HTMLDocument* self)
243 {
244     if (!self)
245         return;
246
247     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
248     coreObj->clear();
249 }
250
251 void ewk_webkitdom_htmldocument_capture_events(WebKitDOM_HTMLDocument* self)
252 {
253     if (!self)
254         return;
255
256     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
257     coreObj->captureEvents();
258 }
259
260 void ewk_webkitdom_htmldocument_release_events(WebKitDOM_HTMLDocument* self)
261 {
262     if (!self)
263         return;
264
265     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
266     coreObj->releaseEvents();
267 }
268
269 Eina_Bool ewk_webkitdom_htmldocument_has_focus(WebKitDOM_HTMLDocument* self)
270 {
271     if (!self)
272         return EINA_FALSE;
273
274     WebCore::HTMLDocument* coreObj = _to_webcore_htmldocument(self);
275     return coreObj->hasFocus();
276 }
277
278
279 void ewk_webkitdom_htmldocument_deinit(const WebKitDOM_Object* objPtr)
280 {
281     if( WEBKITDOM_ISNULL(objPtr) )
282        return;
283     ((WebCore::HTMLDocument*)(objPtr->p_coreObject))->deref();
284     (((WebKitDOM_Object*)(objPtr))->p_coreObject) = 0;
285 }
286
287 void _copy_webkit_htmldocument(WebKitDOM_HTMLDocument* kitObjSrc, WebKitDOM_HTMLDocument* ret)
288 {
289     if (WEBKITDOM_COREOBJ(kitObjSrc) == WEBKITDOM_COREOBJ(ret))
290         return;
291     WebCore::HTMLDocument* tmpPtr = _to_webcore_htmldocument(ret);
292     if (tmpPtr)
293         tmpPtr->deref();
294     if (!WEBKITDOM_ISNULL(kitObjSrc))
295         _to_webcore_htmldocument(kitObjSrc)->ref();
296     ((WebKitDOM_Object*)ret)->p_coreObject = WEBKITDOM_COREOBJ(kitObjSrc);
297 }
298
299 WebCore::HTMLDocument* _to_webcore_htmldocument(const WebKitDOM_HTMLDocument* kitObj)
300 {
301     return (WebCore::HTMLDocument*)WEBKITDOM_COREOBJ(kitObj);
302 }
303
304 WebKitDOM_HTMLDocument* _to_webkit_htmldocument(WebCore::HTMLDocument* coreObj, WebKitDOM_HTMLDocument* ret)
305 {
306     WebCore::HTMLDocument* tmpPtr = _to_webcore_htmldocument(ret);
307     if (tmpPtr && tmpPtr != coreObj)
308         tmpPtr->deref();
309     if (coreObj)
310         coreObj->ref();
311     ((WebKitDOM_Object*)ret)->p_coreObject = coreObj;
312     return ret;
313 }
314