2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
26 #ifndef WebCoreArgumentCoders_h
27 #define WebCoreArgumentCoders_h
29 #include "ArgumentCoders.h"
32 class AffineTransform;
33 class AuthenticationChallenge;
34 class CertificateInfo;
38 class DatabaseDetails;
39 class FilterOperations;
44 class FixedPositionViewportConstraints;
50 class KeyframeValueList;
53 class ProtectionSpace;
55 class ResourceRequest;
56 class ResourceResponse;
57 class StickyPositionViewportConstraints;
58 class TextCheckingRequestData;
59 class TransformationMatrix;
62 struct CompositionUnderline;
64 struct DictationAlternative;
66 struct FileChooserSettings;
67 struct IDBDatabaseMetadata;
69 struct IDBIndexMetadata;
71 struct IDBKeyRangeData;
72 struct IDBObjectStoreMetadata;
76 struct PasteboardImage;
77 struct PasteboardWebContent;
79 struct ScrollableAreaParameters;
80 struct TextCheckingResult;
81 struct ViewportAttributes;
82 struct WindowFeatures;
87 struct KeypressCommand;
95 struct PasteboardImage;
96 struct PasteboardWebContent;
97 struct ViewportArguments;
103 template<> struct ArgumentCoder<WebCore::AffineTransform> {
104 static void encode(ArgumentEncoder&, const WebCore::AffineTransform&);
105 static bool decode(ArgumentDecoder&, WebCore::AffineTransform&);
108 template<> struct ArgumentCoder<WebCore::TransformationMatrix> {
109 static void encode(ArgumentEncoder&, const WebCore::TransformationMatrix&);
110 static bool decode(ArgumentDecoder&, WebCore::TransformationMatrix&);
113 template<> struct ArgumentCoder<WebCore::CertificateInfo> {
114 static void encode(ArgumentEncoder&, const WebCore::CertificateInfo&);
115 static bool decode(ArgumentDecoder&, WebCore::CertificateInfo&);
118 template<> struct ArgumentCoder<WebCore::FloatPoint> {
119 static void encode(ArgumentEncoder&, const WebCore::FloatPoint&);
120 static bool decode(ArgumentDecoder&, WebCore::FloatPoint&);
123 template<> struct ArgumentCoder<WebCore::FloatPoint3D> {
124 static void encode(ArgumentEncoder&, const WebCore::FloatPoint3D&);
125 static bool decode(ArgumentDecoder&, WebCore::FloatPoint3D&);
128 template<> struct ArgumentCoder<WebCore::FloatRect> {
129 static void encode(ArgumentEncoder&, const WebCore::FloatRect&);
130 static bool decode(ArgumentDecoder&, WebCore::FloatRect&);
133 template<> struct ArgumentCoder<WebCore::FloatSize> {
134 static void encode(ArgumentEncoder&, const WebCore::FloatSize&);
135 static bool decode(ArgumentDecoder&, WebCore::FloatSize&);
139 template<> struct ArgumentCoder<WebCore::FloatQuad> {
140 static void encode(ArgumentEncoder&, const WebCore::FloatQuad&);
141 static bool decode(ArgumentDecoder&, WebCore::FloatQuad&);
144 template<> struct ArgumentCoder<WebCore::ViewportArguments> {
145 static void encode(ArgumentEncoder&, const WebCore::ViewportArguments&);
146 static bool decode(ArgumentDecoder&, WebCore::ViewportArguments&);
148 #endif // PLATFORM(IOS)
150 template<> struct ArgumentCoder<WebCore::IntPoint> {
151 static void encode(ArgumentEncoder&, const WebCore::IntPoint&);
152 static bool decode(ArgumentDecoder&, WebCore::IntPoint&);
155 template<> struct ArgumentCoder<WebCore::IntRect> {
156 static void encode(ArgumentEncoder&, const WebCore::IntRect&);
157 static bool decode(ArgumentDecoder&, WebCore::IntRect&);
160 template<> struct ArgumentCoder<WebCore::IntSize> {
161 static void encode(ArgumentEncoder&, const WebCore::IntSize&);
162 static bool decode(ArgumentDecoder&, WebCore::IntSize&);
165 template<> struct ArgumentCoder<WebCore::Length> {
166 static void encode(ArgumentEncoder&, const WebCore::Length&);
167 static bool decode(ArgumentDecoder&, WebCore::Length&);
170 template<> struct ArgumentCoder<WebCore::ViewportAttributes> {
171 static void encode(ArgumentEncoder&, const WebCore::ViewportAttributes&);
172 static bool decode(ArgumentDecoder&, WebCore::ViewportAttributes&);
175 template<> struct ArgumentCoder<WebCore::MimeClassInfo> {
176 static void encode(ArgumentEncoder&, const WebCore::MimeClassInfo&);
177 static bool decode(ArgumentDecoder&, WebCore::MimeClassInfo&);
180 template<> struct ArgumentCoder<WebCore::PluginInfo> {
181 static void encode(ArgumentEncoder&, const WebCore::PluginInfo&);
182 static bool decode(ArgumentDecoder&, WebCore::PluginInfo&);
185 template<> struct ArgumentCoder<WebCore::HTTPHeaderMap> {
186 static void encode(ArgumentEncoder&, const WebCore::HTTPHeaderMap&);
187 static bool decode(ArgumentDecoder&, WebCore::HTTPHeaderMap&);
190 template<> struct ArgumentCoder<WebCore::AuthenticationChallenge> {
191 static void encode(ArgumentEncoder&, const WebCore::AuthenticationChallenge&);
192 static bool decode(ArgumentDecoder&, WebCore::AuthenticationChallenge&);
195 template<> struct ArgumentCoder<WebCore::ProtectionSpace> {
196 static void encode(ArgumentEncoder&, const WebCore::ProtectionSpace&);
197 static bool decode(ArgumentDecoder&, WebCore::ProtectionSpace&);
200 template<> struct ArgumentCoder<WebCore::Credential> {
201 static void encode(ArgumentEncoder&, const WebCore::Credential&);
202 static bool decode(ArgumentDecoder&, WebCore::Credential&);
205 template<> struct ArgumentCoder<WebCore::Cursor> {
206 static void encode(ArgumentEncoder&, const WebCore::Cursor&);
207 static bool decode(ArgumentDecoder&, WebCore::Cursor&);
210 template<> struct ArgumentCoder<WebCore::ResourceRequest> {
212 static const bool kShouldSerializeWebCoreData = false;
214 static const bool kShouldSerializeWebCoreData = true;
217 static void encode(ArgumentEncoder&, const WebCore::ResourceRequest&);
218 static bool decode(ArgumentDecoder&, WebCore::ResourceRequest&);
219 static void encodePlatformData(ArgumentEncoder&, const WebCore::ResourceRequest&);
220 static bool decodePlatformData(ArgumentDecoder&, WebCore::ResourceRequest&);
223 template<> struct ArgumentCoder<WebCore::ResourceResponse> {
224 static void encode(ArgumentEncoder&, const WebCore::ResourceResponse&);
225 static bool decode(ArgumentDecoder&, WebCore::ResourceResponse&);
226 static void encodePlatformData(ArgumentEncoder&, const WebCore::ResourceResponse&);
227 static bool decodePlatformData(ArgumentDecoder&, WebCore::ResourceResponse&);
230 template<> struct ArgumentCoder<WebCore::ResourceError> {
232 static const bool kShouldSerializeWebCoreData = false;
234 static const bool kShouldSerializeWebCoreData = true;
237 static void encode(ArgumentEncoder&, const WebCore::ResourceError&);
238 static bool decode(ArgumentDecoder&, WebCore::ResourceError&);
239 static void encodePlatformData(ArgumentEncoder&, const WebCore::ResourceError&);
240 static bool decodePlatformData(ArgumentDecoder&, WebCore::ResourceError&);
243 template<> struct ArgumentCoder<WebCore::WindowFeatures> {
244 static void encode(ArgumentEncoder&, const WebCore::WindowFeatures&);
245 static bool decode(ArgumentDecoder&, WebCore::WindowFeatures&);
248 template<> struct ArgumentCoder<WebCore::Color> {
249 static void encode(ArgumentEncoder&, const WebCore::Color&);
250 static bool decode(ArgumentDecoder&, WebCore::Color&);
254 template<> struct ArgumentCoder<WebCore::KeypressCommand> {
255 static void encode(ArgumentEncoder&, const WebCore::KeypressCommand&);
256 static bool decode(ArgumentDecoder&, WebCore::KeypressCommand&);
261 template<> struct ArgumentCoder<WebCore::SelectionRect> {
262 static void encode(ArgumentEncoder&, const WebCore::SelectionRect&);
263 static bool decode(ArgumentDecoder&, WebCore::SelectionRect&);
266 template<> struct ArgumentCoder<WebCore::PasteboardWebContent> {
267 static void encode(ArgumentEncoder&, const WebCore::PasteboardWebContent&);
268 static bool decode(ArgumentDecoder&, WebCore::PasteboardWebContent&);
271 template<> struct ArgumentCoder<WebCore::PasteboardImage> {
272 static void encode(ArgumentEncoder&, const WebCore::PasteboardImage&);
273 static bool decode(ArgumentDecoder&, WebCore::PasteboardImage&);
277 template<> struct ArgumentCoder<WebCore::CompositionUnderline> {
278 static void encode(ArgumentEncoder&, const WebCore::CompositionUnderline&);
279 static bool decode(ArgumentDecoder&, WebCore::CompositionUnderline&);
282 template<> struct ArgumentCoder<WebCore::Cookie> {
283 static void encode(ArgumentEncoder&, const WebCore::Cookie&);
284 static bool decode(ArgumentDecoder&, WebCore::Cookie&);
287 template<> struct ArgumentCoder<WebCore::DatabaseDetails> {
288 static void encode(ArgumentEncoder&, const WebCore::DatabaseDetails&);
289 static bool decode(ArgumentDecoder&, WebCore::DatabaseDetails&);
292 template<> struct ArgumentCoder<WebCore::DictationAlternative> {
293 static void encode(ArgumentEncoder&, const WebCore::DictationAlternative&);
294 static bool decode(ArgumentDecoder&, WebCore::DictationAlternative&);
297 template<> struct ArgumentCoder<WebCore::FileChooserSettings> {
298 static void encode(ArgumentEncoder&, const WebCore::FileChooserSettings&);
299 static bool decode(ArgumentDecoder&, WebCore::FileChooserSettings&);
302 template<> struct ArgumentCoder<WebCore::GrammarDetail> {
303 static void encode(ArgumentEncoder&, const WebCore::GrammarDetail&);
304 static bool decode(ArgumentDecoder&, WebCore::GrammarDetail&);
307 template<> struct ArgumentCoder<WebCore::TextCheckingRequestData> {
308 static void encode(ArgumentEncoder&, const WebCore::TextCheckingRequestData&);
309 static bool decode(ArgumentDecoder&, WebCore::TextCheckingRequestData&);
312 template<> struct ArgumentCoder<WebCore::TextCheckingResult> {
313 static void encode(ArgumentEncoder&, const WebCore::TextCheckingResult&);
314 static bool decode(ArgumentDecoder&, WebCore::TextCheckingResult&);
317 template<> struct ArgumentCoder<WebCore::DragSession> {
318 static void encode(ArgumentEncoder&, const WebCore::DragSession&);
319 static bool decode(ArgumentDecoder&, WebCore::DragSession&);
322 template<> struct ArgumentCoder<WebCore::URL> {
323 static void encode(ArgumentEncoder&, const WebCore::URL&);
324 static bool decode(ArgumentDecoder&, WebCore::URL&);
327 template<> struct ArgumentCoder<WebCore::UserStyleSheet> {
328 static void encode(ArgumentEncoder&, const WebCore::UserStyleSheet&);
329 static bool decode(ArgumentDecoder&, WebCore::UserStyleSheet&);
332 template<> struct ArgumentCoder<WebCore::UserScript> {
333 static void encode(ArgumentEncoder&, const WebCore::UserScript&);
334 static bool decode(ArgumentDecoder&, WebCore::UserScript&);
337 template<> struct ArgumentCoder<WebCore::ScrollableAreaParameters> {
338 static void encode(ArgumentEncoder&, const WebCore::ScrollableAreaParameters&);
339 static bool decode(ArgumentDecoder&, WebCore::ScrollableAreaParameters&);
342 template<> struct ArgumentCoder<WebCore::FixedPositionViewportConstraints> {
343 static void encode(ArgumentEncoder&, const WebCore::FixedPositionViewportConstraints&);
344 static bool decode(ArgumentDecoder&, WebCore::FixedPositionViewportConstraints&);
347 template<> struct ArgumentCoder<WebCore::StickyPositionViewportConstraints> {
348 static void encode(ArgumentEncoder&, const WebCore::StickyPositionViewportConstraints&);
349 static bool decode(ArgumentDecoder&, WebCore::StickyPositionViewportConstraints&);
352 #if ENABLE(CSS_FILTERS) && !USE(COORDINATED_GRAPHICS)
353 template<> struct ArgumentCoder<WebCore::FilterOperations> {
354 static void encode(ArgumentEncoder&, const WebCore::FilterOperations&);
355 static bool decode(ArgumentDecoder&, WebCore::FilterOperations&);
359 #if ENABLE(INDEXED_DATABASE)
360 template<> struct ArgumentCoder<WebCore::IDBDatabaseMetadata> {
361 static void encode(ArgumentEncoder&, const WebCore::IDBDatabaseMetadata&);
362 static bool decode(ArgumentDecoder&, WebCore::IDBDatabaseMetadata&);
365 template<> struct ArgumentCoder<WebCore::IDBGetResult> {
366 static void encode(ArgumentEncoder&, const WebCore::IDBGetResult&);
367 static bool decode(ArgumentDecoder&, WebCore::IDBGetResult&);
370 template<> struct ArgumentCoder<WebCore::IDBIndexMetadata> {
371 static void encode(ArgumentEncoder&, const WebCore::IDBIndexMetadata&);
372 static bool decode(ArgumentDecoder&, WebCore::IDBIndexMetadata&);
375 template<> struct ArgumentCoder<WebCore::IDBKeyData> {
376 static void encode(ArgumentEncoder&, const WebCore::IDBKeyData&);
377 static bool decode(ArgumentDecoder&, WebCore::IDBKeyData&);
380 template<> struct ArgumentCoder<WebCore::IDBKeyPath> {
381 static void encode(ArgumentEncoder&, const WebCore::IDBKeyPath&);
382 static bool decode(ArgumentDecoder&, WebCore::IDBKeyPath&);
385 template<> struct ArgumentCoder<WebCore::IDBKeyRangeData> {
386 static void encode(ArgumentEncoder&, const WebCore::IDBKeyRangeData&);
387 static bool decode(ArgumentDecoder&, WebCore::IDBKeyRangeData&);
390 template<> struct ArgumentCoder<WebCore::IDBObjectStoreMetadata> {
391 static void encode(ArgumentEncoder&, const WebCore::IDBObjectStoreMetadata&);
392 static bool decode(ArgumentDecoder&, WebCore::IDBObjectStoreMetadata&);
398 #endif // WebCoreArgumentCoders_h