OInterfaceContainerHelper3 needs to be thread-safe
[LibreOffice.git] / vcl / win / dtrans / globals.hxx
blob69e9f2d15597b212f0e20a9fc3cbb0673f5e1a86
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #pragma once
21 #include <sal/config.h>
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <osl/mutex.hxx>
26 namespace com::sun::star::datatransfer
28 class XTransferable;
31 #include <wtypes.h>
32 #include <sal/types.h>
34 // This maps key states as occur as parameter, e.g. in IDropTarget::DragEnter,
35 // IDropSource::QueryContinueDrag, to actions as are declared in
36 // css::datatransfer::dnd::DNDConstants ( ACTION_MOVE etc).
37 // If the grfKeyState indicates the ALt or right mousebutton then the returned
38 // values combines all possible actions. This is because those keys and buttons are
39 // used when the user expect a menu to appear when he drops. The menu then
40 // contains entries, such as move, copy, link, cancel.
41 // An odd fact is that the argument grfKeyState in IDropTarget::Drop does not
42 // contain mouse buttons (winnt 4 SP6). That indicates that the right mouse button
43 // is not considered relevant in a drag operation. Contrarily the file explorer
44 // gives that button a special meaning: the user has to select the effect from
45 // a context menu on drop.
46 sal_Int8 dndOleKeysToAction(DWORD grfKeyState, sal_Int8 sourceActions);
48 // The function maps a windows DROPEFFECTs to actions
49 // ( css::datatransfer::dnd::DNDConstants).
50 // The argument can be a combination of different DROPEFFECTS,
51 // In that case the return value is also a combination of the
52 // appropriate actions.
53 sal_Int8 dndOleDropEffectsToActions(DWORD dwEffect);
55 // The function maps actions ( css::datatransfer::dnd::DNDConstants)
56 // to window DROPEFFECTs.
57 // The argument can be a combination of different actions
58 // In that case the return value is also a combination of the
59 // appropriate DROPEFFECTS.
60 DWORD dndActionsToDropEffects(sal_Int8 actions);
62 // If the argument constitutes only one action then it is mapped to the
63 // corresponding DROPEFFECT otherwise DROPEFFECT_MOVE is returned. This is
64 // why move is the default effect (no modifiers pressed, or right mouse button
65 // or Alt).
66 DWORD dndActionsToSingleDropEffect(sal_Int8 actions);
68 struct MutexDummy
70 osl::Mutex m_mutex;
73 extern css::uno::Reference<css::datatransfer::XTransferable> g_XTransferable;
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */