Add ICU message format support
[chromium-blink-merge.git] / ui / base / clipboard / custom_data_helper.h
blobc1778c73bf622425a669c5102dc5d085472b1f6a
1 // Copyright (c) 2012 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.
4 //
5 // Due to restrictions of most operating systems, we don't directly map each
6 // type of custom data to a native data transfer type. Instead, we serialize
7 // each key-value pair into the pickle as a pair of string objects, and then
8 // write the binary data in the pickle to the native data transfer object.
10 #ifndef UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_
11 #define UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_
13 #include <map>
14 #include <vector>
16 #include "base/strings/string16.h"
17 #include "ui/base/ui_base_export.h"
19 namespace base {
20 class Pickle;
23 #if defined(OS_MACOSX)
24 #ifdef __OBJC__
25 @class NSString;
26 #else
27 class NSString;
28 #endif
29 #endif // defined(OS_MACOSX)
31 namespace ui {
33 #if defined(OS_MACOSX) && !defined(USE_AURA)
34 UI_BASE_EXPORT extern NSString* const kWebCustomDataPboardType;
35 #elif !defined(OS_WIN) && defined(USE_AURA)
36 UI_BASE_EXPORT extern const char kMimeTypeWebCustomData[];
37 #endif
39 UI_BASE_EXPORT void ReadCustomDataTypes(const void* data,
40 size_t data_length,
41 std::vector<base::string16>* types);
42 UI_BASE_EXPORT void ReadCustomDataForType(const void* data,
43 size_t data_length,
44 const base::string16& type,
45 base::string16* result);
46 UI_BASE_EXPORT void ReadCustomDataIntoMap(
47 const void* data,
48 size_t data_length,
49 std::map<base::string16, base::string16>* result);
51 UI_BASE_EXPORT void WriteCustomDataToPickle(
52 const std::map<base::string16, base::string16>& data,
53 base::Pickle* pickle);
55 } // namespace ui
57 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_