tizen beta release
[framework/web/webkit-efl.git] / Source / WebCore / bindings / scripts / test / CPP / WebDOMTestInterface.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  * 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(Condition1) || ENABLE(Condition2)
24
25 #include "WebDOMTestInterface.h"
26
27 #include "KURL.h"
28 #include "TestInterface.h"
29 #include "TestSupplemental.h"
30 #include "WebDOMString.h"
31 #include "WebExceptionHandler.h"
32 #include "wtf/text/AtomicString.h"
33 #include <wtf/GetPtr.h>
34 #include <wtf/RefPtr.h>
35
36 struct WebDOMTestInterface::WebDOMTestInterfacePrivate {
37     WebDOMTestInterfacePrivate(WebCore::TestInterface* object = 0)
38         : impl(object)
39     {
40     }
41
42     RefPtr<WebCore::TestInterface> impl;
43 };
44
45 WebDOMTestInterface::WebDOMTestInterface()
46     : WebDOMObject()
47     , m_impl(0)
48 {
49 }
50
51 WebDOMTestInterface::WebDOMTestInterface(WebCore::TestInterface* impl)
52     : WebDOMObject()
53     , m_impl(new WebDOMTestInterfacePrivate(impl))
54 {
55 }
56
57 WebDOMTestInterface::WebDOMTestInterface(const WebDOMTestInterface& copy)
58     : WebDOMObject()
59 {
60     m_impl = copy.impl() ? new WebDOMTestInterfacePrivate(copy.impl()) : 0;
61 }
62
63 WebDOMTestInterface& WebDOMTestInterface::operator=(const WebDOMTestInterface& copy)
64 {
65     delete m_impl;
66     m_impl = copy.impl() ? new WebDOMTestInterfacePrivate(copy.impl()) : 0;
67     return *this;
68 }
69
70 WebCore::TestInterface* WebDOMTestInterface::impl() const
71 {
72     return m_impl ? m_impl->impl.get() : 0;
73 }
74
75 WebDOMTestInterface::~WebDOMTestInterface()
76 {
77     delete m_impl;
78     m_impl = 0;
79 }
80
81 #if ENABLE(Condition11) || ENABLE(Condition12)
82 WebDOMString WebDOMTestInterface::str1() const
83 {
84     if (!impl())
85         return WebDOMString();
86
87     return static_cast<const WTF::String&>(TestSupplemental::str1(impl()));
88 }
89
90 #endif
91 #if ENABLE(Condition11) || ENABLE(Condition12)
92 WebDOMString WebDOMTestInterface::str2() const
93 {
94     if (!impl())
95         return WebDOMString();
96
97     return static_cast<const WTF::String&>(TestSupplemental::str2(impl()));
98 }
99
100 void WebDOMTestInterface::setStr2(const WebDOMString& newStr2)
101 {
102     if (!impl())
103         return;
104
105     TestSupplemental::setStr2(impl(), newStr2);
106 }
107
108 #endif
109 WebCore::TestInterface* toWebCore(const WebDOMTestInterface& wrapper)
110 {
111     return wrapper.impl();
112 }
113
114 WebDOMTestInterface toWebKit(WebCore::TestInterface* value)
115 {
116     return WebDOMTestInterface(value);
117 }
118
119 #endif // ENABLE(Condition1) || ENABLE(Condition2)