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 "controller/SlsAnimator.hxx"
24 #include "model/SlsSharedPageDescriptor.hxx"
25 #include <boost/noncopyable.hpp>
26 #include <boost/optional.hpp>
28 namespace sd
{ namespace slidesorter
{ namespace controller
{
30 /** Manage requests for scrolling page objects into view.
32 class VisibleAreaManager
33 : public ::boost::noncopyable
36 VisibleAreaManager (SlideSorter
& rSlideSorter
);
37 ~VisibleAreaManager();
39 void ActivateCurrentSlideTracking();
40 void DeactivateCurrentSlideTracking();
41 bool IsCurrentSlideTrackingActive() const { return mbIsCurrentSlideTrackingActive
;}
43 /** Request the current slide to be moved into the visible area.
44 This request is only obeyed when the current slide tracking is
46 @see ActivateCurrentSlideTracking() and DeactivateCurrentSlideTracking()
48 void RequestCurrentSlideVisible();
50 /** Request to make the specified page object visible.
53 const model::SharedPageDescriptor
& rpDescriptor
,
54 const bool bForce
= false);
56 /** Temporarily disable the update of the visible area.
58 class TemporaryDisabler
61 TemporaryDisabler (SlideSorter
& rSlideSorter
);
64 VisibleAreaManager
& mrVisibleAreaManager
;
68 SlideSorter
& mrSlideSorter
;
70 /** List of rectangle that someone wants to be moved into the visible
72 Cleared on every call to ForgetVisibleRequests() and MakeVisible().
74 ::std::vector
<Rectangle
> maVisibleRequests
;
76 /** Animation id for a scroll animation that sets the top
77 and left of the visible area to maRequestedVisibleTopLeft.
79 Animator::AnimationId mnScrollAnimationId
;
80 Point maRequestedVisibleTopLeft
;
81 Animator::AnimationMode meRequestedAnimationMode
;
82 bool mbIsCurrentSlideTrackingActive
;
86 ::boost::optional
<Point
> GetRequestedTopLeft() const;
89 } } } // end of namespace ::sd::slidesorter::view
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */