OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
13 * | 13 * |
14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef WebIDBKey_h | 26 #ifndef WebIDBKey_h |
27 #define WebIDBKey_h | 27 #define WebIDBKey_h |
28 | 28 |
29 #include "WebCommon.h" | 29 #include "WebCommon.h" |
| 30 #include "WebIDBTypes.h" |
30 #include "WebPrivatePtr.h" | 31 #include "WebPrivatePtr.h" |
31 #include "WebString.h" | 32 #include "WebString.h" |
32 #include "WebVector.h" | 33 #include "WebVector.h" |
33 | 34 |
34 namespace WebCore { class IDBKey; } | 35 namespace WebCore { class IDBKey; } |
35 | 36 |
36 namespace WebKit { | 37 namespace WebKit { |
37 | 38 |
38 class WebIDBKey { | 39 class WebIDBKey { |
39 public: | 40 public: |
(...skipping 17 matching lines...) Expand all Loading... |
57 | 58 |
58 WEBKIT_EXPORT void assign(const WebIDBKey&); | 59 WEBKIT_EXPORT void assign(const WebIDBKey&); |
59 WEBKIT_EXPORT void assignArray(const WebVector<WebIDBKey>&); | 60 WEBKIT_EXPORT void assignArray(const WebVector<WebIDBKey>&); |
60 WEBKIT_EXPORT void assignString(const WebString&); | 61 WEBKIT_EXPORT void assignString(const WebString&); |
61 WEBKIT_EXPORT void assignDate(double); | 62 WEBKIT_EXPORT void assignDate(double); |
62 WEBKIT_EXPORT void assignNumber(double); | 63 WEBKIT_EXPORT void assignNumber(double); |
63 WEBKIT_EXPORT void assignInvalid(); | 64 WEBKIT_EXPORT void assignInvalid(); |
64 WEBKIT_EXPORT void assignNull(); | 65 WEBKIT_EXPORT void assignNull(); |
65 WEBKIT_EXPORT void reset(); | 66 WEBKIT_EXPORT void reset(); |
66 | 67 |
67 enum Type { | 68 WEBKIT_EXPORT WebIDBKeyType keyType() const; |
68 InvalidType = 0, | |
69 ArrayType, | |
70 StringType, | |
71 DateType, | |
72 NumberType, | |
73 NullType, | |
74 MinType, | |
75 }; | |
76 | |
77 WEBKIT_EXPORT Type type() const; | |
78 WEBKIT_EXPORT bool isValid() const; | 69 WEBKIT_EXPORT bool isValid() const; |
79 WEBKIT_EXPORT WebVector<WebIDBKey> array() const; // Only valid for ArrayTyp
e. | 70 WEBKIT_EXPORT WebVector<WebIDBKey> array() const; // Only valid for ArrayTyp
e. |
80 WEBKIT_EXPORT WebString string() const; // Only valid for StringType. | 71 WEBKIT_EXPORT WebString string() const; // Only valid for StringType. |
81 WEBKIT_EXPORT double date() const; // Only valid for DateType. | 72 WEBKIT_EXPORT double date() const; // Only valid for DateType. |
82 WEBKIT_EXPORT double number() const; // Only valid for NumberType. | 73 WEBKIT_EXPORT double number() const; // Only valid for NumberType. |
83 | 74 |
84 #if WEBKIT_IMPLEMENTATION | 75 #if WEBKIT_IMPLEMENTATION |
85 WebIDBKey(const WTF::PassRefPtr<WebCore::IDBKey>&); | 76 WebIDBKey(const WTF::PassRefPtr<WebCore::IDBKey>&); |
86 WebIDBKey& operator=(const WTF::PassRefPtr<WebCore::IDBKey>&); | 77 WebIDBKey& operator=(const WTF::PassRefPtr<WebCore::IDBKey>&); |
87 operator WTF::PassRefPtr<WebCore::IDBKey>() const; | 78 operator WTF::PassRefPtr<WebCore::IDBKey>() const; |
88 #endif | 79 #endif |
89 | 80 |
| 81 // DEPRECATED! Use WebIDBKeyType and keyType() instead. |
| 82 // FIXME: Remove once the chromium-side users are updated. |
| 83 enum Type { |
| 84 InvalidType = 0, |
| 85 ArrayType, |
| 86 StringType, |
| 87 DateType, |
| 88 NumberType, |
| 89 NullType, |
| 90 MinType, |
| 91 }; |
| 92 WEBKIT_EXPORT Type type() const; |
| 93 |
90 private: | 94 private: |
91 WebPrivatePtr<WebCore::IDBKey> m_private; | 95 WebPrivatePtr<WebCore::IDBKey> m_private; |
92 }; | 96 }; |
93 | 97 |
94 } // namespace WebKit | 98 } // namespace WebKit |
95 | 99 |
96 #endif // WebIDBKey_h | 100 #endif // WebIDBKey_h |
OLD | NEW |