/src/libreoffice/include/vcl/dndhelp.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
11 | | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | | * contributor license agreements. See the NOTICE file distributed |
13 | | * with this work for additional information regarding copyright |
14 | | * ownership. The ASF licenses this file to you under the Apache |
15 | | * License, Version 2.0 (the "License"); you may not use this file |
16 | | * except in compliance with the License. You may obtain a copy of |
17 | | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | | */ |
19 | | |
20 | | #ifndef INCLUDED_VCL_DNDHELP_HXX |
21 | | #define INCLUDED_VCL_DNDHELP_HXX |
22 | | |
23 | | #include <vcl/dllapi.h> |
24 | | #include <cppuhelper/weak.hxx> |
25 | | #include <com/sun/star/datatransfer/dnd/XDragGestureListener.hpp> |
26 | | #include <com/sun/star/datatransfer/dnd/XDragSourceListener.hpp> |
27 | | #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp> |
28 | | |
29 | | namespace com::sun::star::datatransfer::dnd { |
30 | | struct DragGestureEvent; |
31 | | struct DragSourceDropEvent; |
32 | | struct DropTargetDragEvent; |
33 | | struct DropTargetDragEnterEvent; |
34 | | struct DropTargetDropEvent; |
35 | | struct DropTargetEvent; |
36 | | } |
37 | | |
38 | | namespace vcl::unohelper |
39 | | { |
40 | | |
41 | | class VCL_DLLPUBLIC DragAndDropClient |
42 | | { |
43 | | public: |
44 | | virtual ~DragAndDropClient(); |
45 | | |
46 | | // css::datatransfer::dnd::XDragGestureListener |
47 | | /// @throws css::uno::RuntimeException |
48 | | SAL_DLLPRIVATE virtual void dragGestureRecognized( const css::datatransfer::dnd::DragGestureEvent& dge ); |
49 | | |
50 | | // css::datatransfer::dnd::XDragSourceListener |
51 | | /// @throws css::uno::RuntimeException |
52 | | SAL_DLLPRIVATE virtual void dragDropEnd(const css::datatransfer::dnd::DragSourceDropEvent& dsde ); |
53 | | |
54 | | // css::datatransfer::dnd::XDropTargetListener |
55 | | /// @throws css::uno::RuntimeException |
56 | | SAL_DLLPRIVATE virtual void drop( const css::datatransfer::dnd::DropTargetDropEvent& dtde ); |
57 | | /// @throws css::uno::RuntimeException |
58 | | SAL_DLLPRIVATE virtual void dragEnter( const css::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ); |
59 | | /// @throws css::uno::RuntimeException |
60 | | SAL_DLLPRIVATE virtual void dragExit( const css::datatransfer::dnd::DropTargetEvent& dte ); |
61 | | /// @throws css::uno::RuntimeException |
62 | | SAL_DLLPRIVATE virtual void dragOver( const css::datatransfer::dnd::DropTargetDragEvent& dtde ); |
63 | | }; |
64 | | |
65 | | class SAL_DLLPUBLIC_RTTI DragAndDropWrapper final : |
66 | | public css::datatransfer::dnd::XDragGestureListener, |
67 | | public css::datatransfer::dnd::XDragSourceListener, |
68 | | public css::datatransfer::dnd::XDropTargetListener, |
69 | | public ::cppu::OWeakObject |
70 | | { |
71 | | private: |
72 | | DragAndDropClient* mpClient; |
73 | | |
74 | | public: |
75 | | VCL_DLLPUBLIC DragAndDropWrapper( DragAndDropClient* pClient ); |
76 | | virtual ~DragAndDropWrapper() override; |
77 | | |
78 | | // css::uno::XInterface |
79 | | css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; |
80 | 0 | void SAL_CALL acquire() noexcept override { OWeakObject::acquire(); } |
81 | 0 | void SAL_CALL release() noexcept override { OWeakObject::release(); } |
82 | | |
83 | | // css::lang::XEventListener |
84 | | VCL_DLLPUBLIC void SAL_CALL disposing( const css::lang::EventObject& Source ) override; |
85 | | |
86 | | // css::datatransfer::dnd::XDragGestureListener |
87 | | void SAL_CALL dragGestureRecognized( const css::datatransfer::dnd::DragGestureEvent& dge ) override; |
88 | | |
89 | | // css::datatransfer::dnd::XDragSourceListener |
90 | | void SAL_CALL dragDropEnd( const css::datatransfer::dnd::DragSourceDropEvent& dsde ) override; |
91 | | void SAL_CALL dragEnter( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override; |
92 | | void SAL_CALL dragExit( const css::datatransfer::dnd::DragSourceEvent& dse ) override; |
93 | | void SAL_CALL dragOver( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override; |
94 | | void SAL_CALL dropActionChanged( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override; |
95 | | |
96 | | // css::datatransfer::dnd::XDropTargetListener |
97 | | void SAL_CALL drop( const css::datatransfer::dnd::DropTargetDropEvent& dtde ) override; |
98 | | void SAL_CALL dragEnter( const css::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) override; |
99 | | void SAL_CALL dragExit( const css::datatransfer::dnd::DropTargetEvent& dte ) override; |
100 | | void SAL_CALL dragOver( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override; |
101 | | void SAL_CALL dropActionChanged( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override; |
102 | | }; |
103 | | |
104 | | } // namespace vcl::unohelper |
105 | | |
106 | | #endif // INCLUDED_VCL_DNDHELP_HXX |
107 | | |
108 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |