20#include <com/sun/star/embed/EmbedVerbs.hpp>
21#include <com/sun/star/embed/XEmbeddedObject.hpp>
29#include <svx/svxids.hrc>
39#include <osl/diagnose.h>
94 sal_uInt16 nCurPage = (pPage->
GetPageNum() - 1) / 2;
127 VirtHScrollHdl(mpHorizontalScrollBar);
151 aVisArea.
SetPos(aVisAreaPos);
175 VirtVScrollHdl(mpVerticalScrollBar);
186 sal_uInt16 nCurPage = (pPage->
GetPageNum() - 1) >> 1;
187 sal_uInt16 nNewPage =
static_cast<sal_uInt16
>(pVScroll->
GetThumbPos())/256;
188 if( nCurPage != nNewPage )
208 aVisArea.
SetPos(aVisAreaPos);
286 aVisArea.
SetPos(aVisAreaPos);
375 aNewPos.
setX( aPos.
X() );
376 aNewPos.
setY( aPos.
Y() );
404 const Point& rWinPos,
bool bUpdate)
446 mpContentWindow->InvertTracking(rRect, ShowTrackFlags::Object | ShowTrackFlags::TrackWindow);
454 bool bBackgroundFullSize)
456 const sal_uInt16 nMasterPageCnt(
GetDoc()->GetMasterSdPageCount(ePageKind));
457 const sal_uInt16 nPageCnt(
GetDoc()->GetSdPageCount(ePageKind));
459 if(0 == nPageCnt && 0 == nMasterPageCnt)
464 std::unique_ptr<SdUndoGroup> pUndoGroup;
469 pUndoGroup->SetComment(
SdResId(STR_UNDO_CHANGE_PAGEFORMAT));
485 bBackgroundFullSize);
500 SdPage* pPage(0 != nPageCnt
501 ?
GetDoc()->GetSdPage(0, ePageKind)
502 :
GetDoc()->GetMasterSdPage(0, ePageKind));
505 const Point aPageOrg(nWidth, nHeight / 2);
506 const Size aViewSize(nWidth * 3, nHeight * 2);
513 if (
GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
530 if(
nullptr != pViewShell)
552 OSL_ASSERT (pViewShell!=
nullptr);
585 bool bReturn =
false;
632 OSL_ASSERT (pViewShell!=
nullptr);
633 bool bChangeDefaultsForChart =
false;
635 uno::Reference < embed::XEmbeddedObject > xObj = pObj->
GetObjRef();
643 if(
aName ==
"StarChart" ||
aName ==
"StarOrg" )
648 bChangeDefaultsForChart =
true;
651 else if(
aName ==
"StarCalc" )
656 else if(
aName ==
"StarMath" )
673 SfxCallMode::SYNCHRON | SfxCallMode::RECORD);
691 if (!
aName.isEmpty())
705 if ( pObj->
GetAspect() != embed::Aspects::MSOLE_ICON )
710 xObj->setVisualAreaSize( pObj->
GetAspect(), aSz );
715 nVerb = embed::EmbedVerbs::MS_OLEVERB_SHOW;
746 const Point aDelta(rBoundRect.Center() - aRect.
Center());
747 aRect.
Move(aDelta.
X(), aDelta.
Y());
755 aObjAreaSize = aDrawSize;
768 if( bChangeDefaultsForChart && xObj.is())
775 SID_NAVIGATOR_STATE,
true);
802 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
858 DropTargetHelper& rTargetHelper,
880 const sal_Int32
nIndex = rSequence.getLength();
881 rSequence.realloc(
nIndex + 1 );
882 auto pSequence = rSequence.getArray();
892 pSequence[
nIndex].Value <<=
"view" + OUString::number(
static_cast<sal_uInt16
>(nViewID));
static void AdaptDefaultsForChart(const css::uno::Reference< css::embed::XEmbeddedObject > &xEmbObj)
static DialogMask HandleError(ErrCode nId, weld::Window *pParent=nullptr, DialogMask nMask=DialogMask::MAX)
void ReduceInaccurate(unsigned nSignificantBits)
HelpEventMode GetMode() const
void HideCursor(bool bDeactivate=false)
void ShowCursor(bool bGotoCursor=true, bool bActivate=false)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
void AdaptPageSizeForAllPages(const Size &rNewSize, PageKind ePageKind, SdUndoGroup *pUndoGroup=nullptr, tools::Long nLeft=0, tools::Long nRight=0, tools::Long nUpper=0, tools::Long nLower=0, bool bScaleAll=false, Orientation eOrientation=Orientation::Landscape, sal_uInt16 nPaperBin=0, bool bBackgroundFullSize=false)
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
PageKind GetPageKind() const
void CreateTitleAndLayout(bool bInit=false, bool bCreate=false)
void SetWorkArea(const tools::Rectangle &rRect)
const Fraction & GetUIScale() const
const OutlinerView * GetTextEditOutlinerView() const
virtual bool IsTextEdit() const final override
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
void SetEmptyPresObj(bool bEpt)
virtual const tools::Rectangle & GetCurrentBoundRect() const
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
sal_Int64 GetAspect() const
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
const OUString & GetProgName() const
void SetObjRef(const css::uno::Reference< css::embed::XEmbeddedObject > &rNewObjRef)
Size GetOrigObjSize(MapMode const *pTargetMapMode=nullptr) const
void SetPersistName(const OUString &rPersistName, SvxOle2Shape *pCreator=nullptr)
void SetPageOrigin(const Point &rOrg)
sal_uInt16 GetPageNum() const
sal_Int32 GetUpperBorder() const
sal_Int32 GetLeftBorder() const
void VisAreaChanged(const OutputDevice *pOut)
SdrPageView * GetSdrPageView() const
void SetActualWin(const OutputDevice *pWin)
virtual const tools::Rectangle & GetLogicRect() const override
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)
bool SetObjArea(const tools::Rectangle &)
void SetSizeScale(const Fraction &rScaleWidth, const Fraction &rScaleHeight)
ErrCode DoVerb(sal_Int32 nVerb)
comphelper::EmbeddedObjectContainer & GetEmbeddedObjectContainer() const
void SetWaitCursor(bool bSet) const
virtual void SetVisArea(const tools::Rectangle &rVisArea)
void SetVerbs(const css::uno::Sequence< css::embed::VerbDescriptor > &aVerbs)
virtual SfxUndoManager * GetUndoManager()
SfxViewShell * GetViewShell() const
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
virtual SfxObjectShell * GetObjectShell() override
SfxViewFrame & GetViewFrame() const
SfxInPlaceClient * FindIPClient(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, vcl::Window *pObjParentWin) const
vcl::Window * GetWindow() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
css::uno::Sequence< sal_Int8 > GetByteSequence() const
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, OUString &, OUString const *pBaseURL=nullptr)
virtual ::tools::Rectangle GetVisArea(sal_uInt16 nAspect) const override
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &)
void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &)
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
Local derivation of the SfxHint class that defines some hint ids that are used by the ViewShell class...
Base class of the stacked shell hierarchy.
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
VclPtr< SvxRuler > mpHorizontalRuler
Horizontal ruler is not shown by default.
VclPtr< ScrollAdaptor > mpVerticalScrollBar
Vertical scroll bar for whole document is always visible.
bool IsMainViewShell() const
Return <TRUE> when the called view shell is the main sub shell of its ViewShellBase object,...
const rtl::Reference< FuPoor > & GetCurrentFunction() const
Point const & GetViewOrigin() const
bool IsPageFlipMode() const
SdDrawDocument * GetDoc() const
bool RequestHelp(const HelpEvent &rEvt)
virtual void SetZoom(::tools::Long nZoom)
Set zoom factor for all split windows.
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer)
virtual void VirtHScrollHdl(ScrollAdaptor *pHScroll)
virtual scroll handler for horizontal Scrollbars
virtual void UpdateScrollBars()
Set internal values of all scroll bars that determine thumb size and position.
void SetWinViewPos(const Point &rWinPos)
virtual bool ActivateObject(SdrOle2Obj *pObj, sal_Int32 nVerb)
void DrawMarkRect(const ::tools::Rectangle &rRect) const
Draw a selection rectangle with the ?provided pen on all split windows.
virtual VclPtr< SvxRuler > CreateHRuler(::sd::Window *pWin)
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer)
void Scroll(::tools::Long nX, ::tools::Long nY)
VclPtr< SvxRuler > mpVerticalRuler
Vertical ruler is not shown by default.
virtual SdPage * GetActualPage()=0
virtual void WriteFrameViewData()
void SetPageSizeAndBorder(PageKind ePageKind, const Size &rNewSize, ::tools::Long nLeft, ::tools::Long nRight, ::tools::Long nUpper, ::tools::Long nLower, bool bScaleAll, Orientation eOrient, sal_uInt16 nPaperBin, bool bBackgroundFullSize)
const ::tools::Rectangle & GetAllWindowRect()
Return the rectangle that encloses all windows of the view.
void SetRuler(bool bRuler)
Switch ruler on/off.
void SetActiveWindow(::sd::Window *pWindow)
Set the active window.
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &)
void ScrollLines(::tools::Long nX, ::tools::Long nY)
Scroll a specific number of lines.
virtual void VisAreaChanged(const ::tools::Rectangle &rRect)
this method is called when the visible area of the view from this viewshell is changed
void InvalidateWindows()
Invalidate all split windows below the ?provided rectangle.
VclPtr< ::sd::Window > mpActiveWindow
The active window.
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
::sd::View * GetView() const
virtual void VirtVScrollHdl(ScrollAdaptor *pVScroll)
handling for vertical Scrollbars
virtual VclPtr< SvxRuler > CreateVRuler(::sd::Window *pWin)
void SetFrameView(FrameView *pFrameView)
Setting a frame view triggers ReadFrameViewData() for the new frame.
::tools::Rectangle maAllWindowRectangle
Area covered by all windows, i.e.
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &)
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect)
Set zoom rectangle for active window.
virtual void ReadFrameViewData(FrameView *pView)
::tools::Long GetZoom() const
void InitWindows(const Point &rViewOrigin, const Size &rViewSize, const Point &rWinPos, bool bUpdate=false)
Initialize imaging parameters for all split windows.
virtual void UpdateHRuler()
SD_DLLPUBLIC weld::Window * GetFrameWeld() const
virtual void SetZoomFactor(const Fraction &rZoomX, const Fraction &rZoomY)
Set zoom factor for InPlace.
Point const & GetWinViewPos() const
VclPtr< sd::Window > mpContentWindow
Window inside the rulers and scroll bars that shows a view of the document.
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
bool HasCurrentFunction() const
virtual void UpdateVRuler()
void SetScrollBarsVisible(bool bVisible)
VclPtr< ScrollAdaptor > mpHorizontalScrollBar
Horizontal scroll bar for the current slide is displayed when needed.
bool mbHasRulers
This flag controls whether the rulers are visible.
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt, DropTargetHelper &rTargetHelper, SdrLayerID nLayer)
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer)
An SdWindow contains the actual working area of ViewShell.
const Point & GetWinViewPos() const
::tools::Long SetZoomRect(const ::tools::Rectangle &rZoomRect)
This method is called when the whole page shall be displayed in the window.
void SetVisibleXY(double fX, double fY)
Set x and y position of the visible area as fraction (< 1) of the whole working area.
::OutputDevice const * GetOutDev() const
Point PixelToLogic(const Point &rDevicePt) const
Size GetOutputSizePixel() const
void EnableChildTransparentMode(bool bEnable=true)
IMPL_LINK_NOARG(MainSequence, onTimerHdl, Timer *, void)
constexpr auto IMPRESS_FACTORY_ID
This are ids used by SfxTopFrame::Create() or CreateViewFrame() to select a factory to create an inst...
OUString SdResId(TranslateId aId)
#define ERRCODE_SFX_OLEGENERAL
SVT_DLLPUBLIC const ErrMsgCode RID_SO_ERRCTX[]
constexpr OUStringLiteral sUNO_View_ViewId
const tools::Long nScrollX
const tools::Long nScrollY