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_DTRANS_SOURCE_WIN32_DND_SOURCE_HXX
21 #define INCLUDED_DTRANS_SOURCE_WIN32_DND_SOURCE_HXX
23 #include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
24 #include <com/sun/star/datatransfer/dnd/XDragSourceContext.hpp>
25 #include <com/sun/star/lang/XInitialization.hpp>
26 #include <osl/mutex.hxx>
27 #include <cppuhelper/compbase3.hxx>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include "../../inc/DtObjFactory.hxx"
30 #include "globals.hxx"
33 #include <systools/win32/comtools.hxx>
35 using namespace ::com::sun::star::lang
;
36 using namespace ::com::sun::star::uno
;
39 using namespace ::com::sun::star::datatransfer
;
40 using namespace ::com::sun::star::datatransfer::dnd
;
43 // RIGHT MOUSE BUTTON drag and drop not supportet currently.
44 // ALT modifier is considered to effect a user selection of effects
47 public WeakComponentImplHelper3
<XDragSource
, XInitialization
, XServiceInfo
>,
51 Reference
<XComponentContext
> m_xContext
;
54 // The mouse button that set off the drag and drop operation
56 // Converts XTransferable objects to IDataObject objects.
57 CDTransObjFactory m_aDataConverter
;
60 DragSource(const DragSource
&);
61 DragSource
&operator= ( const DragSource
&);
63 // First starting a new drag and drop thread if
64 // the last one has finished
66 const DragGestureEvent
& trigger
,
67 sal_Int8 sourceActions
,
70 const Reference
<XTransferable
>& trans
,
71 const Reference
<XDragSourceListener
>& listener
);
74 long m_RunningDndOperationCount
;
77 // only valid for one dnd operation
78 // the thread ID of the thread which created the window
79 DWORD m_threadIdWindow
;
80 // The context notifies the XDragSourceListener s
81 Reference
<XDragSourceContext
> m_currentContext
;
83 // the wrapper for the Transferable ( startDrag)
84 IDataObjectPtr m_spDataObject
;
86 sal_Int8 m_sourceActions
;
89 DragSource(const Reference
<XComponentContext
>& rxContext
);
90 virtual ~DragSource();
93 virtual void SAL_CALL
initialize( const Sequence
< Any
>& aArguments
)
94 throw(Exception
, RuntimeException
);
97 virtual sal_Bool SAL_CALL
isDragImageSupported( ) throw(RuntimeException
);
98 virtual sal_Int32 SAL_CALL
getDefaultCursor( sal_Int8 dragAction
)
99 throw( IllegalArgumentException
, RuntimeException
);
100 virtual void SAL_CALL
startDrag( const DragGestureEvent
& trigger
,
101 sal_Int8 sourceActions
,
104 const Reference
<XTransferable
>& trans
,
105 const Reference
<XDragSourceListener
>& listener
)
106 throw( RuntimeException
);
109 virtual OUString SAL_CALL
getImplementationName( ) throw (RuntimeException
);
110 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw (RuntimeException
);
111 virtual Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw (RuntimeException
);
113 virtual HRESULT STDMETHODCALLTYPE
QueryInterface(
114 /* [in] */ REFIID riid
,
115 /* [iid_is][out] */ void __RPC_FAR
*__RPC_FAR
*ppvObject
);
117 virtual ULONG STDMETHODCALLTYPE
AddRef( );
119 virtual ULONG STDMETHODCALLTYPE
Release( );
122 virtual HRESULT STDMETHODCALLTYPE
QueryContinueDrag(
123 /* [in] */ BOOL fEscapePressed
,
124 /* [in] */ DWORD grfKeyState
);
126 virtual HRESULT STDMETHODCALLTYPE
GiveFeedback(
127 /* [in] */ DWORD dwEffect
);
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */