22#include <svx/svxids.hrc>
23#include <com/sun/star/drawing/framework/ResourceId.hpp>
24#include <com/sun/star/drawing/framework/XView.hpp>
25#include <rtl/ustrbuf.hxx>
30#include <osl/diagnose.h>
43#include <officecfg/Office/Common.hxx>
54 mnPresViewShellId(SID_VIEWSHELL0),
55 mbIsNavigatorShowingAllShapes(false)
57 EndListening(*pDrawDoc);
68 if(
nullptr == pFrameView )
90 Reference<drawing::framework::XView> xView (
92 drawing::framework::ResourceId::create(
93 ::comphelper::getProcessComponentContext(),
96 sViewURL = xView->getResourceId()->getResourceURL();
239 bInitDesignMode =
true;
244 bInitDesignMode =
false;
346 OUStringBuffer aLines;
349 for( sal_uInt16 nHlpLine = 0; nHlpLine <
nCount; nHlpLine++ )
351 const SdrHelpLine& rHelpLine = rHelpLines[nHlpLine];
356 case SdrHelpLineKind::Point:
357 aLines.append(
'P' );
358 aLines.append(
static_cast<sal_Int32
>(rPos.
X()) );
359 aLines.append(
',' );
360 aLines.append(
static_cast<sal_Int32
>(rPos.
Y()) );
362 case SdrHelpLineKind::Vertical:
363 aLines.append(
'V' );
364 aLines.append(
static_cast<sal_Int32
>(rPos.
X()) );
366 case SdrHelpLineKind::Horizontal:
367 aLines.append(
'H' );
368 aLines.append(
static_cast<sal_Int32
>(rPos.
Y()) );
371 OSL_FAIL(
"Unsupported helpline Kind!" );
375 return aLines.makeStringAndClear();
380 std::vector< std::pair< OUString, Any > > aUserData;
381 aUserData.reserve(41);
397 if ( officecfg::Office::Common::Misc::WriteLayerStateAsConfigItem::get() )
438 const ::tools::Rectangle aVisArea =
GetVisArea();
457 const sal_Int32 nOldLength = rValues.getLength();
458 rValues.realloc( nOldLength + aUserData.size() );
460 PropertyValue* pValue = &(rValues.getArray()[nOldLength]);
462 for(
const auto& rItem : aUserData )
464 pValue->Name = rItem.first;
465 pValue->Value = rItem.second;
474 OUStringBuffer sBuffer;
483 aNewHelpLine.
SetKind( SdrHelpLineKind::Point );
486 aNewHelpLine.
SetKind( SdrHelpLineKind::Vertical );
489 aNewHelpLine.
SetKind( SdrHelpLineKind::Horizontal );
492 OSL_FAIL(
"syntax error in snap lines settings string" );
498 while( (*pStr >=
'0' && *pStr <=
'9') || (*pStr ==
'+') || (*pStr ==
'-') )
500 sBuffer.append( *pStr++ );
504 sBuffer.setLength(0);
506 if( aNewHelpLine.
GetKind() == SdrHelpLineKind::Horizontal )
514 if( aNewHelpLine.
GetKind() == SdrHelpLineKind::Point )
519 while( (*pStr >=
'0' && *pStr <=
'9') || (*pStr ==
'+') || (*pStr ==
'-') )
521 sBuffer.append( *pStr++ );
525 sBuffer.setLength(0);
530 aNewHelpLine.
SetPos( aPoint );
531 rHelpLines.
Insert( aNewHelpLine );
537 const sal_Int32
nLength = rSequence.getLength();
545 sal_Int32 nInt32 = 0;
546 sal_Int16 nInt16 = 0;
555 for (
const css::beans::PropertyValue& rValue : rSequence)
562 if( rValue.Value >>= aString )
571 if( rValue.Value >>= aString )
580 if( rValue.Value >>= aString )
589 if( rValue.Value >>= bBool )
596 if( rValue.Value >>= nInt16 )
599 if( pDoc && pDoc->
GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->
GetDocSh()->GetCreateMode() ) )
607 if( rValue.Value >>= nInt16 )
610 if( pDoc && pDoc->
GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->
GetDocSh()->GetCreateMode() ) )
618 if( rValue.Value >>= bBool )
625 if( rValue.Value >>= bBool )
632 if( rValue.Value >>= bBool )
639 if( rValue.Value >>= nInt16 )
646 if( rValue.Value >>= nInt32 )
649 if( pDoc && pDoc->
GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->
GetDocSh()->GetCreateMode() ) )
658 if( rValue.Value >>= nInt32 )
661 if( pDoc && pDoc->
GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->
GetDocSh()->GetCreateMode() ) )
668 if( rValue.Value >>= nTop )
679 if( rValue.Value >>= nLeft )
689 sal_Int32 nWidth = 0;
690 if( rValue.Value >>= nWidth )
699 sal_Int32 nHeight = 0;
700 if( rValue.Value >>= nHeight )
710 if( rValue.Value >>= bBool )
718 if( rValue.Value >>= bBool )
725 if( rValue.Value >>= bBool )
732 if( rValue.Value >>= bBool )
739 if( rValue.Value >>= bBool )
746 if( rValue.Value >>= bBool )
753 if( rValue.Value >>= bBool )
760 if( rValue.Value >>= bBool )
767 if( rValue.Value >>= bBool )
774 if( rValue.Value >>= nInt32 )
781 if( rValue.Value >>= bBool )
788 if( rValue.Value >>= aString )
795 if( rValue.Value >>= bBool )
802 if( rValue.Value >>= bBool )
809 if( rValue.Value >>= nInt32 )
817 if( rValue.Value >>= nInt32 )
825 if( rValue.Value >>= nInt32 )
833 if( rValue.Value >>= nInt32 )
841 if( rValue.Value >>= bBool )
848 if( rValue.Value >>= nInt32 )
855 rValue.Value >>= aSnapGridWidthXNum;
859 rValue.Value >>= aSnapGridWidthXDom;
863 rValue.Value >>= aSnapGridWidthYNum;
867 rValue.Value >>= aSnapGridWidthYDom;
872 aSdrLayerIDSets.
PutValue( rValue.Value );
878 aSdrLayerIDSets.
PutValue( rValue.Value );
884 aSdrLayerIDSets.
PutValue( rValue.Value );
891 const Fraction aSnapGridWidthX( aSnapGridWidthXNum, aSnapGridWidthXDom );
892 const Fraction aSnapGridWidthY( aSnapGridWidthYNum, aSnapGridWidthYDom );
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
SAL_DLLPRIVATE::sd::FrameView * GetFrameView(sal_uLong nPos)
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
SAL_DLLPRIVATE DocumentType GetDocumentType() const
sal_uInt32 GetFieldDrawX() const
sal_uInt32 GetFieldDivisionX() const
bool IsGridVisible() const
bool IsUseGridSnap() const
sal_uInt32 GetFieldDivisionY() const
sal_uInt32 GetFieldDrawY() const
bool IsMoveOutline() const
bool IsRulerVisible() const
bool IsDragStripes() const
bool IsHandlesBezier() const
bool IsMasterPagePaintCaching() const
bool IsCrookNoContortion() const
bool IsDragWithCopy() const
bool IsDoubleClickTextEdit() const
bool IsMarkedHitMovesAlways() const
bool IsMoveOnlyDragging() const
bool IsPickThrough() const
bool IsClickChangeRotation() const
bool IsSolidDragging() const
sal_Int32 GetDragThresholdPixels() const
bool IsSnapHelplines() const
bool IsSnapPoints() const
Degree100 GetAngle() const
bool IsSnapBorder() const
Degree100 GetEliminatePolyPointLimitAngle() const
sal_Int16 GetSnapArea() const
void SetDragStripes(bool bOn)
void SetNoDragXorPolys(bool bOn)
bool IsSolidDragging() const
bool IsDragWithCopy() const
bool IsNoDragXorPolys() const
void SetDragWithCopy(bool bOn)
bool IsDragStripes() const
void SetDragThresholdPixels(sal_Int32 nDragThresholdPixels)
void SetSolidDragging(bool bOn)
void SetMarkedHitMovesAlways(bool bOn)
bool IsMarkedHitMovesAlways() const
void Insert(const SdrHelpLine &rHL)
sal_uInt16 GetCount() const
const Point & GetPos() const
SdrHelpLineKind GetKind() const
void SetKind(SdrHelpLineKind eNewKind)
void SetPos(const Point &rPnt)
void QueryValue(const SdrLayerIDSet &rViewLayerSet, css::uno::Any &rAny)
void getPrintableLayersODF(SdrLayerIDSet &rOutSet) const
void getLockedLayersODF(SdrLayerIDSet &rOutSet) const
void getVisibleLayersODF(SdrLayerIDSet &rOutSet) const
void PutValue(const css::uno::Any &rAny)
void SetFrameDragSingles(bool bOn=true)
bool IsFrameDragSingles() const
bool IsDesignMode() const
void SetPlusHandlesAlwaysVisible(bool bOn)
void SetDesignMode(bool bOn=true)
bool IsPlusHandlesAlwaysVisible() const
void SetPickThroughTransparentTextFrames(bool bOn)
const SdrLayerAdmin & GetLayerAdmin() const
void SetHlplVisible(bool bOn=true)
const Size & GetGridFine() const
void SetActiveLayer(const OUString &rName)
const Size & GetGridCoarse() const
void SetGridFine(const Size &rSiz)
SdrModel & getSdrModelFromSdrView() const
void SetGridFront(bool bOn)
bool IsHlplVisible() const
void SetGridCoarse(const Size &rSiz)
void SetHlplFront(bool bOn)
SdrModel & GetModel() const
const OUString & GetActiveLayer() const
void SetGridVisible(bool bOn)
bool IsGridVisible() const
bool IsCrookNoContortion() const
void SetOFrmSnap(bool bOn)
Degree100 GetEliminatePolyPointLimitAngle() const
void SetSnapGridWidth(const Fraction &rX, const Fraction &rY)
void SetOPntSnap(bool bOn)
void SetSnapMagneticPixel(sal_uInt16 nPix)
void SetHlplSnap(bool bOn)
const Fraction & GetSnapGridWidthY() const
void SetBordSnap(bool bOn)
void SetGridSnap(bool bOn)
void SetSnapAngle(Degree100 nAngle)
void SetAngleSnapEnabled(bool bOn)
bool IsAngleSnapEnabled() const
Degree100 GetSnapAngle() const
void SetBigOrtho(bool bOn)
void SetMoveOnlyDragging(bool bOn)
void SetEliminatePolyPointLimitAngle(Degree100 nAngle)
bool IsMoveOnlyDragging() const
const Fraction & GetSnapGridWidthX() const
void SetEliminatePolyPoints(bool bOn)
void SetOConSnap(bool bOn)
void SetCrookNoContortion(bool bOn)
sal_uInt16 GetSnapMagneticPixel() const
bool IsSlantButShear() const
bool IsEliminatePolyPoints() const
void SetSlantButShear(bool bOn)
void EnableExtendedMouseEventDispatcher(bool bOn)
bool IsMasterPagePaintCaching() const
void SetMasterPagePaintCaching(bool bOn)
void EnableExtendedKeyInputDispatcher(bool bOn)
SfxViewShell * GetViewShell() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
bool GetHighContrastMode() const
SdDrawDocument * GetDoc()
sal_uInt16 mnSelectedPage
EditMode GetViewShEditMode() const
Return EditMode (Page or MasterPage) of working mode.
void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &)
ViewShell::ShellType GetViewShellTypeOnLoad() const
PageKind mePageKind
kind of page (standard, notes, handout)
sal_uInt16 GetSelectedPage() const
void SetLockedLayers(const SdrLayerIDSet &rLockedLayers)
ViewShell::ShellType meViewShellTypeOnLoad
void SetLayerMode(bool bMode)
SdrLayerIDSet maVisibleLayers
bool IsNavigatorShowingAllShapes() const
PageKind GetPageKindOnLoad() const
can be used to get the page kind that was selected on last save of this document
void SetDoubleClickTextEdit(bool bOn)
void SetNoAttribs(const bool bNoAttr)
void SetNotesHelpLines(const SdrHelpLineList &rHelpLines)
SdrLayerIDSet maLockedLayers
void SetPageKindOnLoad(PageKind eKind)
is used in FrameView::ReadUserDataSequence() only to store the page kind that was selected while last...
void SetViewShEditModeOnLoad(const EditMode eMode)
Remember the edit mode of the main view shell at the time when the document is loaded.
const SdrHelpLineList & GetStandardHelpLines() const
sal_uInt16 GetSlidesPerRow() const
void SetSlidesPerRow(sal_uInt16 nSlides)
bool IsClickChangeRotation() const
void SetIsNavigatorShowingAllShapes(const bool bIsNavigatorShowingAllShapes)
EditMode GetViewShEditModeOnLoad() const
Return the value of the edit mode as it was when the document was loaded.
void SetQuickEdit(bool bQEdit)
bool mbNoColors
structuring mode
bool mbDoubleClickTextEdit
text mode after double click
ViewShell::ShellType GetPreviousViewShellType() const
Return the type of the view shell previously associated with this frame view.
void SetPrintableLayers(const SdrLayerIDSet &rPrintableLayers)
bool mbClickChangeRotation
single click switches between selection/rotation mode
SdrHelpLineList maNotesHelpLines
const ::tools::Rectangle & GetVisArea() const
void SetNoColors(const bool bNoCol)
const SdrHelpLineList & GetHandoutHelpLines() const
PageKind mePageKindOnLoad
bool mbLayerMode
layer on/off
EditMode meEditModeOnLoad
const SdrLayerIDSet & GetLockedLayers() const
bool IsDoubleClickTextEdit() const
const SdrLayerIDSet & GetVisibleLayers() const
const SdrHelpLineList & GetNotesHelpLines() const
void SetSelectedPage(sal_uInt16 nPage)
bool mbIsNavigatorShowingAllShapes
Remember whether the navigator shows all shapes (<TRUE>) or only the names ones (<FALSE>).
void Update(SdOptions const *pOptions)
Update with data from the specified SdOptions.
bool mbNoAttribs
structuring mode
PageKind GetPageKind() const
void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &)
::tools::Rectangle maVisArea
visible area
void SetSelectedPageOnLoad(sal_uInt16 nPage)
is used in FrameView::ReadUserDataSequence() only to store the page that was selected while last savi...
sal_uInt16 mnSlidesPerRow
slides per row on the slide-desk
void SetPreviousViewShellType(ViewShell::ShellType eType)
Remember the type of the view shell that was (or soon will be) previously associated with this frame ...
void SetViewShellTypeOnLoad(ViewShell::ShellType eType)
Remember the type of the view shell at the time when the document is loaded or, rather,...
EditMode mePageEditMode
edit mode in drawing mode (Page/MasterPage)
void SetPageKind(PageKind eKind)
ViewShell::ShellType mePreviousViewShellType
The type of the previous view shell.
sal_uInt16 mnSelectedPageOnLoad
DrawModeFlags GetDrawMode() const
sal_uInt16 GetSelectedPageOnLoad() const
can be used to get the page that was selected on last save of this document
void SetClickChangeRotation(bool bOn)
void SetViewShEditMode(EditMode eMode)
Set EditMode (Page or MasterPage) of working mode.
void SetHandoutHelpLines(const SdrHelpLineList &rHelpLines)
DrawModeFlags mnDrawMode
draw mode for the normal window
SdrHelpLineList maStandardHelpLines
FrameView(SdDrawDocument *pDrawDoc, FrameView *pFrameView=nullptr)
SdrLayerIDSet maPrintableLayers
void SetStandardHelpLines(const SdrHelpLineList &rHelpLines)
bool mbQuickEdit
QuickEdit on/off.
void SetVisibleLayers(const SdrLayerIDSet &rVisibleLayers)
const SdrLayerIDSet & GetPrintableLayers() const
void SetVisArea(const ::tools::Rectangle &rVisArea)
sal_uInt16 mnPresViewShellId
ViewShell from which the presentation was started.
void SetRuler(const bool bRulerOn)
SdrHelpLineList maHandoutHelpLines
virtual ~FrameView() override
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
static const OUString msCenterPaneURL
static ViewShell::ShellType GetViewId(const OUString &rsViewURL)
Return an identifier for the given view URL.
static ::std::shared_ptr< FrameworkHelper > Instance(ViewShellBase &rBase)
Return the FrameworkHelper object that is associated with the given ViewShellBase.
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
const DrawModeFlags OUTPUT_DRAWMODE_CONTRAST
static void createHelpLinesFromString(const OUString &rLines, SdrHelpLineList &rHelpLines)
const DrawModeFlags OUTPUT_DRAWMODE_COLOR
static OUString createHelpLinesString(const SdrHelpLineList &rHelpLines)
constexpr OUStringLiteral sUNO_View_IsClickChangeRotation
constexpr OUStringLiteral sUNO_View_VisibleAreaLeft
constexpr OUStringLiteral sUNO_View_GridCoarseWidth
constexpr OUStringLiteral sUNO_View_IsSnapToObjectFrame
constexpr OUStringLiteral sUNO_View_GridFineHeight
constexpr OUStringLiteral sUNO_View_SnapLinesHandout
constexpr OUStringLiteral sUNO_View_IsAngleSnapEnabled
constexpr OUStringLiteral sUNO_View_IsSnapToSnapLines
constexpr OUStringLiteral sUNO_View_GridSnapWidthXNumerator
constexpr OUStringLiteral sUNO_View_LockedLayers
constexpr OUStringLiteral sUNO_View_IsSnapToGrid
constexpr OUStringLiteral sUNO_View_IsSnapToPageMargins
constexpr OUStringLiteral sUNO_View_PageKind
constexpr OUStringLiteral sUNO_View_IsDoubleClickTextEdit
constexpr OUStringLiteral sUNO_LayerName_layout
constexpr OUStringLiteral sUNO_View_VisibleAreaWidth
constexpr OUStringLiteral sUNO_View_GridSnapWidthYNumerator
constexpr OUStringLiteral sUNO_View_ViewId
constexpr OUStringLiteral sUNO_View_PrintableLayers
constexpr OUStringLiteral sUNO_View_GridIsVisible
constexpr OUStringLiteral sUNO_View_GridIsFront
constexpr OUStringLiteral sUNO_View_RulerIsVisible
constexpr OUStringLiteral sUNO_View_VisibleAreaHeight
constexpr OUStringLiteral sUNO_View_SnapLinesDrawing
constexpr OUStringLiteral sUNO_View_GridCoarseHeight
constexpr OUStringLiteral sUNO_View_SlidesPerRow
const char sUNO_View_ActiveLayer[]
constexpr OUStringLiteral sUNO_View_GridSnapWidthXDenominator
constexpr OUStringLiteral sUNO_View_IsEliminatePolyPoints
constexpr OUStringLiteral sUNO_View_SnapLinesNotes
constexpr OUStringLiteral sUNO_View_SnapAngle
constexpr OUStringLiteral sUNO_View_SelectedPage
constexpr OUStringLiteral sUNO_View_NoColors
constexpr OUStringLiteral sUNO_View_EditMode
constexpr OUStringLiteral sUNO_View_VisibleAreaTop
constexpr OUStringLiteral sUNO_View_IsFrameDragSingles
constexpr OUStringLiteral sUNO_View_EliminatePolyPointLimitAngle
constexpr OUStringLiteral sUNO_View_IsPlusHandlesAlwaysVisible
constexpr OUStringLiteral sUNO_View_IsLayerMode
constexpr OUStringLiteral sUNO_View_GridFineWidth
constexpr OUStringLiteral sUNO_View_IsSnapToObjectPoints
const char sUNO_View_EditModeStandard[]
constexpr OUStringLiteral sUNO_View_VisibleLayers
constexpr OUStringLiteral sUNO_View_NoAttribs
constexpr OUStringLiteral sUNO_View_GridSnapWidthYDenominator