LibreOffice Module sw (master) 1
usrpref.hxx
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#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_USRPREF_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_USRPREF_HXX
21
22#include <memory>
24#include <fldupde.hxx>
25#include <viewopt.hxx>
26#include <tools/fldunit.hxx>
27
28class SwMasterUsrPref;
29
31{
32private:
34 bool m_bWeb;
35
36 css::uno::Sequence<OUString> GetPropertyNames() const;
37
38 virtual void ImplCommit() override;
39
40public:
41 SwContentViewConfig(bool bWeb, SwMasterUsrPref& rParent);
42 virtual ~SwContentViewConfig() override;
43
44 // utl::ConfigItem
45 virtual void Notify( const css::uno::Sequence< OUString > &rPropertyNames ) override;
46
47 void Load();
48 using ConfigItem::SetModified;
49};
50
52{
53private:
55 bool m_bWeb;
56
57 css::uno::Sequence<OUString> GetPropertyNames() const;
58
59 virtual void ImplCommit() override;
60
61public:
62 SwLayoutViewConfig(bool bWeb, SwMasterUsrPref& rParent);
63 virtual ~SwLayoutViewConfig() override;
64
65 virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
66 void Load();
67 using ConfigItem::SetModified;
68};
69
70class SwGridConfig final : public utl::ConfigItem
71{
72private:
74
75 static css::uno::Sequence<OUString> GetPropertyNames();
76
77 virtual void ImplCommit() override;
78
79public:
80 SwGridConfig(bool bWeb, SwMasterUsrPref& rParent);
81 virtual ~SwGridConfig() override;
82
83 virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
84 void Load();
85 using ConfigItem::SetModified;
86};
87
88class SwCursorConfig final : public utl::ConfigItem
89{
90private:
92
93 static css::uno::Sequence<OUString> GetPropertyNames();
94
95 virtual void ImplCommit() override;
96
97public:
99 virtual ~SwCursorConfig() override;
100
101 virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
102 void Load();
103 using ConfigItem::SetModified;
104};
105
107{
108private:
110 css::uno::Sequence<OUString> m_aPropNames;
111
112 virtual void ImplCommit() override;
113
114public:
116 virtual ~SwWebColorConfig() override;
117
118 virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
119 void Load();
120 using ConfigItem::SetModified;
121};
122
124{
126 friend class SwLayoutViewConfig;
127 friend class SwGridConfig;
128 friend class SwCursorConfig;
129 friend class SwWebColorConfig;
130
131 SwFieldUpdateFlags m_eFieldUpdateFlags; //update of fields and charts
138
139 sal_Int32 m_nDefTabInMm100; //default tab stop distance, in 1/100 mm
140
141 bool m_bIsSquaredPageMode; //default page mode for text grid
143
148 std::unique_ptr<SwWebColorConfig> m_pWebColorConfig;
149
150 bool m_bApplyCharUnit; // apply_char_unit
151public:
152 SwMasterUsrPref(bool bWeb);
154
155 void SetUsrPref(const SwViewOption &rCopy);
156
158 {
164 m_pWebColorConfig->SetModified();
165 }
166
167 void SetUpdateLinkMode(sal_Int32 nSet, bool bNoModify = false)
168 {
169 m_nLinkUpdateMode = nSet;
170 if(!bNoModify)
172 }
173 sal_Int32 GetUpdateLinkMode() const {return m_nLinkUpdateMode; }
174
175 void SetUpdateFields(bool bSet)
176 {
177 if(bSet && m_eFieldUpdateFlags == AUTOUPD_OFF)
178 {
180 }
181 else if(!bSet)
182 {
184 }
185 };
187
190 {
191 m_eFieldUpdateFlags = eSet;
193 }
194
195 void SetUpdateCharts(bool bSet)
196 {
197 if(bSet)
198 {
200 }
202 {
204 }
205 };
207
209 void SetMetric(FieldUnit eSet, bool bNoModify = false)
210 {
211 m_eUserMetric = eSet;
212 if(!bNoModify)
214 }
215
219 {
222 }
223
227 {
230 }
231
232 bool IsApplyCharUnit() const
233 {
234 return m_bApplyCharUnit;
235 }
236 void SetApplyCharUnit(bool bSet, bool noModify = false)
237 {
238 m_bApplyCharUnit = bSet;
239 if (!noModify) {
241 }
242 }
243
244 sal_Int32 GetDefTabInMm100() const { return m_nDefTabInMm100;}
245 void SetDefTabInMm100( sal_Int32 nSet, bool bNoModify = false )
246 {
247 m_nDefTabInMm100 = nSet;
248 if(!bNoModify)
250 }
251
252 //default page mode for text grid
254 void SetDefaultPageMode( bool bVal, bool bNoModify = false )
255 {
257 if(!bNoModify)
259 }
260
262 void SetAlignMathObjectsToBaseline( bool bVal, bool noModify = false )
263 {
265 if (!noModify) {
267 }
268 }
269};
270
271#endif
272
273/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Notify(const css::uno::Sequence< OUString > &rPropertyNames) override
Definition: usrpref.cxx:140
virtual void ImplCommit() override
Definition: usrpref.cxx:145
SwMasterUsrPref & m_rParent
Definition: usrpref.hxx:33
virtual ~SwContentViewConfig() override
Definition: usrpref.cxx:136
css::uno::Sequence< OUString > GetPropertyNames() const
Definition: usrpref.cxx:81
SwContentViewConfig(bool bWeb, SwMasterUsrPref &rParent)
Definition: usrpref.cxx:127
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: usrpref.cxx:568
virtual ~SwCursorConfig() override
Definition: usrpref.cxx:515
static css::uno::Sequence< OUString > GetPropertyNames()
Definition: usrpref.cxx:493
SwMasterUsrPref & m_rParent
Definition: usrpref.hxx:91
virtual void ImplCommit() override
Definition: usrpref.cxx:519
SwCursorConfig(SwMasterUsrPref &rParent)
Definition: usrpref.cxx:509
virtual ~SwGridConfig() override
Definition: usrpref.cxx:431
SwGridConfig(bool bWeb, SwMasterUsrPref &rParent)
Definition: usrpref.cxx:424
void Load()
Definition: usrpref.cxx:458
static css::uno::Sequence< OUString > GetPropertyNames()
Definition: usrpref.cxx:402
virtual void ImplCommit() override
Definition: usrpref.cxx:435
SwMasterUsrPref & m_rParent
Definition: usrpref.hxx:73
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: usrpref.cxx:491
virtual ~SwLayoutViewConfig() override
Definition: usrpref.cxx:294
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: usrpref.cxx:400
virtual void ImplCommit() override
Definition: usrpref.cxx:298
SwMasterUsrPref & m_rParent
Definition: usrpref.hxx:54
css::uno::Sequence< OUString > GetPropertyNames() const
Definition: usrpref.cxx:249
SwLayoutViewConfig(bool bWeb, SwMasterUsrPref &rParent)
Definition: usrpref.cxx:286
bool IsVScrollMetric() const
Definition: usrpref.hxx:224
FieldUnit GetHScrollMetric() const
Definition: usrpref.hxx:217
sal_Int32 GetUpdateLinkMode() const
Definition: usrpref.hxx:173
FieldUnit m_eUserMetric
Definition: usrpref.hxx:133
SwCursorConfig m_aCursorConfig
Definition: usrpref.hxx:147
SwLayoutViewConfig m_aLayoutConfig
Definition: usrpref.hxx:145
void SetDefTabInMm100(sal_Int32 nSet, bool bNoModify=false)
Definition: usrpref.hxx:245
void SetUsrPref(const SwViewOption &rCopy)
Definition: usrpref.cxx:37
void SetUpdateLinkMode(sal_Int32 nSet, bool bNoModify=false)
Definition: usrpref.hxx:167
sal_Int32 m_nLinkUpdateMode
Definition: usrpref.hxx:132
SwFieldUpdateFlags m_eFieldUpdateFlags
Definition: usrpref.hxx:131
void SetAlignMathObjectsToBaseline(bool bVal, bool noModify=false)
Definition: usrpref.hxx:262
bool m_bIsSquaredPageMode
Definition: usrpref.hxx:141
void SetUpdateFields(bool bSet)
Definition: usrpref.hxx:175
FieldUnit GetMetric() const
Definition: usrpref.hxx:208
SwMasterUsrPref(bool bWeb)
Definition: usrpref.cxx:42
void SetVScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:226
SwFieldUpdateFlags GetFieldUpdateFlags() const
Definition: usrpref.hxx:188
void SetMetric(FieldUnit eSet, bool bNoModify=false)
Definition: usrpref.hxx:209
void SetDefaultPageMode(bool bVal, bool bNoModify=false)
Definition: usrpref.hxx:254
void SetApplyCharUnit(bool bSet, bool noModify=false)
Definition: usrpref.hxx:236
bool IsAlignMathObjectsToBaseline() const
Definition: usrpref.hxx:261
bool IsUpdateFields() const
Definition: usrpref.hxx:186
SwGridConfig m_aGridConfig
Definition: usrpref.hxx:146
FieldUnit m_eHScrollMetric
Definition: usrpref.hxx:134
bool IsHScrollMetric() const
Definition: usrpref.hxx:216
FieldUnit GetVScrollMetric() const
Definition: usrpref.hxx:225
bool IsUpdateCharts() const
Definition: usrpref.hxx:206
void SetModified()
Definition: usrpref.hxx:157
sal_Int32 m_nDefTabInMm100
Definition: usrpref.hxx:139
FieldUnit m_eVScrollMetric
Definition: usrpref.hxx:136
std::unique_ptr< SwWebColorConfig > m_pWebColorConfig
Definition: usrpref.hxx:148
bool m_bIsAlignMathObjectsToBaseline
Definition: usrpref.hxx:142
sal_Int32 GetDefTabInMm100() const
Definition: usrpref.hxx:244
bool m_bApplyCharUnit
Definition: usrpref.hxx:150
void SetUpdateCharts(bool bSet)
Definition: usrpref.hxx:195
bool IsApplyCharUnit() const
Definition: usrpref.hxx:232
void SetFieldUpdateFlags(SwFieldUpdateFlags eSet)
Definition: usrpref.hxx:189
SwContentViewConfig m_aContentConfig
Definition: usrpref.hxx:144
bool m_bIsHScrollMetricSet
Definition: usrpref.hxx:135
bool m_bIsVScrollMetricSet
Definition: usrpref.hxx:137
void SetHScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:218
bool IsSquaredPageMode() const
Definition: usrpref.hxx:253
SwWebColorConfig(SwMasterUsrPref &rParent)
Definition: usrpref.cxx:570
virtual void ImplCommit() override
Definition: usrpref.cxx:582
css::uno::Sequence< OUString > m_aPropNames
Definition: usrpref.hxx:110
virtual ~SwWebColorConfig() override
Definition: usrpref.cxx:578
SwMasterUsrPref & m_rParent
Definition: usrpref.hxx:109
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: usrpref.cxx:596
FieldUnit
SwFieldUpdateFlags
Definition: fldupde.hxx:23
@ AUTOUPD_FIELD_ONLY
Definition: fldupde.hxx:25
@ AUTOUPD_OFF
Definition: fldupde.hxx:24
@ AUTOUPD_FIELD_AND_CHARTS
Definition: fldupde.hxx:26