Chromium Code Reviews| 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 APP_OS_EXCHANGE_DATA_PROVIDER_GTK_H_ | 5 #ifndef APP_OS_EXCHANGE_DATA_PROVIDER_GTK_H_ |
| 6 #define APP_OS_EXCHANGE_DATA_PROVIDER_GTK_H_ | 6 #define APP_OS_EXCHANGE_DATA_PROVIDER_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 virtual bool GetString(std::wstring* data) const; | 62 virtual bool GetString(std::wstring* data) const; |
| 63 virtual bool GetURLAndTitle(GURL* url, std::wstring* title) const; | 63 virtual bool GetURLAndTitle(GURL* url, std::wstring* title) const; |
| 64 virtual bool GetFilename(std::wstring* full_path) const; | 64 virtual bool GetFilename(std::wstring* full_path) const; |
| 65 virtual bool GetPickledData(OSExchangeData::CustomFormat format, | 65 virtual bool GetPickledData(OSExchangeData::CustomFormat format, |
| 66 Pickle* data) const; | 66 Pickle* data) const; |
| 67 virtual bool HasString() const; | 67 virtual bool HasString() const; |
| 68 virtual bool HasURL() const; | 68 virtual bool HasURL() const; |
| 69 virtual bool HasFile() const; | 69 virtual bool HasFile() const; |
| 70 virtual bool HasCustomFormat(OSExchangeData::CustomFormat format) const; | 70 virtual bool HasCustomFormat(OSExchangeData::CustomFormat format) const; |
| 71 | 71 |
| 72 // Set the image and cursor offset data for this drag. Will | |
| 73 // increment the ref count of pixbuf. | |
| 74 void SetDragImage(GdkPixbuf* pixbuf, | |
| 75 int cursor_offset_x, | |
| 76 int cursor_offset_y); | |
| 77 GdkPixbuf* get_drag_image() const { return drag_image_; } | |
|
sky
2009/10/12 19:41:20
nit: no get, just drag_image, like the other metho
skrul
2009/10/12 19:44:38
Gah, sorry, thanks for paying more attention than
| |
| 78 int cursor_offset_x() const { return cursor_offset_x_; } | |
| 79 int cursor_offset_y() const { return cursor_offset_y_; } | |
| 80 | |
| 72 private: | 81 private: |
| 73 typedef std::map<OSExchangeData::CustomFormat, Pickle> PickleData; | 82 typedef std::map<OSExchangeData::CustomFormat, Pickle> PickleData; |
| 74 | 83 |
| 75 // Returns true if |formats_| contains a string format and the string can be | 84 // Returns true if |formats_| contains a string format and the string can be |
| 76 // parsed as a URL. | 85 // parsed as a URL. |
| 77 bool GetPlainTextURL(GURL* url) const; | 86 bool GetPlainTextURL(GURL* url) const; |
| 78 | 87 |
| 79 // These are the possible formats the OSExchangeData may contain. Don't | 88 // These are the possible formats the OSExchangeData may contain. Don't |
| 80 // confuse this with the actual formats that have been set, which are | 89 // confuse this with the actual formats that have been set, which are |
| 81 // |formats_| and |custom_formats_|. | 90 // |formats_| and |custom_formats_|. |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 92 // URL contents. | 101 // URL contents. |
| 93 GURL url_; | 102 GURL url_; |
| 94 string16 title_; | 103 string16 title_; |
| 95 | 104 |
| 96 // File name. | 105 // File name. |
| 97 std::string filename_; | 106 std::string filename_; |
| 98 | 107 |
| 99 // PICKLED_DATA contents. | 108 // PICKLED_DATA contents. |
| 100 PickleData pickle_data_; | 109 PickleData pickle_data_; |
| 101 | 110 |
| 111 // Drag image and offset data. | |
| 112 GdkPixbuf* drag_image_; | |
| 113 int cursor_offset_x_; | |
| 114 int cursor_offset_y_; | |
| 115 | |
| 102 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderGtk); | 116 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderGtk); |
| 103 }; | 117 }; |
| 104 | 118 |
| 105 #endif // APP_OS_EXCHANGE_DATA_PROVIDER_GTK_H_ | 119 #endif // APP_OS_EXCHANGE_DATA_PROVIDER_GTK_H_ |
| OLD | NEW |