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 #pragma once
20 
21 #include <sal/config.h>
22 
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <osl/mutex.hxx>
25 
26 namespace com::sun::star::datatransfer { class XTransferable; }
27 
28 #include <wtypes.h>
29 #include <sal/types.h>
30 
31 // This maps key states as occur as parameter, e.g. in IDropTarget::DragEnter,
32 // IDropSource::QueryContinueDrag, to actions as are declared in
33 // css::datatransfer::dnd::DNDConstants ( ACTION_MOVE etc).
34 // If the grfKeyState indicates the ALt or right mousebutton then the returned
35 // values combines all possible actions. This is because those keys and buttons are
36 // used when the user expect a menu to appear when he drops. The menu then
37 // contains entries, such as move, copy, link, cancel.
38 // An odd fact is that the argument grfKeyState in IDropTarget::Drop does not
39 // contain mouse buttons (winnt 4 SP6). That indicates that the right mouse button
40 // is not considered relevant in a drag operation. Contrarily the file explorer
41 // gives that button a special meaning: the user has to select the effect from
42 // a context menu on drop.
43 sal_Int8 dndOleKeysToAction( DWORD grfKeyState, sal_Int8 sourceActions);
44 
45 // The function maps a windows DROPEFFECTs to actions
46 // ( css::datatransfer::dnd::DNDConstants).
47 // The argument can be a combination of different DROPEFFECTS,
48 // In that case the return value is also a combination of the
49 // appropriate actions.
50 sal_Int8 dndOleDropEffectsToActions( DWORD dwEffect);
51 
52 // The function maps actions ( css::datatransfer::dnd::DNDConstants)
53 // to window DROPEFFECTs.
54 // The argument can be a combination of different actions
55 // In that case the return value is also a combination of the
56 // appropriate DROPEFFECTS.
57 DWORD dndActionsToDropEffects( sal_Int8 actions);
58 
59 // If the argument constitutes only one action then it is mapped to the
60 // corresponding DROPEFFECT otherwise DROPEFFECT_MOVE is returned. This is
61 // why move is the default effect (no modifiers pressed, or right mouse button
62 // or Alt).
64 
65 struct MutexDummy
66 {
67  osl::Mutex m_mutex;
68 };
69 
70 extern css::uno::Reference<css::datatransfer::XTransferable> g_XTransferable;
71 
72 /* 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:67
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