27#include <osl/diagnose.h>
86 const Size& rWindowSize,
87 const Size& rPreviewModelSize,
88 const sal_uInt32 nPageCount);
106 sal_Int32 nYPosition,
107 bool bIncludeBordersAndGaps,
121 sal_Int32 nXPosition,
122 bool bIncludeBordersAndGaps,
147 sal_Int32 nDistanceIntoGap,
156 const Point& rModelPosition,
166 const Size& rIndicatorSize,
167 const bool bIsVertical,
175 const sal_Int32 nIndex)
const;
182 const sal_Int32 nRow,
183 const sal_Int32 nColumn,
184 const bool bClampToValidRange)
const;
187 const sal_Int32 nIndex,
188 const bool bIncludeBorderAndGap =
false)
const;
191 const sal_Int32 nRow,
192 const sal_Int32 nColumn)
const;
195 const ::tools::Rectangle& rBoundingBox,
196 const sal_Int32 nRow,
197 const sal_Int32 nColumn)
const;
206 std::shared_ptr<view::Theme> pTheme);
212 const Size& rWindowSize)
const = 0;
214 const Size& rWindowSize,
215 const bool bCalculateWidth,
216 const bool bCalculateHeight)
const;
218 const Point& rModelPosition,
230 explicit VerticalImplementation (
const Implementation& rImplementation);
234 void CalculateLogicalInsertPosition (
235 const Point& rModelPosition,
239 virtual void CalculateRowAndColumnCount (
const Size& rWindowSize)
override;
240 virtual void CalculateMaxRowAndColumnCount (
const Size& rWindowSize)
override;
241 virtual Size CalculateTargetSize (
242 const Size& rWindowSize)
const override;
251 explicit HorizontalImplementation(
const Implementation& rImplementation);
255 void CalculateLogicalInsertPosition (
256 const Point& rModelPosition,
260 virtual void CalculateRowAndColumnCount (
const Size& rWindowSize)
override;
261 virtual void CalculateMaxRowAndColumnCount (
const Size& rWindowSize)
override;
262 virtual Size CalculateTargetSize (
263 const Size& rWindowSize)
const override;
270class GridImplementation :
public Layouter::Implementation
275 const std::shared_ptr<view::Theme>& rpTheme);
276 explicit GridImplementation(
const Implementation& rImplementation);
280 void CalculateLogicalInsertPosition (
281 const Point& rModelPosition,
282 InsertPosition& rPosition)
const override;
285 virtual void CalculateRowAndColumnCount (
const Size& rWindowSize)
override;
286 virtual void CalculateMaxRowAndColumnCount (
const Size& rWindowSize)
override;
287 virtual Size CalculateTargetSize (
288 const Size& rWindowSize)
const override;
297 const std::shared_ptr<Theme>& rpTheme)
298 : mpImplementation(new GridImplementation(pWindow, rpTheme)),
313 sal_Int32 nMinimalColumnCount,
314 sal_Int32 nMaximalColumnCount)
316 if (nMinimalColumnCount <= nMaximalColumnCount)
325 const Size& rWindowSize,
326 const Size& rPageSize,
327 const sal_uInt32 nPageCount)
353 const sal_Int32 nIndex,
354 const bool bIncludeBorderAndGap)
const
365 const Point& rModelPosition,
366 const Size& rIndicatorSize,
397 const Point& rPosition,
398 const bool bIncludePageBorders,
399 const bool bClampToValidRange)
const
401 const sal_Int32 nRow (
406 const sal_Int32 nColumn (
421 switch (eOrientation)
423 case HORIZONTAL:
return new HorizontalImplementation(rImplementation);
424 case VERTICAL:
return new VerticalImplementation(rImplementation);
426 default:
return new GridImplementation(rImplementation);
432 std::shared_ptr<view::Theme> pTheme)
438 maMinimalSize(132,98),
439 maPreferredSize(200,150),
440 maMaximalSize(600,400),
441 mnMinimalColumnCount(1),
442 mnMaximalColumnCount(15),
448 maPageObjectSize(1,1),
449 mpTheme(
std::move(pTheme))
455 mnLeftBorder(rImplementation.mnLeftBorder),
456 mnRightBorder(rImplementation.mnRightBorder),
457 mnTopBorder(rImplementation.mnTopBorder),
458 mnBottomBorder(rImplementation.mnBottomBorder),
459 maMinimalSize(rImplementation.maMinimalSize),
460 maPreferredSize(rImplementation.maPreferredSize),
461 maMaximalSize(rImplementation.maMaximalSize),
462 mnMinimalColumnCount(rImplementation.mnMinimalColumnCount),
463 mnMaximalColumnCount(rImplementation.mnMaximalColumnCount),
464 mnPageCount(rImplementation.mnPageCount),
465 mnColumnCount(rImplementation.mnColumnCount),
466 mnRowCount(rImplementation.mnRowCount),
467 mnMaxColumnCount(rImplementation.mnMaxColumnCount),
468 mnMaxRowCount(rImplementation.mnMaxRowCount),
469 maPageObjectSize(rImplementation.maPageObjectSize),
470 mpTheme(rImplementation.mpTheme)
479 const Size& rWindowSize,
480 const Size& rPreviewModelSize,
481 const sal_uInt32 nPageCount)
483 mnPageCount = nPageCount;
488 if (rPreviewModelSize.
IsEmpty())
491 CalculateRowAndColumnCount(rWindowSize);
494 mnLeftBorder = mnRequestedLeftBorder;
495 mnTopBorder = mnRequestedTopBorder;
496 mnRightBorder = mnRequestedRightBorder;
497 mnBottomBorder = mnRequestedBottomBorder;
498 if (mnColumnCount > 1)
500 int nMinimumBorderWidth = gnHorizontalGap/2;
501 if (mnLeftBorder < nMinimumBorderWidth)
502 mnLeftBorder = nMinimumBorderWidth;
503 if (mnRightBorder < nMinimumBorderWidth)
504 mnRightBorder = nMinimumBorderWidth;
508 int nMinimumBorderHeight = gnVerticalGap/2;
509 if (mnTopBorder < nMinimumBorderHeight)
510 mnTopBorder = nMinimumBorderHeight;
511 if (mnBottomBorder < nMinimumBorderHeight)
512 mnBottomBorder = nMinimumBorderHeight;
515 mpPageObjectLayouter =
516 std::make_shared<PageObjectLayouter>(
517 CalculateTargetSize(rWindowSize),
522 maPageObjectSize = mpPageObjectLayouter->GetGridMaxSize();
524 CalculateMaxRowAndColumnCount(rWindowSize);
530 sal_Int32 nYPosition,
531 bool bIncludeBordersAndGaps,
536 const sal_Int32 nY = nYPosition - mnTopBorder;
540 const sal_Int32 nRowOffset (maPageObjectSize.Height() + gnVerticalGap);
543 nRow = nY / nRowOffset;
545 const sal_Int32 nDistanceIntoGap ((nY - nRow*nRowOffset) - maPageObjectSize.Height());
548 if (nDistanceIntoGap > 0)
550 sal_Int32 nResolvedRow = ResolvePositionInGap(
555 if (!bIncludeBordersAndGaps || nResolvedRow != -1)
559 else if (bIncludeBordersAndGaps)
570 sal_Int32 nXPosition,
571 bool bIncludeBordersAndGaps,
574 sal_Int32 nColumn = -1;
576 sal_Int32 nX = nXPosition - mnLeftBorder;
580 const sal_Int32 nColumnOffset (maPageObjectSize.Width() + gnHorizontalGap);
583 nColumn = nX / nColumnOffset;
586 else if (nColumn >= mnColumnCount)
587 nColumn = mnColumnCount-1;
589 const sal_Int32 nDistanceIntoGap ((nX - nColumn*nColumnOffset) - maPageObjectSize.Width());
592 if (nDistanceIntoGap > 0)
594 sal_Int32 nResolvedColumn = ResolvePositionInGap(
599 if (!bIncludeBordersAndGaps || nResolvedColumn != -1)
600 nColumn = nResolvedColumn;
603 else if (bIncludeBordersAndGaps)
614 sal_Int32 nDistanceIntoGap,
619 switch (eGapMembership)
629 sal_Int32 nFirstHalfGapWidth = nGap / 2;
630 if (nDistanceIntoGap > nFirstHalfGapWidth)
645 if (nDistanceIntoGap > 0)
647 if (nDistanceIntoGap > nGap)
669 const Size& rIndicatorSize,
670 const bool bIsVertical,
675 sal_Int32 nLeadingLocation (0);
676 sal_Int32 nTrailingLocation (0);
677 bool bIsLeadingFixed (
false);
678 bool bIsTrailingFixed (
false);
679 sal_Int32 nSecondaryLocation (0);
686 const ::tools::Rectangle aInnerBox (GetInnerBoundingBox(rModel,
nIndex));
689 nLeadingLocation = aOuterBox.Top();
690 nTrailingLocation = aInnerBox.Top();
691 nSecondaryLocation = aInnerBox.Center().X();
695 nLeadingLocation = aOuterBox.Left();
696 nTrailingLocation = aInnerBox.Left();
697 nSecondaryLocation = aInnerBox.Center().Y();
699 bIsLeadingFixed =
true;
706 const ::tools::Rectangle aInnerBox (GetInnerBoundingBox(rModel,
nIndex-1));
709 nLeadingLocation = aInnerBox.Bottom();
710 nTrailingLocation = aOuterBox.Bottom();
711 nSecondaryLocation = aInnerBox.Center().X();
715 nLeadingLocation = aInnerBox.Right();
716 nTrailingLocation = aOuterBox.Right();
717 nSecondaryLocation = aInnerBox.Center().Y();
719 bIsTrailingFixed =
true;
721 bIsLeadingFixed =
true;
726 const ::tools::Rectangle aBox1 (GetInnerBoundingBox(rModel,
nIndex-1));
727 const ::tools::Rectangle aBox2 (GetInnerBoundingBox(rModel,
nIndex));
730 nLeadingLocation = aBox1.Bottom();
731 nTrailingLocation = aBox2.Top();
732 nSecondaryLocation = (aBox1.Center().X() + aBox2.Center().X()) / 2;
736 nLeadingLocation = aBox1.Right();
737 nTrailingLocation = aBox2.Left();
738 nSecondaryLocation = (aBox1.Center().Y() + aBox2.Center().Y()) / 2;
744 const sal_Int32 nAvailableSpace (nTrailingLocation - nLeadingLocation);
745 const sal_Int32 nRequiredSpace (bIsVertical ? rIndicatorSize.
Height():rIndicatorSize.
Width());
746 const sal_Int32 nMissingSpace (::std::max(sal_Int32(0), nRequiredSpace - nAvailableSpace));
747 sal_Int32 nPrimaryLocation (0);
748 sal_Int32 nLeadingOffset (0);
749 sal_Int32 nTrailingOffset (0);
752 nPrimaryLocation = nLeadingLocation + nRequiredSpace/2;
753 if ( ! bIsTrailingFixed)
754 nTrailingOffset = nMissingSpace;
756 else if (bIsTrailingFixed)
758 nPrimaryLocation = nTrailingLocation - nRequiredSpace/2;
759 nLeadingOffset = -nMissingSpace;
763 nPrimaryLocation = (nLeadingLocation + nTrailingLocation) /2;
764 nLeadingOffset = -nMissingSpace/2;
765 nTrailingOffset = nMissingSpace + nLeadingOffset;
771 Point(nSecondaryLocation, nPrimaryLocation),
772 Point(0, nLeadingOffset),
773 Point(0, nTrailingOffset));
778 Point(nPrimaryLocation, nSecondaryLocation),
779 Point(nLeadingOffset, 0),
780 Point(nTrailingOffset, 0));
786 const sal_Int32 nIndex)
const
790 return ::tools::Rectangle();
797 return mpPageObjectLayouter->GetBoundingBox(
805 mnLeftBorder + maMinimalSize.Width() + mnRightBorder,
806 mnLeftBorder + maMaximalSize.Width() + mnRightBorder);
812 mnTopBorder + maMinimalSize.Height() + mnBottomBorder,
813 mnTopBorder + maMaximalSize.Height() + mnBottomBorder);
819 if (aVisibleArea.IsEmpty())
820 return Range(-1, -1);
822 const sal_Int32 nRow0 (GetRowAtPosition(aVisibleArea.Top(),
true, GM_NEXT));
823 const sal_Int32 nCol0 (GetColumnAtPosition(aVisibleArea.Left(),
true, GM_NEXT));
824 const sal_Int32 nRow1 (GetRowAtPosition(aVisibleArea.Bottom(),
true, GM_PREVIOUS));
825 const sal_Int32 nCol1 (GetColumnAtPosition(aVisibleArea.Right(),
true, GM_PREVIOUS));
833 const Size& rWindowSize,
834 const bool bCalculateWidth,
835 const bool bCalculateHeight)
const
837 if (mnColumnCount<=0 || mnRowCount<=0)
838 return maPreferredSize;
839 if ( ! (bCalculateWidth || bCalculateHeight))
841 OSL_ASSERT(bCalculateWidth || bCalculateHeight);
842 return maPreferredSize;
846 Size aTargetSize (0,0);
849 (rWindowSize.
Width() - mnLeftBorder - mnRightBorder
850 - (mnColumnCount-1) * gnHorizontalGap)
852 else if (bCalculateHeight)
854 (rWindowSize.
Height() - mnTopBorder - mnBottomBorder
855 - (mnRowCount-1) * gnVerticalGap)
860 if (aTargetSize.
Width() < maMinimalSize.Width())
861 aTargetSize.
setWidth(maMinimalSize.Width());
862 else if (aTargetSize.
Width() > maMaximalSize.Width())
863 aTargetSize.
setWidth(maMaximalSize.Width());
865 else if (bCalculateHeight)
867 if (aTargetSize.
Height() < maMinimalSize.Height())
868 aTargetSize.
setHeight(maMinimalSize.Height());
869 else if (aTargetSize.
Height() > maMaximalSize.Height())
870 aTargetSize.
setHeight(maMaximalSize.Height());
877 const sal_Int32 nRow,
878 const sal_Int32 nColumn,
879 const bool bClampToValidRange)
const
881 if (nRow >= 0 && nColumn >= 0)
883 const sal_Int32
nIndex (nRow * mnColumnCount + nColumn);
884 if (
nIndex >= mnPageCount)
885 if (bClampToValidRange)
886 return mnPageCount-1;
892 else if (bClampToValidRange)
899 const sal_Int32 nIndex,
900 const bool bIncludeBorderAndGap)
const
902 const sal_Int32 nRow (
nIndex / mnColumnCount);
903 const sal_Int32 nColumn (
nIndex % mnColumnCount);
906 if (bIncludeBorderAndGap)
907 return AddBorderAndGap(aBoundingBox, nRow, nColumn);
913 const sal_Int32 nRow,
914 const sal_Int32 nColumn)
const
916 return ::tools::Rectangle(
918 + nColumn * maPageObjectSize.Width()
919 + std::max<sal_Int32>(nColumn,0) * gnHorizontalGap,
921 + nRow * maPageObjectSize.Height()
922 + std::max<sal_Int32>(nRow,0) * gnVerticalGap),
927 const ::tools::Rectangle& rBoundingBox,
928 const sal_Int32 nRow,
929 const sal_Int32 nColumn)
const
936 aBoundingBox.
AdjustLeft( -(gnHorizontalGap/2) );
937 if (nColumn == mnColumnCount-1)
944 aBoundingBox.
AdjustTop( -(gnVerticalGap/2) );
945 if (nRow == mnRowCount-1)
954 sal_Int32 nHorizontalSize = 0;
955 sal_Int32 nVerticalSize = 0;
956 if (mnColumnCount > 0)
958 sal_Int32 nRowCount = (mnPageCount+mnColumnCount-1) / mnColumnCount;
962 + mnColumnCount * maPageObjectSize.Width();
963 if (mnColumnCount > 1)
964 nHorizontalSize += (mnColumnCount-1) * gnHorizontalGap;
968 + nRowCount * maPageObjectSize.Height();
970 nVerticalSize += (nRowCount-1) * gnVerticalGap;
973 return ::tools::Rectangle (
975 Size (nHorizontalSize, nVerticalSize)
980 const Point& rModelPosition,
983 const sal_Int32 nY = rModelPosition.
Y() - mnTopBorder + maPageObjectSize.Height()/2;
984 const sal_Int32 nRowHeight (maPageObjectSize.Height() + gnVerticalGap);
985 const sal_Int32 nRow (::std::min(mnPageCount, nY / nRowHeight));
991 (nRow == mnRowCount),
992 (nRow >= mnMaxRowCount));
997HorizontalImplementation::HorizontalImplementation (
const Implementation& rImplementation)
1007void HorizontalImplementation::CalculateRowAndColumnCount (
const Size&)
1010 mnColumnCount = mnPageCount;
1014void HorizontalImplementation::CalculateMaxRowAndColumnCount (
const Size& rWindowSize)
1016 mnMaxColumnCount = (rWindowSize.
Width() - mnLeftBorder - mnRightBorder)
1017 / (maPageObjectSize.Width() + gnHorizontalGap);
1021Size HorizontalImplementation::CalculateTargetSize (
1022 const Size& rWindowSize)
const
1027void HorizontalImplementation::CalculateLogicalInsertPosition (
1028 const Point& rModelPosition,
1029 InsertPosition& rPosition)
const
1031 const sal_Int32 nX = rModelPosition.
X() - mnLeftBorder + maPageObjectSize.Width()/2;
1032 const sal_Int32 nColumnWidth (maPageObjectSize.Width() + gnHorizontalGap);
1033 const sal_Int32 nColumn (::std::min(mnPageCount, nX / nColumnWidth));
1034 rPosition.SetLogicalPosition (
1039 (nColumn == mnColumnCount),
1040 (nColumn >= mnMaxColumnCount));
1045VerticalImplementation::VerticalImplementation (
const Implementation& rImplementation)
1046 : Implementation(rImplementation)
1055void VerticalImplementation::CalculateRowAndColumnCount (
const Size&)
1058 mnRowCount = mnPageCount;
1063void VerticalImplementation::CalculateMaxRowAndColumnCount (
const Size& rWindowSize)
1065 mnMaxRowCount = (rWindowSize.
Height() - mnTopBorder - mnBottomBorder)
1066 / (maPageObjectSize.Height() + gnVerticalGap);
1067 mnMaxColumnCount = 1;
1070Size VerticalImplementation::CalculateTargetSize (
1071 const Size& rWindowSize)
const
1076void VerticalImplementation::CalculateLogicalInsertPosition (
1077 const Point& rModelPosition,
1078 InsertPosition& rPosition)
const
1080 return CalculateVerticalLogicalInsertPosition(rModelPosition, rPosition);
1085GridImplementation::GridImplementation (
1087 const std::shared_ptr<view::Theme>& rpTheme)
1088 : Implementation(pWindow, rpTheme)
1092GridImplementation::GridImplementation (
const Implementation& rImplementation)
1093 : Implementation(rImplementation)
1102void GridImplementation::CalculateRowAndColumnCount (
const Size& rWindowSize)
1106 = (rWindowSize.
Width() - mnRequestedLeftBorder - mnRequestedRightBorder)
1107 / (maPreferredSize.Width() + gnHorizontalGap);
1108 if (mnColumnCount < mnMinimalColumnCount)
1109 mnColumnCount = mnMinimalColumnCount;
1110 if (mnColumnCount > mnMaximalColumnCount)
1111 mnColumnCount = mnMaximalColumnCount;
1112 mnRowCount = (mnPageCount + mnColumnCount-1)/mnColumnCount;
1115void GridImplementation::CalculateMaxRowAndColumnCount (
const Size& rWindowSize)
1117 mnMaxColumnCount = (rWindowSize.
Width() - mnLeftBorder - mnRightBorder)
1118 / (maPageObjectSize.Width() + gnHorizontalGap);
1119 mnMaxRowCount = (rWindowSize.
Height() - mnTopBorder - mnBottomBorder)
1120 / (maPageObjectSize.Height() + gnVerticalGap);
1123Size GridImplementation::CalculateTargetSize (
1124 const Size& rWindowSize)
const
1129void GridImplementation::CalculateLogicalInsertPosition (
1130 const Point& rModelPosition,
1131 InsertPosition& rPosition)
const
1133 if (mnColumnCount == 1)
1135 CalculateVerticalLogicalInsertPosition(rModelPosition, rPosition);
1140 sal_Int32 nRow (::std::min(
1142 GetRowAtPosition (rModelPosition.
Y(),
true, GM_BOTH)));
1143 const sal_Int32 nX = rModelPosition.
X() - mnLeftBorder + maPageObjectSize.Width()/2;
1144 const sal_Int32 nColumnWidth (maPageObjectSize.Width() + gnHorizontalGap);
1145 sal_Int32 nColumn (::std::min(mnColumnCount, nX / nColumnWidth));
1146 sal_Int32
nIndex (nRow * mnColumnCount + nColumn);
1147 bool bIsAtRunEnd (nColumn == mnColumnCount);
1149 if (nIndex >= mnPageCount)
1152 nRow = mnRowCount-1;
1153 nColumn = ::std::min(::std::min(mnPageCount, mnColumnCount), nColumn);
1157 rPosition.SetLogicalPosition (
1163 (nColumn >= mnMaxColumnCount));
1173 mbIsAtRunStart(false),
1174 mbIsAtRunEnd(false),
1175 mbIsExtraSpaceNeeded(false),
1177 maLeadingOffset(0,0),
1178 maTrailingOffset(0,0)
1199 const sal_Int32 nRow,
1200 const sal_Int32 nColumn,
1201 const sal_Int32 nIndex,
1202 const bool bIsAtRunStart,
1203 const bool bIsAtRunEnd,
1204 const bool bIsExtraSpaceNeeded)
1215 const Point& rLocation,
1216 const Point& rLeadingOffset,
1217 const Point& rTrailingOffset)
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
An SdWindow contains the actual working area of ViewShell.
The model of the slide sorter gives access to the slides that are to be displayed in the slide sorter...
SharedPageDescriptor GetPageDescriptor(const sal_Int32 nPageIndex, const bool bCreate=true) const
Return a page descriptor for the page with the specified index.
Collect all values concerning the logical and visual properties of the insertion position that is use...
bool operator!=(const InsertPosition &rInsertPosition) const
bool IsAtRunStart() const
sal_Int32 GetIndex() const
void SetGeometricalPosition(const Point &rLocation, const Point &rLeadingOffset, const Point &rTrailingOffset)
bool operator==(const InsertPosition &rInsertPosition) const
void SetLogicalPosition(const sal_Int32 nRow, const sal_Int32 nColumn, const sal_Int32 nIndex, const bool bIsAtRunStart, const bool bIsAtRunEnd, const bool bIsExtraSpaceNeeded)
bool IsExtraSpaceNeeded() const
bool mbIsExtraSpaceNeeded
Range GetValidVerticalSizeRange() const
static const sal_Int32 mnRequestedLeftBorder
static sal_Int32 ResolvePositionInGap(sal_Int32 nDistanceIntoGap, GapMembership eGapMembership, sal_Int32 nIndex, sal_Int32 nGap)
This method is typically called from GetRowAtPosition() and GetColumnAtPosition() to handle a positio...
::tools::Rectangle GetTotalBoundingBox() const
virtual Size CalculateTargetSize(const Size &rWindowSize) const =0
Size GetTargetSize(const Size &rWindowSize, const bool bCalculateWidth, const bool bCalculateHeight) const
static const sal_Int32 mnRequestedRightBorder
::tools::Rectangle AddBorderAndGap(const ::tools::Rectangle &rBoundingBox, const sal_Int32 nRow, const sal_Int32 nColumn) const
Implementation(sd::Window *pWindow, std::shared_ptr< view::Theme > pTheme)
static const sal_Int32 gnVerticalGap
sal_Int32 mnMaximalColumnCount
sal_Int32 GetRowAtPosition(sal_Int32 nYPosition, bool bIncludeBordersAndGaps, GapMembership eGapMembership) const
Calculate the row that the point with the given vertical coordinate is over.
std::shared_ptr< view::Theme > mpTheme
GapMembership
Specify how the gap between two page objects is associated with the page objects.
virtual void CalculateMaxRowAndColumnCount(const Size &rWindowSize)=0
void CalculateGeometricPosition(InsertPosition &rPosition, const Size &rIndicatorSize, const bool bIsVertical, model::SlideSorterModel const &rModel) const
Calculate the geometrical part of the insert position, i.e.
::tools::Rectangle GetPageObjectBox(const sal_Int32 nIndex, const bool bIncludeBorderAndGap=false) const
sal_Int32 GetColumnAtPosition(sal_Int32 nXPosition, bool bIncludeBordersAndGaps, GapMembership eGapMembership) const
Calculate the column that the point with the given horizontal coordinate is over.
sal_Int32 GetIndex(const sal_Int32 nRow, const sal_Int32 nColumn, const bool bClampToValidRange) const
VclPtr< sd::Window > mpWindow
static const sal_Int32 mnRequestedBottomBorder
sal_Int32 mnMaxColumnCount
The maximum number of columns.
bool Rearrange(const Size &rWindowSize, const Size &rPreviewModelSize, const sal_uInt32 nPageCount)
Range GetRangeOfVisiblePageObjects(const ::tools::Rectangle &aVisibleArea) const
static Implementation * Create(const Implementation &rImplementation, const Layouter::Orientation eOrientation)
sal_Int32 mnMinimalColumnCount
::tools::Rectangle GetInnerBoundingBox(model::SlideSorterModel const &rModel, const sal_Int32 nIndex) const
Return the bounding box of the preview or, when selected, of the page object.
sal_Int32 mnMaxRowCount
The maximum number of rows.
virtual void CalculateLogicalInsertPosition(const Point &rModelPosition, InsertPosition &rPosition) const =0
Calculate the logical part of the insert position, i.e.
static const sal_Int32 gnHorizontalGap
virtual void CalculateRowAndColumnCount(const Size &rWindowSize)=0
std::shared_ptr< PageObjectLayouter > mpPageObjectLayouter
virtual Layouter::Orientation GetOrientation() const =0
void CalculateVerticalLogicalInsertPosition(const Point &rModelPosition, InsertPosition &rPosition) const
Range GetValidHorizontalSizeRange() const
static const sal_Int32 mnRequestedTopBorder
virtual ~Implementation()
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
Range GetValidVerticalSizeRange() 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
std::shared_ptr< PageDescriptor > SharedPageDescriptor
const int Theme_FocusIndicatorWidth
VclPtr< vcl::Window > mpWindow