| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_COMMON_OS_EXCHANGE_DATA_H__ | 5 #ifndef CHROME_COMMON_OS_EXCHANGE_DATA_H__ |
| 6 #define CHROME_COMMON_OS_EXCHANGE_DATA_H__ | 6 #define CHROME_COMMON_OS_EXCHANGE_DATA_H__ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <objidl.h> | 9 #include <objidl.h> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 void SetString(const std::wstring& data); | 49 void SetString(const std::wstring& data); |
| 50 // A URL can have an optional title in some exchange formats. | 50 // A URL can have an optional title in some exchange formats. |
| 51 void SetURL(const GURL& url, const std::wstring& title); | 51 void SetURL(const GURL& url, const std::wstring& title); |
| 52 // A full path to a file | 52 // A full path to a file |
| 53 void SetFilename(const std::wstring& full_path); | 53 void SetFilename(const std::wstring& full_path); |
| 54 // Adds pickled data of the specified format. | 54 // Adds pickled data of the specified format. |
| 55 void SetPickledData(CLIPFORMAT format, const Pickle& data); | 55 void SetPickledData(CLIPFORMAT format, const Pickle& data); |
| 56 // Adds the bytes of a file (CFSTR_FILECONTENTS and CFSTR_FILEDESCRIPTOR). | 56 // Adds the bytes of a file (CFSTR_FILECONTENTS and CFSTR_FILEDESCRIPTOR). |
| 57 void SetFileContents(const std::wstring& filename, | 57 void SetFileContents(const std::wstring& filename, |
| 58 const std::string& file_contents); | 58 const std::string& file_contents); |
| 59 // Adds a snippet of Windows HTML (CF_HTML). | 59 // Adds a snippet of HTML. |html| is just raw html but this sets both |
| 60 void SetCFHtml(const std::wstring& cf_html); | 60 // text/html and CF_HTML. |
| 61 void SetHtml(const std::wstring& html, const GURL& base_url); |
| 61 | 62 |
| 62 // These functions retrieve data of the specified type. If data exists, the | 63 // These functions retrieve data of the specified type. If data exists, the |
| 63 // functions return and the result is in the out parameter. If the data does | 64 // functions return and the result is in the out parameter. If the data does |
| 64 // not exist, the out parameter is not touched. The out parameter cannot be | 65 // not exist, the out parameter is not touched. The out parameter cannot be |
| 65 // NULL. | 66 // NULL. |
| 66 bool GetString(std::wstring* data) const; | 67 bool GetString(std::wstring* data) const; |
| 67 bool GetURLAndTitle(GURL* url, std::wstring* title) const; | 68 bool GetURLAndTitle(GURL* url, std::wstring* title) const; |
| 68 // Return the path of a file, if available. | 69 // Return the path of a file, if available. |
| 69 bool GetFilename(std::wstring* full_path) const; | 70 bool GetFilename(std::wstring* full_path) const; |
| 70 bool GetPickledData(CLIPFORMAT format, Pickle* data) const; | 71 bool GetPickledData(CLIPFORMAT format, Pickle* data) const; |
| 71 bool GetFileContents(std::wstring* filename, | 72 bool GetFileContents(std::wstring* filename, |
| 72 std::string* file_contents) const; | 73 std::string* file_contents) const; |
| 73 bool GetCFHtml(std::wstring* cf_html) const; | 74 bool GetHtml(std::wstring* html, GURL* base_url) const; |
| 74 | 75 |
| 75 // Test whether or not data of certain types is present, without actually | 76 // Test whether or not data of certain types is present, without actually |
| 76 // returning anything. | 77 // returning anything. |
| 77 bool HasString() const; | 78 bool HasString() const; |
| 78 bool HasURL() const; | 79 bool HasURL() const; |
| 79 bool HasURLTitle() const; | 80 bool HasURLTitle() const; |
| 80 bool HasFile() const; | 81 bool HasFile() const; |
| 81 bool HasFormat(CLIPFORMAT format) const; | 82 bool HasFormat(CLIPFORMAT format) const; |
| 82 | 83 |
| 83 // IDataObject implementation: | 84 // IDataObject implementation: |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 StoredData contents_; | 135 StoredData contents_; |
| 135 | 136 |
| 136 CComPtr<IDataObject> source_object_; | 137 CComPtr<IDataObject> source_object_; |
| 137 | 138 |
| 138 LONG ref_count_; | 139 LONG ref_count_; |
| 139 | 140 |
| 140 DISALLOW_EVIL_CONSTRUCTORS(OSExchangeData); | 141 DISALLOW_EVIL_CONSTRUCTORS(OSExchangeData); |
| 141 }; | 142 }; |
| 142 | 143 |
| 143 #endif // #ifndef CHROME_COMMON_OS_EXCHANGE_DATA_H__ | 144 #endif // #ifndef CHROME_COMMON_OS_EXCHANGE_DATA_H__ |
| 144 | |
| OLD | NEW |