1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef SD_SLIDESORTER_SUBSTITUTION_HANDLER_HXX 29 #define SD_SLIDESORTER_SUBSTITUTION_HANDLER_HXX 30 31 #include <tools/gen.hxx> 32 33 #include "model/SlsSharedPageDescriptor.hxx" 34 #include "controller/SlsInsertionIndicatorHandler.hxx" 35 #include <vector> 36 37 38 namespace sd { namespace slidesorter { 39 class SlideSorter; 40 } } 41 42 43 44 namespace sd { namespace slidesorter { namespace controller { 45 46 /** A DragAndDropContext object handles an active drag and drop operation. 47 When the mouse is moved from one slide sorter window to another the 48 target SlideSorter object is exchanged accordingly. 49 */ 50 class DragAndDropContext 51 { 52 public: 53 /** Create a substitution display of the currently selected pages or, 54 when provided, the pages in the transferable. 55 */ 56 DragAndDropContext (SlideSorter& rSlideSorter); 57 ~DragAndDropContext (void); 58 59 /** Call this method (for example as reaction to ESC key press) to avoid 60 processing (ie moving or inserting) the substition when the called 61 DragAndDropContext object is destroyed. 62 */ 63 void Dispose (void); 64 65 /** Move the substitution display by the distance the mouse has 66 travelled since the last call to this method or to 67 CreateSubstitution(). The given point becomes the new anchor. 68 */ 69 void UpdatePosition ( 70 const Point& rMousePosition, 71 const InsertionIndicatorHandler::Mode eMode, 72 const bool bAllowAutoScroll = true); 73 74 void SetTargetSlideSorter ( 75 SlideSorter* pSlideSorter = NULL, 76 const Point aMousePosition = Point(0,0), 77 const InsertionIndicatorHandler::Mode eMode = InsertionIndicatorHandler::UnknownMode, 78 const bool bIsOverSourceView = false); 79 80 private: 81 SlideSorter* mpTargetSlideSorter; 82 model::SharedPageDescriptor mpHitDescriptor; 83 sal_Int32 mnInsertionIndex; 84 85 void GetPagesFromBookmarks ( 86 ::std::vector<const SdPage*>& rPages, 87 sal_Int32& rnSelectionCount, 88 DrawDocShell* pDocShell, 89 const List& rBookmarks) const; 90 void GetPagesFromSelection ( 91 ::std::vector<const SdPage*>& rPages, 92 sal_Int32& rnSelectionCount, 93 model::PageEnumeration& rSelection) const; 94 }; 95 96 97 98 } } } // end of namespace ::sd::slidesorter::controller 99 100 #endif 101