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 .
19 #ifndef INCLUDED_DTRANS_SOURCE_WIN32_DND_SOURCECONTEXT_HXX
20 #define INCLUDED_DTRANS_SOURCE_WIN32_DND_SOURCECONTEXT_HXX
22 #include <com/sun/star/datatransfer/dnd/XDragSourceContext.hpp>
23 #include <cppuhelper/compbase.hxx>
27 using namespace ::com::sun::star::datatransfer
;
28 using namespace ::com::sun::star::datatransfer::dnd
;
29 using namespace ::cppu
;
30 using namespace ::com::sun::star::uno
;
31 using namespace ::com::sun::star::lang
;
33 // This class fires events to XDragSourceListener implementations.
34 // Of that interface only dragDropEnd and dropActionChanged are called.
35 // The functions dragEnter, dragExit and dragOver are not supported
37 // An instance of SourceContext only lives as long as the drag and drop
39 class SourceContext
: public MutexDummy
,
40 public WeakComponentImplHelper
<XDragSourceContext
>
42 DragSource
* m_pDragSource
;
43 Reference
<XDragSource
> m_dragSource
;
44 // the action ( copy, move etc)
45 sal_Int8 m_currentAction
;
48 SourceContext( DragSource
* pSource
, const Reference
<XDragSourceListener
>& listener
);
49 ~SourceContext() override
;
50 SourceContext(const SourceContext
&) = delete;
51 SourceContext
&operator= (const SourceContext
&) = delete;
53 /// @throws RuntimeException
54 virtual void addDragSourceListener( const Reference
<XDragSourceListener
>& dsl
);
55 /// @throws RuntimeException
56 virtual void removeDragSourceListener( const Reference
<XDragSourceListener
>& dsl
);
57 virtual sal_Int32 SAL_CALL
getCurrentCursor( ) override
;
58 virtual void SAL_CALL
setCursor( sal_Int32 cursorId
) override
;
59 virtual void SAL_CALL
setImage( sal_Int32 imageId
) override
;
60 virtual void SAL_CALL
transferablesFlavorsChanged( ) override
;
62 // non - interface functions
63 void fire_dragDropEnd( bool success
, sal_Int8 byte
);
64 void fire_dropActionChanged( sal_Int8 dropAction
, sal_Int8 userAction
);
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */