Fix build
[LibreOffice.git] / vcl / inc / dndlistenercontainer.hxx
blob1e23dfa6c9bc26a8c333e6a0417effcd13f5b27d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_INC_DNDLCON_HXX
21 #define INCLUDED_VCL_INC_DNDLCON_HXX
23 #include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
24 #include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
25 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
26 #include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
27 #include <com/sun/star/datatransfer/dnd/XDropTargetDropContext.hpp>
28 #include <cppuhelper/compbase.hxx>
29 #include <cppuhelper/basemutex.hxx>
31 class DNDListenerContainer final : public cppu::BaseMutex,
32 public ::cppu::WeakComponentImplHelper<
33 css::datatransfer::dnd::XDragGestureRecognizer,
34 css::datatransfer::dnd::XDropTargetDragContext,
35 css::datatransfer::dnd::XDropTargetDropContext,
36 css::datatransfer::dnd::XDropTarget >
38 bool m_bActive;
39 sal_Int8 m_nDefaultActions;
41 css::uno::Reference< css::datatransfer::dnd::XDropTargetDragContext > m_xDropTargetDragContext;
42 css::uno::Reference< css::datatransfer::dnd::XDropTargetDropContext > m_xDropTargetDropContext;
44 public:
46 DNDListenerContainer( sal_Int8 nDefaultActions );
47 virtual ~DNDListenerContainer() override;
49 sal_uInt32 fireDropEvent(
50 const css::uno::Reference< css::datatransfer::dnd::XDropTargetDropContext >& context,
51 sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions,
52 const css::uno::Reference< css::datatransfer::XTransferable >& transferable );
54 sal_uInt32 fireDragExitEvent();
56 sal_uInt32 fireDragOverEvent(
57 const css::uno::Reference< css::datatransfer::dnd::XDropTargetDragContext >& context,
58 sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions );
60 sal_uInt32 fireDragEnterEvent(
61 const css::uno::Reference< css::datatransfer::dnd::XDropTargetDragContext >& context,
62 sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions,
63 const css::uno::Sequence< css::datatransfer::DataFlavor >& dataFlavor );
65 sal_uInt32 fireDropActionChangedEvent(
66 const css::uno::Reference< css::datatransfer::dnd::XDropTargetDragContext >& context,
67 sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions );
69 sal_uInt32 fireDragGestureEvent(
70 sal_Int8 dragAction, sal_Int32 dragOriginX, sal_Int32 dragOriginY,
71 const css::uno::Reference< css::datatransfer::dnd::XDragSource >& dragSource,
72 const css::uno::Any& triggerEvent );
75 * XDragGestureRecognizer
78 virtual void SAL_CALL addDragGestureListener( const css::uno::Reference< css::datatransfer::dnd::XDragGestureListener >& dgl ) override;
79 virtual void SAL_CALL removeDragGestureListener( const css::uno::Reference< css::datatransfer::dnd::XDragGestureListener >& dgl ) override;
80 virtual void SAL_CALL resetRecognizer( ) override;
83 * XDropTargetDragContext
86 virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation ) override;
87 virtual void SAL_CALL rejectDrag( ) override;
90 * XDropTargetDropContext
93 virtual void SAL_CALL acceptDrop( sal_Int8 dropOperation ) override;
94 virtual void SAL_CALL rejectDrop( ) override;
95 virtual void SAL_CALL dropComplete( sal_Bool success ) override;
98 * XDropTarget
101 virtual void SAL_CALL addDropTargetListener( const css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >& dtl ) override;
102 virtual void SAL_CALL removeDropTargetListener( const css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >& dtl ) override;
103 virtual sal_Bool SAL_CALL isActive( ) override;
104 virtual void SAL_CALL setActive( sal_Bool active ) override;
105 virtual sal_Int8 SAL_CALL getDefaultActions( ) override;
106 virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) override;
109 #endif
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */