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)
67 m_eUserMetric = MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH;
87 static constexpr const char*
const aPropNames[] =
89 "Display/GraphicObject",
91 "Display/DrawingControl",
94 "Display/ShowContentTips",
95 "NonprintingCharacter/MetaCharacters",
96 "NonprintingCharacter/ParagraphEnd",
97 "NonprintingCharacter/OptionalHyphen",
98 "NonprintingCharacter/Space",
99 "NonprintingCharacter/Break",
100 "NonprintingCharacter/ProtectedSpace",
101 "NonprintingCharacter/Tab",
102 "NonprintingCharacter/HiddenText",
103 "NonprintingCharacter/HiddenParagraph",
104 "NonprintingCharacter/HiddenCharacter",
105 "NonprintingCharacter/Bookmarks",
109 "Display/ShowInlineTooltips",
110 "Display/UseHeaderFooterMenu",
111 "Display/ShowOutlineContentVisibilityButton",
112 "Display/TreatSubOutlineLevelsAsContent",
113 "Display/ShowChangesInMargin",
114 "Display/DefaultAnchor"
116#if defined(__GNUC__) && !defined(__clang__)
122 Sequence<OUString> aNames(
nCount);
123 OUString* pNames = aNames.getArray();
132 ConfigItem(bIsWeb ? OUString(
"Office.WriterWeb/Content") : OUString(
"Office.Writer/Content")),
153 Sequence<Any> aValues(aNames.getLength());
156 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
199 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
200 if(aValues.getLength() != aNames.getLength())
202 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
207 && *o3tl::doAccess<bool>(
pValues[nProp]);
258 "Window/HorizontalScroll",
259 "Window/VerticalScroll",
261 "Window/HorizontalRuler",
262 "Window/VerticalRuler",
263 "Window/HorizontalRulerUnit",
264 "Window/VerticalRulerUnit",
265 "Window/SmoothScroll",
268 "Other/IsAlignMathObjectsToBaseline",
272 "Window/IsVerticalRulerRight",
273 "ViewLayout/Columns",
274 "ViewLayout/BookMode",
275 "Other/IsSquaredPageMode",
276 "Other/ApplyCharUnit",
277 "Window/ShowScrollBarTips",
280 Sequence<OUString> aNames(
nCount);
281 OUString* pNames = aNames.getArray();
290 ConfigItem(bIsWeb ? OUString(
"Office.WriterWeb/Layout") : OUString(
"Office.Writer/Layout"),
305 Sequence<Any> aValues(aNames.getLength());
308 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
351 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
352 if(aValues.getLength() != aNames.getLength())
355 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
359 sal_Int32 nInt32Val = 0;
408 "Option/VisibleGrid",
409 "Option/Synchronize",
416 Sequence<OUString> aNames(
nCount);
417 OUString* pNames = aNames.getArray();
426 ConfigItem(bIsWeb ? OUString(
"Office.WriterWeb/Grid") : OUString(
"Office.Writer/Grid"),
440 Sequence<Any> aValues(aNames.getLength());
443 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
464 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
465 if(aValues.getLength() != aNames.getLength())
469 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
473 bool bSet = nProp < 3 && *o3tl::doAccess<bool>(
pValues[nProp]);
498 "DirectCursor/UseDirectCursor",
499 "DirectCursor/Insert",
500 "Option/ProtectedArea",
503 Sequence<OUString> aNames(
nCount);
504 OUString* pNames = aNames.getArray();
524 Sequence<Any> aValues(aNames.getLength());
527 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
544 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
545 if(aValues.getLength() != aNames.getLength())
549 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
556 bSet = *o3tl::doAccess<bool>(
pValues[nProp]);
587 for(
int nProp = 0; nProp <
m_aPropNames.getLength(); nProp++)
603 OSL_ENSURE(aValues.getLength() ==
m_aPropNames.getLength(),
"GetProperties failed");
607 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
sal_Int32 m_nDefTabInMm100
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 IsParagraph(bool bHard=false) const
void SetLineBreak(bool b)
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 SetCore2Option(bool b, ViewOptCoreFlags2 f)
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