2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 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 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
23 #ifndef WebDOMTestObj_h
24 #define WebDOMTestObj_h
26 #include <WebDOMObject.h>
27 #include <WebDOMString.h>
33 class WebDOMDictionary;
35 class WebDOMEventListener;
47 class WebDOMTestObj : public WebDOMObject {
50 explicit WebDOMTestObj(WebCore::TestObj*);
51 WebDOMTestObj(const WebDOMTestObj&);
52 WebDOMTestObj& operator=(const WebDOMTestObj&);
53 virtual ~WebDOMTestObj();
56 #if ENABLE(Condition1)
57 WEBDOM_CONDITIONAL_CONST = 0,
59 WEBDOM_CONST_VALUE_0 = 0,
60 WEBDOM_CONST_VALUE_1 = 1,
61 WEBDOM_CONST_VALUE_2 = 2,
62 WEBDOM_CONST_VALUE_4 = 4,
63 WEBDOM_CONST_VALUE_8 = 8,
64 WEBDOM_CONST_VALUE_9 = -1,
65 WEBDOM_CONST_VALUE_10 = "my constant string",
66 WEBDOM_CONST_VALUE_11 = 0xffffffff,
67 WEBDOM_CONST_VALUE_12 = 0x01,
68 WEBDOM_CONST_VALUE_13 = 0X20,
69 WEBDOM_CONST_VALUE_14 = 0x1abc,
70 WEBDOM_CONST_JAVASCRIPT = 15
73 int readOnlyIntAttr() const;
74 WebDOMString readOnlyStringAttr() const;
75 WebDOMTestObj readOnlyTestObjAttr() const;
76 short shortAttr() const;
77 void setShortAttr(short);
78 unsigned short unsignedShortAttr() const;
79 void setUnsignedShortAttr(unsigned short);
82 long long longLongAttr() const;
83 void setLongLongAttr(long long);
84 unsigned long long unsignedLongLongAttr() const;
85 void setUnsignedLongLongAttr(unsigned long long);
86 WebDOMString stringAttr() const;
87 void setStringAttr(const WebDOMString&);
88 WebDOMTestObj testObjAttr() const;
89 void setTestObjAttr(const WebDOMTestObj&);
90 WebDOMTestObj XMLObjAttr() const;
91 void setXMLObjAttr(const WebDOMTestObj&);
94 WebDOMString reflectedStringAttr() const;
95 void setReflectedStringAttr(const WebDOMString&);
96 int reflectedIntegralAttr() const;
97 void setReflectedIntegralAttr(int);
98 unsigned reflectedUnsignedIntegralAttr() const;
99 void setReflectedUnsignedIntegralAttr(unsigned);
100 bool reflectedBooleanAttr() const;
101 void setReflectedBooleanAttr(bool);
102 WebDOMString reflectedURLAttr() const;
103 void setReflectedURLAttr(const WebDOMString&);
104 WebDOMString reflectedStringAttr() const;
105 void setReflectedStringAttr(const WebDOMString&);
106 int reflectedCustomIntegralAttr() const;
107 void setReflectedCustomIntegralAttr(int);
108 bool reflectedCustomBooleanAttr() const;
109 void setReflectedCustomBooleanAttr(bool);
110 WebDOMString reflectedCustomURLAttr() const;
111 void setReflectedCustomURLAttr(const WebDOMString&);
112 int attrWithGetterException() const;
113 void setAttrWithGetterException(int);
114 int attrWithSetterException() const;
115 void setAttrWithSetterException(int);
116 WebDOMString stringAttrWithGetterException() const;
117 void setStringAttrWithGetterException(const WebDOMString&);
118 WebDOMString stringAttrWithSetterException() const;
119 void setStringAttrWithSetterException(const WebDOMString&);
120 #if ENABLE(Condition1)
121 int conditionalAttr1() const;
122 void setConditionalAttr1(int);
124 #if ENABLE(Condition1) && ENABLE(Condition2)
125 int conditionalAttr2() const;
126 void setConditionalAttr2(int);
128 #if ENABLE(Condition1) || ENABLE(Condition2)
129 int conditionalAttr3() const;
130 void setConditionalAttr3(int);
132 WebDOMDocument contentDocument() const;
133 WebDOMSVGPoint mutablePoint() const;
134 void setMutablePoint(const WebDOMSVGPoint&);
135 WebDOMSVGPoint immutablePoint() const;
136 void setImmutablePoint(const WebDOMSVGPoint&);
137 float strictFloat() const;
138 void setStrictFloat(float);
139 int description() const;
142 WebDOMString hash() const;
145 void voidMethodWithArgs(int intArg, const WebDOMString& strArg, const WebDOMTestObj& objArg);
147 int intMethodWithArgs(int intArg, const WebDOMString& strArg, const WebDOMTestObj& objArg);
148 WebDOMTestObj objMethod();
149 WebDOMTestObj objMethodWithArgs(int intArg, const WebDOMString& strArg, const WebDOMTestObj& objArg);
150 WebDOMTestObj methodThatRequiresAllArgsAndThrows(const WebDOMString& strArg, const WebDOMTestObj& objArg);
151 void serializedValue(const WebDOMString& serializedArg);
152 void idbKey(const WebDOMIDBKey& key);
153 void optionsObject(const WebDOMDictionary& oo, const WebDOMDictionary& ooo);
154 void methodWithException();
155 void addEventListener(const WebDOMString& type, const WebDOMEventListener& listener, bool useCapture);
156 void removeEventListener(const WebDOMString& type, const WebDOMEventListener& listener, bool useCapture);
157 void methodWithOptionalArg(int opt);
158 void methodWithNonOptionalArgAndOptionalArg(int nonOpt, int opt);
159 void methodWithNonOptionalArgAndTwoOptionalArgs(int nonOpt, int opt1, int opt2);
160 void methodWithOptionalString(const WebDOMString& str);
161 void methodWithOptionalStringIsUndefined(const WebDOMString& str);
162 void methodWithOptionalStringIsNullString(const WebDOMString& str);
163 #if ENABLE(Condition1)
164 WebDOMString conditionalMethod1();
166 #if ENABLE(Condition1) && ENABLE(Condition2)
167 void conditionalMethod2();
169 #if ENABLE(Condition1) || ENABLE(Condition2)
170 void conditionalMethod3();
173 int classMethodWithOptional(int arg);
174 #if ENABLE(Condition1)
175 void overloadedMethod1(int arg);
177 #if ENABLE(Condition1)
178 void overloadedMethod1(const WebDOMString& type);
180 void convert1(const WebDOMa& );
181 void convert2(const WebDOMb& );
182 void convert3(const WebDOMc& );
183 void convert4(const WebDOMd& );
184 void convert5(const WebDOMe& );
185 WebDOMSVGPoint mutablePointFunction();
186 WebDOMSVGPoint immutablePointFunction();
188 WebDOMbool strictFunction(const WebDOMString& str, float a, int b);
190 WebCore::TestObj* impl() const;
193 struct WebDOMTestObjPrivate;
194 WebDOMTestObjPrivate* m_impl;
197 WebCore::TestObj* toWebCore(const WebDOMTestObj&);
198 WebDOMTestObj toWebKit(WebCore::TestObj*);