xref: /aoo4110/main/dtrans/source/win32/dnd/globals.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _GLOBALS_HXX_
24 #define _GLOBALS_HXX_
25 
26 #ifndef _OSL_MUTEX_H_
27 #include <osl/mutex.hxx>
28 #endif
29 
30 #if defined _MSC_VER
31 #pragma warning(push,1)
32 #endif
33 #include <wtypes.h>
34 #if defined _MSC_VER
35 #pragma warning(pop)
36 #endif
37 #include <sal/types.h>
38 
39 
40 #define DNDSOURCE_SERVICE_NAME  "com.sun.star.datatransfer.dnd.OleDragSource"
41 #define DNDSOURCE_IMPL_NAME  "com.sun.star.comp.datatransfer.dnd.OleDragSource_V1"
42 #define DNDSOURCE_REGKEY_NAME  "/com.sun.star.comp.datatransfer.dnd.OleDragSource_V1/UNO/SERVICES/com.sun.star.datatransfer.dnd.OleDragSource"
43 
44 #define DNDTARGET_SERVICE_NAME  "com.sun.star.datatransfer.dnd.OleDropTarget"
45 #define DNDTARGET_IMPL_NAME  "com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1"
46 #define DNDTARGET_REGKEY_NAME  "/com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1/UNO/SERVICES/com.sun.star.datatransfer.dnd.OleDropTarget"
47 
48 // This maps key states as occur as parameter, e.g. in IDropTarget::DragEnter,
49 // IDropSource::QueryContinueDrag, to actions as are declared in
50 // com::sun::star::datatransfer::dnd::DNDConstants ( ACTION_MOVE etc).
51 // If the grfKeyState indicates the ALt or right mousebutton then the returned
52 // values combines all possible actions. This is because those key and button are
53 // used when the user expect a menu to appear when he drops. The menu then
54 // contains entries, such as move, copy, link, cancel.
55 // An odd fact is that the argument grfKeyState in IDropTarget::Drop does not
56 // contain mouse buttons (winnt 4 SP6). That indicates that the right mouse button
57 // is not considered relevant in a drag operation. Contrarily the file explorer
58 // gives that button a special meaning: the user has to select the effect from
59 // a context menu on drop.
60 sal_Int8 dndOleKeysToAction( DWORD grfKeyState, sal_Int8 sourceActions);
61 
62 // The function maps a windows DROPEFFECTs to actions
63 // ( com::sun::star::datatransfer::dnd::DNDConstants).
64 // The argument can be a combination of different DROPEFFECTS,
65 // In that case the return value is also a combination of the
66 // appropriate actions.
67 sal_Int8 dndOleDropEffectsToActions( DWORD dwEffect);
68 
69 // The function maps actions ( com::sun::star::datatransfer::dnd::DNDConstants)
70 // to window DROPEFFECTs.
71 // The argument can be a combination of different actions
72 // In that case the return value is also a combination of the
73 // appropriate DROPEFFECTS.
74 DWORD dndActionsToDropEffects( sal_Int8 actions);
75 
76 // If the argument constitutes only one action then it is mapped to the
77 // corresponding DROPEFFECT otherwise DROPEFFECT_MOVE is returned. This is
78 // why move is the default effect (no modifiers pressed, or right mouse button
79 // or Alt).
80 DWORD dndActionsToSingleDropEffect( sal_Int8 actions);
81 
82 
83 
84 struct MutexDummy
85 {
86 	osl::Mutex m_mutex;
87 };
88 
89 
90 #endif
91