LibreOffice Module sc (master) 1
prevwsh.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <scitems.hxx>
23
25#include <sfx2/app.hxx>
26#include <editeng/sizeitem.hxx>
28#include <svx/svdview.hxx>
29#include <sfx2/dispatch.hxx>
30#include <sfx2/objface.hxx>
31#include <sfx2/request.hxx>
32#include <svl/stritem.hxx>
33#include <svl/whiter.hxx>
34#include <vcl/commandevent.hxx>
35#include <vcl/help.hxx>
36#include <vcl/settings.hxx>
37#include <vcl/svapp.hxx>
38#include <tools/urlobj.hxx>
39#include <sfx2/docfile.hxx>
40#include <sfx2/printer.hxx>
41#include <sfx2/viewfrm.hxx>
42#include <sfx2/viewfac.hxx>
44#include <o3tl/string_view.hxx>
45
46#include <drwlayer.hxx>
47#include <prevwsh.hxx>
48#include <preview.hxx>
49#include <printfun.hxx>
50#include <scmod.hxx>
51#include <inputhdl.hxx>
52#include <docsh.hxx>
53#include <tabvwsh.hxx>
54#include <stlpool.hxx>
55#include <editutil.hxx>
56#include <globstr.hrc>
57#include <scresid.hxx>
58#include <sc.hrc>
60#include <viewuno.hxx>
61
62#include <svx/svxdlg.hxx>
63#include <svx/dialogs.hrc>
64
66#include <svx/zoom_def.hxx>
67#include <com/sun/star/document/XDocumentProperties.hpp>
68
69#include <scabstdlg.hxx>
70#include <vcl/EnumContext.hxx>
72
73// for mouse wheel
74#define MINZOOM_SLIDER 10
75#define MAXZOOM_SLIDER 400
76
77#define SC_USERDATA_SEP ';'
78
79using namespace com::sun::star;
80
81#define ShellClass_ScPreviewShell
82#include <scslots.hxx>
83
84#include <memory>
85
86
88
89void ScPreviewShell::InitInterface_Impl()
90{
91 GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
92 SfxVisibilityFlags::Standard|SfxVisibilityFlags::Server|SfxVisibilityFlags::ReadonlyDoc,
93 ToolbarId::Objectbar_Preview);
94
95 GetStaticInterface()->RegisterPopupMenu("preview");
96}
97
99{
101}
102
104{
105 // Find the top-most window, and set the close window handler to intercept
106 // the window close event.
107 vcl::Window* pWin = pParent;
108 while (!pWin->IsSystemWindow())
109 {
110 if (pWin->GetParent())
111 pWin = pWin->GetParent();
112 else
113 break;
114 }
115
116 mpFrameWindow = dynamic_cast<SystemWindow*>(pWin);
117 if (mpFrameWindow)
118 mpFrameWindow->SetCloseHdl(LINK(this, ScPreviewShell, CloseHdl));
119
120 eZoom = SvxZoomType::WHOLEPAGE;
121
124
125 // RTL: no mirroring for horizontal scrollbars
126 pHorScroll->EnableRTL( false );
127
128 pHorScroll->SetScrollHdl(LINK(this, ScPreviewShell, HorzScrollHandler));
129 pVerScroll->SetScrollHdl(LINK(this, ScPreviewShell, VertScrollHandler));
130
131 pPreview = VclPtr<ScPreview>::Create( pParent, pDocShell, this );
132
133 SetPool( &SC_MOD()->GetPool() );
135 StartListening(*pDocShell, DuplicateHandling::Prevent);
136 StartListening(*SfxGetpApp(), DuplicateHandling::Prevent); // #i62045# #i62046# application is needed for Calc's own hints
138 if (pDrawBC)
139 StartListening(*pDrawBC);
140
141 pHorScroll->Show( false );
142 pVerScroll->Show( false );
143 SetName("Preview");
144}
145
147 SfxViewShell* pOldSh) :
149 pDocShell( static_cast<ScDocShell*>(rViewFrame.GetObjectShell()) ),
150 mpFrameWindow(nullptr),
151 nSourceDesignMode( TRISTATE_INDET ),
152 nMaxVertPos(0),
153 nPrevHThumbPos(0),
154 nPrevVThumbPos(0)
155{
156 Construct(&rViewFrame.GetWindow());
158
159 if ( auto pTabViewShell = dynamic_cast<ScTabViewShell*>( pOldSh) )
160 {
161 // store view settings, show table from TabView
164
165 const ScViewData& rData = pTabViewShell->GetViewData();
166 pPreview->SetSelectedTabs(rData.GetMarkData());
167 InitStartTable( rData.GetTabNo() );
168
169 // also have to store the TabView's DesignMode state
170 // (only if draw view exists)
171 SdrView* pDrawView = pTabViewShell->GetScDrawView();
172 if ( pDrawView )
174 = pDrawView->IsDesignMode() ? TRISTATE_TRUE : TRISTATE_FALSE;
175 }
176
177 new ScPreviewObj(this);
178}
179
181{
182 if (mpFrameWindow)
183 mpFrameWindow->SetCloseHdl(Link<SystemWindow&,void>()); // Remove close handler.
184
185 // #108333#; notify Accessibility that Shell is dying and before destroy all
186 BroadcastAccessibility( SfxHint( SfxHintId::Dying ) );
188
190 if (pDrawBC)
191 EndListening(*pDrawBC);
192 EndListening(*SfxGetpApp());
193 EndListening(*pDocShell);
194
195 SetWindow(nullptr);
199
200 // normal mode of operation is switching back to default view in the same frame,
201 // so there's no need to activate any other window here anymore
202}
203
205{
206 pPreview->SetPageNo( pPreview->GetFirstPage(nTab) );
207}
208
209void ScPreviewShell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
210{
211 Size aOutSize( rSize );
212 pPreview->SetPosSizePixel( rPos, aOutSize );
213
214 if ( SvxZoomType::WHOLEPAGE == eZoom )
215 pPreview->SetZoom( pPreview->GetOptimalZoom(false) );
216 else if ( SvxZoomType::PAGEWIDTH == eZoom )
217 pPreview->SetZoom( pPreview->GetOptimalZoom(true) );
218
220}
221
222void ScPreviewShell::InnerResizePixel( const Point &rOfs, const Size &rSize, bool )
223{
224 AdjustPosSizePixel( rOfs,rSize );
225}
226
227void ScPreviewShell::OuterResizePixel( const Point &rOfs, const Size &rSize )
228{
229 AdjustPosSizePixel( rOfs,rSize );
230}
231
233{
235 SCTAB nTab = pPreview->GetTab();
236
237 ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
238 SfxStyleSheetBase* pStyleSheet = pStylePool->Find( rDoc.GetPageStyle( nTab ),
239 SfxStyleFamily::Page );
240 OSL_ENSURE(pStyleSheet,"No style sheet");
241 if (!pStyleSheet) return false;
242 const SfxItemSet* pParamSet = &pStyleSheet->GetItemSet();
243
244 aPageSize = pParamSet->Get(ATTR_PAGE_SIZE).GetSize();
247 return true;
248}
249
251{
252 Size aPageSize;
254
256 tools::Long nBarH = nBarW;
257
258 tools::Long aHeightOffSet = pDevice ? pDevice->PixelToLogic( Size( nBarW, nBarH ), pPreview->GetMapMode() ).Height() : 0;
259 tools::Long aWidthOffSet = aHeightOffSet;
260
261 if (!GetPageSize( aPageSize ))
262 return;
263
264 // for centering, page size without the shadow is used
265 bool bVert = pVerScroll->IsVisible();
266 bool bHori = pHorScroll->IsVisible();
267 Size aWindowSize = pPreview->GetOutDev()->GetOutputSize();
268 Point aPos = pPreview->GetPosPixel();
269 Size aWindowPixelSize = pPreview->GetOutputSizePixel();
270
271 // if we are called from Zoom then we need to compensate for whatever
272 // scrollbars were displayed before the zoom was called
273 if ( bFromZoom )
274 {
275 if ( bVert )
276 {
277 aWindowPixelSize.AdjustWidth(nBarH );
278 aWindowSize.AdjustWidth(aHeightOffSet );
279 }
280 if ( bHori )
281 {
282 aWindowPixelSize.AdjustHeight(nBarW );
283 aWindowSize.AdjustHeight(aWidthOffSet );
284 }
285 }
286
287 // recalculate any needed scrollbars
288 tools::Long nMaxWidthPos = aPageSize.Width() - aWindowSize.Width();
289 bHori = nMaxWidthPos >= 0;
290 tools::Long nMaxHeightPos = aPageSize.Height() - aWindowSize.Height();
291 bVert = nMaxHeightPos >= 0;
292
293 // see if having a scroll bar requires the other
294 if ( bVert != bHori && ( bVert || bHori ) )
295 {
296 if ( bVert && ( (nMaxWidthPos + aWidthOffSet ) > 0 ) )
297 bHori = true;
298 else if ( (nMaxHeightPos + aHeightOffSet ) > 0 )
299 bVert = true;
300 }
301 pHorScroll->Show( bHori );
302 pVerScroll->Show( bVert );
303
304 // make room for needed scrollbars ( and reduce the size
305 // of the preview appropriately )
306 if ( bHori )
307 aWindowPixelSize.AdjustHeight( -nBarW );
308 if ( bVert )
309 aWindowPixelSize.AdjustWidth( -nBarH );
310
311 pPreview->SetSizePixel( aWindowPixelSize );
312 pHorScroll->SetPosSizePixel( Point( aPos.X(), aPos.Y() + aWindowPixelSize.Height() ),
313 Size( aWindowPixelSize.Width(), nBarH ) );
314 pVerScroll->SetPosSizePixel( Point( aPos.X() + aWindowPixelSize.Width(), aPos.Y() ),
315 Size( nBarW, aWindowPixelSize.Height() ) );
317}
318
320{
321 Size aPageSize;
322 if ( !GetPageSize( aPageSize ) )
323 return;
324
325 // for centering, page size without the shadow is used
326
327 Size aWindowSize = pPreview->GetOutDev()->GetOutputSize();
328
329 Point aOfs = pPreview->GetOffset();
330
331 if( pHorScroll )
332 {
333 pHorScroll->SetRange( Range( 0, aPageSize.Width() ) );
334 pHorScroll->SetLineSize( aWindowSize.Width() / 16 );
335 pHorScroll->SetPageSize( aWindowSize.Width() );
336 pHorScroll->SetVisibleSize( aWindowSize.Width() );
337 tools::Long nMaxPos = aPageSize.Width() - aWindowSize.Width();
338 if ( nMaxPos<0 )
339 {
340 // page smaller than window -> center (but put scrollbar to 0)
341 aOfs.setX( 0 );
342 pPreview->SetXOffset( nMaxPos / 2 );
343 }
344 else if (aOfs.X() < 0)
345 {
346 // page larger than window -> never use negative offset
347 aOfs.setX( 0 );
348 pPreview->SetXOffset( 0 );
349 }
350 else if (aOfs.X() > nMaxPos)
351 {
352 // limit offset to align with right edge of window
353 aOfs.setX( nMaxPos );
354 pPreview->SetXOffset(nMaxPos);
355 }
356 pHorScroll->SetThumbPos( aOfs.X() );
357 nPrevHThumbPos = pHorScroll->GetThumbPos();
358 }
359
360 if( !pVerScroll )
361 return;
362
363 tools::Long nPageNo = pPreview->GetPageNo();
364 tools::Long nTotalPages = pPreview->GetTotalPages();
365
366 nMaxVertPos = aPageSize.Height() - aWindowSize.Height();
367 pVerScroll->SetLineSize( aWindowSize.Height() / 16 );
368 pVerScroll->SetPageSize( aWindowSize.Height() );
369 pVerScroll->SetVisibleSize( aWindowSize.Height() );
370 if ( nMaxVertPos < 0 )
371 {
372 // page smaller than window -> center (but put scrollbar to 0)
373 aOfs.setY( 0 );
374 pPreview->SetYOffset( nMaxVertPos / 2 );
375 pVerScroll->SetThumbPos( nPageNo * aWindowSize.Height() );
376 pVerScroll->SetRange( Range( 0, aWindowSize.Height() * nTotalPages ));
377 }
378 else if (aOfs.Y() < 0)
379 {
380 // page larger than window -> never use negative offset
381 pVerScroll->SetRange( Range( 0, aPageSize.Height() ) );
382 aOfs.setY( 0 );
383 pPreview->SetYOffset( 0 );
384 pVerScroll->SetThumbPos( aOfs.Y() );
385 }
386 else if (aOfs.Y() > nMaxVertPos )
387 {
388 // limit offset to align with window bottom
389 pVerScroll->SetRange( Range( 0, aPageSize.Height() ) );
390 aOfs.setY( nMaxVertPos );
391 pPreview->SetYOffset( nMaxVertPos );
392 pVerScroll->SetThumbPos( aOfs.Y() );
393 }
394 nPrevVThumbPos = pVerScroll->GetThumbPos();
395}
396
398{
399 ScrollHandler(pHorScroll);
400}
401
403{
404 ScrollHandler(pVerScroll);
405}
406
408{
409 tools::Long nPos = pScroll->GetThumbPos();
410 tools::Long nMaxRange = pScroll->GetRangeMax();
411 tools::Long nTotalPages = pPreview->GetTotalPages();
412 tools::Long nPageNo = 0;
413 tools::Long nPerPageLength = 0;
414 bool bIsDivide = true;
415
416 if( nTotalPages )
417 nPerPageLength = nMaxRange / nTotalPages;
418
419 if( nPerPageLength )
420 {
421 nPageNo = nPos / nPerPageLength;
422 if( nPos % nPerPageLength )
423 {
424 bIsDivide = false;
425 nPageNo ++;
426 }
427 }
428
429 bool bHoriz = ( pScroll == pHorScroll );
430
431 tools::Long nDelta = bHoriz ? (pHorScroll->GetThumbPos() - nPrevHThumbPos)
432 : (pVerScroll->GetThumbPos() - nPrevVThumbPos);
433
434 if( bHoriz )
435 pPreview->SetXOffset( nPos );
436 else
437 {
438 if( nMaxVertPos > 0 )
439 pPreview->SetYOffset( nPos );
440 else
441 {
442 Point aMousePos = pScroll->OutputToNormalizedScreenPixel( pScroll->GetPointerPosPixel() );
443 Point aPos = pScroll->GetParent()->OutputToNormalizedScreenPixel( pScroll->GetPosPixel() );
444 OUString aHelpStr;
445 tools::Rectangle aRect;
446 QuickHelpFlags nAlign;
447
448 if( nDelta < 0 )
449 {
450 if ( nTotalPages && nPageNo > 0 && !bIsDivide )
451 pPreview->SetPageNo( nPageNo-1 );
452 if( bIsDivide )
453 pPreview->SetPageNo( nPageNo );
454
455 aHelpStr = ScResId( STR_PAGE ) +
456 " " + OUString::number( nPageNo ) +
457 " / " + OUString::number( nTotalPages );
458 }
459 else if( nDelta > 0 )
460 {
461 bool bAllTested = pPreview->AllTested();
462 if ( nTotalPages && ( nPageNo < nTotalPages || !bAllTested ) )
463 pPreview->SetPageNo( nPageNo );
464
465 aHelpStr = ScResId( STR_PAGE ) +
466 " " + OUString::number( nPageNo+1 ) +
467 " / " + OUString::number( nTotalPages );
468 }
469
470 aRect.SetLeft( aPos.X() - 8 );
471 aRect.SetTop( aMousePos.Y() );
472 aRect.SetRight( aRect.Left() );
473 aRect.SetBottom( aRect.Top() );
474 nAlign = QuickHelpFlags::Bottom|QuickHelpFlags::Center;
475 Help::ShowQuickHelp( pScroll->GetParent(), aRect, aHelpStr, nAlign );
476 }
477 }
478}
479
481{
482 ExitPreview();
483}
484
486{
487 bool bDone = false;
488 const CommandWheelData* pData = rCEvt.GetWheelData();
489 if ( pData && pData->GetMode() == CommandWheelMode::ZOOM )
490 {
491 sal_uInt16 nOld = pPreview->GetZoom();
492 sal_uInt16 nNew;
493 if ( pData->GetDelta() < 0 )
494 nNew = std::max( MINZOOM, basegfx::zoomtools::zoomOut( nOld ));
495 else
496 nNew = std::min( MAXZOOM, basegfx::zoomtools::zoomIn( nOld ));
497
498 if ( nNew != nOld )
499 {
500 eZoom = SvxZoomType::PERCENT;
501 pPreview->SetZoom( nNew );
502 }
503
504 bDone = true;
505 }
506 else
507 {
508 bDone = pPreview->HandleScrollCommand( rCEvt, pHorScroll, pVerScroll );
509 }
510
511 return bDone;
512}
513
515{
516 return pDocShell->GetPrinter(bCreate);
517}
518
519sal_uInt16 ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags )
520{
521 return pDocShell->SetPrinter( pNewPrinter, nDiffFlags );
522}
523
525{
526 return true;
527}
528
529std::unique_ptr<SfxTabPage> ScPreviewShell::CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rOptions)
530{
532 ::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc(RID_SC_TP_PRINT);
533 if ( ScTpPrintOptionsCreate )
534 return ScTpPrintOptionsCreate(pPage, pController, &rOptions);
535 return nullptr;
536}
537
539{
541
543
544 if (bMDI)
545 {
546 // InputHdl is now mostly Null, no more assertion!
547 ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
548 if ( pInputHdl )
549 pInputHdl->NotifyChange( nullptr );
550 }
551
552 SfxShell::Activate(bMDI);
553}
554
556{
557 sal_uInt16 nSlot = rReq.GetSlot();
558 const SfxItemSet* pReqArgs = rReq.GetArgs();
559
560 switch ( nSlot )
561 {
562 case SID_FORMATPAGE:
563 case SID_STATUS_PAGESTYLE:
564 case SID_HFEDIT:
565 pDocShell->ExecutePageStyle( *this, rReq, pPreview->GetTab() );
566 break;
567 case SID_REPAINT:
568 pPreview->Invalidate();
569 rReq.Done();
570 break;
571 case SID_PREV_TABLE: // Accelerator
572 case SID_PREVIEW_PREVIOUS:
573 {
574 tools::Long nPage = pPreview->GetPageNo();
575 tools::Long nTotal = pPreview->GetTotalPages();
576 if (nTotal && nPage > 0)
577 pPreview->SetPageNo( nPage-1 );
578 }
579 break;
580 case SID_NEXT_TABLE: // Accelerator
581 case SID_PREVIEW_NEXT:
582 {
583 bool bAllTested = pPreview->AllTested();
584 tools::Long nPage = pPreview->GetPageNo();
585 tools::Long nTotal = pPreview->GetTotalPages();
586 if (nTotal && (nPage+1 < nTotal || !bAllTested))
587 pPreview->SetPageNo( nPage+1 );
588 }
589 break;
590 case SID_CURSORTOPOFFILE: // Accelerator
591 case SID_PREVIEW_FIRST:
592 {
593 tools::Long nPage = pPreview->GetPageNo();
594 tools::Long nTotal = pPreview->GetTotalPages();
595 if (nTotal && nPage != 0)
596 pPreview->SetPageNo( 0 );
597 }
598 break;
599 case SID_CURSORENDOFFILE: // Accelerator
600 case SID_PREVIEW_LAST:
601 {
602 if (!pPreview->AllTested())
603 pPreview->CalcAll();
604
605 tools::Long nPage = pPreview->GetPageNo();
606 tools::Long nTotal = pPreview->GetTotalPages();
607 if (nTotal && nPage+1 != nTotal)
608 pPreview->SetPageNo( nTotal-1 );
609 }
610 break;
611 case SID_ATTR_ZOOM:
612 case FID_SCALE:
613 {
614 sal_uInt16 nZoom = 100;
615 bool bCancel = false;
616
617 eZoom = SvxZoomType::PERCENT;
618
619 if ( pReqArgs )
620 {
621
622 const SvxZoomItem& rZoomItem = pReqArgs->Get(SID_ATTR_ZOOM);
623
624 eZoom = rZoomItem.GetType();
625 nZoom = rZoomItem.GetValue();
626 }
627 else
628 {
630 SvxZoomItem aZoomItem( SvxZoomType::PERCENT, pPreview->GetZoom(), SID_ATTR_ZOOM );
631
632 aSet.Put( aZoomItem );
635 pDlg->SetLimits( 20, 400 );
636 pDlg->HideButton( ZoomButtonId::OPTIMAL );
637 bCancel = ( RET_CANCEL == pDlg->Execute() );
638
639 if ( !bCancel )
640 {
641 const SvxZoomItem& rZoomItem = pDlg->GetOutputItemSet()->
642 Get( SID_ATTR_ZOOM );
643
644 eZoom = rZoomItem.GetType();
645 nZoom = rZoomItem.GetValue();
646 }
647 }
648
649 if ( !bCancel )
650 {
651 switch ( eZoom )
652 {
653 case SvxZoomType::OPTIMAL:
654 case SvxZoomType::WHOLEPAGE:
655 nZoom = pPreview->GetOptimalZoom(false);
656 break;
657 case SvxZoomType::PAGEWIDTH:
658 nZoom = pPreview->GetOptimalZoom(true);
659 break;
660 default:
661 {
662 // added to avoid warnings
663 }
664 }
665
666 pPreview->SetZoom( nZoom );
667 rReq.Done();
668 }
669 }
670 break;
671 case SID_ZOOM_IN:
672 {
673 sal_uInt16 nNew = pPreview->GetZoom() + 20 ;
674 nNew -= nNew % 20;
675 pPreview->SetZoom( nNew );
676 eZoom = SvxZoomType::PERCENT;
677 rReq.Done();
678 }
679 break;
680 case SID_ZOOM_OUT:
681 {
682 sal_uInt16 nNew = pPreview->GetZoom() - 1;
683 nNew -= nNew % 20;
684 pPreview->SetZoom( nNew );
685 eZoom = SvxZoomType::PERCENT;
686 rReq.Done();
687 }
688 break;
689 case SID_PREVIEW_MARGIN:
690 {
691 bool bMargin = pPreview->GetPageMargins();
692 pPreview->SetPageMargins( !bMargin );
693 pPreview->Invalidate();
694 rReq.Done();
695 }
696 break;
697 case SID_ATTR_ZOOMSLIDER:
698 {
699 const SvxZoomSliderItem* pItem;
700 eZoom = SvxZoomType::PERCENT;
701 if( pReqArgs && (pItem = pReqArgs->GetItemIfSet( SID_ATTR_ZOOMSLIDER )) )
702 {
703 const sal_uInt16 nCurrentZoom = pItem->GetValue();
704 if( nCurrentZoom )
705 {
706 pPreview->SetZoom( nCurrentZoom );
707 rReq.Done();
708 }
709 }
710 }
711 break;
712 case SID_PREVIEW_SCALINGFACTOR:
713 {
714 const SvxZoomSliderItem* pItem;
715 SCTAB nTab = pPreview->GetTab();
716 OUString aOldName = pDocShell->GetDocument().GetPageStyle( pPreview->GetTab() );
718 SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SfxStyleFamily::Page );
719 OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" );
720
721 if ( pReqArgs && pStyleSheet && (pItem = pReqArgs->GetItemIfSet( SID_PREVIEW_SCALINGFACTOR )) )
722 {
723 const sal_uInt16 nCurrentZoom = pItem->GetValue();
724 SfxItemSet& rSet = pStyleSheet->GetItemSet();
725 rSet.Put( SfxUInt16Item( ATTR_PAGE_SCALE, nCurrentZoom ) );
726 ScPrintFunc aPrintFunc( pDocShell, pDocShell->GetPrinter(), nTab );
727 aPrintFunc.UpdatePages();
728 rReq.Done();
729 }
731 }
732 break;
733 case SID_PRINTPREVIEW:
734 case SID_PREVIEW_CLOSE:
735 // print preview is now always in the same frame as the tab view
736 // -> always switch this frame back to normal view
737 // (ScTabViewShell ctor reads stored view data)
738
739 ExitPreview();
740 break;
741 case SID_CURSORPAGEUP:
742 case SID_CURSORPAGEDOWN:
743 case SID_CURSORHOME:
744 case SID_CURSOREND:
745 case SID_CURSORUP:
746 case SID_CURSORDOWN:
747 case SID_CURSORLEFT:
748 case SID_CURSORRIGHT:
749 DoScroll( nSlot );
750 break;
751 case SID_CANCEL:
752 if( ScViewUtil::IsFullScreen( *this ) )
753 ScViewUtil::SetFullScreen( *this, false );
754 break;
755
756 default:
757 break;
758 }
759}
760
762{
763 pPreview->SetInGetState(true);
764
765 SCTAB nTab = pPreview->GetTab();
766 tools::Long nPage = pPreview->GetPageNo();
767 tools::Long nTotal = pPreview->GetTotalPages();
768 sal_uInt16 nZoom = pPreview->GetZoom();
769 bool bAllTested = pPreview->AllTested();
770
771 SfxWhichIter aIter(rSet);
772 sal_uInt16 nWhich = aIter.FirstWhich();
773 while ( nWhich )
774 {
775 switch (nWhich)
776 {
777 case SID_STATUS_PAGESTYLE:
778 case SID_HFEDIT:
780 break;
781 case SID_UNDO:
782 case SID_REDO:
783 case SID_REPEAT:
784 case SID_SAVEDOC:
785 case SID_SAVEASDOC:
786 case SID_MAIL_SENDDOC:
787 case SID_VIEW_DATA_SOURCE_BROWSER:
788 case SID_QUITAPP:
789 rSet.DisableItem(nWhich);
790 break;
791 case SID_PREVIEW_PREVIOUS:
792 case SID_PREVIEW_FIRST:
793 if (!nTotal || nPage==0)
794 rSet.DisableItem(nWhich);
795 break;
796 case SID_PREVIEW_NEXT:
797 case SID_PREVIEW_LAST:
798 if (bAllTested)
799 if (!nTotal || nPage==nTotal-1)
800 rSet.DisableItem(nWhich);
801 break;
802 case SID_ZOOM_IN:
803 if (nZoom >= 400)
804 rSet.DisableItem(nWhich);
805 break;
806 case SID_ZOOM_OUT:
807 if (nZoom <= 20)
808 rSet.DisableItem(nWhich);
809 break;
810 case SID_ATTR_ZOOM:
811 {
812 SvxZoomItem aZoom( eZoom, nZoom, TypedWhichId<SvxZoomItem>(nWhich) );
813 aZoom.SetValueSet( SvxZoomEnableFlags::ALL & ~SvxZoomEnableFlags::OPTIMAL );
814 rSet.Put( aZoom );
815 }
816 break;
817 case SID_ATTR_ZOOMSLIDER:
818 {
819 SvxZoomSliderItem aZoomSliderItem( nZoom, MINZOOM, MAXZOOM, SID_ATTR_ZOOMSLIDER );
820 aZoomSliderItem.AddSnappingPoint( 100 );
821 rSet.Put( aZoomSliderItem );
822 }
823 break;
824 case SID_PREVIEW_SCALINGFACTOR:
825 {
826 if( pDocShell->IsReadOnly() )
827 rSet.DisableItem( nWhich );
828 else
829 {
830 OUString aOldName = pDocShell->GetDocument().GetPageStyle( pPreview->GetTab() );
832 SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SfxStyleFamily::Page );
833 OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" );
834
835 if ( pStyleSheet )
836 {
837 SfxItemSet& rStyleSet = pStyleSheet->GetItemSet();
838 sal_uInt16 nCurrentZoom = rStyleSet.Get(ATTR_PAGE_SCALE).GetValue();
839 if( nCurrentZoom )
840 {
841 SvxZoomSliderItem aZoomSliderItem( nCurrentZoom, MINZOOM_SLIDER, MAXZOOM_SLIDER, SID_PREVIEW_SCALINGFACTOR );
842 aZoomSliderItem.AddSnappingPoint( 100 );
843 rSet.Put( aZoomSliderItem );
844 }
845 else
846 rSet.DisableItem( nWhich );
847 }
848 }
849 }
850 break;
851 case SID_STATUS_DOCPOS:
852 rSet.Put( SfxStringItem( nWhich, pPreview->GetPosString() ) );
853 break;
854 case SID_PRINTPREVIEW:
855 rSet.Put( SfxBoolItem( nWhich, true ) );
856 break;
857 case SID_FORMATPAGE:
858 case SID_PREVIEW_MARGIN:
859 if( pDocShell->IsReadOnly() )
860 rSet.DisableItem( nWhich );
861 break;
862 }
863
864 nWhich = aIter.NextWhich();
865 }
866
867 pPreview->SetInGetState(false);
868}
869
871{
873 SCTAB nTab = pPreview->GetTab();
874 OUString aTmp;
875 rDoc.GetName(nTab, aTmp);
876 rData.aTabName = aTmp;
877
878 if( pDocShell->getDocProperties()->getTitle().getLength() != 0 )
879 rData.aTitle = pDocShell->getDocProperties()->getTitle();
880 else
881 rData.aTitle = pDocShell->GetTitle();
882
883 const INetURLObject& rURLObj = pDocShell->GetMedium()->GetURLObject();
885 if ( !rData.aLongDocName.isEmpty() )
887 else
888 rData.aShortDocName = rData.aLongDocName = rData.aTitle;
889 rData.nPageNo = pPreview->GetPageNo() + 1;
890
891 bool bAllTested = pPreview->AllTested();
892 if (bAllTested)
893 rData.nTotalPages = pPreview->GetTotalPages();
894 else
895 rData.nTotalPages = 99;
896
897 // the dialog knows eNumType
898}
899
900void ScPreviewShell::WriteUserData(OUString& rData, bool /* bBrowse */)
901{
902 // nZoom
903 // nPageNo
904
905 rData = OUString::number(pPreview->GetZoom())
906 + OUStringChar(SC_USERDATA_SEP)
907 + OUString::number(pPreview->GetPageNo());
908}
909
910void ScPreviewShell::ReadUserData(const OUString& rData, bool /* bBrowse */)
911{
912 if (!rData.isEmpty())
913 {
914 sal_Int32 nIndex = 0;
915 pPreview->SetZoom(static_cast<sal_uInt16>(o3tl::toInt32(o3tl::getToken(rData, 0, SC_USERDATA_SEP, nIndex))));
917 eZoom = SvxZoomType::PERCENT;
918 }
919}
920
921void ScPreviewShell::WriteUserDataSequence(uno::Sequence < beans::PropertyValue >& rSeq)
922{
923 // tdf#130559: don't export preview view data if active
924 if (comphelper::IsContextFlagActive("NoPreviewData"))
925 return;
926
927 rSeq.realloc(3);
928 beans::PropertyValue* pSeq = rSeq.getArray();
929 sal_uInt16 nViewID(GetViewFrame().GetCurViewId());
930 pSeq[0].Name = SC_VIEWID;
931 pSeq[0].Value <<= SC_VIEW + OUString::number(nViewID);
932 pSeq[1].Name = SC_ZOOMVALUE;
933 pSeq[1].Value <<= sal_Int32 (pPreview->GetZoom());
934 pSeq[2].Name = "PageNumber";
935 pSeq[2].Value <<= pPreview->GetPageNo();
936
937 // Common SdrModel processing
938 if (ScDrawLayer* pDrawLayer = GetDocument().GetDrawLayer())
939 pDrawLayer->WriteUserDataSequence(rSeq);
940}
941
942void ScPreviewShell::ReadUserDataSequence(const uno::Sequence < beans::PropertyValue >& rSeq)
943{
944 for (const auto& propval : rSeq)
945 {
946 if (propval.Name == SC_ZOOMVALUE)
947 {
948 sal_Int32 nTemp = 0;
949 if (propval.Value >>= nTemp)
950 pPreview->SetZoom(sal_uInt16(nTemp));
951 }
952 else if (propval.Name == "PageNumber")
953 {
954 sal_Int32 nTemp = 0;
955 if (propval.Value >>= nTemp)
956 pPreview->SetPageNo(nTemp);
957 }
958 // Fallback to common SdrModel processing
959 else
961 }
962}
963
964void ScPreviewShell::DoScroll( sal_uInt16 nMode )
965{
966 Point aCurPos, aPrevPos;
967
968 tools::Long nHRange = pHorScroll->GetRange().Max();
969 tools::Long nHLine = pHorScroll->GetLineSize();
970 tools::Long nHPage = pHorScroll->GetPageSize();
971 tools::Long nVRange = pVerScroll->GetRange().Max();
972 tools::Long nVLine = pVerScroll->GetLineSize();
973 tools::Long nVPage = pVerScroll->GetPageSize();
974
975 aCurPos.setX( pHorScroll->GetThumbPos() );
976 aCurPos.setY( pVerScroll->GetThumbPos() );
977 aPrevPos = aCurPos;
978
979 tools::Long nThumbPos = pVerScroll->GetThumbPos();
980 tools::Long nRangeMax = pVerScroll->GetRangeMax();
981
982 switch( nMode )
983 {
984 case SID_CURSORUP:
985 if( nMaxVertPos<0 )
986 {
987 tools::Long nPage = pPreview->GetPageNo();
988
989 if( nPage>0 )
990 {
991 SfxViewFrame& rSfxViewFrame = GetViewFrame();
992 SfxRequest aSfxRequest(rSfxViewFrame, SID_PREVIEW_PREVIOUS);
993 Execute( aSfxRequest );
994 }
995 }
996 else
997 aCurPos.AdjustY( -nVLine );
998 break;
999 case SID_CURSORDOWN:
1000 if( nMaxVertPos<0 )
1001 {
1002 tools::Long nPage = pPreview->GetPageNo();
1003 tools::Long nTotal = pPreview->GetTotalPages();
1004
1005 // before testing for last page, make sure all page counts are calculated
1006 if ( nPage+1 == nTotal && !pPreview->AllTested() )
1007 {
1008 pPreview->CalcAll();
1009 nTotal = pPreview->GetTotalPages();
1010 }
1011
1012 if( nPage<nTotal-1 )
1013 {
1014 SfxViewFrame& rSfxViewFrame = GetViewFrame();
1015 SfxRequest aSfxRequest(rSfxViewFrame, SID_PREVIEW_NEXT);
1016 Execute( aSfxRequest );
1017 }
1018 }
1019 else
1020 aCurPos.AdjustY(nVLine );
1021 break;
1022 case SID_CURSORLEFT:
1023 aCurPos.AdjustX( -nHLine );
1024 break;
1025 case SID_CURSORRIGHT:
1026 aCurPos.AdjustX(nHLine );
1027 break;
1028 case SID_CURSORPAGEUP:
1029 if( nThumbPos==0 || nMaxVertPos<0 )
1030 {
1031 tools::Long nPage = pPreview->GetPageNo();
1032
1033 if( nPage>0 )
1034 {
1035 SfxViewFrame& rSfxViewFrame = GetViewFrame();
1036 SfxRequest aSfxRequest(rSfxViewFrame, SID_PREVIEW_PREVIOUS);
1037 Execute( aSfxRequest );
1038 aCurPos.setY( nVRange );
1039 }
1040 }
1041 else
1042 aCurPos.AdjustY( -nVPage );
1043 break;
1044 case SID_CURSORPAGEDOWN:
1045 if( (std::abs(nVPage+nThumbPos-nRangeMax)<10) || nMaxVertPos<0 )
1046 {
1047 tools::Long nPage = pPreview->GetPageNo();
1048 tools::Long nTotal = pPreview->GetTotalPages();
1049
1050 // before testing for last page, make sure all page counts are calculated
1051 if ( nPage+1 == nTotal && !pPreview->AllTested() )
1052 {
1053 pPreview->CalcAll();
1054 nTotal = pPreview->GetTotalPages();
1055 }
1056 if( nPage<nTotal-1 )
1057 {
1058 SfxViewFrame& rSfxViewFrame = GetViewFrame();
1059 SfxRequest aSfxRequest(rSfxViewFrame, SID_PREVIEW_NEXT);
1060 Execute( aSfxRequest );
1061 aCurPos.setY( 0 );
1062 }
1063 }
1064 else
1065 aCurPos.AdjustY(nVPage );
1066 break;
1067 case SID_CURSORHOME:
1068 if( nMaxVertPos<0 )
1069 {
1070 tools::Long nPage = pPreview->GetPageNo();
1071 tools::Long nTotal = pPreview->GetTotalPages();
1072 if( nTotal && nPage != 0 )
1073 {
1074 SfxViewFrame& rSfxViewFrame = GetViewFrame();
1075 SfxRequest aSfxRequest(rSfxViewFrame, SID_PREVIEW_FIRST);
1076 Execute( aSfxRequest );
1077 }
1078 }
1079 else
1080 {
1081 aCurPos.setY( 0 );
1082 aCurPos.setX( 0 );
1083 }
1084 break;
1085 case SID_CURSOREND:
1086 if( nMaxVertPos<0 )
1087 {
1088 if( !pPreview->AllTested() )
1089 pPreview->CalcAll();
1090 tools::Long nPage = pPreview->GetPageNo();
1091 tools::Long nTotal = pPreview->GetTotalPages();
1092 if( nTotal && nPage+1 != nTotal )
1093 {
1094 SfxViewFrame& rSfxViewFrame = GetViewFrame();
1095 SfxRequest aSfxRequest(rSfxViewFrame, SID_PREVIEW_LAST);
1096 Execute( aSfxRequest );
1097 }
1098 }
1099 else
1100 {
1101 aCurPos.setY( nVRange );
1102 aCurPos.setX( nHRange );
1103 }
1104 break;
1105 }
1106
1107 // nHRange-nHPage might be negative, that's why we check for < 0 afterwards
1108
1109 if( aCurPos.Y() > (nVRange-nVPage) )
1110 aCurPos.setY( nVRange-nVPage );
1111 if( aCurPos.Y() < 0 )
1112 aCurPos.setY( 0 );
1113 if( aCurPos.X() > (nHRange-nHPage) )
1114 aCurPos.setX( nHRange-nHPage );
1115 if( aCurPos.X() < 0 )
1116 aCurPos.setX( 0 );
1117
1118 if( nMaxVertPos>=0 )
1119 {
1120 if( aCurPos.Y() != aPrevPos.Y() )
1121 {
1122 pVerScroll->SetThumbPos( aCurPos.Y() );
1123 nPrevVThumbPos = pVerScroll->GetThumbPos();
1124 pPreview->SetYOffset( aCurPos.Y() );
1125 }
1126 }
1127
1128 if( aCurPos.X() != aPrevPos.X() )
1129 {
1130 pHorScroll->SetThumbPos( aCurPos.X() );
1131 nPrevHThumbPos = pHorScroll->GetThumbPos();
1132 pPreview->SetXOffset( aCurPos.X() );
1133 }
1134
1135}
1136
1138{
1139 GetViewFrame().GetDispatcher()->Execute(SID_VIEWSHELL0, SfxCallMode::ASYNCHRON);
1140}
1141
1143{
1146
1148}
1149
1151{
1154 else
1155 {
1156 OSL_FAIL("no accessibility broadcaster?");
1157 }
1158}
1159
1161{
1163 pAccessibilityBroadcaster->Broadcast( rHint );
1164}
1165
1167{
1168 return pAccessibilityBroadcaster && pAccessibilityBroadcaster->HasListeners();
1169}
1170
1172{
1173 return pPreview->GetLocationData();
1174}
1175
1177{
1178 return pDocShell->GetDocument();
1179}
1180
1181/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral SC_ZOOMVALUE
constexpr OUStringLiteral SC_VIEWID
SfxApplication * SfxGetpApp()
const StyleSettings & GetStyleSettings() const
static OutputDevice * GetDefaultDevice()
const CommandWheelData * GetWheelData() const
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
OUString GetLastName(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
static SC_DLLPUBLIC ScAbstractDialogFactory * Create()
Definition: scabstdlg.cxx:37
sal_uInt16 SetPrinter(VclPtr< SfxPrinter > const &pNewPrinter, SfxPrinterChangeFlags nDiffFlags=SFX_PRINTER_ALL)
Definition: docsh3.cxx:471
const ScDocument & GetDocument() const
Definition: docsh.hxx:219
ScDrawLayer * MakeDrawLayer()
Definition: docsh2.cxx:169
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
Definition: docsh3.cxx:451
void ExecutePageStyle(const SfxViewShell &rCaller, SfxRequest &rReq, SCTAB nCurTab)
Definition: docsh4.cxx:1820
void GetStatePageStyle(SfxItemSet &rSet, SCTAB nCurTab)
Definition: docsh4.cxx:2039
SC_DLLPUBLIC OUString GetPageStyle(SCTAB nTab) const
Definition: document.cxx:6176
SfxBroadcaster * GetDrawBroadcaster()
Definition: documen9.cxx:56
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6055
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:204
void NotifyChange(const ScInputHdlState *pState, bool bForce=false, ScTabViewShell *pSourceSh=nullptr, bool bStopEditing=true)
Definition: inputhdl.cxx:4172
virtual bool HasPrintOptionsPage() const override
Definition: prevwsh.cxx:524
const ScPreviewLocationData & GetLocationData()
Definition: prevwsh.cxx:1171
VclPtr< ScrollAdaptor > pVerScroll
Definition: prevwsh.hxx:47
void UpdateScrollBars()
Definition: prevwsh.cxx:319
void AddAccessibilityObject(SfxListener &rObject)
Definition: prevwsh.cxx:1142
void GetState(SfxItemSet &rSet)
Definition: prevwsh.cxx:761
void ExitPreview()
Definition: prevwsh.cxx:1137
virtual void WriteUserData(OUString &, bool bBrowse=false) override
Definition: prevwsh.cxx:900
void ScrollHandler(ScrollAdaptor *pScrollBar)
Definition: prevwsh.cxx:407
ScDocument & GetDocument()
Definition: prevwsh.cxx:1176
tools::Long nPrevVThumbPos
Definition: prevwsh.hxx:53
TriState nSourceDesignMode
Definition: prevwsh.hxx:49
VclPtr< ScrollAdaptor > pHorScroll
Definition: prevwsh.hxx:46
VclPtr< ScPreview > pPreview
Definition: prevwsh.hxx:45
bool HasAccessibilityObjects() const
Definition: prevwsh.cxx:1166
std::unique_ptr< SfxBroadcaster > pAccessibilityBroadcaster
Definition: prevwsh.hxx:55
ScDocShell * pDocShell
Definition: prevwsh.hxx:42
virtual void OuterResizePixel(const Point &rOfs, const Size &rSize) override
Definition: prevwsh.cxx:227
virtual ~ScPreviewShell() override
Definition: prevwsh.cxx:180
virtual SfxPrinter * GetPrinter(bool bCreate=false) override
Definition: prevwsh.cxx:514
SvxZoomType eZoom
Definition: prevwsh.hxx:50
void FillFieldData(ScHeaderFieldData &rData)
Definition: prevwsh.cxx:870
tools::Long nMaxVertPos
Definition: prevwsh.hxx:51
void Construct(vcl::Window *pParent)
Definition: prevwsh.cxx:103
bool GetPageSize(Size &aPageSize)
Definition: prevwsh.cxx:232
virtual sal_uInt16 SetPrinter(SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags=SFX_PRINTER_ALL) override
Definition: prevwsh.cxx:519
VclPtr< SystemWindow > mpFrameWindow
Definition: prevwsh.hxx:44
virtual void ReadUserData(const OUString &, bool bBrowse=false) override
Definition: prevwsh.cxx:910
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: prevwsh.cxx:921
void UpdateNeededScrollBars(bool bFromZoom)
Definition: prevwsh.cxx:250
virtual void Activate(bool bMDI) override
Definition: prevwsh.cxx:538
void DoScroll(sal_uInt16 nMode)
Definition: prevwsh.cxx:964
ScPreviewShell(SfxViewFrame &rViewFrame, SfxViewShell *pOldSh)
Definition: prevwsh.cxx:146
void Execute(SfxRequest &rReq)
Definition: prevwsh.cxx:555
void BroadcastAccessibility(const SfxHint &rHint)
Definition: prevwsh.cxx:1160
virtual void InnerResizePixel(const Point &rOfs, const Size &rSize, bool inplaceEditModeChange) override
Definition: prevwsh.cxx:222
bool ScrollCommand(const CommandEvent &rCEvt)
Definition: prevwsh.cxx:485
void AdjustPosSizePixel(const Point &rPos, const Size &rSize)
Definition: prevwsh.cxx:209
void RemoveAccessibilityObject(SfxListener &rObject)
Definition: prevwsh.cxx:1150
virtual std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions) override
Definition: prevwsh.cxx:529
void InitStartTable(SCTAB nTab)
Definition: prevwsh.cxx:204
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: prevwsh.cxx:942
tools::Long nPrevHThumbPos
Definition: prevwsh.hxx:52
bool UpdatePages()
Definition: printfun.cxx:2426
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3146
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
static void SetFullScreen(const SfxViewShell &rViewShell, bool bSet)
Enters or leaves full screen mode at the passed view shell.
Definition: viewutil.cxx:343
static bool IsFullScreen(const SfxViewShell &rViewShell)
Returns true, if the passed view shell is in full screen mode.
Definition: viewutil.cxx:331
virtual tools::Long GetThumbPos() const override
virtual tools::Long GetRangeMax() const override
bool IsDesignMode() const
void ReadUserDataSequenceValue(const css::beans::PropertyValue *pValue)
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)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) 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)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
const INetURLObject & GetURLObject() const
css::uno::Reference< css::document::XDocumentProperties > getDocProperties() const
bool IsReadOnly() const
SfxMedium * GetMedium() const
OUString GetTitle(sal_uInt16 nMaxLen=0) const
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
virtual void Activate(bool bMDI)
void SetContextName(const OUString &rsContextName)
void SetPool(SfxItemPool *pNewPool)
void SetName(const OUString &rName)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
virtual SfxItemSet & GetItemSet()
vcl::Window & GetWindow() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
virtual void Activate(bool IsMDIActivate) override
SfxViewFrame & GetViewFrame() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Get(const css::uno::Reference< css::frame::XController > &i_rController)
void SetWindow(vcl::Window *pViewPort)
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
sal_Int32 GetScrollBarSize() const
virtual VclPtr< AbstractSvxZoomDialog > CreateSvxZoomDialog(weld::Window *pParent, const SfxItemSet &rCoreSet)=0
static SvxAbstractDialogFactory * Create()
void SetValueSet(SvxZoomEnableFlags nValues)
SvxZoomType GetType() const
void AddSnappingPoint(sal_Int32 nNew)
void disposeAndClear()
static VclPtr< reference_type > Create(Arg &&... arg)
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
constexpr void SetRight(tools::Long v)
constexpr void SetBottom(tools::Long v)
constexpr tools::Long Left() const
static const OUString & GetContextName(const Context eContext)
vcl::Window * GetParent() const
const AllSettings & GetSettings() const
bool IsSystemWindow() const
TRISTATE_FALSE
TRISTATE_INDET
TRISTATE_TRUE
const sal_uInt16 MINZOOM
Definition: global.hxx:79
@ StartListening
If set, cloned formula cells will start to listen to the document.
const sal_uInt16 MAXZOOM
Definition: global.hxx:80
QuickHelpFlags
sal_Int32 nIndex
sal_uInt16 nPos
std::unique_ptr< sal_Int32[]> pData
sal_uInt16 zoomIn(sal_uInt16 nCurrent)
sal_uInt16 zoomOut(sal_uInt16 nCurrent)
bool IsContextFlagActive(const OUString &sName)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
long Long
#define SFX_OBJECTBAR_OBJECT
IMPL_LINK_NOARG(ScPreviewShell, HorzScrollHandler, weld::Scrollbar &, void)
Definition: prevwsh.cxx:397
#define MAXZOOM_SLIDER
Definition: prevwsh.cxx:75
#define MINZOOM_SLIDER
Definition: prevwsh.cxx:74
#define SC_USERDATA_SEP
Definition: prevwsh.cxx:77
SFX_IMPL_NAMED_VIEWFACTORY(ScPreviewShell, "PrintPreview")
Definition: prevwsh.cxx:98
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALE(175)
constexpr TypedWhichId< SvxSizeItem > ATTR_PAGE_SIZE(161)
#define SC_MOD()
Definition: scmod.hxx:247
static SfxItemSet & rSet
#define SFX_IMPL_INTERFACE(Class, SuperClass)
OUString aLongDocName
Definition: editutil.hxx:202
tools::Long nPageNo
Definition: editutil.hxx:206
OUString aShortDocName
Definition: editutil.hxx:203
OUString aTabName
Definition: editutil.hxx:204
tools::Long nTotalPages
Definition: editutil.hxx:207
sal_Int16 SCTAB
Definition: types.hxx:22
RET_CANCEL
SfxPrinterChangeFlags
#define SFX_VIEW_REGISTRATION(DocClass)
SfxViewShellFlags