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 _VCL_DNDHELP_HXX
21 #define _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
) throw (::com::sun::star::uno::RuntimeException
);
61 // ::com::sun::star::datatransfer::dnd::XDragSourceListener
62 virtual void dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
);
63 virtual void dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
);
64 virtual void dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent
& dse
) throw (::com::sun::star::uno::RuntimeException
);
65 virtual void dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
);
66 virtual void dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) 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
) throw (::com::sun::star::uno::RuntimeException
);
70 virtual void dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent
& dtdee
) throw (::com::sun::star::uno::RuntimeException
);
71 virtual void dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent
& dte
) throw (::com::sun::star::uno::RuntimeException
);
72 virtual void dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw (::com::sun::star::uno::RuntimeException
);
73 virtual void dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw (::com::sun::star::uno::RuntimeException
);
76 class VCL_DLLPUBLIC DragAndDropWrapper
:
77 public ::com::sun::star::datatransfer::dnd::XDragGestureListener
,
78 public ::com::sun::star::datatransfer::dnd::XDragSourceListener
,
79 public ::com::sun::star::datatransfer::dnd::XDropTargetListener
,
80 public ::cppu::OWeakObject
83 DragAndDropClient
* mpClient
;
86 DragAndDropWrapper( DragAndDropClient
* pClient
);
87 ~DragAndDropWrapper();
89 // ::com::sun::star::uno::XInterface
90 ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& rType
) throw(::com::sun::star::uno::RuntimeException
);
91 void SAL_CALL
acquire() throw() { OWeakObject::acquire(); }
92 void SAL_CALL
release() throw() { OWeakObject::release(); }
94 // ::com::sun::star::lang::XEventListener
95 void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw (::com::sun::star::uno::RuntimeException
);
97 // ::com::sun::star::datatransfer::dnd::XDragGestureListener
98 void SAL_CALL
dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent
& dge
) throw (::com::sun::star::uno::RuntimeException
);
100 // ::com::sun::star::datatransfer::dnd::XDragSourceListener
101 void SAL_CALL
dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
);
102 void SAL_CALL
dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
);
103 void SAL_CALL
dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent
& dse
) throw (::com::sun::star::uno::RuntimeException
);
104 void SAL_CALL
dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
);
105 void SAL_CALL
dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
);
107 // ::com::sun::star::datatransfer::dnd::XDropTargetListener
108 void SAL_CALL
drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent
& dtde
) throw (::com::sun::star::uno::RuntimeException
);
109 void SAL_CALL
dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent
& dtdee
) throw (::com::sun::star::uno::RuntimeException
);
110 void SAL_CALL
dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent
& dte
) throw (::com::sun::star::uno::RuntimeException
);
111 void SAL_CALL
dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw (::com::sun::star::uno::RuntimeException
);
112 void SAL_CALL
dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw (::com::sun::star::uno::RuntimeException
);
115 }} // namespace vcl::unohelper
117 #endif // _VCL_DNDHELP_HXX
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */