1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_VCL_DNDHELP_HXX
21 #define INCLUDED_VCL_DNDHELP_HXX
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>
33 namespace datatransfer
{
35 struct DragGestureEvent
;
36 struct DragSourceDragEvent
;
37 struct DragSourceDropEvent
;
38 struct DragSourceEvent
;
39 struct DropTargetDragEvent
;
40 struct DropTargetDragEnterEvent
;
41 struct DropTargetDropEvent
;
42 struct DropTargetEvent
;
53 class VCL_DLLPUBLIC DragAndDropClient
56 virtual ~DragAndDropClient();
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
,
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
,
68 // ::com::sun::star::datatransfer::dnd::XDropTargetListener
69 virtual void drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent
& dtde
)
70 throw (::com::sun::star::uno::RuntimeException
,
72 virtual void dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent
& dtdee
)
73 throw (::com::sun::star::uno::RuntimeException
,
75 virtual void dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent
& dte
)
76 throw (::com::sun::star::uno::RuntimeException
,
78 virtual void dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& dtde
)
79 throw (::com::sun::star::uno::RuntimeException
,
83 class VCL_DLLPUBLIC DragAndDropWrapper
:
84 public ::com::sun::star::datatransfer::dnd::XDragGestureListener
,
85 public ::com::sun::star::datatransfer::dnd::XDragSourceListener
,
86 public ::com::sun::star::datatransfer::dnd::XDropTargetListener
,
87 public ::cppu::OWeakObject
90 DragAndDropClient
* mpClient
;
93 DragAndDropWrapper( DragAndDropClient
* pClient
);
94 virtual ~DragAndDropWrapper();
96 // ::com::sun::star::uno::XInterface
97 ::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
;
98 void SAL_CALL
acquire() throw() SAL_OVERRIDE
{ OWeakObject::acquire(); }
99 void SAL_CALL
release() throw() SAL_OVERRIDE
{ OWeakObject::release(); }
101 // ::com::sun::star::lang::XEventListener
102 void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
104 // ::com::sun::star::datatransfer::dnd::XDragGestureListener
105 void SAL_CALL
dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent
& dge
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
107 // ::com::sun::star::datatransfer::dnd::XDragSourceListener
108 void SAL_CALL
dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
109 void SAL_CALL
dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
110 void SAL_CALL
dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent
& dse
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
111 void SAL_CALL
dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
112 void SAL_CALL
dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
114 // ::com::sun::star::datatransfer::dnd::XDropTargetListener
115 void SAL_CALL
drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent
& dtde
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
116 void SAL_CALL
dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent
& dtdee
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
117 void SAL_CALL
dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent
& dte
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
118 void SAL_CALL
dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
119 void SAL_CALL
dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
122 }} // namespace vcl::unohelper
124 #endif // INCLUDED_VCL_DNDHELP_HXX
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */