tizen beta release
[profile/ivi/webkit-efl.git] / Source / WebCore / bindings / scripts / test / TestObj.idl
1 /*
2  * Copyright (C) 2009 Google Inc. All rights reserved.
3  * Copyright (C) 2010 Apple Inc. All rights reserved.
4  *
5  * Redistribution and use in source and binary formstrArg, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1.  Redistributions of source code must retain the above copyright
10  *     notice, this list of conditions and the following disclaimer.
11  * 2.  Redistributions in binary form must reproduce the above copyright
12  *     notice, this list of conditions and the following disclaimer in the
13  *     documentation and/or other materials provided with the distribution.
14  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
15  *     its contributors may be used to endorse or promote products derived
16  *     from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
19  * EXPRESS OR IMPLIED WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
22  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29
30 // This IDL file is for testing the bindings code generator and for tracking
31 // changes in its ouput.
32 module test {
33     interface [
34         Constructor
35     ] TestObj {
36         // Attributes
37         readonly attribute long            readOnlyIntAttr;
38         readonly attribute DOMString       readOnlyStringAttr;
39         readonly attribute TestObj         readOnlyTestObjAttr;
40         attribute short                    shortAttr;
41         attribute unsigned short           unsignedShortAttr;
42         attribute long                     intAttr;
43         attribute long long                longLongAttr;
44         attribute unsigned long long       unsignedLongLongAttr;
45         attribute DOMString                stringAttr;
46         attribute TestObj                  testObjAttr;
47
48         JS, V8
49         // WK_ucfirst, WK_lcfirst exceptional cases.
50         attribute TestObj                  XMLObjAttr;
51         attribute boolean                  create;
52
53         // Reflected DOM attributes
54         attribute [Reflect] DOMString reflectedStringAttr;
55         attribute [Reflect] long reflectedIntegralAttr;
56         attribute [Reflect] unsigned long reflectedUnsignedIntegralAttr;
57         attribute [Reflect] boolean reflectedBooleanAttr;
58         attribute [Reflect, URL] DOMString reflectedURLAttr;
59         attribute [Reflect, NonEmpty, URL] DOMString reflectedNonEmptyURLAttr;
60         attribute [Reflect=customContentStringAttr] DOMString reflectedStringAttr;
61         attribute [Reflect=customContentIntegralAttr] long reflectedCustomIntegralAttr;
62         attribute [Reflect=customContentBooleanAttr] boolean reflectedCustomBooleanAttr;
63         attribute [Reflect=customContentURLAttr, URL] DOMString reflectedCustomURLAttr;
64         attribute [Reflect=customContentNonEmptyURLAttr, NonEmpty, URL] DOMString reflectedCustomNonEmptyURLAttr;
65
66         // Methods
67         void    voidMethod();
68         void    voidMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg);
69         long    intMethod();
70         long    intMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg);
71         TestObj objMethod();
72         TestObj objMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg);
73
74         TestObj methodThatRequiresAllArgsAndThrows(in DOMString strArg, in TestObj objArg)
75             raises(DOMException);
76
77         void serializedValue(in SerializedScriptValue serializedArg);
78         void idbKey(in IDBKey key);
79         void optionsObject(in OptionsObject oo, in [Optional] OptionsObject ooo);
80
81         // Exceptions
82         void methodWithException() raises(DOMException);
83         attribute long attrWithGetterException getter raises(DOMException);
84         attribute long attrWithSetterException setter raises(DOMException);
85         attribute DOMString stringAttrWithGetterException getter raises(DOMException);
86         attribute DOMString stringAttrWithSetterException setter raises(DOMException);
87
88         // 'Custom' extended attribute
89         attribute [Custom] long            customAttr;
90         [Custom] void customMethod();
91         [Custom] void customMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg);
92
93         [CustomArgumentHandling] void customArgsAndException(in log intArg)
94             raises(DOMException);
95
96         void addEventListener(in DOMString type, 
97                               in EventListener listener, 
98                               in [Optional] boolean useCapture);
99         void removeEventListener(in DOMString type, 
100                                  in EventListener listener, 
101                                  in [Optional] boolean useCapture);
102
103         // 'CallWith' extended attribute
104         [CallWith=DynamicFrame] void withDynamicFrame();
105         [CallWith=DynamicFrame] void withDynamicFrameAndArg(in long intArg);
106         [CallWith=DynamicFrame] void withDynamicFrameAndOptionalArg(in long intArg, in [Optional] long optionalArg);
107         [NeedsUserGestureCheck, CallWith=DynamicFrame] void withDynamicFrameAndUserGesture(in long intArg);
108         [NeedsUserGestureCheck, CallWith=DynamicFrame] void withDynamicFrameAndUserGestureASAD(in long intArg, in [Optional] long optionalArg);
109         [CallWith=ScriptState] void withScriptStateVoid();
110         [CallWith=ScriptState] TestObj withScriptStateObj();
111         [CallWith=ScriptState] void withScriptStateVoidException()
112             raises(DOMException);
113         [CallWith=ScriptState] TestObj withScriptStateObjException()
114             raises(DOMException);
115         [CallWith=ScriptExecutionContext] void withScriptExecutionContext();
116
117         // 'Optional' extended attribute
118         void    methodWithOptionalArg(in [Optional] long opt);
119         void    methodWithNonOptionalArgAndOptionalArg(in long nonOpt, in [Optional] long opt);
120         void    methodWithNonOptionalArgAndTwoOptionalArgs(in long nonOpt, in [Optional] long opt1, in [Optional] long opt2);
121
122 #if defined(TESTING_V8) || defined(TESTING_JS)
123         // 'Callback' extended attribute
124         void    methodWithCallbackArg(in [Callback] TestCallback callback);
125         void    methodWithNonCallbackArgAndCallbackArg(in long nonCallback, in [Callback] TestCallback callback);
126         void    methodWithCallbackAndOptionalArg(in [Callback, Optional] TestCallback callback);
127 #endif
128
129         // 'ConvertScriptString' extended attribute
130         readonly attribute [ConvertScriptString] DOMString scriptStringAttr;
131
132         // 'Conditional' extended attribute
133         attribute [Conditional=Condition1] long conditionalAttr1;
134         attribute [Conditional=Condition1&Condition2] long conditionalAttr2;
135         attribute [Conditional=Condition1|Condition2] long conditionalAttr3;
136
137         // 'Conditional' extended method
138         [Conditional=Condition1] DOMString conditionalMethod1();
139         [Conditional=Condition1&Condition2] void conditionalMethod2();
140         [Conditional=Condition1|Condition2] void conditionalMethod3();
141
142         attribute [Conditional=Condition1] TestObjectAConstructor conditionalAttr4;
143         attribute [Conditional=Condition1&Condition2] TestObjectBConstructor conditionalAttr5;
144         attribute [Conditional=Condition1|Condition2] TestObjectCConstructor conditionalAttr6;
145
146         const [Conditional=Condition1] unsigned short CONDITIONAL_CONST = 0;
147
148 #if defined(TESTING_V8) || defined(TESTING_JS)
149         readonly attribute [CachedAttribute] any cachedAttribute1;
150         readonly attribute [CachedAttribute] any cachedAttribute2;
151 #endif
152
153 #if defined(TESTING_V8) || defined(TESTING_JS)
154         // Overloads
155         void    overloadedMethod(in TestObj objArg, in DOMString strArg);
156         void    overloadedMethod(in TestObj objArg, in [Optional] long intArg);
157         void    overloadedMethod(in DOMString strArg);
158         void    overloadedMethod(in long intArg);
159         void    overloadedMethod(in [Callback] TestCallback callback);
160         void    overloadedMethod(in DOMStringList listArg);
161         void    overloadedMethod(in DOMString[] arrayArg);
162 #endif
163
164         // Class methods within JavaScript (like what's used for IDBKeyRange).
165         static void classMethod();
166         static long classMethodWithOptional(in [Optional] long arg);
167
168 #if defined(TESTING_V8)
169         // 'EnabledAtRuntime' methods and attributes.
170         [EnabledAtRuntime] void enabledAtRuntimeMethod1(in int intArg);
171         [EnabledAtRuntime=FeatureName] void enabledAtRuntimeMethod2(in int intArg);
172         attribute [EnabledAtRuntime] long enabledAtRuntimeAttr1;
173         attribute [EnabledAtRuntime=FeatureName] long enabledAtRuntimeAttr2;
174 #endif
175
176
177 #if defined(TESTING_V8)
178         attribute float[]                   floatArray;
179         attribute double[]                  doubleArray;
180 #endif
181
182         // ObjectiveC reserved words.
183         readonly attribute long      description;
184         attribute long               id;
185         readonly attribute DOMString hash;
186
187         // Check constants and enums.
188         const unsigned short CONST_VALUE_0 = 0;
189         const unsigned short CONST_VALUE_1 = 1;
190         const unsigned short CONST_VALUE_2 = 2;
191         const unsigned short CONST_VALUE_4 = 4;
192         const unsigned short CONST_VALUE_8 = 8;
193         const short CONST_VALUE_9 = -1;
194         const DOMString CONST_VALUE_10 = "my constant string";
195         const unsigned short CONST_VALUE_11 = 0xffffffff;
196         const unsigned short CONST_VALUE_12 = 0x01;
197         const unsigned short CONST_VALUE_13 = 0X20;
198         const unsigned short CONST_VALUE_14 = 0x1abc;
199         const [Reflect=CONST_IMPL] unsigned short CONST_JAVASCRIPT = 15;
200     };
201 }