22#include <osl/diagnose.h>
29#include <com/sun/star/uno/Any.hxx>
30#include <com/sun/star/uno/Sequence.hxx>
45 m_bIsHScrollMetricSet(false),
46 m_bIsVScrollMetricSet(false),
47 m_nDefTabInMm100( 2000 ),
48 m_bIsSquaredPageMode(false),
49 m_bIsAlignMathObjectsToBaseline(false),
50 m_aContentConfig(bWeb, *this),
51 m_aLayoutConfig(bWeb, *this),
52 m_aGridConfig(bWeb, *this),
53 m_aCursorConfig(*this),
55 m_bApplyCharUnit(false)
63 m_eUserMetric = MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH;
83 static constexpr const char*
const aPropNames[] =
85 "Display/GraphicObject",
87 "Display/DrawingControl",
90 "Display/ShowContentTips",
91 "NonprintingCharacter/MetaCharacters",
92 "NonprintingCharacter/ParagraphEnd",
93 "NonprintingCharacter/OptionalHyphen",
94 "NonprintingCharacter/Space",
95 "NonprintingCharacter/Break",
96 "NonprintingCharacter/ProtectedSpace",
97 "NonprintingCharacter/Tab",
98 "NonprintingCharacter/HiddenText",
99 "NonprintingCharacter/HiddenParagraph",
100 "NonprintingCharacter/HiddenCharacter",
101 "NonprintingCharacter/Bookmarks",
105 "Display/ShowInlineTooltips",
106 "Display/UseHeaderFooterMenu",
107 "Display/ShowOutlineContentVisibilityButton",
108 "Display/TreatSubOutlineLevelsAsContent",
109 "Display/ShowChangesInMargin",
110 "Display/DefaultAnchor"
112#if defined(__GNUC__) && !defined(__clang__)
118 Sequence<OUString> aNames(
nCount);
119 OUString* pNames = aNames.getArray();
128 ConfigItem(bIsWeb ? OUString(
"Office.WriterWeb/Content") : OUString(
"Office.Writer/Content")),
149 Sequence<Any> aValues(aNames.getLength());
152 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
195 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
196 if(aValues.getLength() != aNames.getLength())
198 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
203 && *o3tl::doAccess<bool>(
pValues[nProp]);
254 "Window/HorizontalScroll",
255 "Window/VerticalScroll",
257 "Window/HorizontalRuler",
258 "Window/VerticalRuler",
259 "Window/HorizontalRulerUnit",
260 "Window/VerticalRulerUnit",
261 "Window/SmoothScroll",
264 "Other/IsAlignMathObjectsToBaseline",
268 "Window/IsVerticalRulerRight",
269 "ViewLayout/Columns",
270 "ViewLayout/BookMode",
271 "Other/IsSquaredPageMode",
272 "Other/ApplyCharUnit",
273 "Window/ShowScrollBarTips",
274 "ViewLayout/HideWhitespace",
277 Sequence<OUString> aNames(
nCount);
278 OUString* pNames = aNames.getArray();
287 ConfigItem(bIsWeb ? OUString(
"Office.WriterWeb/Layout") : OUString(
"Office.Writer/Layout"),
302 Sequence<Any> aValues(aNames.getLength());
305 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
349 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
350 if(aValues.getLength() != aNames.getLength())
353 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
357 sal_Int32 nInt32Val = 0;
407 "Option/VisibleGrid",
408 "Option/Synchronize",
415 Sequence<OUString> aNames(
nCount);
416 OUString* pNames = aNames.getArray();
425 ConfigItem(bIsWeb ? OUString(
"Office.WriterWeb/Grid") : OUString(
"Office.Writer/Grid"),
439 Sequence<Any> aValues(aNames.getLength());
442 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
463 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
464 if(aValues.getLength() != aNames.getLength())
468 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
472 bool bSet = nProp < 3 && *o3tl::doAccess<bool>(
pValues[nProp]);
497 "DirectCursor/UseDirectCursor",
498 "DirectCursor/Insert",
499 "Option/ProtectedArea",
502 Sequence<OUString> aNames(
nCount);
503 OUString* pNames = aNames.getArray();
523 Sequence<Any> aValues(aNames.getLength());
526 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
543 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
544 if(aValues.getLength() != aNames.getLength())
548 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
555 bSet = *o3tl::doAccess<bool>(
pValues[nProp]);
586 for(
int nProp = 0; nProp <
m_aPropNames.getLength(); nProp++)
602 OSL_ENSURE(aValues.getLength() ==
m_aPropNames.getLength(),
"GetProperties failed");
606 for(
int nProp = 0; nProp <
m_aPropNames.getLength(); nProp++)
const PropertyValue * pValues
constexpr auto convertTwipToMm100(N n)
MeasurementSystem getMeasurementSystemEnum() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const LocaleDataWrapper & GetLocaleData() const
virtual void Notify(const css::uno::Sequence< OUString > &rPropertyNames) override
virtual void ImplCommit() override
SwMasterUsrPref & m_rParent
virtual ~SwContentViewConfig() override
css::uno::Sequence< OUString > GetPropertyNames() const
SwContentViewConfig(bool bWeb, SwMasterUsrPref &rParent)
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
virtual ~SwCursorConfig() override
static css::uno::Sequence< OUString > GetPropertyNames()
SwMasterUsrPref & m_rParent
virtual void ImplCommit() override
SwCursorConfig(SwMasterUsrPref &rParent)
virtual ~SwGridConfig() override
SwGridConfig(bool bWeb, SwMasterUsrPref &rParent)
static css::uno::Sequence< OUString > GetPropertyNames()
virtual void ImplCommit() override
SwMasterUsrPref & m_rParent
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
virtual ~SwLayoutViewConfig() override
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
virtual void ImplCommit() override
SwMasterUsrPref & m_rParent
css::uno::Sequence< OUString > GetPropertyNames() const
SwLayoutViewConfig(bool bWeb, SwMasterUsrPref &rParent)
sal_Int32 GetUpdateLinkMode() const
SwCursorConfig m_aCursorConfig
SwLayoutViewConfig m_aLayoutConfig
void SetDefTabInMm100(sal_Int32 nSet, bool bNoModify=false)
void SetUsrPref(const SwViewOption &rCopy)
void SetUpdateLinkMode(sal_Int32 nSet, bool bNoModify=false)
void SetAlignMathObjectsToBaseline(bool bVal, bool noModify=false)
void SetUpdateFields(bool bSet)
FieldUnit GetMetric() const
SwMasterUsrPref(bool bWeb)
void SetMetric(FieldUnit eSet, bool bNoModify=false)
void SetDefaultPageMode(bool bVal, bool bNoModify=false)
void SetApplyCharUnit(bool bSet, bool noModify=false)
bool IsAlignMathObjectsToBaseline() const
bool IsUpdateFields() const
SwGridConfig m_aGridConfig
FieldUnit m_eHScrollMetric
bool IsUpdateCharts() const
FieldUnit m_eVScrollMetric
std::unique_ptr< SwWebColorConfig > m_pWebColorConfig
sal_Int32 GetDefTabInMm100() const
void SetUpdateCharts(bool bSet)
bool IsApplyCharUnit() const
SwContentViewConfig m_aContentConfig
bool m_bIsHScrollMetricSet
bool m_bIsVScrollMetricSet
bool IsSquaredPageMode() const
bool IsViewHRuler(bool bDirect=false) const
bool IsHideWhitespaceMode() const
bool IsParagraph(bool bHard=false) const
void SetLineBreak(bool b)
void SetHideWhitespaceMode(bool bMode)
bool IsVRulerRight() const
bool IsSynchronize() const
void SetShdwCursorFillMode(SwFillMode nMode)
void SetShowContentTips(bool b)
bool IsShadowCursor() const
bool IsSmoothScroll() const
sal_Int32 GetDefaultAnchor() const
bool IsShowBookmarks(bool const bHard=false) const
void SetShowChangesInMargin(bool b)
bool IsViewLayoutBookMode() const
void SetVRulerRight(bool b)
bool IsBlank(bool bHard=false) const
void SetViewHRuler(bool b)
void SetDefaultAnchor(const sal_Int32 aFlag)
bool IsShowOutlineContentVisibilityButton() const
void SetSynchronize(bool b)
bool IsGridVisible() const
SvxZoomType GetZoomType() const
bool IsShowHiddenField() const
void SetShowHiddenChar(bool b)
void SetHardBlank(bool b)
SwFillMode GetShdwCursorFillMode() const
bool IsShowHiddenPara() const
short GetDivisionY() const
sal_uInt16 GetZoom() const
void SetZoomType(SvxZoomType eZoom_)
void SetZoom(sal_uInt16 n)
void SetCursorInProtectedArea(bool b)
void SetParagraph(bool b)
const Color & GetRetoucheColor() const
sal_uInt16 GetViewLayoutColumns() const
bool IsTreatSubOutlineLevelsAsContent() const
bool IsShowScrollBarTips() const
void SetShadowCursor(bool b)
void SetTreatSubOutlineLevelsAsContent(bool b)
void SetSmoothScroll(bool b)
void SetUseHeaderFooterMenu(bool b)
void SetGridVisible(bool b)
void SetShowHiddenField(bool b)
void SetSnapSize(Size const &rSz)
void SetShowScrollBarTips(bool b)
bool IsViewAnyRuler() const
void SetShowOutlineContentVisibilityButton(bool b)
void SetShowBookmarks(bool const b)
bool IsViewHScrollBar() const
const Size & GetSnapSize() const
bool IsShowContentTips() const
void SetViewHScrollBar(bool b)
bool IsShowHiddenChar(bool bHard=false) const
bool IsViewVRuler(bool bDirect=false) const
bool IsCursorInProtectedArea() const
bool IsViewVScrollBar() const
void SetViewVScrollBar(bool b)
void SetViewAnyRuler(bool bSet)
void SetViewVRuler(bool b)
void SetDivisionX(short n)
void SetViewLayoutColumns(sal_uInt16 nNew)
bool IsViewMetaChars() const
void SetShowHiddenPara(bool b)
bool IsLineBreak(bool bHard=false) const
bool IsTab(bool bHard=false) const
void SetCrossHair(bool b)
void SetShowInlineTooltips(bool b)
short GetDivisionX() const
void SetDivisionY(short n)
void SetFieldName(bool b)
bool IsUseHeaderFooterMenu() const
void SetRetoucheColor(const Color &r)
bool IsShowInlineTooltips() const
void SetViewLayoutBookMode(bool bNew)
bool IsShowChangesInMargin() const
void SetViewMetaChars(bool b)
SwWebColorConfig(SwMasterUsrPref &rParent)
virtual void ImplCommit() override
css::uno::Sequence< OUString > m_aPropNames
virtual ~SwWebColorConfig() override
SwMasterUsrPref & m_rParent
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
static bool PutProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, const css::uno::Sequence< css::uno::Any > &rValues, bool bAllLocales)
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
static css::uno::Sequence< css::uno::Any > GetProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, bool bAllLocales)
#define SAL_N_ELEMENTS(arr)
constexpr auto toTwips(N number, Length from)
const PropertyStruct aPropNames[]
const auto g_DefaultAnchor
const auto g_UpdateLinkIndex