1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef DictionaryTest_h
6 #define DictionaryTest_h
8 #include "bindings/core/v8/Nullable.h"
9 #include "bindings/core/v8/ScriptValue.h"
10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "core/dom/Element.h"
12 #include "platform/heap/Handle.h"
13 #include "wtf/text/WTFString.h"
17 class InternalDictionary;
19 class DictionaryTest : public GarbageCollectedFinalized<DictionaryTest>, public ScriptWrappable {
20 DEFINE_WRAPPERTYPEINFO();
22 static DictionaryTest* create()
24 return new DictionaryTest();
26 virtual ~DictionaryTest();
28 // Stores all members into corresponding fields
29 void set(const InternalDictionary&);
30 // Sets each member of the given TestDictionary from fields
31 void get(InternalDictionary&);
40 // The reason to use Nullable<T> is convenience; we use Nullable<T> here to
41 // record whether the member field is set or not. Some members are not
42 // wrapped with Nullable because:
43 // - |longMemberWithDefault| has a non-null default value
44 // - String and PtrTypes can express whether they are null
45 Nullable<int> m_longMember;
46 int m_longMemberWithDefault;
47 Nullable<int> m_longOrNullMember;
48 Nullable<int> m_longOrNullMemberWithDefault;
49 Nullable<bool> m_booleanMember;
50 Nullable<double> m_doubleMember;
51 String m_stringMember;
52 String m_stringMemberWithDefault;
53 Nullable<Vector<String> > m_stringSequenceMember;
54 Nullable<Vector<String> > m_stringSequenceOrNullMember;
56 String m_enumMemberWithDefault;
57 String m_enumOrNullMember;
58 RefPtrWillBeMember<Element> m_elementMember;
59 RefPtrWillBeMember<Element> m_elementOrNullMember;
60 ScriptValue m_objectMember;
61 ScriptValue m_objectOrNullMemberWithDefault;
66 #endif // DictionaryTest_h