OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 /* |
2 // Use of this source code is governed by a BSD-style license that can be | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 // found in the LICENSE file. | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are |
| 6 * met: |
| 7 * |
| 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above |
| 11 * copyright notice, this list of conditions and the following disclaimer |
| 12 * in the documentation and/or other materials provided with the |
| 13 * distribution. |
| 14 * * Neither the name of Google Inc. nor the names of its |
| 15 * contributors may be used to endorse or promote products derived from |
| 16 * this software without specific prior written permission. |
| 17 * |
| 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ |
4 | 30 |
5 #ifndef WEBKIT_GLUE_DRAGCLIENT_IMPL_H__ | 31 #ifndef DragClientImpl_h |
6 #define WEBKIT_GLUE_DRAGCLIENT_IMPL_H__ | 32 #define DragClientImpl_h |
7 | 33 |
8 #include "DragClient.h" | 34 #include "DragClient.h" |
9 #include "DragActions.h" | 35 #include "DragActions.h" |
10 | 36 |
11 namespace WebCore { | 37 namespace WebCore { |
12 class ClipBoard; | 38 class ClipBoard; |
13 class DragData; | 39 class DragData; |
14 class IntPoint; | 40 class IntPoint; |
15 class KURL; | 41 class KURL; |
16 } | 42 } |
17 | 43 |
18 class WebViewImpl; | 44 class WebViewImpl; |
19 | 45 |
| 46 namespace WebKit { |
| 47 |
20 class DragClientImpl : public WebCore::DragClient { | 48 class DragClientImpl : public WebCore::DragClient { |
21 public: | 49 public: |
22 DragClientImpl(WebViewImpl* webview) : webview_(webview) {} | 50 DragClientImpl(WebViewImpl* webView) : m_webView(webView) { } |
23 virtual ~DragClientImpl() {} | |
24 | 51 |
25 virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction, | 52 virtual void willPerformDragDestinationAction( |
26 WebCore::DragData*); | 53 WebCore::DragDestinationAction, WebCore::DragData*); |
27 virtual void willPerformDragSourceAction(WebCore::DragSourceAction, | 54 virtual void willPerformDragSourceAction( |
28 const WebCore::IntPoint&, | 55 WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*); |
29 WebCore::Clipboard*); | 56 virtual WebCore::DragDestinationAction actionMaskForDrag(WebCore::DragData*); |
30 virtual WebCore::DragDestinationAction actionMaskForDrag(WebCore::DragData*); | 57 virtual WebCore::DragSourceAction dragSourceActionMaskForPoint( |
31 virtual WebCore::DragSourceAction dragSourceActionMaskForPoint( | 58 const WebCore::IntPoint& windowPoint); |
32 const WebCore::IntPoint& window_point); | 59 virtual void startDrag( |
| 60 WebCore::DragImageRef dragImage, |
| 61 const WebCore::IntPoint& dragImageOrigin, |
| 62 const WebCore::IntPoint& eventPos, |
| 63 WebCore::Clipboard* clipboard, |
| 64 WebCore::Frame* frame, |
| 65 bool isLinkDrag = false); |
| 66 virtual WebCore::DragImageRef createDragImageForLink( |
| 67 WebCore::KURL&, const WebCore::String& label, WebCore::Frame*); |
| 68 virtual void dragControllerDestroyed(); |
33 | 69 |
34 virtual void startDrag(WebCore::DragImageRef drag_image, | 70 private: |
35 const WebCore::IntPoint& drag_image_origin, | 71 WebViewImpl* m_webView; |
36 const WebCore::IntPoint& event_pos, | |
37 WebCore::Clipboard* clipboard, | |
38 WebCore::Frame* frame, | |
39 bool is_link_drag = false); | |
40 virtual WebCore::DragImageRef createDragImageForLink( | |
41 WebCore::KURL&, const WebCore::String& label, WebCore::Frame*); | |
42 | |
43 virtual void dragControllerDestroyed(); | |
44 | |
45 private: | |
46 WebViewImpl* webview_; | |
47 }; | 72 }; |
48 | 73 |
49 #endif // #ifndef WEBKIT_GLUE_DRAGCLIENT_IMPL_H__ | 74 } // namespace WebKit |
| 75 |
| 76 #endif |
OLD | NEW |