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 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21 #include "config.h"
22
23 #if ENABLE(DATABASE)
24
25 #include "WebDOMTestCallback.h"
26
27 #include "Class1.h"
28 #include "Class2.h"
29 #include "Class3.h"
30 #include "DOMStringList.h"
31 #include "KURL.h"
32 #include "TestCallback.h"
33 #include "WebDOMClass1.h"
34 #include "WebDOMClass2.h"
35 #include "WebDOMClass3.h"
36 #include "WebDOMDOMStringList.h"
37 #include "WebDOMString.h"
38 #include "WebExceptionHandler.h"
39 #include "wtf/text/AtomicString.h"
40 #include <wtf/GetPtr.h>
41 #include <wtf/RefPtr.h>
42
43 struct WebDOMTestCallback::WebDOMTestCallbackPrivate {
WebDOMTestCallbackPrivateWebDOMTestCallback::WebDOMTestCallbackPrivate44 WebDOMTestCallbackPrivate(WebCore::TestCallback* object = 0)
45 : impl(object)
46 {
47 }
48
49 RefPtr<WebCore::TestCallback> impl;
50 };
51
WebDOMTestCallback()52 WebDOMTestCallback::WebDOMTestCallback()
53 : WebDOMObject()
54 , m_impl(0)
55 {
56 }
57
WebDOMTestCallback(WebCore::TestCallback * impl)58 WebDOMTestCallback::WebDOMTestCallback(WebCore::TestCallback* impl)
59 : WebDOMObject()
60 , m_impl(new WebDOMTestCallbackPrivate(impl))
61 {
62 }
63
WebDOMTestCallback(const WebDOMTestCallback & copy)64 WebDOMTestCallback::WebDOMTestCallback(const WebDOMTestCallback& copy)
65 : WebDOMObject()
66 {
67 m_impl = copy.impl() ? new WebDOMTestCallbackPrivate(copy.impl()) : 0;
68 }
69
operator =(const WebDOMTestCallback & copy)70 WebDOMTestCallback& WebDOMTestCallback::operator=(const WebDOMTestCallback& copy)
71 {
72 delete m_impl;
73 m_impl = copy.impl() ? new WebDOMTestCallbackPrivate(copy.impl()) : 0;
74 return *this;
75 }
76
impl() const77 WebCore::TestCallback* WebDOMTestCallback::impl() const
78 {
79 return m_impl ? m_impl->impl.get() : 0;
80 }
81
~WebDOMTestCallback()82 WebDOMTestCallback::~WebDOMTestCallback()
83 {
84 delete m_impl;
85 m_impl = 0;
86 }
87
callbackWithNoParam()88 bool WebDOMTestCallback::callbackWithNoParam()
89 {
90 if (!impl())
91 return false;
92
93 return impl()->callbackWithNoParam();
94 }
95
callbackWithClass1Param(const WebDOMClass1 & class1Param)96 bool WebDOMTestCallback::callbackWithClass1Param(const WebDOMClass1& class1Param)
97 {
98 if (!impl())
99 return false;
100
101 return impl()->callbackWithClass1Param(toWebCore(class1Param));
102 }
103
callbackWithClass2Param(const WebDOMClass2 & class2Param,const WebDOMString & strArg)104 bool WebDOMTestCallback::callbackWithClass2Param(const WebDOMClass2& class2Param, const WebDOMString& strArg)
105 {
106 if (!impl())
107 return false;
108
109 return impl()->callbackWithClass2Param(toWebCore(class2Param), strArg);
110 }
111
callbackWithNonBoolReturnType(const WebDOMClass3 & class3Param)112 int WebDOMTestCallback::callbackWithNonBoolReturnType(const WebDOMClass3& class3Param)
113 {
114 if (!impl())
115 return 0;
116
117 return impl()->callbackWithNonBoolReturnType(toWebCore(class3Param));
118 }
119
callbackWithStringList(const WebDOMDOMStringList & listParam)120 bool WebDOMTestCallback::callbackWithStringList(const WebDOMDOMStringList& listParam)
121 {
122 if (!impl())
123 return false;
124
125 return impl()->callbackWithStringList(toWebCore(listParam));
126 }
127
toWebCore(const WebDOMTestCallback & wrapper)128 WebCore::TestCallback* toWebCore(const WebDOMTestCallback& wrapper)
129 {
130 return wrapper.impl();
131 }
132
toWebKit(WebCore::TestCallback * value)133 WebDOMTestCallback toWebKit(WebCore::TestCallback* value)
134 {
135 return WebDOMTestCallback(value);
136 }
137
138 #endif // ENABLE(DATABASE)
139