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