bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / slidesorter / inc / controller / SlsVisibleAreaManager.hxx
blobacd74e2b5ffc5a8b519be4ab2918c793a8853337
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_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>
26 #include <vector>
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
36 public:
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
48 active.
49 @see ActivateCurrentSlideTracking() and DeactivateCurrentSlideTracking()
51 void RequestCurrentSlideVisible();
53 /** Request to make the specified page object visible.
55 void RequestVisible (
56 const model::SharedPageDescriptor& rpDescriptor,
57 const bool bForce = false);
59 /** Temporarily disable the update of the visible area.
61 class TemporaryDisabler
63 public:
64 explicit TemporaryDisabler (SlideSorter const & rSlideSorter);
65 ~TemporaryDisabler();
66 private:
67 VisibleAreaManager& mrVisibleAreaManager;
70 private:
71 SlideSorter& mrSlideSorter;
73 /** List of rectangle that someone wants to be moved into the visible
74 area.
75 Cleared on every call to ForgetVisibleRequests() and MakeVisible().
77 ::std::vector<::tools::Rectangle> maVisibleRequests;
79 Point maRequestedVisibleTopLeft;
80 bool mbIsCurrentSlideTrackingActive;
81 int mnDisableCount;
83 void MakeVisible();
84 ::boost::optional<Point> GetRequestedTopLeft() const;
87 } } } // end of namespace ::sd::slidesorter::view
89 #endif
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */