2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
5 Copyright (C) 2011 Samsung Electronics
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.
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.
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
23 #include "WebKitDOM_DOMTokenList.h"
24 #include "WebKitDOM_DOMTokenList_Private.h"
26 #include "DOMTokenList.h"
28 #include "WebKitDOM_String.h"
29 #include "WebKitDOM_String_Private.h"
30 #include "wtf/text/AtomicString.h"
31 #include <wtf/text/CString.h>
32 #include <wtf/GetPtr.h>
33 #include <wtf/RefPtr.h>
35 unsigned ewk_webkitdom_domtokenlist_get_length(WebKitDOM_DOMTokenList* self)
40 WebCore::DOMTokenList* coreObj = _to_webcore_domtokenlist(self);
41 return coreObj->length();
44 void ewk_webkitdom_domtokenlist_item(WebKitDOM_DOMTokenList* self, unsigned index, WebKitDOM_String* ret)
49 WebCore::DOMTokenList* coreObj = _to_webcore_domtokenlist(self);
50 WTF::String result = coreObj->item(index);
51 _to_webkit_string(&result, ret);
55 Eina_Bool ewk_webkitdom_domtokenlist_contains(WebKitDOM_DOMTokenList* self, WebKitDOM_String* token)
60 WebCore::DOMTokenList* coreObj = _to_webcore_domtokenlist(self);
62 WebCore::ExceptionCode ec = 0;
63 return coreObj->contains(_to_webcore_string_value(token), ec);
66 void ewk_webkitdom_domtokenlist_add(WebKitDOM_DOMTokenList* self, WebKitDOM_String* token)
71 WebCore::DOMTokenList* coreObj = _to_webcore_domtokenlist(self);
72 WebCore::ExceptionCode ec = 0;
73 coreObj->add(_to_webcore_string_value(token), ec);
74 // WebKitDOM_RaiseError(static_cast<WebKitDOM_ExceptionCode>(ec)); // TODO: Exceptions
77 void ewk_webkitdom_domtokenlist_remove(WebKitDOM_DOMTokenList* self, WebKitDOM_String* token)
82 WebCore::DOMTokenList* coreObj = _to_webcore_domtokenlist(self);
83 WebCore::ExceptionCode ec = 0;
84 coreObj->remove(_to_webcore_string_value(token), ec);
85 // WebKitDOM_RaiseError(static_cast<WebKitDOM_ExceptionCode>(ec)); // TODO: Exceptions
88 Eina_Bool ewk_webkitdom_domtokenlist_toggle(WebKitDOM_DOMTokenList* self, WebKitDOM_String* token)
93 WebCore::DOMTokenList* coreObj = _to_webcore_domtokenlist(self);
95 WebCore::ExceptionCode ec = 0;
96 return coreObj->toggle(_to_webcore_string_value(token), ec);
100 void ewk_webkitdom_domtokenlist_deinit(const WebKitDOM_Object* objPtr)
102 if( WEBKITDOM_ISNULL(objPtr) )
104 ((WebCore::DOMTokenList*)(objPtr->p_coreObject))->deref();
105 (((WebKitDOM_Object*)(objPtr))->p_coreObject) = 0;
108 void _copy_webkit_domtokenlist(WebKitDOM_DOMTokenList* kitObjSrc, WebKitDOM_DOMTokenList* ret)
110 if (WEBKITDOM_COREOBJ(kitObjSrc) == WEBKITDOM_COREOBJ(ret))
112 WebCore::DOMTokenList* tmpPtr = _to_webcore_domtokenlist(ret);
115 if (!WEBKITDOM_ISNULL(kitObjSrc))
116 _to_webcore_domtokenlist(kitObjSrc)->ref();
117 ((WebKitDOM_Object*)ret)->p_coreObject = WEBKITDOM_COREOBJ(kitObjSrc);
120 WebCore::DOMTokenList* _to_webcore_domtokenlist(const WebKitDOM_DOMTokenList* kitObj)
122 return (WebCore::DOMTokenList*)WEBKITDOM_COREOBJ(kitObj);
125 WebKitDOM_DOMTokenList* _to_webkit_domtokenlist(WebCore::DOMTokenList* coreObj, WebKitDOM_DOMTokenList* ret)
127 WebCore::DOMTokenList* tmpPtr = _to_webcore_domtokenlist(ret);
128 if (tmpPtr && tmpPtr != coreObj)
132 ((WebKitDOM_Object*)ret)->p_coreObject = coreObj;