bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / slidesorter / controller / SlsDragAndDropContext.hxx
blobc7f6f1ee6c57aacdc3aeb52049aa7af66fddec9c
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 .
20 #ifndef INCLUDED_SD_SOURCE_UI_SLIDESORTER_CONTROLLER_SLSDRAGANDDROPCONTEXT_HXX
21 #define INCLUDED_SD_SOURCE_UI_SLIDESORTER_CONTROLLER_SLSDRAGANDDROPCONTEXT_HXX
23 #include <tools/gen.hxx>
25 #include "model/SlsSharedPageDescriptor.hxx"
26 #include "controller/SlsInsertionIndicatorHandler.hxx"
27 #include <vector>
29 namespace sd { namespace slidesorter {
30 class SlideSorter;
31 } }
33 namespace sd { namespace slidesorter { namespace controller {
35 /** A DragAndDropContext object handles an active drag and drop operation.
36 When the mouse is moved from one slide sorter window to another the
37 target SlideSorter object is exchanged accordingly.
39 class DragAndDropContext
41 public:
42 /** Create a substitution display of the currently selected pages or,
43 when provided, the pages in the transferable.
45 DragAndDropContext (SlideSorter& rSlideSorter);
46 ~DragAndDropContext();
48 /** Call this method (for example as reaction to ESC key press) to avoid
49 processing (ie moving or inserting) the substition when the called
50 DragAndDropContext object is destroyed.
52 void Dispose();
54 /** Move the substitution display by the distance the mouse has
55 travelled since the last call to this method or to
56 CreateSubstitution(). The given point becomes the new anchor.
58 void UpdatePosition (
59 const Point& rMousePosition,
60 const InsertionIndicatorHandler::Mode eMode,
61 const bool bAllowAutoScroll = true);
63 void SetTargetSlideSorter (
64 SlideSorter* pSlideSorter = NULL,
65 const Point& rMousePosition = Point(0,0),
66 const InsertionIndicatorHandler::Mode eMode = InsertionIndicatorHandler::UnknownMode,
67 const bool bIsOverSourceView = false);
69 private:
70 SlideSorter* mpTargetSlideSorter;
71 model::SharedPageDescriptor mpHitDescriptor;
72 sal_Int32 mnInsertionIndex;
75 } } } // end of namespace ::sd::slidesorter::controller
77 #endif
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */