Line data Source code
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 {
30 : namespace sun {
31 : namespace star {
32 :
33 : namespace datatransfer {
34 : namespace dnd {
35 : struct DragGestureEvent;
36 : struct DragSourceDragEvent;
37 : struct DragSourceDropEvent;
38 : struct DragSourceEvent;
39 : struct DropTargetDragEvent;
40 : struct DropTargetDragEnterEvent;
41 : struct DropTargetDropEvent;
42 : struct DropTargetEvent;
43 : }}
44 :
45 : }}}
46 :
47 : namespace vcl
48 : {
49 :
50 : namespace unohelper
51 : {
52 :
53 0 : class VCL_DLLPUBLIC DragAndDropClient
54 : {
55 : public:
56 : virtual ~DragAndDropClient();
57 :
58 : // ::com::sun::star::datatransfer::dnd::XDragGestureListener
59 : virtual void dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge )
60 : throw (::com::sun::star::uno::RuntimeException,
61 : std::exception);
62 :
63 : // ::com::sun::star::datatransfer::dnd::XDragSourceListener
64 : virtual void dragDropEnd(const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& dsde )
65 : throw (::com::sun::star::uno::RuntimeException,
66 : std::exception);
67 : virtual void dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde )
68 : throw (::com::sun::star::uno::RuntimeException,
69 : std::exception);
70 : virtual void dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent& dse )
71 : throw (::com::sun::star::uno::RuntimeException,
72 : std::exception);
73 : virtual void dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde )
74 : throw (::com::sun::star::uno::RuntimeException,
75 : std::exception);
76 : virtual void dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde )
77 : throw (::com::sun::star::uno::RuntimeException,
78 : std::exception);
79 :
80 : // ::com::sun::star::datatransfer::dnd::XDropTargetListener
81 : virtual void drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde )
82 : throw (::com::sun::star::uno::RuntimeException,
83 : std::exception);
84 : virtual void dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee )
85 : throw (::com::sun::star::uno::RuntimeException,
86 : std::exception);
87 : virtual void dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte )
88 : throw (::com::sun::star::uno::RuntimeException,
89 : std::exception);
90 : virtual void dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde )
91 : throw (::com::sun::star::uno::RuntimeException,
92 : std::exception);
93 : virtual void dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde )
94 : throw (::com::sun::star::uno::RuntimeException,
95 : std::exception);
96 : };
97 :
98 : class VCL_DLLPUBLIC DragAndDropWrapper :
99 : public ::com::sun::star::datatransfer::dnd::XDragGestureListener,
100 : public ::com::sun::star::datatransfer::dnd::XDragSourceListener,
101 : public ::com::sun::star::datatransfer::dnd::XDropTargetListener,
102 : public ::cppu::OWeakObject
103 : {
104 : private:
105 : DragAndDropClient* mpClient;
106 :
107 : public:
108 : DragAndDropWrapper( DragAndDropClient* pClient );
109 : virtual ~DragAndDropWrapper();
110 :
111 : // ::com::sun::star::uno::XInterface
112 : ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
113 0 : void SAL_CALL acquire() throw() SAL_OVERRIDE { OWeakObject::acquire(); }
114 0 : void SAL_CALL release() throw() SAL_OVERRIDE { OWeakObject::release(); }
115 :
116 : // ::com::sun::star::lang::XEventListener
117 : void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
118 :
119 : // ::com::sun::star::datatransfer::dnd::XDragGestureListener
120 : void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
121 :
122 : // ::com::sun::star::datatransfer::dnd::XDragSourceListener
123 : void SAL_CALL dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& dsde ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
124 : void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
125 : void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent& dse ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
126 : void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
127 : void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
128 :
129 : // ::com::sun::star::datatransfer::dnd::XDropTargetListener
130 : void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
131 : void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
132 : void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
133 : void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
134 : void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
135 : };
136 :
137 : }} // namespace vcl::unohelper
138 :
139 : #endif // INCLUDED_VCL_DNDHELP_HXX
140 :
141 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|