| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef DragController_h | 26 #ifndef DragController_h |
| 27 #define DragController_h | 27 #define DragController_h |
| 28 | 28 |
| 29 #include "core/page/DragActions.h" | 29 #include "core/page/DragActions.h" |
| 30 #include "core/platform/DragImage.h" | |
| 31 #include "core/platform/graphics/IntPoint.h" | 30 #include "core/platform/graphics/IntPoint.h" |
| 32 #include "weborigin/KURL.h" | 31 #include "weborigin/KURL.h" |
| 32 #include "wtf/Forward.h" |
| 33 | 33 |
| 34 namespace WebCore { | 34 namespace WebCore { |
| 35 | 35 |
| 36 class Clipboard; | 36 class Clipboard; |
| 37 class Document; | 37 class Document; |
| 38 class DragClient; | 38 class DragClient; |
| 39 class DragData; | 39 class DragData; |
| 40 class DragImage; |
| 40 struct DragSession; | 41 struct DragSession; |
| 41 struct DragState; | 42 struct DragState; |
| 42 class Element; | 43 class Element; |
| 43 class Frame; | 44 class Frame; |
| 44 class FrameSelection; | 45 class FrameSelection; |
| 45 class HTMLInputElement; | 46 class HTMLInputElement; |
| 46 class Image; | 47 class Image; |
| 47 class IntRect; | 48 class IntRect; |
| 48 class Node; | 49 class Node; |
| 49 class Page; | 50 class Page; |
| 50 class PlatformMouseEvent; | 51 class PlatformMouseEvent; |
| 51 class Range; | 52 class Range; |
| 52 | 53 |
| 53 class DragController { | 54 class DragController { |
| 54 WTF_MAKE_NONCOPYABLE(DragController); WTF_MAKE_FAST_ALLOCATED; | 55 WTF_MAKE_NONCOPYABLE(DragController); WTF_MAKE_FAST_ALLOCATED; |
| 55 public: | 56 public: |
| 56 ~DragController(); | 57 ~DragController(); |
| 57 | 58 |
| 58 static PassOwnPtr<DragController> create(Page*, DragClient*); | 59 static PassOwnPtr<DragController> create(Page*, DragClient*); |
| 59 | 60 |
| 60 DragClient* client() const { return m_client; } | 61 DragClient* client() const { return m_client; } |
| 61 | 62 |
| 62 DragSession dragEntered(DragData*); | 63 DragSession dragEntered(DragData*); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 bool tryDocumentDrag(DragData*, DragDestinationAction, DragSession&); | 104 bool tryDocumentDrag(DragData*, DragDestinationAction, DragSession&); |
| 104 bool tryDHTMLDrag(DragData*, DragOperation&); | 105 bool tryDHTMLDrag(DragData*, DragOperation&); |
| 105 DragOperation dragOperation(DragData*); | 106 DragOperation dragOperation(DragData*); |
| 106 void cancelDrag(); | 107 void cancelDrag(); |
| 107 bool dragIsMove(FrameSelection*, DragData*); | 108 bool dragIsMove(FrameSelection*, DragData*); |
| 108 bool isCopyKeyDown(DragData*); | 109 bool isCopyKeyDown(DragData*); |
| 109 | 110 |
| 110 void mouseMovedIntoDocument(Document*); | 111 void mouseMovedIntoDocument(Document*); |
| 111 | 112 |
| 112 IntRect selectionDraggingRect(Frame*); | 113 IntRect selectionDraggingRect(Frame*); |
| 113 bool doDrag(Frame* src, Clipboard* clipboard, DragImageRef dragImage, co
nst KURL& linkURL, const KURL& imageURL, Node* node, IntPoint& dragLoc, IntPoint
& dragImageOffset); | 114 bool doDrag(Frame* src, Clipboard*, DragImage*, const KURL& linkURL, con
st KURL& imageURL, Node*, IntPoint& dragLoc, IntPoint& dragImageOffset); |
| 114 void doImageDrag(Element*, const IntPoint&, const IntRect&, Clipboard*,
Frame*, IntPoint&); | 115 void doImageDrag(Element*, const IntPoint&, const IntRect&, Clipboard*,
Frame*, IntPoint&); |
| 115 void doSystemDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipbo
ard*, Frame*, bool forLink); | 116 void doSystemDrag(DragImage*, const IntPoint&, const IntPoint&, Clipboar
d*, Frame*, bool forLink); |
| 116 void cleanupAfterSystemDrag(); | 117 void cleanupAfterSystemDrag(); |
| 117 | 118 |
| 118 Page* m_page; | 119 Page* m_page; |
| 119 DragClient* m_client; | 120 DragClient* m_client; |
| 120 | 121 |
| 121 RefPtr<Document> m_documentUnderMouse; // The document the mouse was las
t dragged over. | 122 RefPtr<Document> m_documentUnderMouse; // The document the mouse was las
t dragged over. |
| 122 RefPtr<Document> m_dragInitiator; // The Document (if any) that initiate
d the drag. | 123 RefPtr<Document> m_dragInitiator; // The Document (if any) that initiate
d the drag. |
| 123 RefPtr<HTMLInputElement> m_fileInputElementUnderMouse; | 124 RefPtr<HTMLInputElement> m_fileInputElementUnderMouse; |
| 124 bool m_documentIsHandlingDrag; | 125 bool m_documentIsHandlingDrag; |
| 125 | 126 |
| 126 DragDestinationAction m_dragDestinationAction; | 127 DragDestinationAction m_dragDestinationAction; |
| 127 DragSourceAction m_dragSourceAction; | 128 DragSourceAction m_dragSourceAction; |
| 128 bool m_didInitiateDrag; | 129 bool m_didInitiateDrag; |
| 129 DragOperation m_sourceDragOperation; // Set in startDrag when a drag sta
rts from a mouse down within WebKit | 130 DragOperation m_sourceDragOperation; // Set in startDrag when a drag sta
rts from a mouse down within WebKit |
| 130 IntPoint m_dragOffset; | 131 IntPoint m_dragOffset; |
| 131 KURL m_draggingImageURL; | 132 KURL m_draggingImageURL; |
| 132 }; | 133 }; |
| 133 | 134 |
| 134 } | 135 } |
| 135 | 136 |
| 136 #endif | 137 #endif |
| OLD | NEW |