WebDragClient.h revision ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb
19df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar/*
29df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * Copyright (C) 2010 Apple Inc. All rights reserved.
39df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar *
49df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * Redistribution and use in source and binary forms, with or without
59df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * modification, are permitted provided that the following conditions
69df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * are met:
79df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * 1. Redistributions of source code must retain the above copyright
89df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar *    notice, this list of conditions and the following disclaimer.
99df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * 2. Redistributions in binary form must reproduce the above copyright
109df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar *    notice, this list of conditions and the following disclaimer in the
1164bfbf573e625c04abc3d40faa9b695fe21ebdbbDaniel Dunbar *    documentation and/or other materials provided with the distribution.
1264bfbf573e625c04abc3d40faa9b695fe21ebdbbDaniel Dunbar *
139df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
149df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15561d3abc881033776ece385a01a510e1cbc1fa92David Blaikie * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
169df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
179df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
185f9e272e632e951b1efe824cd16acb4d96077930Chris Lattner * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
199df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
209df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
219df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
229df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
239df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar * THE POSSIBILITY OF SUCH DAMAGE.
249df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar */
259df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar
269df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar#ifndef WebDragClient_h
279df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar#define WebDragClient_h
289df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar
299df23493f5b8a223dfbc491e4b7de3850797c2e7Daniel Dunbar#include <WebCore/DragClient.h>
30d6471f7c1921c7802804ce3ff6fe9768310f72b9David Blaikie
3164bfbf573e625c04abc3d40faa9b695fe21ebdbbDaniel Dunbarnamespace WebKit {
32d6471f7c1921c7802804ce3ff6fe9768310f72b9David Blaikie
33d6471f7c1921c7802804ce3ff6fe9768310f72b9David Blaikieclass WebPage;
34d6471f7c1921c7802804ce3ff6fe9768310f72b9David Blaikie
35d6471f7c1921c7802804ce3ff6fe9768310f72b9David Blaikieclass WebDragClient : public WebCore::DragClient {
36d6471f7c1921c7802804ce3ff6fe9768310f72b9David Blaikiepublic:
3764bfbf573e625c04abc3d40faa9b695fe21ebdbbDaniel Dunbar    WebDragClient(WebPage* page)
38561d3abc881033776ece385a01a510e1cbc1fa92David Blaikie        : m_page(page)
3964bfbf573e625c04abc3d40faa9b695fe21ebdbbDaniel Dunbar    {
4064bfbf573e625c04abc3d40faa9b695fe21ebdbbDaniel Dunbar    }
41cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier
42cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosierprivate:
43cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier    virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction, WebCore::DragData*);
44cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier    virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*);
45cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier    virtual WebCore::DragDestinationAction actionMaskForDrag(WebCore::DragData*);
46cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier    virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint);
47cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier
48cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier    virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragImageOrigin, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag = false);
49cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier    virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const String& label, WebCore::Frame*);
50cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier
51cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier#if PLATFORM(MAC)
52cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier    virtual void declareAndWriteDragImage(NSPasteboard*, DOMElement*, NSURL*, NSString*, WebCore::Frame*);
53cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier#endif
54cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier    virtual void dragControllerDestroyed();
55cc78c6c6152b6c30b069769b45716e0ae6519211Chad Rosier
5664bfbf573e625c04abc3d40faa9b695fe21ebdbbDaniel Dunbar    WebPage* m_page;
5764bfbf573e625c04abc3d40faa9b695fe21ebdbbDaniel Dunbar};
5864bfbf573e625c04abc3d40faa9b695fe21ebdbbDaniel Dunbar
5964bfbf573e625c04abc3d40faa9b695fe21ebdbbDaniel Dunbar} // namespace WebKit
6078ad0b98848c17a0a11847fa1d456e2dfec8aa2fDavid Blaikie
6178ad0b98848c17a0a11847fa1d456e2dfec8aa2fDavid Blaikie#endif // WebDragClient_h
6278ad0b98848c17a0a11847fa1d456e2dfec8aa2fDavid Blaikie