OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_CLIPBOARD_H_ | 5 #ifndef BASE_CLIPBOARD_H_ |
6 #define BASE_CLIPBOARD_H_ | 6 #define BASE_CLIPBOARD_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 18 matching lines...) Expand all Loading... |
29 // ObjectType designates the type of data to be stored in the clipboard. This | 29 // ObjectType designates the type of data to be stored in the clipboard. This |
30 // designation is shared across all OSes. The system-specific designation | 30 // designation is shared across all OSes. The system-specific designation |
31 // is defined by FormatType. A single ObjectType might be represented by | 31 // is defined by FormatType. A single ObjectType might be represented by |
32 // several system-specific FormatTypes. For example, on Linux the CBF_TEXT | 32 // several system-specific FormatTypes. For example, on Linux the CBF_TEXT |
33 // ObjectType maps to "text/plain", "STRING", and several other formats. On | 33 // ObjectType maps to "text/plain", "STRING", and several other formats. On |
34 // windows it maps to CF_UNICODETEXT. | 34 // windows it maps to CF_UNICODETEXT. |
35 enum ObjectType { | 35 enum ObjectType { |
36 CBF_TEXT, | 36 CBF_TEXT, |
37 CBF_HTML, | 37 CBF_HTML, |
38 CBF_BOOKMARK, | 38 CBF_BOOKMARK, |
39 CBF_LINK, | |
40 CBF_FILES, | 39 CBF_FILES, |
41 CBF_WEBKIT, | 40 CBF_WEBKIT, |
42 CBF_BITMAP, | 41 CBF_BITMAP, |
43 CBF_SMBITMAP, // Bitmap from shared memory. | 42 CBF_SMBITMAP, // Bitmap from shared memory. |
44 CBF_DATA, // Arbitrary block of bytes. | 43 CBF_DATA, // Arbitrary block of bytes. |
45 }; | 44 }; |
46 | 45 |
47 // ObjectMap is a map from ObjectType to associated data. | 46 // ObjectMap is a map from ObjectType to associated data. |
48 // The data is organized differently for each ObjectType. The following | 47 // The data is organized differently for each ObjectType. The following |
49 // table summarizes what kind of data is stored for each key. | 48 // table summarizes what kind of data is stored for each key. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 void WriteHTML(const char* markup_data, | 178 void WriteHTML(const char* markup_data, |
180 size_t markup_len, | 179 size_t markup_len, |
181 const char* url_data, | 180 const char* url_data, |
182 size_t url_len); | 181 size_t url_len); |
183 | 182 |
184 void WriteBookmark(const char* title_data, | 183 void WriteBookmark(const char* title_data, |
185 size_t title_len, | 184 size_t title_len, |
186 const char* url_data, | 185 const char* url_data, |
187 size_t url_len); | 186 size_t url_len); |
188 | 187 |
189 void WriteHyperlink(const char* title_data, | |
190 size_t title_len, | |
191 const char* url_data, | |
192 size_t url_len); | |
193 | |
194 void WriteWebSmartPaste(); | 188 void WriteWebSmartPaste(); |
195 | 189 |
196 void WriteFiles(const char* file_data, size_t file_len); | 190 void WriteFiles(const char* file_data, size_t file_len); |
197 | 191 |
198 void WriteBitmap(const char* pixel_data, const char* size_data); | 192 void WriteBitmap(const char* pixel_data, const char* size_data); |
199 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD) | 193 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD) |
200 // |format_name| is an ASCII string and should be NULL-terminated. | 194 // |format_name| is an ASCII string and should be NULL-terminated. |
201 // TODO(estade): port to mac. | 195 // TODO(estade): port to mac. |
202 void WriteData(const char* format_name, size_t format_len, | 196 void WriteData(const char* format_name, size_t format_len, |
203 const char* data_data, size_t data_len); | 197 const char* data_data, size_t data_len); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 241 |
248 TargetMap* clipboard_data_; | 242 TargetMap* clipboard_data_; |
249 GtkClipboard* clipboard_; | 243 GtkClipboard* clipboard_; |
250 GtkClipboard* primary_selection_; | 244 GtkClipboard* primary_selection_; |
251 #endif | 245 #endif |
252 | 246 |
253 DISALLOW_COPY_AND_ASSIGN(Clipboard); | 247 DISALLOW_COPY_AND_ASSIGN(Clipboard); |
254 }; | 248 }; |
255 | 249 |
256 #endif // BASE_CLIPBOARD_H_ | 250 #endif // BASE_CLIPBOARD_H_ |
OLD | NEW |