xref: /aoo42x/main/dtrans/source/win32/dnd/globals.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _GLOBALS_HXX_
28*cdf0e10cSrcweir #define _GLOBALS_HXX_
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #ifndef _OSL_MUTEX_H_
31*cdf0e10cSrcweir #include <osl/mutex.hxx>
32*cdf0e10cSrcweir #endif
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #if defined _MSC_VER
35*cdf0e10cSrcweir #pragma warning(push,1)
36*cdf0e10cSrcweir #endif
37*cdf0e10cSrcweir #include <wtypes.h>
38*cdf0e10cSrcweir #if defined _MSC_VER
39*cdf0e10cSrcweir #pragma warning(pop)
40*cdf0e10cSrcweir #endif
41*cdf0e10cSrcweir #include <sal/types.h>
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir #define DNDSOURCE_SERVICE_NAME  "com.sun.star.datatransfer.dnd.OleDragSource"
45*cdf0e10cSrcweir #define DNDSOURCE_IMPL_NAME  "com.sun.star.comp.datatransfer.dnd.OleDragSource_V1"
46*cdf0e10cSrcweir #define DNDSOURCE_REGKEY_NAME  "/com.sun.star.comp.datatransfer.dnd.OleDragSource_V1/UNO/SERVICES/com.sun.star.datatransfer.dnd.OleDragSource"
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir #define DNDTARGET_SERVICE_NAME  "com.sun.star.datatransfer.dnd.OleDropTarget"
49*cdf0e10cSrcweir #define DNDTARGET_IMPL_NAME  "com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1"
50*cdf0e10cSrcweir #define DNDTARGET_REGKEY_NAME  "/com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1/UNO/SERVICES/com.sun.star.datatransfer.dnd.OleDropTarget"
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir // This maps key states as occur as parameter, e.g. in IDropTarget::DragEnter,
53*cdf0e10cSrcweir // IDropSource::QueryContinueDrag, to actions as are declared in
54*cdf0e10cSrcweir // com::sun::star::datatransfer::dnd::DNDConstants ( ACTION_MOVE etc).
55*cdf0e10cSrcweir // If the grfKeyState indicates the ALt or right mousebutton then the returned
56*cdf0e10cSrcweir // values combines all possible actions. This is because those key and button are
57*cdf0e10cSrcweir // used when the user expect a menu to appear when he drops. The menu then
58*cdf0e10cSrcweir // contains entries, such as move, copy, link, cancel.
59*cdf0e10cSrcweir // An odd fact is that the argument grfKeyState in IDropTarget::Drop does not
60*cdf0e10cSrcweir // contain mouse buttons (winnt 4 SP6). That indicates that the right mouse button
61*cdf0e10cSrcweir // is not considered relevant in a drag operation. Contrarily the file explorer
62*cdf0e10cSrcweir // gives that button a special meaning: the user has to select the effect from
63*cdf0e10cSrcweir // a context menu on drop.
64*cdf0e10cSrcweir sal_Int8 dndOleKeysToAction( DWORD grfKeyState, sal_Int8 sourceActions);
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir // The function maps a windows DROPEFFECTs to actions
67*cdf0e10cSrcweir // ( com::sun::star::datatransfer::dnd::DNDConstants).
68*cdf0e10cSrcweir // The argument can be a combination of different DROPEFFECTS,
69*cdf0e10cSrcweir // In that case the return value is also a combination of the
70*cdf0e10cSrcweir // appropriate actions.
71*cdf0e10cSrcweir sal_Int8 dndOleDropEffectsToActions( DWORD dwEffect);
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir // The function maps actions ( com::sun::star::datatransfer::dnd::DNDConstants)
74*cdf0e10cSrcweir // to window DROPEFFECTs.
75*cdf0e10cSrcweir // The argument can be a combination of different actions
76*cdf0e10cSrcweir // In that case the return value is also a combination of the
77*cdf0e10cSrcweir // appropriate DROPEFFECTS.
78*cdf0e10cSrcweir DWORD dndActionsToDropEffects( sal_Int8 actions);
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir // If the argument constitutes only one action then it is mapped to the
81*cdf0e10cSrcweir // corresponding DROPEFFECT otherwise DROPEFFECT_MOVE is returned. This is
82*cdf0e10cSrcweir // why move is the default effect (no modifiers pressed, or right mouse button
83*cdf0e10cSrcweir // or Alt).
84*cdf0e10cSrcweir DWORD dndActionsToSingleDropEffect( sal_Int8 actions);
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir struct MutexDummy
89*cdf0e10cSrcweir {
90*cdf0e10cSrcweir 	osl::Mutex m_mutex;
91*cdf0e10cSrcweir };
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir #endif
95