| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
| 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| 11 * | 11 * |
| 12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
| 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
| 16 * | 16 * |
| 17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
| 18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
| 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
| 21 * | 21 * |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #ifndef DataTransfer_h | 24 #ifndef DataTransfer_h |
| 25 #define DataTransfer_h | 25 #define DataTransfer_h |
| 26 | 26 |
| 27 #include "bindings/core/v8/ScriptWrappable.h" | 27 #include "bindings/core/v8/ScriptWrappable.h" |
| 28 #include "core/CoreExport.h" | 28 #include "core/CoreExport.h" |
| 29 #include "core/clipboard/DataTransferAccessPolicy.h" | 29 #include "core/clipboard/DataTransferAccessPolicy.h" |
| 30 #include "core/fetch/ImageResource.h" | 30 #include "core/fetch/ImageResourceContent.h" |
| 31 #include "core/page/DragActions.h" | 31 #include "core/page/DragActions.h" |
| 32 #include "platform/geometry/IntPoint.h" | 32 #include "platform/geometry/IntPoint.h" |
| 33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
| 34 #include "wtf/Forward.h" | 34 #include "wtf/Forward.h" |
| 35 #include <memory> | 35 #include <memory> |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class DataObject; | 39 class DataObject; |
| 40 class DataTransferItemList; | 40 class DataTransferItemList; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 String getData(const String& type) const; | 86 String getData(const String& type) const; |
| 87 void setData(const String& type, const String& data); | 87 void setData(const String& type, const String& data); |
| 88 | 88 |
| 89 // extensions beyond IE's API | 89 // extensions beyond IE's API |
| 90 Vector<String> types() const; | 90 Vector<String> types() const; |
| 91 FileList* files() const; | 91 FileList* files() const; |
| 92 | 92 |
| 93 IntPoint dragLocation() const { return m_dragLoc; } | 93 IntPoint dragLocation() const { return m_dragLoc; } |
| 94 void setDragImage(Element*, int x, int y); | 94 void setDragImage(Element*, int x, int y); |
| 95 void clearDragImage(); | 95 void clearDragImage(); |
| 96 void setDragImageResource(ImageResource*, const IntPoint&); | 96 void setDragImageResource(ImageResourceContent*, const IntPoint&); |
| 97 void setDragImageElement(Node*, const IntPoint&); | 97 void setDragImageElement(Node*, const IntPoint&); |
| 98 | 98 |
| 99 std::unique_ptr<DragImage> createDragImage(IntPoint& dragLocation, | 99 std::unique_ptr<DragImage> createDragImage(IntPoint& dragLocation, |
| 100 LocalFrame*) const; | 100 LocalFrame*) const; |
| 101 void declareAndWriteDragImage(Element*, const KURL&, const String& title); | 101 void declareAndWriteDragImage(Element*, const KURL&, const String& title); |
| 102 void writeURL(Node*, const KURL&, const String&); | 102 void writeURL(Node*, const KURL&, const String&); |
| 103 void writeSelection(const FrameSelection&); | 103 void writeSelection(const FrameSelection&); |
| 104 | 104 |
| 105 void setAccessPolicy(DataTransferAccessPolicy); | 105 void setAccessPolicy(DataTransferAccessPolicy); |
| 106 bool canReadTypes() const; | 106 bool canReadTypes() const; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 122 | 122 |
| 123 DataTransferItemList* items(); | 123 DataTransferItemList* items(); |
| 124 | 124 |
| 125 DataObject* dataObject() const; | 125 DataObject* dataObject() const; |
| 126 | 126 |
| 127 DECLARE_TRACE(); | 127 DECLARE_TRACE(); |
| 128 | 128 |
| 129 private: | 129 private: |
| 130 DataTransfer(DataTransferType, DataTransferAccessPolicy, DataObject*); | 130 DataTransfer(DataTransferType, DataTransferAccessPolicy, DataObject*); |
| 131 | 131 |
| 132 void setDragImage(ImageResource*, Node*, const IntPoint&); | 132 void setDragImage(ImageResourceContent*, Node*, const IntPoint&); |
| 133 | 133 |
| 134 bool hasFileOfType(const String&) const; | 134 bool hasFileOfType(const String&) const; |
| 135 bool hasStringOfType(const String&) const; | 135 bool hasStringOfType(const String&) const; |
| 136 | 136 |
| 137 // Instead of using this member directly, prefer to use the can*() methods | 137 // Instead of using this member directly, prefer to use the can*() methods |
| 138 // above. | 138 // above. |
| 139 DataTransferAccessPolicy m_policy; | 139 DataTransferAccessPolicy m_policy; |
| 140 String m_dropEffect; | 140 String m_dropEffect; |
| 141 String m_effectAllowed; | 141 String m_effectAllowed; |
| 142 DataTransferType m_transferType; | 142 DataTransferType m_transferType; |
| 143 Member<DataObject> m_dataObject; | 143 Member<DataObject> m_dataObject; |
| 144 | 144 |
| 145 IntPoint m_dragLoc; | 145 IntPoint m_dragLoc; |
| 146 Member<ImageResource> m_dragImage; | 146 Member<ImageResourceContent> m_dragImage; |
| 147 Member<Node> m_dragImageElement; | 147 Member<Node> m_dragImageElement; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 DragOperation convertDropZoneOperationToDragOperation( | 150 DragOperation convertDropZoneOperationToDragOperation( |
| 151 const String& dragOperation); | 151 const String& dragOperation); |
| 152 String convertDragOperationToDropZoneOperation(DragOperation); | 152 String convertDragOperationToDropZoneOperation(DragOperation); |
| 153 | 153 |
| 154 } // namespace blink | 154 } // namespace blink |
| 155 | 155 |
| 156 #endif // DataTransfer_h | 156 #endif // DataTransfer_h |
| OLD | NEW |