LibreOffice Module sd (master) 1
SlsLayouter.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <vcl/vclptr.hxx>
23#include <tools/gen.hxx>
24#include <sal/types.h>
25#include <memory>
26
27namespace sd { class Window; }
28namespace sd::slidesorter::model { class SlideSorterModel; }
29namespace sd::slidesorter::view { class PageObjectLayouter; }
30namespace sd::slidesorter::view { class Theme; }
31
32namespace sd::slidesorter::view {
33
34class InsertPosition;
35
60{
61public:
63
64 Layouter (
65 sd::Window *rpWindow,
66 const std::shared_ptr<Theme>& rpTheme);
67 ~Layouter();
68
69 std::shared_ptr<PageObjectLayouter> const & GetPageObjectLayouter() const;
78 void SetColumnCount (sal_Int32 nMinimalColumnCount,
79 sal_Int32 nMaximalColumnCount);
80
100 bool Rearrange (
101 const Orientation eOrientation,
102 const Size& rWindowSize,
103 const Size& rPreviewModelSize,
104 const sal_uInt32 nPageCount);
105
108 sal_Int32 GetColumnCount() const;
109
110 sal_Int32 GetIndex (const sal_Int32 nRow, const sal_Int32 nColumn) const;
111
112 Size const & GetPageObjectSize() const;
113
118 const sal_Int32 nIndex,
119 const bool bIncludeBorderAndGap) const;
120
125
132 Range GetRangeOfVisiblePageObjects (const ::tools::Rectangle& rVisibleArea) const;
133
154 sal_Int32 GetIndexAtPoint (
155 const Point& rModelPosition,
156 const bool bIncludePageBorders,
157 const bool bClampToValidRange = true) const;
158
177 const Point& rModelPosition,
178 const Size& rIndicatorSize,
179 model::SlideSorterModel const & rModel) const;
180
183
184 class Implementation;
185
186private:
187 std::unique_ptr<Implementation> mpImplementation;
189};
190
195{
196public:
198 bool operator== (const InsertPosition& rInsertPosition) const;
199 bool operator!= (const InsertPosition& rInsertPosition) const;
200
201 void SetLogicalPosition (
202 const sal_Int32 nRow,
203 const sal_Int32 nColumn,
204 const sal_Int32 nIndex,
205 const bool bIsAtRunStart,
206 const bool bIsAtRunEnd,
207 const bool bIsExtraSpaceNeeded);
209 const Point& rLocation,
210 const Point& rLeadingOffset,
211 const Point& rTrailingOffset);
212
213 sal_Int32 GetRow() const { return mnRow; }
214 sal_Int32 GetColumn() const { return mnColumn; }
215 sal_Int32 GetIndex() const { return mnIndex; }
216 const Point& GetLocation() const { return maLocation; }
217 const Point& GetLeadingOffset() const { return maLeadingOffset; }
218 const Point& GetTrailingOffset() const { return maTrailingOffset; }
219 bool IsAtRunStart() const { return mbIsAtRunStart; }
220 bool IsAtRunEnd() const { return mbIsAtRunEnd; }
222
223private:
224 sal_Int32 mnRow;
225 sal_Int32 mnColumn;
226 sal_Int32 mnIndex;
228 bool mbIsAtRunEnd : 1;
233};
234
235} // end of namespace ::sd::slidesorter::view
236
237/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
The model of the slide sorter gives access to the slides that are to be displayed in the slide sorter...
Collect all values concerning the logical and visual properties of the insertion position that is use...
bool operator!=(const InsertPosition &rInsertPosition) const
void SetGeometricalPosition(const Point &rLocation, const Point &rLeadingOffset, const Point &rTrailingOffset)
bool operator==(const InsertPosition &rInsertPosition) const
const Point & GetLeadingOffset() const
void SetLogicalPosition(const sal_Int32 nRow, const sal_Int32 nColumn, const sal_Int32 nIndex, const bool bIsAtRunStart, const bool bIsAtRunEnd, const bool bIsExtraSpaceNeeded)
const Point & GetTrailingOffset() const
Calculate the size and position of page objects displayed by a slide sorter.
Definition: SlsLayouter.hxx:60
sal_Int32 GetIndexAtPoint(const Point &rModelPosition, const bool bIncludePageBorders, const bool bClampToValidRange=true) const
Return the index of the page object that is rendered at the given point.
std::unique_ptr< Implementation > mpImplementation
InsertPosition GetInsertPosition(const Point &rModelPosition, const Size &rIndicatorSize, model::SlideSorterModel const &rModel) const
Return an object that describes the logical and visual properties of where to do an insert operation ...
sal_Int32 GetIndex(const sal_Int32 nRow, const sal_Int32 nColumn) const
std::shared_ptr< PageObjectLayouter > const & GetPageObjectLayouter() const
Range GetRangeOfVisiblePageObjects(const ::tools::Rectangle &rVisibleArea) const
Return the index of the first fully or partially visible page object.
void SetColumnCount(sal_Int32 nMinimalColumnCount, sal_Int32 nMaximalColumnCount)
Set the interval of valid column counts.
VclPtr< sd::Window > mpWindow
sal_Int32 GetColumnCount() const
Return the number of columns.
::tools::Rectangle GetPageObjectBox(const sal_Int32 nIndex, const bool bIncludeBorderAndGap) const
Return the bounding box in window coordinates of the nIndex-th page object.
bool Rearrange(const Orientation eOrientation, const Size &rWindowSize, const Size &rPreviewModelSize, const sal_uInt32 nPageCount)
Central method of this class.
::tools::Rectangle GetTotalBoundingBox() const
Return the bounding box in model coordinates of the page that contains the given amount of page objec...
Size const & GetPageObjectSize() const
Layouter(sd::Window *rpWindow, const std::shared_ptr< Theme > &rpTheme)
Range GetValidHorizontalSizeRange() const
sal_Int32 nIndex
Orientation