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