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