27#include <bitmaps.hlst>
28#include <osl/diagnose.h>
33const sal_Int32 gnLeftPageNumberOffset = 2;
34const sal_Int32 gnRightPageNumberOffset = 5;
35const sal_Int32 gnOuterBorderWidth = 5;
36const sal_Int32 gnInfoAreaMinWidth = 26;
40 const Size& rPageObjectWindowSize,
41 const Size& rPageSize,
43 const sal_Int32 nPageCount)
45 maTransitionEffectIcon(
IconCache::Instance().GetIcon(BMP_FADE_EFFECT_INDICATOR)),
46 maCustomAnimationEffectIcon(
IconCache::Instance().GetIcon(BMP_CUSTOM_ANIMATION_INDICATOR)),
51 const int nMaximumBorderWidth (gnOuterBorderWidth);
54 Size aPageObjectSize(rPageObjectWindowSize.
Width(), rPageObjectWindowSize.
Height());
58 aPageNumberAreaSize.
Width(),
59 nFocusIndicatorWidth);
64 nFocusIndicatorWidth),
66 aPageObjectSize.
Width()-2*nFocusIndicatorWidth,
67 aPageObjectSize.
Height()-2*nFocusIndicatorWidth));
71 std::max(gnLeftPageNumberOffset,
73 - gnRightPageNumberOffset
74 - aPageNumberAreaSize.
Width())),
96 Size& rPageObjectSize,
97 const Size& rPageSize,
98 const sal_Int32 nPageNumberAreaWidth,
99 const sal_Int32 nFocusIndicatorWidth)
102 const sal_Int32 nLeftAreaWidth (
105 gnRightPageNumberOffset
107 nPageNumberAreaWidth,
109 sal_Int32 nPreviewWidth;
110 sal_Int32 nPreviewHeight;
111 const double nPageAspectRatio (
double(rPageSize.
Width()) /
double(rPageSize.
Height()));
112 if (rPageObjectSize.
Height() == 0)
117 nPreviewWidth = rPageObjectSize.
Width()
118 - nLeftAreaWidth - gnOuterBorderWidth - 2*nFocusIndicatorWidth - 1;
119 nPreviewHeight = ::basegfx::fround(nPreviewWidth / nPageAspectRatio);
120 rPageObjectSize.
setHeight(nPreviewHeight + 2*gnOuterBorderWidth + 2*nFocusIndicatorWidth + 1);
122 else if (rPageObjectSize.
Width() == 0)
127 nPreviewHeight = rPageObjectSize.
Height() - 2*gnOuterBorderWidth - 2*nFocusIndicatorWidth - 1;
128 nPreviewWidth = ::basegfx::fround(nPreviewHeight * nPageAspectRatio);
129 rPageObjectSize.
setWidth(nPreviewWidth
130 + nLeftAreaWidth + gnOuterBorderWidth + 2*nFocusIndicatorWidth + 1);
137 nPreviewWidth = rPageObjectSize.
Width()
138 - nLeftAreaWidth - gnOuterBorderWidth - 2*nFocusIndicatorWidth - 1;
139 nPreviewHeight = rPageObjectSize.
Height()
140 - gnOuterBorderWidth - 2*nFocusIndicatorWidth - 1;
141 if (
double(nPreviewWidth)/
double(nPreviewHeight) > nPageAspectRatio)
142 nPreviewWidth = ::basegfx::fround(nPreviewHeight * nPageAspectRatio);
144 nPreviewHeight = ::basegfx::fround(nPreviewWidth / nPageAspectRatio);
148 const int nLeft (rPageObjectSize.
Width()
149 - gnOuterBorderWidth - nPreviewWidth - nFocusIndicatorWidth - 1);
150 const int nTop ((rPageObjectSize.
Height() - nPreviewHeight)/2);
151 return ::tools::Rectangle(
154 nLeft + nPreviewWidth,
155 nTop + nPreviewHeight);
162 bool bIgnoreLocation)
164 OSL_ASSERT(rpPageDescriptor);
165 Point aLocation(0,0);
166 if (rpPageDescriptor)
167 aLocation = rpPageDescriptor->GetLocation( bIgnoreLocation );
172 const Point& rPageObjectLocation,
204 Point aLocation (rPageObjectLocation);
206 aLocation +=
mpWindow->GetMapMode().GetOrigin();
208 return ::tools::Rectangle(
209 aBoundingBox.
TopLeft() + aLocation,
234 OUString sPageNumberTemplate;
236 sPageNumberTemplate =
"9";
237 else if (nPageCount < 100)
238 sPageNumberTemplate =
"99";
239 else if (nPageCount < 200)
241 sPageNumberTemplate =
"199";
242 else if (nPageCount < 1000)
243 sPageNumberTemplate =
"999";
245 sPageNumberTemplate =
"9999";
249 mpWindow->GetTextWidth(sPageNumberTemplate),
Size GetSizePixel() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
This simple class stores frequently used icons so that the classes that use the icons do not have to ...
An SdWindow contains the actual working area of ViewShell.
Size GetPageNumberAreaSize(const int nPageCount)
Size GetPreviewSize()
the size of the embedded preview: position independent, in window coordinate system
::tools::Rectangle maPreviewBoundingBox
PageObjectLayouter(const Size &rPageObjectWindowSize, const Size &rPreviewModelSize, sd::Window *pWindow, const sal_Int32 nPageCount)
Create a new PageObjectLayouter object.
::tools::Rectangle CalculatePreviewBoundingBox(Size &rPageObjectSize, const Size &rPreviewModelSize, const sal_Int32 nPageNumberAreaWidth, const sal_Int32 nFocusIndicatorWidth)
::tools::Rectangle GetBoundingBox(const model::SharedPageDescriptor &rpPageDescriptor, const Part ePart, const CoordinateSystem eCoordinateSystem, bool bIgnoreLocation=false)
Return the bounding box of the page object or one of its graphical parts.
::tools::Rectangle maPageNumberAreaBoundingBox
VclPtr< sd::Window > mpWindow
const Image maTransitionEffectIcon
CoordinateSystem
Two coordinate systems are supported.
const std::shared_ptr< vcl::Font > mpPageNumberFont
::tools::Rectangle maTransitionEffectBoundingBox
::tools::Rectangle maCustomAnimationEffectBoundingBox
@ TransitionEffectIndicator
@ CustomAnimationEffectIndicator
Size GetGridMaxSize()
the maximum size of each tile, also position independent, in window coordinate system
::tools::Rectangle maPageObjectBoundingBox
::tools::Rectangle maFocusIndicatorBoundingBox
Collection of colors and styles that are used to paint the slide sorter view.
std::shared_ptr< PageDescriptor > SharedPageDescriptor
const int Theme_FocusIndicatorWidth
vcl::Font GetFont(vcl::Font const &rFont, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
VclPtr< vcl::Window > mpWindow