20#include <config_wasm_strip.h>
42#include <osl/diagnose.h>
64#define ShellClass_SwPagePreview
87 GetStaticInterface()->RegisterPopupMenu(
"preview");
89 SfxVisibilityFlags::Standard|SfxVisibilityFlags::Client|SfxVisibilityFlags::FullScreen|SfxVisibilityFlags::ReadonlyDoc,
90 ToolbarId::PView_Toolbox);
94#define SWVIEWFLAGS SfxViewShellFlags::HAS_PRINTOPTIONS
96#define MIN_PREVIEW_ZOOM 25
97#define MAX_PREVIEW_ZOOM 600
101 static const sal_uInt16 aZoomArr[] =
103 25, 50, 75, 100, 150, 200, 400, 600
105 const int nZoomArrSize =
static_cast<int>(
SAL_N_ELEMENTS(aZoomArr));
108 for(sal_uInt16
i : aZoomArr)
116 for(
int i = nZoomArrSize - 1;
i >= 0; --
i)
118 if(nCurrentZoom > aZoomArr[
i] || !
i)
127 static sal_uInt16
const aInval[] =
141 std::unique_ptr<weld::SpinButton> m_xRowEdit;
142 std::unique_ptr<weld::SpinButton> m_xColEdit;
146 : GenericDialogController(rParent.
GetFrameWeld(),
"modules/swriter/ui/previewzoomdialog.ui",
"PreviewZoomDialog")
148 , m_xRowEdit(m_xBuilder->weld_spin_button(
"rows"))
149 , m_xColEdit(m_xBuilder->weld_spin_button(
"cols"))
151 m_xRowEdit->set_value(rParent.
GetRow());
152 m_xColEdit->set_value(rParent.
GetCol());
159 m_rParent.CalcWish(m_xRowEdit->get_value(), m_xColEdit->get_value());
169 , mpViewShell(nullptr)
171 , mbCalcScaleForPreviewLayout(true)
173 , mpPgPreviewLayout(nullptr)
226 const sal_Int16 nOldCol =
mnCol;
244 if( (1 == nOldCol) != (1 ==
mnCol) )
249 static sal_uInt16 aInval[] =
251 SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN,
274 bool bPaintPageAtFirstCol =
true;
281 const sal_uInt16 nNewAbsSttPage = nRelSttPage - nPages > 0 ?
284 nNewSttPage = nNewAbsSttPage;
287 const sal_uInt16 nNewRelSelPage = nRelSelPage - nPages > 0 ?
288 nRelSelPage - nPages :
298 nNewSttPage =
std::min(nNewAbsSttPage, nPageCount);
307 nNewSttPage = nDefSttPg;
312 nNewSttPage = nPageCount;
321 bPaintPageAtFirstCol =
false;
328 bPaintPageAtFirstCol =
false;
338 if( nNewSttPage > nPageCount )
339 nNewSttPage = nPageCount;
357 static sal_uInt16 aInval[] =
405 if( nVirtPageNum && nVirtPageNum != nPageNum )
407 aStatusStr = OUString::number(nVirtPageNum) +
" " ;
409 return aStatusStr + OUString::number(nPageNum) +
" / " + OUString::number(nPageCnt);
415 bool bHandled =
false;
418 sal_uInt16 nSlot = 0;
421 case KEY_ADD : nSlot = SID_ZOOM_IN;
break;
429 nSlot, SfxCallMode::ASYNCHRON );
433 Window::KeyInput( rKEvt );
438 bool bCallBase =
true;
441 case CommandEventId::ContextMenu:
446 case CommandEventId::Wheel:
447 case CommandEventId::StartAutoScroll:
448 case CommandEventId::AutoScroll:
467 Window::Command( rCEvt );
478 bool bPosInEmptyPage;
479 sal_uInt16 nNewSelectedPage;
482 aDocPos, bPosInEmptyPage, nNewSelectedPage );
483 if ( bIsDocPos && rMEvt.
GetClicks() == 2 )
487 OUString sNewCursorPos = OUString::number( aDocPos.
X() ) +
";" +
488 OUString::number( aDocPos.
Y() ) +
";";
493 SfxCallMode::ASYNCHRON );
495 else if ( bIsDocPos || bPosInEmptyPage )
506 static sal_uInt16 aInval[] =
554 Window::DataChanged( rDCEvt );
558 case DataChangedEventType::SETTINGS:
563 if( rDCEvt.
GetFlags() & AllSettingsFlags::STYLE )
569 case DataChangedEventType::PRINTER:
570 case DataChangedEventType::DISPLAY:
571 case DataChangedEventType::FONTS:
572 case DataChangedEventType::FONTSUBSTITUTION:
593 const int eMvMode = _bPgUp ?
602 sal_uInt16 nNewSelectedPageNum = 0;
609 if ( (
m_pViewWin->SelectedPage() - nVisPages) > 0 )
610 nNewSelectedPageNum =
m_pViewWin->SelectedPage() - nVisPages;
612 nNewSelectedPageNum = 1;
616 m_pViewWin->GetPaintedPreviewDocRect().Top() );
624 nNewSelectedPageNum =
m_pViewWin->SelectedPage() + nVisPages;
631 m_pViewWin->GetPaintedPreviewDocRect().Bottom() ) );
634 if ( nNewSelectedPageNum != 0 )
636 m_pViewWin->SetSelectedPage( nNewSelectedPageNum );
640 static sal_uInt16 aInval[] =
660 bool bRefresh =
true;
664 case SID_REFRESH_VIEW:
672 if( pArgs && pArgs->
Count() >= 2 )
674 sal_Int16 nCols = pArgs->
Get(SID_ATTR_TABLE_COLUMN).GetValue();
675 sal_Int16 nRows = pArgs->
Get(SID_ATTR_TABLE_ROW).GetValue();
697 if (
m_pViewWin->SetBookPreviewMode( bBookPreview ) )
702 static sal_uInt16 aInval[] =
733 SvxZoomEnableFlags::N50|
734 SvxZoomEnableFlags::N75|
735 SvxZoomEnableFlags::N100|
736 SvxZoomEnableFlags::N150|
737 SvxZoomEnableFlags::N200|
738 SvxZoomEnableFlags::WHOLEPAGE);
739 aCoreSet.
Put( aZoom );
746 pArgs = pDlg->GetOutputItemSet();
751 sal_uInt16 nZoomFactor = USHRT_MAX;
754 eType = pZoomItem->GetType();
755 nZoomFactor = pZoomItem->GetValue();
758 nZoomFactor = pPreviewItem->GetValue();
759 if(USHRT_MAX != nZoomFactor)
764 case SID_ATTR_ZOOMSLIDER :
769 if ( pArgs && (pItem = pArgs->
GetItemIfSet(SID_ATTR_ZOOMSLIDER ) ) )
771 const sal_uInt16 nCurrentZoom = pItem->GetValue();
772 SetZoom( SvxZoomType::PERCENT, nCurrentZoom );
790 sal_uInt16 nNewSelectedPage;
791 sal_uInt16 nNewStartPage;
793 sal_Int16 nHoriMove = 0;
794 sal_Int16 nVertMove = 0;
803 nNewSelectedPage, nNewStartPage, aNewStartPos );
804 if (
m_pViewWin->SelectedPage() != nNewSelectedPage )
815 m_pViewWin->SetSelectedPage( nNewSelectedPage );
821 static sal_uInt16 aInval[] =
844 if( pArgs && pArgs->
Count())
863 case FN_END_OF_DOCUMENT:
866 bool bRet =
ChgPage( eMvMode );
882 if((pPrinter->GetOrientation() == Orientation::Landscape)
884 pPrinter->SetOrientation(pPPVPD->
GetLandscape() ? Orientation::Landscape : Orientation::Portrait);
893 case SID_PRINTDOCDIRECT:
900 case SID_PRINTPREVIEW:
906 case FN_INSERT_BREAK:
908 sal_uInt16 nSelPage =
m_pViewWin->SelectedPage();
916 SfxCallMode::ASYNCHRON );
920 OSL_ENSURE(
false,
"wrong dispatcher");
932 OSL_ENSURE(nWhich,
"empty set");
939 case SID_BROWSER_MODE:
949 case FN_END_OF_DOCUMENT:
985 SvxZoomEnableFlags::N50|
986 SvxZoomEnableFlags::N75|
987 SvxZoomEnableFlags::N100|
988 SvxZoomEnableFlags::N150|
989 SvxZoomEnableFlags::N200);
993 case SID_ATTR_ZOOMSLIDER :
996 const sal_uInt16 nCurrentZoom = pVOpt->
GetZoom();
1019 case SID_ATTR_VIEWLAYOUT:
1045 if( SfxItemState::DISABLED == aSet.
GetItemState( SID_PRINTDOC,
false ))
1047 else if( SfxItemState::SET == aSet.
GetItemState( SID_PRINTDOC,
1056 case SID_PRINTPREVIEW:
1061 case SID_PRINTDOCDIRECT:
1101 bool bIsModified = pESh !=
nullptr && pESh->
IsModified();
1129#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1140 if( !bIsModified && pESh !=
nullptr )
1147 m_nNewPage(USHRT_MAX),
1148 m_sPageStr(
SwResId(STR_PAGE)),
1149 m_pHScrollbar(nullptr),
1150 m_pVScrollbar(nullptr),
1152 mbResetFormDesignMode( false ),
1153 mbFormDesignModeToReset( false )
1167 if (pF == &rViewFrame)
1176 pVS = pPagePreview->GetViewShell();
1181 pVS = pView->GetWrtShellPtr();
1190 sal_uInt16 nPhysPg, nVirtPg;
1191 static_cast<SwCursorShell*
>(pVS)->GetPageNum( nPhysPg, nVirtPg,
true,
false );
1192 if( 1 !=
m_pViewWin->GetCol() && 1 == nPhysPg )
1222 pVShell->
SetWin(
nullptr);
1246 assert(!ppScrollbar);
1257 ppScrollbar->ExtendedShow();
1263 bool bChg =
m_pViewWin->MovePage( eMvMode ) ||
1273 if( bUpdateScrollbar )
1277 static sal_uInt16 aInval[] =
1300 rToFill.
Right() = nTmp;
1395 ScrollHdl(rScrollbar,
true);
1400 ScrollHdl(rScrollbar,
false);
1413 GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow())
1420 sStateStr += OUString::number( nThmbPos );
1431 QuickHelpFlags::Right|QuickHelpFlags::VCenter);
1442 bool bInvalidateWin =
true;
1448 if (
GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow() )
1462 bInvalidateWin =
false;
1479 const sal_Int16 nPageDiff = nThmbPos -
m_pViewWin->SelectedPage();
1481 sal_Int16 nWinPagesToScroll = nPageDiff / nVisPages;
1482 if ( nPageDiff % nVisPages )
1485 nPageDiff < 0 ? --nWinPagesToScroll : ++nWinPagesToScroll;
1497 bInvalidateWin =
false;
1512 static sal_uInt16 aInval[] =
1520 if ( bInvalidateWin )
1557 bool bShowVScrollbar =
false, bShowHScrollbar =
false;
1561 if(
GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow())
1584 ++aScrollbarRange.
Max();
1586 aScrollbarRange.
Max() += ( nVisPages - 1 );
1594 const Size& rPreviewSize =
1603 bShowVScrollbar =
true;
1607 bShowVScrollbar =
false;
1614 const Size& rPreviewSize =
1620 bShowHScrollbar =
true;
1634 bShowHScrollbar =
false;
1648 return m_pViewWin->GetViewShell()->getIDocumentDeviceAccess().getPrinter( bCreate );
1655 if ( pOld && pOld->IsPrinting() )
1659 if( ( SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP ) & nDiffFlags )
1662 if( nDiffFlags & SfxPrinterChangeFlags::PRINTER )
1665 if ( ( nDiffFlags & SfxPrinterChangeFlags::OPTIONS ) == SfxPrinterChangeFlags::OPTIONS )
1668 const bool bChgOri = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION);
1669 const bool bChgSize = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE);
1670 if ( bChgOri || bChgSize )
1685 static sal_uInt16 aInval[] =
1687 SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE,
1688 SID_RULER_BORDERS, SID_RULER_PAGE_POS, 0
1690#if OSL_DEBUG_LEVEL > 0
1692 const sal_uInt16* pPtr = aInval + 1;
1694 OSL_ENSURE( *(pPtr - 1) < *pPtr,
"wrong sorting!" );
1742 if ( _eZoomType == SvxZoomType::WHOLEPAGE )
1753 else if ( _nZoomFactor != 0 )
1756 Fraction aNewScale( _nZoomFactor, 100 );
1764 Point aNewPaintStartPos =
1795 if( pWData && CommandWheelMode::ZOOM == pWData->
GetMode() )
1801 const sal_uInt16 nOffset = 10;
1814 SetZoom(SvxZoomType::PERCENT, nFactor);
1823uno::Reference< css::accessibility::XAccessible >
1827#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1828 OSL_ENSURE(
GetViewShell() !=
nullptr,
"We need a view shell" );
1829 css::uno::Reference< css::accessibility::XAccessible > xAcc =
GetAccessible(
false );
1883 if ( aOpt.
GetZoom() != nFactor ||
static const AllSettings & GetSettings()
CommandEventId GetCommand() const
const CommandWheelData * GetWheelData() const
const Point & GetMousePosPixel() const
bool IsMouseEvent() const
tools::Long GetDelta() const
CommandWheelMode GetMode() const
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
static bool IsQuickHelpEnabled()
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual void setPrinter(SfxPrinter *pP, bool bDeleteOld, bool bCallPrtDataChanged)=0
Set the printer at the document.
const vcl::KeyCode & GetKeyCode() const
void SetScaleY(const Fraction &rScaleY)
const Fraction & GetScaleX() const
void SetScaleX(const Fraction &rScaleX)
sal_uInt16 GetModifier() const
sal_uInt16 GetClicks() const
sal_uInt16 GetButtons() const
const Point & GetPosPixel() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
const MapMode & GetMapMode() const
void SetOutDevViewType(OutDevViewType eOutDevViewType)
constexpr tools::Long Y() const
void setY(tools::Long nY)
constexpr tools::Long X() const
void disposeAndReset(reference_type *pBody)
bool IsDesignMode() const
void SetAnimationEnabled(bool bEnable=true)
void SetState(const SfxItemSet &rSet)
void Update(sal_uInt16 nId)
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
void ExecutePopup(const OUString &rResName, vcl::Window *pWin=nullptr, const Point *pPos=nullptr)
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
void SetSlot(sal_uInt16 nNewSlot)
void SetReturnValue(const SfxPoolItem &)
void Done(bool bRemove=false)
const SfxPoolItem * GetSlotState(sal_uInt16 nSlotId, const SfxInterface *pIF=nullptr, SfxItemSet *pStateSet=nullptr)
SfxItemPool & GetPool() const
virtual void Activate(bool bMDI)
void SetContextName(const OUString &rsContextName)
virtual SfxInterface * GetInterface() const
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
SfxViewShell * GetViewShell() const
void SetName(const OUString &rName)
vcl::Window & GetWindow() const
SfxBindings & GetBindings()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxDispatcher * GetDispatcher()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
virtual SfxObjectShell * GetObjectShell() override
weld::Window * GetFrameWeld() const
virtual void Activate(bool IsMDIActivate) override
virtual void WriteUserData(OUString &, bool bBrowse=false)
void SetBorderPixel(const SvBorder &rBorder)
SfxViewFrame & GetViewFrame() const
virtual bool KeyInput(const KeyEvent &rKeyEvent)
void SetWindow(vcl::Window *pViewPort)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
virtual VclPtr< AbstractSvxZoomDialog > CreateSvxZoomDialog(weld::Window *pParent, const SfxItemSet &rCoreSet)=0
static SvxAbstractDialogFactory * Create()
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
void SetValueSet(SvxZoomEnableFlags nValues)
void AddSnappingPoint(sal_Int32 nNew)
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
SwDoc * GetDoc()
returns Doc. But be careful!
void StartAllAction()
For all views of this document.
bool IsModified() const
Changes in document?
page preview functionality in the writer
sal_uInt16 SelectedPage()
get selected page number
void MarkNewSelectedPage(const sal_uInt16 _nSelectedPage)
paint to mark new selected page
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
void Repaint(const tools::Rectangle &rInvalidCoreRect) const
repaint pages on page preview
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.
SwViewShell & GetParentViewShell()
Size GetPreviewDocSize() const
void SetSelectedPage(sal_uInt16 _nSelectedPageNum)
set selected page number
void ReInit()
method to adjust page preview layout to document changes
bool SetBookPreviewMode(const bool _bEnableBookPreview, sal_uInt16 &_onStartPageNum, tools::Rectangle &_orDocPreviewPaintRect)
enable/disable book preview
SwTwips GetWinPagesScrollAmount(const sal_Int16 _nWinPagesToScroll) const
determine preview window page scroll amount
void Init(const sal_uInt16 _nCols, const sal_uInt16 _nRows, const Size &_rPxWinSize)
init page preview layout
bool IsPageVisible(const sal_uInt16 _nPageNum) const
determines, if page with given page number is visible in preview
bool Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rOutRect) const
paint prepared preview
sal_uInt16 ConvertRelativeToAbsolutePageNum(sal_uInt16 _nRelPageNum) const
Convert relative to absolute page numbers (see PrintEmptyPages)
bool DoesPreviewLayoutRowsFitIntoWindow() const
bool IsPreviewPosInDocPreviewPage(const Point &rPreviewPos, Point &_orDocPos, bool &_obPosInEmptyPage, sal_uInt16 &_onPageNum) const
checks, if given position is inside a shown document page
sal_uInt16 ConvertAbsoluteToRelativePageNum(sal_uInt16 _nAbsPageNum) const
Convert absolute to relative page numbers (see PrintEmptyPages)
sal_uInt16 GetVirtPageNumByPageNum(sal_uInt16 _nPageNum) const
get virtual page number by its physical page number
bool PreviewLayoutValid() const
Point GetPreviewStartPosForNewScale(const Fraction &_aNewScale, const Fraction &_aOldScale, const Size &_aNewWinSize) const
calculate start position for new scale
bool DoesPreviewLayoutColsFitIntoWindow() const
bool GetLandscape() const
Provides the VCL widget that is used for the main area of the File -> Print Preview window.
OUString GetStatusStr(sal_uInt16 nPageCount) const
void SetPagePreview(sal_Int16 nRow, sal_Int16 nCol)
void SetWinSize(const Size &rNewSize)
void SetSelectedPage(sal_uInt16 _nSelectedPageNum)
set selected page number in document preview
sal_uInt16 GetDefSttPage() const
void SetViewShell(SwViewShell *pShell)
void CalcWish(sal_Int16 nNewRow, sal_Int16 nNewCol)
virtual void Command(const CommandEvent &rCEvt) override
bool SetBookPreviewMode(const bool _bBookPreview)
Method to enable/disable book preview.
sal_uInt16 SelectedPage() const
get selected page number of document preview
void Scroll(tools::Long nXMove, tools::Long nYMove, ScrollFlags nFlags=ScrollFlags::NONE) override
pixel scrolling - horizontally always or vertically when less than the desired number of rows fits in...
virtual void KeyInput(const KeyEvent &) override
void RepaintCoreRect(const SwRect &rRect)
bool MovePage(int eMoveMode)
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
SwViewShell * mpViewShell
bool mbCalcScaleForPreviewLayout
void AdjustPreviewToNewZoom(const sal_uInt16 _nZoomFactor, const SvxZoomType _eZoomType)
Method to adjust preview to a new zoom factor paint of preview is prepared for a new zoom factor Zoom...
SwViewShell * GetViewShell() const
SwPagePreviewWin(vcl::Window *pParent, SwPagePreview &rView)
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual void DataChanged(const DataChangedEvent &) override
tools::Rectangle maPaintedPreviewDocRect
virtual ~SwPagePreviewWin() override
SwPagePreviewLayout * mpPgPreviewLayout
void EnableHScrollbar(bool bEnable)
SAL_DLLPRIVATE void Init()
VclPtr< SwScrollbar > m_pHScrollbar
virtual void OuterResizePixel(const Point &rOfs, const Size &rSize) override
tools::Rectangle m_aVisArea
VclPtr< SwPagePreviewWin > m_pViewWin
void SetZoom(SvxZoomType eSet, sal_uInt16 nFactor)
SAL_DLLPRIVATE bool ChgPage(int eMvMode, bool bUpdateScrollbar=true)
sal_uInt16 GetPageCount() const
VclPtr< SwScrollbar > m_pVScrollbar
SAL_DLLPRIVATE Point AlignToPixel(const Point &rPt) const
SwPagePreview(SfxViewFrame &rFrame, SfxViewShell *)
virtual SAL_DLLPRIVATE bool HasPrintOptionsPage() const override
void SetNewCursorPos(const OUString &rStr)
virtual void InnerResizePixel(const Point &rOfs, const Size &rSize, bool inplaceEditModeChange) override
static void StateUndo(SfxItemSet &)
bool mbResetFormDesignMode
SwDocShell * GetDocShell()
void SetVisArea(const tools::Rectangle &)
SAL_DLLPRIVATE void ScrollHdl(weld::Scrollbar &, bool bHorizontal)
SAL_DLLPRIVATE void ExecPgUpAndPgDown(const bool _bPgUp, SfxRequest *_pReq)
Helper method to execute SfxRequest FN_PAGE_UP and FN_PAGE_DOWN.
void DocSzChgd(const Size &rNewSize)
SwViewShell * GetViewShell() const
bool HandleWheelCommands(const CommandEvent &)
virtual ~SwPagePreview() override
void SetVScrollbarThumbPos(const sal_uInt16 _nNewThumbPos)
Adjust position of vertical scrollbar.
virtual SAL_DLLPRIVATE sal_uInt16 SetPrinter(SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags=SFX_PRINTER_ALL) override
void ShowVScrollbar(bool bShow)
SAL_DLLPRIVATE void CalcAndSetBorderPixel(SvBorder &rToFill)
void Activate(bool bMDI) override
virtual SAL_DLLPRIVATE SfxPrinter * GetPrinter(bool bCreate=false) override
virtual SAL_DLLPRIVATE std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions) override
void GetState(SfxItemSet &)
void Execute(SfxRequest &)
SAL_DLLPRIVATE void CreateScrollbar(bool bHori)
bool mbFormDesignModeToReset
void EnableVScrollbar(bool bEnable)
SAL_DLLPRIVATE void EndScrollHdl(weld::Scrollbar &, bool bHorizontal)
void ApplyAccessibilityOptions()
void ShowHScrollbar(bool bShow)
Of course Writer needs its own rectangles.
void Pos(const Point &rNew)
void SSize(const Size &rNew)
void SetPagePreview(bool bSet)
void SetLineBreak(bool b)
void SetHideWhitespaceMode(bool bMode)
void SetPagePrevCol(sal_uInt8 n)
void SetViewHRuler(bool b)
SvxZoomType GetZoomType() const
void SetShowHiddenChar(bool b)
void SetHardBlank(bool b)
void SetColumnBreak(bool b)
sal_uInt16 GetZoom() const
bool IsPagePrevBookview() const
void SetPageBreak(bool b)
void SetZoomType(SvxZoomType eZoom_)
void SetZoom(sal_uInt16 n)
sal_uInt8 GetPagePrevCol() const
void SetParagraph(bool b)
sal_uInt8 GetPagePrevRow() const
void SetPagePrevRow(sal_uInt8 n)
void SetGridVisible(bool b)
void SetShowHiddenField(bool b)
void SetShowBookmarks(bool const b)
bool IsViewHScrollBar() const
void SetOnlineSpell(bool b)
bool IsViewVScrollBar() const
void SetViewVRuler(bool b)
void SetShowHiddenPara(bool b)
void SetFieldName(bool b)
const SwViewOption * GetViewOptions() const
SwPagePreviewLayout * PagePreviewLayout()
void setOutputToWindow(bool bOutputToWindow)
virtual void ApplyViewOptions(const SwViewOption &rOpt)
void ChgAllPageOrientation(Orientation eOri)
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
void ApplyAccessibilityOptions()
void InvalidateLayout(bool bSizeChanged)
SwRootFrame * GetLayout() const
sal_uInt16 GetNumPages() const
vcl::Window * GetWin() const
void ChgAllPageSize(Size const &rSz)
void SetWin(vcl::Window *win)
void AdjustOptionsForPagePreview(SwPrintData const &rPrintOptions)
adjust view options for page preview
virtual void CalcLayout()
void SetSfxViewShell(SfxViewShell *pNew)
css::uno::Reference< css::accessibility::XAccessible > CreateAccessiblePreview()
void ShowPreviewSelection(sal_uInt16 nSelPage)
static VclPtr< reference_type > Create(Arg &&... arg)
static const OUString & GetContextName(const Context eContext)
sal_uInt16 GetCode() const
sal_uInt16 GetModifier() const
const Wallpaper & GetBackground() const
Point LogicToPixel(const Point &rLogicPt) const
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
const MapMode & GetMapMode() const
::OutputDevice const * GetOutDev() const
Point PixelToLogic(const Point &rDevicePt) const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
Size GetOutputSizePixel() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
void SetHelpId(const OUString &)
#define FN_SHOW_MULTIPLE_PAGES
#define SID_JUMP_TO_SPECIFIC_PAGE
#define FN_START_OF_DOCUMENT
#define FN_SHOW_TWO_PAGES
#define FN_SHOW_SINGLE_PAGE
#define FN_PRINT_PAGEPREVIEW
#define FN_CLOSE_PAGEPREVIEW
#define COMMAND_WHEEL_PAGESCROLL
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
virtual SfxBindings & GetBindings() override
constexpr OUStringLiteral HID_PAGEPREVIEW
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_ADD
constexpr sal_uInt16 KEY_SUBTRACT
#define LINK(Instance, Class, Member)
#define SAL_N_ELEMENTS(arr)
std::unique_ptr< sal_Int32[]> pData
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwNodeOffset abs(const SwNodeOffset &a)
#define SFX_OBJECTBAR_OBJECT
IMPL_LINK(SwPagePreview, HoriScrollHdl, weld::Scrollbar &, rScrollbar, void)
SFX_IMPL_NAMED_VIEWFACTORY(SwPagePreview, "PrintPreview")
static void lcl_InvalidateZoomSlots(SfxBindings &rBindings)
static sal_uInt16 lcl_GetNextZoomStep(sal_uInt16 nCurrentZoom, bool bZoomIn)
#define SFX_IMPL_INTERFACE(Class, SuperClass)
OUString SwResId(TranslateId aId)
const std::u16string_view aStringList[]
void ViewResizePixel(const vcl::RenderContext &rRef, const Point &rOfst, const Size &rSize, const Size &rEditSz, SwScrollbar &rVScrollbar, SwScrollbar &rHScrollbar, SvxRuler *pVRuler=nullptr, SvxRuler *pHRuler=nullptr, bool bVRulerRight=false)
void SetAppPrintOptions(SwViewShell *pSh, bool bWeb)
std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions, bool bPreview)
#define VSHELLFLAG_ISPREVIEW
#define SFX_PRINTERROR_BUSY
#define SFX_VIEW_REGISTRATION(DocClass)
WinBits const WB_CLIPCHILDREN