LibreOffice Module sw (master) 1
|
page preview functionality in the writer More...
#include <pagepreviewlayout.hxx>
Public Member Functions | |
SwPagePreviewLayout (SwViewShell &_rParentViewShell, const SwRootFrame &_rLayoutRootFrame) | |
constructor of <SwPagePreviewLayout> More... | |
~SwPagePreviewLayout () | |
destructor of <SwPagePreviewLayout> More... | |
void | Init (const sal_uInt16 _nCols, const sal_uInt16 _nRows, const Size &_rPxWinSize) |
init page preview layout More... | |
void | ReInit () |
method to adjust page preview layout to document changes More... | |
bool | Prepare (const sal_uInt16 _nProposedStartPageNum, const Point &rProposedStartPos, const Size &_rPxWinSize, sal_uInt16 &_onStartPageNum, tools::Rectangle &_orDocPreviewPaintRect, const bool _bStartWithPageAtFirstCol=true) |
prepare paint of page preview More... | |
sal_uInt16 | SelectedPage () |
get selected page number More... | |
void | SetSelectedPage (sal_uInt16 _nSelectedPageNum) |
set selected page number More... | |
bool | Paint (vcl::RenderContext &rRenderContext, const tools::Rectangle &rOutRect) const |
paint prepared preview More... | |
void | Repaint (const tools::Rectangle &rInvalidCoreRect) const |
repaint pages on page preview More... | |
void | MarkNewSelectedPage (const sal_uInt16 _nSelectedPage) |
paint to mark new selected page More... | |
Point | GetPreviewStartPosForNewScale (const Fraction &_aNewScale, const Fraction &_aOldScale, const Size &_aNewWinSize) const |
calculate start position for new scale More... | |
bool | IsPageVisible (const sal_uInt16 _nPageNum) const |
determines, if page with given page number is visible in preview More... | |
void | CalcStartValuesForSelectedPageMove (const sal_Int16 _nHoriMove, const sal_Int16 _nVertMove, sal_uInt16 &_orNewSelectedPage, sal_uInt16 &_orNewStartPage, Point &_orNewStartPos) const |
calculate data to bring new selected page into view. More... | |
bool | IsPreviewPosInDocPreviewPage (const Point &rPreviewPos, Point &_orDocPos, bool &_obPosInEmptyPage, sal_uInt16 &_onPageNum) const |
checks, if given position is inside a shown document page More... | |
bool | DoesPreviewLayoutRowsFitIntoWindow () const |
bool | DoesPreviewLayoutColsFitIntoWindow () const |
bool | PreviewLayoutValid () const |
SwTwips | GetWinPagesScrollAmount (const sal_Int16 _nWinPagesToScroll) const |
determine preview window page scroll amount More... | |
sal_uInt16 | GetRowOfPage (sal_uInt16 _nPageNum) const |
determine row the page with the given number is in More... | |
sal_uInt16 | GetColOfPage (sal_uInt16 _nPageNum) const |
determine column the page with the given number is in More... | |
Size | GetPreviewDocSize () const |
Size | GetPreviewPageSizeByPageNum (sal_uInt16 _nPageNum) const |
get size of a preview page by its physical page number More... | |
sal_uInt16 | GetVirtPageNumByPageNum (sal_uInt16 _nPageNum) const |
get virtual page number by its physical page number More... | |
bool | SetBookPreviewMode (const bool _bEnableBookPreview, sal_uInt16 &_onStartPageNum, tools::Rectangle &_orDocPreviewPaintRect) |
enable/disable book preview More... | |
sal_uInt16 | ConvertRelativeToAbsolutePageNum (sal_uInt16 _nRelPageNum) const |
Convert relative to absolute page numbers (see PrintEmptyPages) More... | |
sal_uInt16 | ConvertAbsoluteToRelativePageNum (sal_uInt16 _nAbsPageNum) const |
Convert absolute to relative page numbers (see PrintEmptyPages) More... | |
SwViewShell & | GetParentViewShell () |
Private Member Functions | |
void | Clear_ () |
clear internal data about current page preview More... | |
void | ClearPreviewLayoutSizes () |
helper method to clear preview page layout sizes More... | |
void | ClearPreviewPageData () |
helper method to clear data in preview page vectors More... | |
void | CalcPreviewLayoutSizes () |
calculate page preview layout sizes More... | |
void | ApplyNewZoomAtViewShell (sal_uInt8 _aNewZoom) |
apply new zoom at given view shell More... | |
void | CalcAdditionalPaintOffset () |
calculate additional paint offset More... | |
void | CalcDocPreviewPaintRect () |
calculate painted preview document rectangle More... | |
void | CalcPreviewDataForPage (const SwPageFrame &_rPage, const Point &_rPreviewOffset, PreviewPage *_opPreviewPage) |
determines preview data for a given page and a given preview offset More... | |
void | CalcPreviewPages () |
calculate preview pages More... | |
const PreviewPage * | GetPreviewPageByPageNum (const sal_uInt16 _nPageNum) const |
get preview page by physical page number More... | |
void | PaintSelectMarkAtPage (vcl::RenderContext &rRenderContext, const PreviewPage *_aSelectedPreviewPage) const |
paint selection mark at page More... | |
Private Attributes | |
SwViewShell & | mrParentViewShell |
view shell the print preview is generated for. More... | |
const SwRootFrame & | mrLayoutRootFrame |
top layout frame of the layout for accessing the pages More... | |
bool | mbLayoutInfoValid |
boolean indicating, if the layout information (number of columns and rows) are valid. More... | |
bool | mbLayoutSizesValid |
boolean indicating, if the calculated print preview layout sizes ( windows size in twips, maximal page size, column width, row height, width and height of a print preview page, size of the print preview document ) are valid More... | |
bool | mbPaintInfoValid |
boolean indicating, if the paint information ( physical number of start page, start column and row, paint offsets, rectangle visible of the print preview document. More... | |
Size | maWinSize |
sal_uInt16 | mnCols |
sal_uInt16 | mnRows |
sal_uInt16 | mnPages |
bool | mbBookPreview |
bool | mbBookPreviewModeToggled |
Size | maMaxPageSize |
tools::Rectangle | maPreviewDocRect |
SwTwips | mnColWidth |
SwTwips | mnRowHeight |
SwTwips | mnPreviewLayoutWidth |
SwTwips | mnPreviewLayoutHeight |
bool | mbDoesLayoutColsFitIntoWindow |
bool | mbDoesLayoutRowsFitIntoWindow |
sal_uInt16 | mnPaintPhyStartPageNum |
sal_uInt16 | mnPaintStartCol |
sal_uInt16 | mnPaintStartRow |
bool | mbNoPageVisible |
Point | maPaintStartPageOffset |
Point | maPaintPreviewDocOffset |
Point | maAdditionalPaintOffset |
tools::Rectangle | maPaintedPreviewDocRect |
sal_uInt16 | mnSelectedPageNum |
std::vector< std::unique_ptr< PreviewPage > > | maPreviewPages |
bool | mbInPaint |
#i22014# - internal booleans to indicate, that a new print preview layout has been created during a paint. More... | |
bool | mbNewLayoutDuringPaint |
bool | mbPrintEmptyPages |
Static Private Attributes | |
static constexpr SwTwips | gnXFree = 4 * 142 |
number of horizontal and vertical twips for spacing between the pages. More... | |
static constexpr SwTwips | gnYFree = 4 * 142 |
Friends | |
class | SwViewShell |
page preview functionality in the writer
Definition at line 42 of file pagepreviewlayout.hxx.
SwPagePreviewLayout::SwPagePreviewLayout | ( | SwViewShell & | _rParentViewShell, |
const SwRootFrame & | _rLayoutRootFrame | ||
) |
constructor of <SwPagePreviewLayout>
_rParentViewShell | input parameter - reference to the view shell the page preview layout belongs to. Reference will be hold as member <mrParentViewShell>. Adjustments/Changes at this view shell: (1) Adjustment of the mapping mode at the output device. (2) Change of the zoom at the view options. (3) Preparations for paint of the page preview. |
_rLayoutRootFrame | input parameter - constant reference to the root frame of the layout. Reference will be hold as member <mrLayoutRootFrame> in order to get access to the page frames. |
Definition at line 46 of file pagepreviewlayout.cxx.
References Clear_(), SwViewShell::getIDocumentDeviceAccess(), IDocumentDeviceAccess::getPrintData(), SwPrintData::IsPrintEmptyPages(), mbBookPreview, mbBookPreviewModeToggled, mbPrintEmptyPages, and mrParentViewShell.
|
inline |
destructor of <SwPagePreviewLayout>
Definition at line 211 of file pagepreviewlayout.hxx.
References ClearPreviewPageData().
|
private |
apply new zoom at given view shell
_aNewZoom | input parameter - new zoom percentage |
Definition at line 236 of file pagepreviewlayout.cxx.
References SwViewShell::ApplyViewOptions(), SwViewShell::GetViewOptions(), SwViewOption::GetZoom(), mrParentViewShell, SwViewOption::SetZoom(), and SwViewOption::SetZoomType().
Referenced by Init().
|
private |
calculate additional paint offset
helper method called by <Prepare> in order to calculate an additional paint offset to center output in given window size. The booleans <mbDoesLayoutRowsFitIntoWindow> and <mbDoesLayoutColsFitIntoWindow> are also determined. preconditions: (1) preview layout is given (number of rows and columns). (2) window size is given. (3) height of row and width of column are calculated. (4) paint offset of start page is calculated.
Definition at line 472 of file pagepreviewlayout.cxx.
References Size::Height(), maAdditionalPaintOffset, maPaintStartPageOffset, maWinSize, mbDoesLayoutColsFitIntoWindow, mbDoesLayoutRowsFitIntoWindow, mnPreviewLayoutHeight, mnPreviewLayoutWidth, Point::setX(), Point::setY(), Size::Width(), Point::X(), and Point::Y().
Referenced by Prepare().
|
private |
calculate painted preview document rectangle
helper method called by <Prepare> in order to calculate the rectangle, which will be painted for the document arranged by the given preview layout. preconditions: (1) paint offset of document preview is calculated. (2) size of document preview is calculated. (3) additional paint offset is calculated - see <CalcAdditionalPaintOffset>.
Definition at line 502 of file pagepreviewlayout.cxx.
References tools::Rectangle::GetHeight(), tools::Rectangle::GetWidth(), Size::Height(), maAdditionalPaintOffset, maPaintedPreviewDocRect, maPaintPreviewDocOffset, maPreviewDocRect, maWinSize, mbDoesLayoutColsFitIntoWindow, mbDoesLayoutRowsFitIntoWindow, min(), mnPreviewLayoutHeight, mnPreviewLayoutWidth, Size::setHeight(), tools::Rectangle::SetPos(), tools::Rectangle::SetSize(), Size::setWidth(), Size::Width(), Point::X(), and Point::Y().
Referenced by Prepare().
|
private |
determines preview data for a given page and a given preview offset
_rPage | input parameter - constant reference to page frame, for which the preview data will be calculated. |
_rPreviewOffset | input parameter - constant reference to the offset the given page has in the current preview window. Note: Offset can be negative. |
_opPreviewPage | output parameter - calculated preview data. |
OD 13.12.2002 #103492#
Definition at line 642 of file pagepreviewlayout.cxx.
References Point::AdjustX(), Point::AdjustY(), PreviewPage::aLogicPos, PreviewPage::aMapOffset, PreviewPage::aPageSize, PreviewPage::aPreviewWinPos, SwFrameAreaDefinition::getFrameArea(), SwFrame::GetNext(), SwPageFrame::GetPhyPageNum(), SwFrame::GetPrev(), Size::Height(), SwPageFrame::IsEmptyPage(), maMaxPageSize, SwRect::Pos(), PreviewPage::pPage, SwRect::SSize(), and Size::Width().
Referenced by CalcPreviewPages().
|
private |
calculate page preview layout sizes
Definition at line 114 of file pagepreviewlayout.cxx.
References SwFrame::Calc(), SwFrameAreaDefinition::getFrameArea(), SwFrame::GetNext(), SwViewShell::GetOut(), GetRowOfPage(), gnXFree, gnYFree, Size::Height(), SwPageFrame::IsEmptyPage(), SwLayoutFrame::Lower(), maMaxPageSize, maPreviewDocRect, mbBookPreview, mbPrintEmptyPages, mnCols, mnColWidth, mnPages, mnPreviewLayoutHeight, mnPreviewLayoutWidth, mnRowHeight, mnRows, mrLayoutRootFrame, mrParentViewShell, Size::setHeight(), tools::Rectangle::SetPos(), tools::Rectangle::SetSize(), Size::setWidth(), SwRect::SSize(), and Size::Width().
|
private |
calculate preview pages
helper method called by <Prepare> in order to determine which pages will be visible in the current preview and calculate the data needed to paint these pages. Also the accessible pages with its needed data are determined.
check whether RTL interface or not
check whether RTL interface or not
check whether RTL interface or not
Definition at line 526 of file pagepreviewlayout.cxx.
References Point::AdjustX(), Point::AdjustY(), SwFrame::Calc(), CalcPreviewDataForPage(), ClearPreviewPageData(), AllSettings::GetLayoutRTL(), SwFrame::GetNext(), SwViewShell::GetOut(), SwRootFrame::GetPageByPageNum(), SwPageFrame::GetPhyPageNum(), gnXFree, gnYFree, Size::Height(), SwPageFrame::IsEmptyPage(), maAdditionalPaintOffset, maPaintStartPageOffset, maPreviewPages, maWinSize, mbBookPreview, mbDoesLayoutRowsFitIntoWindow, mbNoPageVisible, mbPrintEmptyPages, mnCols, mnColWidth, mnPaintPhyStartPageNum, mnPaintStartCol, mnRowHeight, mnRows, mrLayoutRootFrame, mrParentViewShell, Point::setX(), Size::Width(), Point::X(), and Point::Y().
Referenced by Prepare().
void SwPagePreviewLayout::CalcStartValuesForSelectedPageMove | ( | const sal_Int16 | _nHoriMove, |
const sal_Int16 | _nVertMove, | ||
sal_uInt16 & | _orNewSelectedPage, | ||
sal_uInt16 & | _orNewStartPage, | ||
Point & | _orNewStartPos | ||
) | const |
calculate data to bring new selected page into view.
_nHoriMove | input parameter - positive/negative number of columns the current selected page have to be moved. |
_nVertMove | input parameter - positive/negative number of rows the current selected page have to be moved. |
_orNewSelectedPage | output parameter - number of new selected page |
_orNewStartPage | output parameter - number of new start page |
_orNewStartPos | output parameter - new start position in document preview |
Definition at line 790 of file pagepreviewlayout.cxx.
References ConvertAbsoluteToRelativePageNum(), ConvertRelativeToAbsolutePageNum(), GetRowOfPage(), IsPageVisible(), mbBookPreview, mbDoesLayoutColsFitIntoWindow, mbDoesLayoutRowsFitIntoWindow, mnCols, mnPages, mnPaintPhyStartPageNum, mnRows, and mnSelectedPageNum.
Referenced by SwPagePreview::Execute().
|
private |
clear internal data about current page preview
Definition at line 59 of file pagepreviewlayout.cxx.
References ClearPreviewLayoutSizes(), ClearPreviewPageData(), maAdditionalPaintOffset, maPaintedPreviewDocRect, maPaintPreviewDocOffset, maPaintStartPageOffset, maWinSize, mbDoesLayoutColsFitIntoWindow, mbDoesLayoutRowsFitIntoWindow, mbInPaint, mbLayoutInfoValid, mbLayoutSizesValid, mbNewLayoutDuringPaint, mbNoPageVisible, mbPaintInfoValid, mnCols, mnPaintPhyStartPageNum, mnPaintStartCol, mnPaintStartRow, mnRows, mnSelectedPageNum, tools::Rectangle::SetBottom(), Size::setHeight(), tools::Rectangle::SetLeft(), tools::Rectangle::SetRight(), tools::Rectangle::SetTop(), Size::setWidth(), Point::setX(), and Point::setY().
Referenced by Init(), and SwPagePreviewLayout().
|
private |
helper method to clear preview page layout sizes
Definition at line 92 of file pagepreviewlayout.cxx.
References maMaxPageSize, maPreviewDocRect, mnColWidth, mnPages, mnPreviewLayoutHeight, mnPreviewLayoutWidth, mnRowHeight, tools::Rectangle::SetBottom(), Size::setHeight(), tools::Rectangle::SetLeft(), tools::Rectangle::SetRight(), tools::Rectangle::SetTop(), and Size::setWidth().
|
private |
helper method to clear data in preview page vectors
Definition at line 106 of file pagepreviewlayout.cxx.
References maPreviewPages.
Referenced by CalcPreviewPages(), Clear_(), and ~SwPagePreviewLayout().
sal_uInt16 SwPagePreviewLayout::ConvertAbsoluteToRelativePageNum | ( | sal_uInt16 | _nAbsPageNum | ) | const |
Convert absolute to relative page numbers (see PrintEmptyPages)
Definition at line 1419 of file pagepreviewlayout.cxx.
References SwFrame::GetNext(), SwPageFrame::GetPhyPageNum(), SwPageFrame::IsEmptyPage(), SwLayoutFrame::Lower(), mbBookPreview, mbPrintEmptyPages, and mrLayoutRootFrame.
Referenced by CalcStartValuesForSelectedPageMove(), SwPagePreviewWin::MovePage(), and Prepare().
sal_uInt16 SwPagePreviewLayout::ConvertRelativeToAbsolutePageNum | ( | sal_uInt16 | _nRelPageNum | ) | const |
Convert relative to absolute page numbers (see PrintEmptyPages)
Definition at line 1442 of file pagepreviewlayout.cxx.
References SwFrame::GetNext(), SwPageFrame::GetPhyPageNum(), i, SwPageFrame::IsEmptyPage(), SwLayoutFrame::Lower(), mbBookPreview, mbPrintEmptyPages, and mrLayoutRootFrame.
Referenced by CalcStartValuesForSelectedPageMove(), SwPagePreviewWin::MovePage(), and Prepare().
|
inline |
Definition at line 406 of file pagepreviewlayout.hxx.
References mbDoesLayoutColsFitIntoWindow.
Referenced by SwPagePreview::EndScrollHdl(), SwPagePreview::ExecPgUpAndPgDown(), and SwPagePreviewWin::MovePage().
|
inline |
Definition at line 401 of file pagepreviewlayout.hxx.
References mbDoesLayoutRowsFitIntoWindow.
Referenced by SwPagePreview::ExecPgUpAndPgDown(), SwPagePreviewWin::MouseButtonDown(), and SwPagePreviewWin::MovePage().
sal_uInt16 SwPagePreviewLayout::GetColOfPage | ( | sal_uInt16 | _nPageNum | ) | const |
determine column the page with the given number is in
_nPageNum | input parameter - physical page number of page, for which the column in preview layout has to be calculated. |
OD 17.01.2003 #103492#
Definition at line 1369 of file pagepreviewlayout.cxx.
References mbBookPreview, and mnCols.
Referenced by Prepare().
|
inline |
Definition at line 481 of file pagepreviewlayout.hxx.
References mrParentViewShell.
Referenced by SwPagePreviewWin::Paint().
Size SwPagePreviewLayout::GetPreviewDocSize | ( | ) | const |
Definition at line 1384 of file pagepreviewlayout.cxx.
References tools::Rectangle::GetSize(), maPreviewDocRect, and PreviewLayoutValid().
Referenced by SwPagePreview::ExecPgUpAndPgDown(), and SwPagePreview::ScrollViewSzChg().
|
private |
get preview page by physical page number
_nPageNum | input parameter - physical page number of page, for which the preview page will be returned. |
Definition at line 1331 of file pagepreviewlayout.cxx.
References maPreviewPages.
Referenced by GetPreviewPageSizeByPageNum(), GetVirtPageNumByPageNum(), IsPageVisible(), and MarkNewSelectedPage().
Size SwPagePreviewLayout::GetPreviewPageSizeByPageNum | ( | sal_uInt16 | _nPageNum | ) | const |
get size of a preview page by its physical page number
_nPageNum | input parameter - physical page number of preview page, for which the page size has to be returned. |
OD 15.01.2003 #103492#
Definition at line 1394 of file pagepreviewlayout.cxx.
References PreviewPage::aPageSize, and GetPreviewPageByPageNum().
Referenced by SwAccessibleMap::GetPreviewPageSize().
Point SwPagePreviewLayout::GetPreviewStartPosForNewScale | ( | const Fraction & | _aNewScale, |
const Fraction & | _aOldScale, | ||
const Size & | _aNewWinSize | ||
) | const |
calculate start position for new scale
calculate new start position for a new scale. Calculation bases on the current visible part of the document arranged in the given preview layout. preconditions: (1) new scaling is already set at the given output device.
Definition at line 719 of file pagepreviewlayout.cxx.
References Point::AdjustX(), Point::AdjustY(), tools::Rectangle::Bottom(), tools::Rectangle::GetHeight(), tools::Rectangle::GetWidth(), Size::Height(), maPaintedPreviewDocRect, maPreviewDocRect, mbDoesLayoutRowsFitIntoWindow, mnPaintStartRow, mnPreviewLayoutHeight, mnPreviewLayoutWidth, mnRowHeight, Point::setX(), Point::setY(), tools::Rectangle::TopLeft(), Size::Width(), Point::X(), and Point::Y().
Referenced by SwPagePreviewWin::AdjustPreviewToNewZoom().
sal_uInt16 SwPagePreviewLayout::GetRowOfPage | ( | sal_uInt16 | _nPageNum | ) | const |
determine row the page with the given number is in
_nPageNum | input parameter - physical page number of page, for which the row in preview layout has to be calculated. |
OD 17.01.2003 #103492#
Definition at line 1349 of file pagepreviewlayout.cxx.
References mbBookPreview, and mnCols.
Referenced by CalcPreviewLayoutSizes(), CalcStartValuesForSelectedPageMove(), and Prepare().
sal_uInt16 SwPagePreviewLayout::GetVirtPageNumByPageNum | ( | sal_uInt16 | _nPageNum | ) | const |
get virtual page number by its physical page number
_nPageNum | input parameter - physical page number of preview page, for which the virtual page number has to be determined. |
OD 21.03.2003 #108282#
Definition at line 1408 of file pagepreviewlayout.cxx.
References GetPreviewPageByPageNum(), SwFrame::GetVirtPageNum(), and PreviewPage::pPage.
Referenced by SwPagePreviewWin::GetStatusStr().
SwTwips SwPagePreviewLayout::GetWinPagesScrollAmount | ( | const sal_Int16 | _nWinPagesToScroll | ) | const |
determine preview window page scroll amount
determine window page scroll amount
_nWinPagesToScroll | input parameter - number of preview window pages the scroll amount has to be calculated for. Negative values for preview window page up scrolling, positive values for preview window page down scrolling. |
Definition at line 926 of file pagepreviewlayout.cxx.
References tools::Rectangle::Bottom(), tools::Rectangle::GetHeight(), gnYFree, maPaintedPreviewDocRect, maPreviewDocRect, mbDoesLayoutRowsFitIntoWindow, mbLayoutSizesValid, mnPreviewLayoutHeight, mnRowHeight, and tools::Rectangle::Top().
Referenced by SwPagePreview::EndScrollHdl(), SwPagePreview::ExecPgUpAndPgDown(), and SwPagePreview::GetState().
void SwPagePreviewLayout::Init | ( | const sal_uInt16 | _nCols, |
const sal_uInt16 | _nRows, | ||
const Size & | _rPxWinSize | ||
) |
init page preview layout
initialize the page preview settings for a given layout. side effects: (1) If parameter <_bCalcScale> is true, mapping mode with calculated scaling is set at the output device and the zoom at the view options of the given view shell is set with the calculated scaling.
_nCols | input parameter - initial number of page columns in the preview. |
_nRows | input parameter - initial number of page rows in the preview. |
_rPxWinSize | input parameter - window size in which the preview will be displayed and for which the scaling will be calculated. |
initialize the page preview settings for a given layout.
side effects: (1) If parameter <_bCalcScale> is true, mapping mode with calculated scaling is set at the output device and the zoom at the view options of the given view shell is set with the calculated scaling.
Definition at line 171 of file pagepreviewlayout.cxx.
References ApplyNewZoomAtViewShell(), CalcPreviewLayoutSizes(), Clear_(), SwViewShell::GetOut(), Size::Height(), maWinSize, mbLayoutInfoValid, mbLayoutSizesValid, mnCols, mnPreviewLayoutHeight, mnPreviewLayoutWidth, mnRows, mrParentViewShell, OutputDevice::PixelToLogic(), OutputDevice::SetMapMode(), MapMode::SetScaleX(), MapMode::SetScaleY(), SwCalcPixStatics(), and Size::Width().
Referenced by SwPagePreviewWin::AdjustPreviewToNewZoom(), SwPagePreviewWin::CalcWish(), and SwPagePreviewWin::SetWinSize().
bool SwPagePreviewLayout::IsPageVisible | ( | const sal_uInt16 | _nPageNum | ) | const |
determines, if page with given page number is visible in preview
_nPageNum | input parameter - physical number of page, for which it will be determined, if it is visible. |
Definition at line 780 of file pagepreviewlayout.cxx.
References PreviewPage::bVisible, and GetPreviewPageByPageNum().
Referenced by CalcStartValuesForSelectedPageMove(), SwPagePreview::EndScrollHdl(), SwPagePreview::Execute(), SwPagePreview::GetState(), SwPagePreviewWin::GetStatusStr(), and SwPagePreview::ScrollViewSzChg().
bool SwPagePreviewLayout::IsPreviewPosInDocPreviewPage | ( | const Point & | rPreviewPos, |
Point & | _orDocPos, | ||
bool & | _obPosInEmptyPage, | ||
sal_uInt16 & | _onPageNum | ||
) | const |
checks, if given position is inside a shown document page
_aPreviewPos | input parameter - position inside the visible preview window. |
_orDocPos | output parameter - corresponding position in the document, if given preview position is inside a shown document page, not an empty page. If not, its value is <Point( 0, 0 )>. |
_obPosInEmptyPage | output parameter - indicates, that given preview position lays inside an shown empty page. |
_onPageNum | output parameter - corresponding physical number of page, if given preview position is inside a shown document page, considers also empty pages. If not, its value is <0>. |
Definition at line 892 of file pagepreviewlayout.cxx.
References maPreviewPages, Point::setX(), and Point::setY().
Referenced by SwPagePreviewWin::MouseButtonDown().
void SwPagePreviewLayout::MarkNewSelectedPage | ( | const sal_uInt16 | _nSelectedPage | ) |
paint to mark new selected page
Perform paint for current selected page in order to unmark it. Set new selected page and perform paint to mark this page.
_nNewSelectedPage | input parameter - physical number of page, which will be marked as selected. |
OD 17.12.2002 #103492# Perform paint for current selected page in order to unmark it. Set new selected page and perform paint to mark this page.
Definition at line 1265 of file pagepreviewlayout.cxx.
References PreviewPage::aPageSize, PreviewPage::aPreviewWinPos, tools::Rectangle::Bottom(), PreviewPage::bVisible, SwViewShell::GetOut(), GetPreviewPageByPageNum(), SwViewShell::GetWin(), vcl::Window::Invalidate(), tools::Rectangle::Left(), OutputDevice::LogicToPixel(), mnSelectedPageNum, mrParentViewShell, OutputDevice::PixelToLogic(), tools::Rectangle::Right(), SwRect::SVRect(), SwAlignRect(), and tools::Rectangle::Top().
Referenced by SwPagePreview::EndScrollHdl(), SwPagePreview::Execute(), and SwPagePreviewWin::MouseButtonDown().
bool SwPagePreviewLayout::Paint | ( | vcl::RenderContext & | rRenderContext, |
const tools::Rectangle & | rOutRect | ||
) | const |
paint prepared preview
_aOutRect | input parameter - Twip rectangle of window, which should be painted. |
Definition at line 991 of file pagepreviewlayout.cxx.
References SwRect::Clear(), SwViewShell::DLPostPaint2(), SwViewShell::DLPrePaint2(), OutputDevice::DrawRect(), OutputDevice::DrawText(), SwPageFrame::GetBorderAndShadowBoundRect(), OutputDevice::GetConnectMetaFile(), SwPageFrame::GetEmptyPageFont(), OutputDevice::GetFillColor(), OutputDevice::GetFont(), OutputDevice::GetMapMode(), SwViewShell::GetOut(), SwRootFrame::GetPageByPageNum(), SwPageFrame::GetPhyPageNum(), SwViewShellImp::GetRetoucheColor(), MapMode::GetScaleX(), SwViewShell::GetWin(), SwViewShell::Imp(), tools::Rectangle::Intersection(), SwPageFrame::IsEmptyPage(), SwPageFrame::IsLeftShadowNeeded(), SwPageFrame::IsRightShadowNeeded(), SwRootFrame::IsSuperfluous(), OutputDevice::LogicToPixel(), SwViewShellImp::m_bFirstPageInvalid, SwViewShellImp::m_pFirstVisiblePage, maPreviewPages, SwViewShell::maVisArea, maWinSize, mbInPaint, mbNewLayoutDuringPaint, mbPaintInfoValid, mnSelectedPageNum, mrLayoutRootFrame, mrParentViewShell, tools::Rectangle::Overlaps(), SwViewShell::Paint(), SwPageFrame::PaintBorderAndShadow(), SwViewShell::PaintDesktop_(), PaintSelectMarkAtPage(), OutputDevice::PixelToLogic(), OutputDevice::SetFillColor(), OutputDevice::SetFont(), OutputDevice::SetLineColor(), OutputDevice::SetMapMode(), MapMode::SetOrigin(), SwRect::SVRect(), SwAlignRect(), SwResId(), and SwViewShellImp::UpdateAccessiblePreview().
Referenced by SwPagePreviewWin::Paint().
|
private |
paint selection mark at page
OD 17.12.2002 #103492#
Definition at line 1205 of file pagepreviewlayout.cxx.
References PreviewPage::aLogicPos, PreviewPage::aMapOffset, PreviewPage::aPageSize, tools::Rectangle::Bottom(), OutputDevice::DrawRect(), OutputDevice::GetFillColor(), StyleSettings::GetHighContrastMode(), StyleSettings::GetHighlightTextColor(), OutputDevice::GetLineColor(), OutputDevice::GetMapMode(), vcl::Window::GetSettings(), AllSettings::GetStyleSettings(), SwViewShell::GetWin(), tools::Rectangle::Left(), OutputDevice::LogicToPixel(), mrParentViewShell, OutputDevice::PixelToLogic(), tools::Rectangle::Right(), OutputDevice::SetFillColor(), OutputDevice::SetLineColor(), OutputDevice::SetMapMode(), MapMode::SetOrigin(), SwRect::SVRect(), SwAlignRect(), and tools::Rectangle::Top().
Referenced by Paint().
bool SwPagePreviewLayout::Prepare | ( | const sal_uInt16 | _nProposedStartPageNum, |
const Point & | rProposedStartPos, | ||
const Size & | _rPxWinSize, | ||
sal_uInt16 & | _onStartPageNum, | ||
tools::Rectangle & | _orDocPreviewPaintRect, | ||
const bool | _bStartWithPageAtFirstCol = true |
||
) |
prepare paint of page preview
With the valid preview layout settings - calculated and set by method <Init(..)> - the paint of a specific part of the virtual preview document is prepared. The corresponding part is given by either a start page (parameter <_nProposedStartPageNum>) or an absolute position (parameter <_aProposedStartPoint>). The accessibility preview will also be updated via a corresponding method call.
_nProposedStartPageNum | [0..<number of document pages>] input parameter - proposed number of page, which should be painted in the left-top-corner in the current output device. input parameter <_bStartWithPageAtFirstCol> influences, if proposed page is actual painted in the left-top-corner. |
_nProposedStartPos | [(0,0)..<PreviewDocumentSize>] input parameter - proposed absolute position in the virtual preview document, which should be painted in the left-top-corner in the current output device. |
_rPxWinSize | input parameter - pixel size of window the preview will be painted in. |
_onStartPageNum | output parameter - physical number of page, which will be painted in the left-top-corner in the current output device. |
_orDocPreviewPaintRect | output parameter - rectangle of preview document, which will be painted. |
_bStartWithPageAtFirstCol | input parameter with default value "true" - controls, if start page is set to page in first column the proposed start page is located. |
delete parameter _onStartPageVirtNum
Definition at line 274 of file pagepreviewlayout.cxx.
References tools::Rectangle::Bottom(), CalcAdditionalPaintOffset(), CalcDocPreviewPaintRect(), CalcPreviewPages(), ConvertAbsoluteToRelativePageNum(), ConvertRelativeToAbsolutePageNum(), GetColOfPage(), tools::Rectangle::GetHeight(), SwViewShell::GetOut(), GetRowOfPage(), tools::Rectangle::GetWidth(), gnXFree, gnYFree, Size::Height(), Size::IsEmpty(), maPaintedPreviewDocRect, maPaintPreviewDocOffset, maPaintStartPageOffset, maPreviewDocRect, maWinSize, mbBookPreview, mbBookPreviewModeToggled, mbDoesLayoutColsFitIntoWindow, mbDoesLayoutRowsFitIntoWindow, mbInPaint, mbLayoutInfoValid, mbLayoutSizesValid, mbNewLayoutDuringPaint, mbNoPageVisible, mbPaintInfoValid, mnCols, mnColWidth, mnPages, mnPaintPhyStartPageNum, mnPaintStartCol, mnPaintStartRow, mnPreviewLayoutHeight, mnRowHeight, tools::Rectangle::Move(), mrParentViewShell, OutputDevice::PixelToLogic(), Prepare(), tools::Rectangle::Right(), Point::setX(), Point::setY(), tools::Rectangle::TopLeft(), Size::Width(), Point::X(), and Point::Y().
Referenced by SwPagePreviewWin::AdjustPreviewToNewZoom(), SwPagePreviewWin::CalcWish(), SwPagePreviewWin::MovePage(), SwPagePreviewWin::Paint(), Prepare(), SwPagePreviewWin::Scroll(), SetBookPreviewMode(), and SwPagePreviewWin::SetWinSize().
|
inline |
Definition at line 411 of file pagepreviewlayout.hxx.
References mbLayoutInfoValid, mbLayoutSizesValid, and mbPaintInfoValid.
Referenced by GetPreviewDocSize(), and SwPagePreviewWin::RepaintCoreRect().
void SwPagePreviewLayout::ReInit | ( | ) |
method to adjust page preview layout to document changes
Definition at line 251 of file pagepreviewlayout.cxx.
References CalcPreviewLayoutSizes(), ClearPreviewLayoutSizes(), mbLayoutInfoValid, and mbLayoutSizesValid.
Referenced by SwPagePreviewWin::MovePage(), and SetBookPreviewMode().
void SwPagePreviewLayout::Repaint | ( | const tools::Rectangle & | rInvalidCoreRect | ) | const |
repaint pages on page preview
method to invalidate visible pages due to changes in a different view shell.
OD 18.12.2002 #103492#
Definition at line 1158 of file pagepreviewlayout.cxx.
References OutputDevice::GetConnectMetaFile(), SwViewShell::GetOut(), SwViewShell::GetWin(), SwViewShell::Imp(), tools::Rectangle::Intersection(), vcl::Window::Invalidate(), SwViewShellImp::m_bFirstPageInvalid, SwViewShellImp::m_pFirstVisiblePage, maPreviewPages, mbPaintInfoValid, mrParentViewShell, tools::Rectangle::Overlaps(), tools::Rectangle::SetPos(), and tools::Rectangle::TopLeft().
Referenced by SwPagePreviewWin::RepaintCoreRect().
|
inline |
get selected page number
Definition at line 288 of file pagepreviewlayout.hxx.
References mnSelectedPageNum.
Referenced by SwPagePreviewWin::GetStatusStr(), and SwPagePreviewWin::SelectedPage().
bool SwPagePreviewLayout::SetBookPreviewMode | ( | const bool | _bEnableBookPreview, |
sal_uInt16 & | _onStartPageNum, | ||
tools::Rectangle & | _orDocPreviewPaintRect | ||
) |
enable/disable book preview
OD 2004-03-04 #i18143#
Definition at line 682 of file pagepreviewlayout.cxx.
References tools::Rectangle::Bottom(), SwViewShell::GetOut(), OutputDevice::LogicToPixel(), maPaintPreviewDocOffset, maPreviewDocRect, maWinSize, mbBookPreview, mbBookPreviewModeToggled, mrParentViewShell, Prepare(), ReInit(), Point::setY(), and Point::Y().
Referenced by SwPagePreviewWin::SetBookPreviewMode().
|
inline |
set selected page number
Definition at line 294 of file pagepreviewlayout.hxx.
References mnSelectedPageNum.
Referenced by SwPagePreviewWin::SetSelectedPage().
|
friend |
Definition at line 45 of file pagepreviewlayout.hxx.
|
staticconstexprprivate |
number of horizontal and vertical twips for spacing between the pages.
Definition at line 48 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewLayoutSizes(), CalcPreviewPages(), and Prepare().
|
staticconstexprprivate |
Definition at line 49 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewLayoutSizes(), CalcPreviewPages(), GetWinPagesScrollAmount(), and Prepare().
|
private |
Definition at line 92 of file pagepreviewlayout.hxx.
Referenced by CalcAdditionalPaintOffset(), CalcDocPreviewPaintRect(), CalcPreviewPages(), and Clear_().
|
private |
Definition at line 77 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewDataForPage(), CalcPreviewLayoutSizes(), and ClearPreviewLayoutSizes().
|
private |
Definition at line 93 of file pagepreviewlayout.hxx.
Referenced by CalcDocPreviewPaintRect(), Clear_(), GetPreviewStartPosForNewScale(), GetWinPagesScrollAmount(), and Prepare().
|
private |
Definition at line 91 of file pagepreviewlayout.hxx.
Referenced by CalcDocPreviewPaintRect(), Clear_(), Prepare(), and SetBookPreviewMode().
|
private |
Definition at line 90 of file pagepreviewlayout.hxx.
Referenced by CalcAdditionalPaintOffset(), CalcPreviewPages(), Clear_(), and Prepare().
|
private |
Definition at line 78 of file pagepreviewlayout.hxx.
Referenced by CalcDocPreviewPaintRect(), CalcPreviewLayoutSizes(), ClearPreviewLayoutSizes(), GetPreviewDocSize(), GetPreviewStartPosForNewScale(), GetWinPagesScrollAmount(), Prepare(), and SetBookPreviewMode().
|
private |
Definition at line 96 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewPages(), ClearPreviewPageData(), GetPreviewPageByPageNum(), IsPreviewPosInDocPreviewPage(), Paint(), and Repaint().
|
private |
Definition at line 69 of file pagepreviewlayout.hxx.
Referenced by CalcAdditionalPaintOffset(), CalcDocPreviewPaintRect(), CalcPreviewPages(), Clear_(), Init(), Paint(), Prepare(), and SetBookPreviewMode().
|
private |
Definition at line 74 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewLayoutSizes(), CalcPreviewPages(), CalcStartValuesForSelectedPageMove(), ConvertAbsoluteToRelativePageNum(), ConvertRelativeToAbsolutePageNum(), GetColOfPage(), GetRowOfPage(), Prepare(), SetBookPreviewMode(), and SwPagePreviewLayout().
|
private |
Definition at line 75 of file pagepreviewlayout.hxx.
Referenced by Prepare(), SetBookPreviewMode(), and SwPagePreviewLayout().
|
private |
Definition at line 83 of file pagepreviewlayout.hxx.
Referenced by CalcAdditionalPaintOffset(), CalcDocPreviewPaintRect(), CalcStartValuesForSelectedPageMove(), Clear_(), DoesPreviewLayoutColsFitIntoWindow(), and Prepare().
|
private |
Definition at line 84 of file pagepreviewlayout.hxx.
Referenced by CalcAdditionalPaintOffset(), CalcDocPreviewPaintRect(), CalcPreviewPages(), CalcStartValuesForSelectedPageMove(), Clear_(), DoesPreviewLayoutRowsFitIntoWindow(), GetPreviewStartPosForNewScale(), GetWinPagesScrollAmount(), and Prepare().
|
mutableprivate |
#i22014# - internal booleans to indicate, that a new print preview layout has been created during a paint.
Definition at line 100 of file pagepreviewlayout.hxx.
|
private |
boolean indicating, if the layout information (number of columns and rows) are valid.
Definition at line 58 of file pagepreviewlayout.hxx.
Referenced by Clear_(), Init(), Prepare(), PreviewLayoutValid(), and ReInit().
|
private |
boolean indicating, if the calculated print preview layout sizes ( windows size in twips, maximal page size, column width, row height, width and height of a print preview page, size of the print preview document ) are valid
Definition at line 63 of file pagepreviewlayout.hxx.
Referenced by Clear_(), GetWinPagesScrollAmount(), Init(), Prepare(), PreviewLayoutValid(), and ReInit().
|
mutableprivate |
Definition at line 101 of file pagepreviewlayout.hxx.
|
private |
Definition at line 89 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewPages(), Clear_(), and Prepare().
|
private |
boolean indicating, if the paint information ( physical number of start page, start column and row, paint offsets, rectangle visible of the print preview document.
Definition at line 67 of file pagepreviewlayout.hxx.
Referenced by Clear_(), Paint(), Prepare(), PreviewLayoutValid(), and Repaint().
|
private |
Definition at line 103 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewLayoutSizes(), CalcPreviewPages(), ConvertAbsoluteToRelativePageNum(), ConvertRelativeToAbsolutePageNum(), and SwPagePreviewLayout().
|
private |
Definition at line 70 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewLayoutSizes(), CalcPreviewPages(), CalcStartValuesForSelectedPageMove(), Clear_(), GetColOfPage(), GetRowOfPage(), Init(), and Prepare().
|
private |
Definition at line 79 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewLayoutSizes(), CalcPreviewPages(), ClearPreviewLayoutSizes(), and Prepare().
|
private |
Definition at line 72 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewLayoutSizes(), CalcStartValuesForSelectedPageMove(), ClearPreviewLayoutSizes(), and Prepare().
|
private |
Definition at line 86 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewPages(), CalcStartValuesForSelectedPageMove(), Clear_(), and Prepare().
|
private |
Definition at line 87 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewPages(), Clear_(), and Prepare().
|
private |
Definition at line 88 of file pagepreviewlayout.hxx.
Referenced by Clear_(), GetPreviewStartPosForNewScale(), and Prepare().
|
private |
Definition at line 82 of file pagepreviewlayout.hxx.
Referenced by CalcAdditionalPaintOffset(), CalcDocPreviewPaintRect(), CalcPreviewLayoutSizes(), ClearPreviewLayoutSizes(), GetPreviewStartPosForNewScale(), GetWinPagesScrollAmount(), Init(), and Prepare().
|
private |
Definition at line 81 of file pagepreviewlayout.hxx.
Referenced by CalcAdditionalPaintOffset(), CalcDocPreviewPaintRect(), CalcPreviewLayoutSizes(), ClearPreviewLayoutSizes(), GetPreviewStartPosForNewScale(), and Init().
|
private |
Definition at line 80 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewLayoutSizes(), CalcPreviewPages(), ClearPreviewLayoutSizes(), GetPreviewStartPosForNewScale(), GetWinPagesScrollAmount(), and Prepare().
|
private |
Definition at line 71 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewLayoutSizes(), CalcPreviewPages(), CalcStartValuesForSelectedPageMove(), Clear_(), and Init().
|
private |
Definition at line 94 of file pagepreviewlayout.hxx.
Referenced by CalcStartValuesForSelectedPageMove(), Clear_(), MarkNewSelectedPage(), Paint(), SelectedPage(), and SetSelectedPage().
|
private |
top layout frame of the layout for accessing the pages
Definition at line 54 of file pagepreviewlayout.hxx.
Referenced by CalcPreviewLayoutSizes(), CalcPreviewPages(), ConvertAbsoluteToRelativePageNum(), ConvertRelativeToAbsolutePageNum(), and Paint().
|
private |
view shell the print preview is generated for.
Definition at line 52 of file pagepreviewlayout.hxx.
Referenced by ApplyNewZoomAtViewShell(), CalcPreviewLayoutSizes(), CalcPreviewPages(), GetParentViewShell(), Init(), MarkNewSelectedPage(), Paint(), PaintSelectMarkAtPage(), Prepare(), Repaint(), SetBookPreviewMode(), and SwPagePreviewLayout().