1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_INC_CONTROLLER_SLSVISIBLEAREAMANAGER_HXX
21 #define INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_CONTROLLER_SLSVISIBLEAREAMANAGER_HXX
23 #include <model/SlsSharedPageDescriptor.hxx>
24 #include <boost/optional.hpp>
25 #include <tools/gen.hxx>
28 namespace sd
{ namespace slidesorter
{ class SlideSorter
; } }
30 namespace sd
{ namespace slidesorter
{ namespace controller
{
32 /** Manage requests for scrolling page objects into view.
34 class VisibleAreaManager
37 explicit VisibleAreaManager (SlideSorter
& rSlideSorter
);
38 ~VisibleAreaManager();
39 VisibleAreaManager(const VisibleAreaManager
&) = delete;
40 VisibleAreaManager
& operator=(const VisibleAreaManager
&) = delete;
42 void ActivateCurrentSlideTracking();
43 void DeactivateCurrentSlideTracking();
44 bool IsCurrentSlideTrackingActive() const { return mbIsCurrentSlideTrackingActive
;}
46 /** Request the current slide to be moved into the visible area.
47 This request is only obeyed when the current slide tracking is
49 @see ActivateCurrentSlideTracking() and DeactivateCurrentSlideTracking()
51 void RequestCurrentSlideVisible();
53 /** Request to make the specified page object visible.
56 const model::SharedPageDescriptor
& rpDescriptor
,
57 const bool bForce
= false);
59 /** Temporarily disable the update of the visible area.
61 class TemporaryDisabler
64 explicit TemporaryDisabler (SlideSorter
const & rSlideSorter
);
67 VisibleAreaManager
& mrVisibleAreaManager
;
71 SlideSorter
& mrSlideSorter
;
73 /** List of rectangle that someone wants to be moved into the visible
75 Cleared on every call to ForgetVisibleRequests() and MakeVisible().
77 ::std::vector
<::tools::Rectangle
> maVisibleRequests
;
79 Point maRequestedVisibleTopLeft
;
80 bool mbIsCurrentSlideTrackingActive
;
84 ::boost::optional
<Point
> GetRequestedTopLeft() const;
87 } } } // end of namespace ::sd::slidesorter::view
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */