LibreOffice Module dtrans (master)  1
globals.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_DTRANS_SOURCE_WIN32_DND_GLOBALS_HXX
20 #define INCLUDED_DTRANS_SOURCE_WIN32_DND_GLOBALS_HXX
21 
22 #include <sal/config.h>
23 
24 #include <com/sun/star/uno/Reference.hxx>
25 #include <osl/mutex.hxx>
26 
27 namespace com { namespace sun { namespace star { namespace datatransfer {
28  class XTransferable;
29 } } } }
30 
31 #include <wtypes.h>
32 #include <sal/types.h>
33 
34 #define DNDSOURCE_SERVICE_NAME "com.sun.star.datatransfer.dnd.OleDragSource"
35 #define DNDSOURCE_IMPL_NAME "com.sun.star.comp.datatransfer.dnd.OleDragSource_V1"
36 
37 #define DNDTARGET_SERVICE_NAME "com.sun.star.datatransfer.dnd.OleDropTarget"
38 #define DNDTARGET_IMPL_NAME "com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1"
39 
40 // This maps key states as occur as parameter, e.g. in IDropTarget::DragEnter,
41 // IDropSource::QueryContinueDrag, to actions as are declared in
42 // css::datatransfer::dnd::DNDConstants ( ACTION_MOVE etc).
43 // If the grfKeyState indicates the ALt or right mousebutton then the returned
44 // values combines all possible actions. This is because those keys and buttons are
45 // used when the user expect a menu to appear when he drops. The menu then
46 // contains entries, such as move, copy, link, cancel.
47 // An odd fact is that the argument grfKeyState in IDropTarget::Drop does not
48 // contain mouse buttons (winnt 4 SP6). That indicates that the right mouse button
49 // is not considered relevant in a drag operation. Contrarily the file explorer
50 // gives that button a special meaning: the user has to select the effect from
51 // a context menu on drop.
52 sal_Int8 dndOleKeysToAction( DWORD grfKeyState, sal_Int8 sourceActions);
53 
54 // The function maps a windows DROPEFFECTs to actions
55 // ( css::datatransfer::dnd::DNDConstants).
56 // The argument can be a combination of different DROPEFFECTS,
57 // In that case the return value is also a combination of the
58 // appropriate actions.
59 sal_Int8 dndOleDropEffectsToActions( DWORD dwEffect);
60 
61 // The function maps actions ( css::datatransfer::dnd::DNDConstants)
62 // to window DROPEFFECTs.
63 // The argument can be a combination of different actions
64 // In that case the return value is also a combination of the
65 // appropriate DROPEFFECTS.
66 DWORD dndActionsToDropEffects( sal_Int8 actions);
67 
68 // If the argument constitutes only one action then it is mapped to the
69 // corresponding DROPEFFECT otherwise DROPEFFECT_MOVE is returned. This is
70 // why move is the default effect (no modifiers pressed, or right mouse button
71 // or Alt).
73 
74 struct MutexDummy
75 {
76  osl::Mutex m_mutex;
77 };
78 
79 extern css::uno::Reference<css::datatransfer::XTransferable> g_XTransferable;
80 
81 #endif
82 
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DWORD dndActionsToDropEffects(sal_Int8 actions)
Definition: globals.cxx:98
signed char sal_Int8
osl::Mutex m_mutex
Definition: globals.hxx:76
DWORD dndActionsToSingleDropEffect(sal_Int8 actions)
Definition: globals.cxx:112
css::uno::Reference< css::datatransfer::XTransferable > g_XTransferable
Definition: globals.cxx:28
sal_Int8 dndOleKeysToAction(DWORD grfKeyState, sal_Int8 sourceActions)
Definition: globals.cxx:34
sal_Int8 dndOleDropEffectsToActions(DWORD dwEffect)
Definition: globals.cxx:85