LibreOffice Module sw (master)  1
appopt.cxx
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 
20 #include <memory>
21 #include <cmdid.h>
22 
23 #include <com/sun/star/i18n/ScriptType.hpp>
24 
25 #include <sal/log.hxx>
26 #include <hintids.hxx>
27 #include <svl/eitem.hxx>
28 #include <sfx2/app.hxx>
29 #include <sfx2/printer.hxx>
30 #include <sfx2/htmlmode.hxx>
31 #include <sfx2/bindings.hxx>
32 #include <editeng/brushitem.hxx>
33 #include <editeng/tstpitem.hxx>
34 #include <svx/optgrid.hxx>
35 #include <svx/dialogs.hrc>
36 #include <tools/UnitConversion.hxx>
37 #include <i18nlangtag/mslangid.hxx>
39 #include <fontcfg.hxx>
40 #include <swmodule.hxx>
41 #include <view.hxx>
42 #include <doc.hxx>
43 #include <wrtsh.hxx>
46 #include <uitool.hxx>
47 #include <wview.hxx>
48 #include <cfgitems.hxx>
49 #include <prtopt.hxx>
50 #include <pview.hxx>
51 #include <usrpref.hxx>
52 #include <uiitems.hxx>
53 #include <editeng/langitem.hxx>
54 #include <unotools/lingucfg.hxx>
55 #include <globals.hrc>
56 #include <swabstdlg.hxx>
57 #include <swwrtshitem.hxx>
58 
59 using namespace ::com::sun::star::uno;
60 using namespace ::com::sun::star::lang;
61 
62 std::unique_ptr<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId )
63 {
64  bool bTextDialog = (nId == SID_SW_EDITOPTIONS);
65 
66  // the options for the Web- and Textdialog are put together here
67  SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
68  SwMasterUsrPref* pPref = bTextDialog ? m_pUsrPref.get() : m_pWebUsrPref.get();
69  // no MakeUsrPref, because only options from textdoks can be used here
70  SwView* pAppView = GetView();
71  if(pAppView && pAppView->GetViewFrame() != SfxViewFrame::Current())
72  pAppView = nullptr;
73  if(pAppView)
74  {
75  bool bWebView = dynamic_cast<SwWebView*>( pAppView ) != nullptr;
76  // if Text then no WebView and vice versa
77  if (bWebView != bTextDialog)
78  {
79  aViewOpt = *pAppView->GetWrtShell().GetViewOptions();
80  }
81  else
82  pAppView = nullptr; // with View, there's nothing to win here
83  }
84 
85  // Options/Edit
86  auto pRet = std::make_unique<SfxItemSet>(
87  GetPool(),
88  svl::Items<
91  SID_PRINTPREVIEW, SID_PRINTPREVIEW,
92  SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS,
93  SID_HTML_MODE, SID_HTML_MODE,
94  SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE,
95  SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE,
96  SID_ATTR_LANGUAGE, SID_ATTR_METRIC,
97  SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
98  SID_ATTR_APPLYCHARUNIT, SID_ATTR_APPLYCHARUNIT,
105  FN_PARAM_CRSR_IN_PROTECTED, FN_PARAM_CRSR_IN_PROTECTED>{});
106 
107  pRet->Put( SwDocDisplayItem( aViewOpt ) );
108  pRet->Put( SwElemItem( aViewOpt ) );
109  if( bTextDialog )
110  {
111  pRet->Put( SwShadowCursorItem( aViewOpt ));
112  pRet->Put( SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aViewOpt.IsCursorInProtectedArea()));
113  }
114 
115  if( pAppView )
116  {
117  SwWrtShell& rWrtShell = pAppView->GetWrtShell();
118 
119  SfxPrinter* pPrt = rWrtShell.getIDocumentDeviceAccess().getPrinter( false );
120  if( pPrt )
121  pRet->Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));
122  pRet->Put(SwPtrItem(FN_PARAM_WRTSHELL, &rWrtShell));
123 
124  pRet->Put(rWrtShell.GetDefault(RES_CHRATR_LANGUAGE).CloneSetWhich(SID_ATTR_LANGUAGE));
125  pRet->Put(rWrtShell.GetDefault(RES_CHRATR_CJK_LANGUAGE).CloneSetWhich(SID_ATTR_CHAR_CJK_LANGUAGE));
126  pRet->Put(rWrtShell.GetDefault(RES_CHRATR_CTL_LANGUAGE).CloneSetWhich(SID_ATTR_CHAR_CTL_LANGUAGE));
127  }
128  else
129  {
130  SvtLinguConfig aLinguCfg;
131  css::lang::Locale aLocale;
133 
134  using namespace ::com::sun::star::i18n::ScriptType;
135 
136  Any aLang = aLinguCfg.GetProperty("DefaultLocale");
137  aLang >>= aLocale;
139  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE));
140 
141  aLang = aLinguCfg.GetProperty("DefaultLocale_CJK");
142  aLang >>= aLocale;
144  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE));
145 
146  aLang = aLinguCfg.GetProperty("DefaultLocale_CTL");
147  aLang >>= aLocale;
149  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE));
150  }
151  if(bTextDialog)
152  pRet->Put(SwPtrItem(FN_PARAM_STDFONTS, GetStdFontConfig()));
153  if( dynamic_cast<SwPagePreview*>( SfxViewShell::Current())!=nullptr )
154  {
155  SfxBoolItem aBool(SfxBoolItem(SID_PRINTPREVIEW, true));
156  pRet->Put(aBool);
157  }
158 
159  FieldUnit eUnit = pPref->GetHScrollMetric();
160  if(pAppView)
161  pAppView->GetHRulerMetric(eUnit);
162  pRet->Put(SfxUInt16Item( FN_HSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit)));
163 
164  eUnit = pPref->GetVScrollMetric();
165  if(pAppView)
166  pAppView->GetVRulerMetric(eUnit);
167  pRet->Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit) ));
168  pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(pPref->GetMetric()) ));
169  pRet->Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, pPref->IsApplyCharUnit()));
170  if(bTextDialog)
171  {
172  if(pAppView)
173  {
174  const SvxTabStopItem& rDefTabs =
176  pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, static_cast<sal_uInt16>(::GetTabDist(rDefTabs))));
177  }
178  else
179  pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, static_cast<sal_uInt16>(convertMm100ToTwip(pPref->GetDefTabInMm100()))));
180  }
181 
182  // Options for GridTabPage
183  SvxGridItem aGridItem( SID_ATTR_GRID_OPTIONS);
184 
185  aGridItem.SetUseGridSnap( aViewOpt.IsSnap());
186  aGridItem.SetSynchronize( aViewOpt.IsSynchronize());
187  aGridItem.SetGridVisible( aViewOpt.IsGridVisible());
188 
189  const Size& rSnapSize = aViewOpt.GetSnapSize();
190  aGridItem.SetFieldDrawX( static_cast<sal_uInt16>(rSnapSize.Width() ));
191  aGridItem.SetFieldDrawY( static_cast<sal_uInt16>(rSnapSize.Height()));
192 
193  aGridItem.SetFieldDivisionX( aViewOpt.GetDivisionX());
194  aGridItem.SetFieldDivisionY( aViewOpt.GetDivisionY());
195 
196  pRet->Put(aGridItem);
197 
198  // Options for PrintTabPage
199  const SwPrintData* pOpt = GetPrtOptions(!bTextDialog);
200  SwAddPrinterItem aAddPrinterItem(*pOpt );
201  pRet->Put(aAddPrinterItem);
202 
203  // Options for Web
204  if(!bTextDialog)
205  {
206  pRet->Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND));
207  pRet->Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON));
208  }
209 
210  return pRet;
211 }
212 
213 void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
214 {
215  bool bTextDialog = nId == SID_SW_EDITOPTIONS;
216  SwView* pAppView = GetView();
217  if(pAppView && pAppView->GetViewFrame() != SfxViewFrame::Current())
218  pAppView = nullptr;
219  if(pAppView)
220  {
221  // the text dialog mustn't apply data to the web view and vice versa
222  bool bWebView = dynamic_cast<SwWebView*>( pAppView ) != nullptr;
223  if(bWebView == bTextDialog)
224  pAppView = nullptr;
225  }
226 
227  SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
228  SwMasterUsrPref* pPref = bTextDialog ? m_pUsrPref.get() : m_pWebUsrPref.get();
229 
230  const SfxPoolItem* pItem;
231  SfxBindings *pBindings = pAppView ? &pAppView->GetViewFrame()->GetBindings()
232  : nullptr;
233 
234  // Interpret the page Documentview
235  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_DOCDISP, false, &pItem ))
236  {
237  const SwDocDisplayItem* pDocDispItem = static_cast<const SwDocDisplayItem*>(pItem);
238 
239  if(!aViewOpt.IsViewMetaChars())
240  {
241  if( (!aViewOpt.IsTab( true ) && pDocDispItem->m_bTab) ||
242  (!aViewOpt.IsBlank( true ) && pDocDispItem->m_bSpace) ||
243  (!aViewOpt.IsShowBookmarks(true) && pDocDispItem->m_bBookmarks) ||
244  (!aViewOpt.IsParagraph( true ) && pDocDispItem->m_bParagraphEnd) ||
245  (!aViewOpt.IsLineBreak( true ) && pDocDispItem->m_bManualBreak) )
246  {
247  aViewOpt.SetViewMetaChars(true);
248  if(pBindings)
249  pBindings->Invalidate(FN_VIEW_META_CHARS);
250  }
251 
252  }
253  pDocDispItem->FillViewOptions( aViewOpt );
254  if(pBindings)
255  {
256  pBindings->Invalidate(FN_VIEW_GRAPHIC);
257  pBindings->Invalidate(FN_VIEW_HIDDEN_PARA);
258  }
259  }
260 
261  // Elements - interpret Item
262  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ELEM, false, &pItem ) )
263  {
264  const SwElemItem* pElemItem = static_cast<const SwElemItem*>(pItem);
265  pElemItem->FillViewOptions( aViewOpt );
266 
267  }
268 
269  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_METRIC, false, &pItem ) )
270  {
271  SfxGetpApp()->SetOptions(rSet);
272  PutItem(*pItem);
273  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
274  ::SetDfltMetric(static_cast<FieldUnit>(pMetricItem->GetValue()), !bTextDialog);
275  }
276  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT,
277  false, &pItem ) )
278  {
279  SfxGetpApp()->SetOptions(rSet);
280  const SfxBoolItem* pCharItem = static_cast<const SfxBoolItem*>(pItem);
281  ::SetApplyCharUnit(pCharItem->GetValue(), !bTextDialog);
282  }
283 
284  if( SfxItemState::SET == rSet.GetItemState(FN_HSCROLL_METRIC, false, &pItem ) )
285  {
286  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
287  FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
288  pPref->SetHScrollMetric(eUnit);
289  if(pAppView)
290  pAppView->ChangeTabMetric(eUnit);
291  }
292 
293  if( SfxItemState::SET == rSet.GetItemState(FN_VSCROLL_METRIC, false, &pItem ) )
294  {
295  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
296  FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
297  pPref->SetVScrollMetric(eUnit);
298  if(pAppView)
299  pAppView->ChangeVRulerMetric(eUnit);
300  }
301 
302  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP, false, &pItem ) )
303  {
304  sal_uInt16 nTabDist = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
305  pPref->SetDefTabInMm100(convertTwipToMm100(nTabDist));
306  if(pAppView)
307  {
308  SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
309  MakeDefTabs( nTabDist, aDefTabs );
310  pAppView->GetWrtShell().SetDefault( aDefTabs );
311  }
312  }
313 
314  // Background only in WebDialog
315  if(SfxItemState::SET == rSet.GetItemState(RES_BACKGROUND))
316  {
317  const SvxBrushItem& rBrushItem = rSet.Get(RES_BACKGROUND);
318  aViewOpt.SetRetoucheColor( rBrushItem.GetColor() );
319  }
320 
321  // Interpret page Grid Settings
322  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS, false, &pItem ))
323  {
324  const SvxGridItem* pGridItem = static_cast<const SvxGridItem*>(pItem);
325 
326  aViewOpt.SetSnap( pGridItem->GetUseGridSnap() );
327  aViewOpt.SetSynchronize(pGridItem->GetSynchronize());
328  if( aViewOpt.IsGridVisible() != pGridItem->GetGridVisible() )
329  aViewOpt.SetGridVisible( pGridItem->GetGridVisible());
330  Size aSize( pGridItem->GetFieldDrawX(), pGridItem->GetFieldDrawY() );
331  if( aViewOpt.GetSnapSize() != aSize )
332  aViewOpt.SetSnapSize( aSize );
333  short nDiv = static_cast<short>(pGridItem->GetFieldDivisionX()) ;
334  if( aViewOpt.GetDivisionX() != nDiv )
335  aViewOpt.SetDivisionX( nDiv );
336  nDiv = static_cast<short>(pGridItem->GetFieldDivisionY());
337  if( aViewOpt.GetDivisionY() != nDiv )
338  aViewOpt.SetDivisionY( nDiv );
339 
340  if(pBindings)
341  {
342  pBindings->Invalidate(SID_GRID_VISIBLE);
343  pBindings->Invalidate(SID_GRID_USE);
344  }
345  }
346 
347  // Interpret Writer Printer Options
348  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, false, &pItem ))
349  {
350  SwPrintOptions* pOpt = GetPrtOptions(!bTextDialog);
351  if (pOpt)
352  {
353  const SwAddPrinterItem* pAddPrinterAttr = static_cast<const SwAddPrinterItem*>(pItem);
354  *pOpt = *pAddPrinterAttr;
355  }
356 
357  }
358 
359  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, false, &pItem ))
360  {
361  static_cast<const SwShadowCursorItem*>(pItem)->FillViewOptions( aViewOpt );
362  if(pBindings)
363  pBindings->Invalidate(FN_SHADOWCURSOR);
364  }
365 
366  if( pAppView )
367  {
368  SwWrtShell &rWrtSh = pAppView->GetWrtShell();
369  const bool bAlignFormulas = rWrtSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT );
370  pPref->SetAlignMathObjectsToBaseline( bAlignFormulas );
371 
372  // don't align formulas in documents that are currently loading
373  if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading())
375  }
376 
377  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, false, &pItem ))
378  {
379  aViewOpt.SetCursorInProtectedArea(static_cast<const SfxBoolItem*>(pItem)->GetValue());
380  }
381 
382  // set elements for the current view and shell
383  ApplyUsrPref( aViewOpt, pAppView, bTextDialog? SvViewOpt::DestText : SvViewOpt::DestWeb);
384 }
385 
386 std::unique_ptr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet )
387 {
388  std::unique_ptr<SfxTabPage> xRet;
389  SfxAllItemSet aSet(*(rSet.GetPool()));
390  switch( nId )
391  {
392  case RID_SW_TP_CONTENT_OPT:
393  case RID_SW_TP_HTML_CONTENT_OPT:
394  {
396  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
397  xRet = (*fnCreatePage)( pPage, pController, &rSet );
398  break;
399  }
400  case RID_SW_TP_HTML_OPTGRID_PAGE:
401  case RID_SVXPAGE_GRID:
402  xRet = SvxGridTabPage::Create(pPage, pController, rSet);
403  break;
404 
405  case RID_SW_TP_STD_FONT:
406  case RID_SW_TP_STD_FONT_CJK:
407  case RID_SW_TP_STD_FONT_CTL:
408  {
410  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
411  xRet = (*fnCreatePage)( pPage, pController, &rSet );
412  if(RID_SW_TP_STD_FONT != nId)
413  {
414  aSet.Put (SfxUInt16Item(SID_FONTMODE_TYPE, RID_SW_TP_STD_FONT_CJK == nId ? FONT_GROUP_CJK : FONT_GROUP_CTL));
415  xRet->PageCreated(aSet);
416  }
417  }
418  break;
419  case RID_SW_TP_HTML_OPTPRINT_PAGE:
420  case RID_SW_TP_OPTPRINT_PAGE:
421  {
423  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
424  xRet = (*fnCreatePage)( pPage, pController, &rSet );
425  aSet.Put (SfxBoolItem(SID_FAX_LIST, true));
426  xRet->PageCreated(aSet);
427  }
428  break;
429  case RID_SW_TP_HTML_OPTTABLE_PAGE:
430  case RID_SW_TP_OPTTABLE_PAGE:
431  {
433  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
434  xRet = (*fnCreatePage)( pPage, pController, &rSet );
435  SwView* pCurrView = GetView();
436  if(pCurrView)
437  {
438  // if text then not WebView and vice versa
439  bool bWebView = dynamic_cast<SwWebView*>( pCurrView ) != nullptr;
440  if( (bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE == nId) ||
441  (!bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE != nId) )
442  {
443  aSet.Put (SwWrtShellItem(pCurrView->GetWrtShellPtr()));
444  xRet->PageCreated(aSet);
445  }
446  }
447  }
448  break;
449  case RID_SW_TP_OPTSHDWCRSR:
450  case RID_SW_TP_HTML_OPTSHDWCRSR:
451  case RID_SW_TP_REDLINE_OPT:
452  case RID_SW_TP_COMPARISON_OPT:
453  case RID_SW_TP_OPTLOAD_PAGE:
454  case RID_SW_TP_OPTCOMPATIBILITY_PAGE:
455  case RID_SW_TP_MAILCONFIG:
456  {
458  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
459  xRet = (*fnCreatePage)( pPage, pController, &rSet );
460  if (nId == RID_SW_TP_OPTSHDWCRSR || nId == RID_SW_TP_HTML_OPTSHDWCRSR)
461  {
462  SwView* pCurrView = GetView();
463  if(pCurrView)
464  {
465  aSet.Put( SwWrtShellItem( pCurrView->GetWrtShellPtr() ) );
466  xRet->PageCreated(aSet);
467  }
468  }
469  }
470  break;
471  case RID_SW_TP_OPTTEST_PAGE:
472  {
474  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
475  xRet = (*fnCreatePage)( pPage, pController, &rSet );
476  break;
477  }
478  case RID_SW_TP_BACKGROUND:
479  {
481  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG );
482  xRet = (*fnCreatePage)( pPage, pController, &rSet );
483  xRet->PageCreated( rSet );
484  break;
485  }
486  case RID_SW_TP_OPTCAPTION_PAGE:
487  {
489  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SW_TP_OPTCAPTION_PAGE );
490  xRet = (*fnCreatePage)( pPage, pController, &rSet );
491  }
492  break;
493  }
494 
495  if(!xRet)
496  SAL_WARN( "sw", "SwModule::CreateTabPage(): Unknown tabpage id " << nId );
497  return xRet;
498 }
499 
500 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in document.
Definition: edatmisc.cxx:84
SfxViewFrame * GetViewFrame() const
bool GetValue() const
long Width() const
bool IsSynchronize() const
Definition: viewopt.hxx:362
sal_uInt32 GetFieldDivisionY() const
bool IsViewMetaChars() const
Definition: viewopt.hxx:357
#define FONT_GROUP_CTL
Definition: fontcfg.hxx:48
#define FN_VIEW_GRAPHIC
Definition: cmdid.h:154
const Color & GetRetoucheColor() const
Definition: viewopt.hxx:560
FieldUnit
void GetHRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:593
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
void SetFieldDrawX(sal_uInt32 nSet)
FieldUnit GetVScrollMetric() const
Definition: usrpref.hxx:225
void SetDivisionX(short n)
Definition: viewopt.hxx:427
static SfxAbstractDialogFactory * Create()
std::string GetValue
#define FN_PARAM_ELEM
Definition: cmdid.h:762
long Height() const
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:570
SwStdFontConfig * GetStdFontConfig()
Definition: swmodule.hxx:172
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:145
void SetFieldDrawY(sal_uInt32 nSet)
SwPrintOptions * GetPrtOptions(bool bWeb)
Definition: swmodul1.cxx:345
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
sal_uInt32 GetFieldDrawX() const
void SetHScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:218
bool IsApplyCharUnit() const
Definition: usrpref.hxx:232
sal_uInt16 GetValue() const
static LanguageType resolveSystemLanguageByScriptType(LanguageType nLang, sal_Int16 nType)
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:581
#define ASIAN
void SetFieldDivisionY(sal_uInt32 nSet)
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pWebUsrPref
Definition: swmodule.hxx:81
void SetVScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:226
const SwMasterUsrPref * GetUsrPref(bool bWeb) const
Definition: apphdl.cxx:1044
#define FN_HSCROLL_METRIC
Definition: cmdid.h:178
void SetAlignMathObjectsToBaseline(bool bVal, bool noModify=false)
Definition: usrpref.hxx:262
#define FN_PARAM_SHADOWCURSOR
Definition: cmdid.h:800
virtual void ApplyItemSet(sal_uInt16 nId, const SfxItemSet &rSet) override
Definition: appopt.cxx:213
void Invalidate(sal_uInt16 nId)
#define FN_PARAM_ADDPRINTER
Definition: cmdid.h:760
void PutItem(const SfxPoolItem &rItem)
FieldUnit GetHScrollMetric() const
Definition: usrpref.hxx:217
SwWrtShell & GetWrtShell() const
Definition: view.hxx:398
static LanguageType nLang
Definition: srtdlg.cxx:51
SfxApplication * SfxGetpApp()
sal_Int32 GetDefTabInMm100() const
Definition: usrpref.hxx:244
#define FN_VSCROLL_METRIC
Definition: cmdid.h:179
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
#define FN_PARAM_DOCDISP
Definition: cmdid.h:761
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
short GetDivisionX() const
Definition: viewopt.hxx:426
void SetCursorInProtectedArea(bool b)
Definition: viewopt.hxx:394
Item for settings dialog, ShadowCursorPage.
Definition: cfgitems.hxx:113
short GetDivisionY() const
Definition: viewopt.hxx:428
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
void SetSynchronize(bool b)
Definition: viewopt.hxx:364
static SfxViewShell * Current()
virtual std::unique_ptr< SfxTabPage > CreateTabPage(sal_uInt16 nId, weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet) override
Definition: appopt.cxx:386
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
#define FN_PARAM_PRINTER
Definition: cmdid.h:788
#define FN_PARAM_CRSR_IN_PROTECTED
Definition: cmdid.h:804
bool IsBlank(bool bHard=false) const
Definition: viewopt.hxx:223
SfxItemPool & GetPool() const
const Color & GetColor() const
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2586
void SetGridVisible(bool bSet)
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Query default attribute of document.
Definition: edatmisc.cxx:93
bool IsCursorInProtectedArea() const
Definition: viewopt.hxx:391
bool GetUseGridSnap() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SfxBindings & GetBindings()
#define FN_PARAM_WRTSHELL
Definition: cmdid.h:791
void SetOptions(const SfxItemSet &)
HTMLMODE_ON
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:234
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
sal_uInt32 GetFieldDivisionX() const
#define FN_PARAM_STDFONTS
Definition: cmdid.h:789
bool IsTab(bool bHard=false) const
Definition: viewopt.hxx:217
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:74
#define FN_SHADOWCURSOR
Definition: cmdid.h:512
void SetFieldDivisionX(sal_uInt32 nSet)
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:250
void SetApplyCharUnit(bool bApplyChar, bool bWeb)
Definition: uitool.cxx:808
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:569
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
SfxItemPool * GetPool() const
void SetViewMetaChars(bool b)
Definition: viewopt.hxx:359
void SetSnapSize(Size const &rSz)
Definition: viewopt.hxx:345
bool IsInReading() const
Definition: doc.hxx:951
#define FONT_GROUP_CJK
Definition: fontcfg.hxx:47
bool GetSynchronize() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetDivisionY(short n)
Definition: viewopt.hxx:429
FieldUnit GetMetric() const
Definition: usrpref.hxx:208
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:399
static SfxViewFrame * Current()
constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void SetSynchronize(bool bSet)
virtual std::unique_ptr< SfxItemSet > CreateItemSet(sal_uInt16 nId) override
Definition: appopt.cxx:62
Item for settings dialog - document view.
Definition: cfgitems.hxx:41
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:423
void SetRetoucheColor(const Color &r)
Definition: viewopt.hxx:561
void AlignAllFormulasToBaseline()
aligns all formulas with anchor 'as char' to baseline
Definition: fefly1.cxx:2087
void SetUseGridSnap(bool bSet)
const Size & GetSnapSize() const
Definition: viewopt.hxx:346
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:176
#define FN_VIEW_HIDDEN_PARA
Definition: cmdid.h:172
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pUsrPref
Definition: swmodule.hxx:80
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:579
sal_uInt32 GetFieldDrawY() const
void GetVRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:588
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
#define FN_VIEW_META_CHARS
Definition: cmdid.h:161
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:244
void SetSnap(bool b)
Definition: viewopt.hxx:342
bool m_bParagraphEnd
Definition: cfgitems.hxx:46
bool IsGridVisible() const
Definition: viewopt.hxx:348
#define SAL_WARN(area, stream)
css::uno::Any GetProperty(const OUString &rPropertyName) const
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
void SetGridVisible(bool b)
Definition: viewopt.hxx:350
bool GetGridVisible() const
bool IsSnap() const
Definition: viewopt.hxx:340
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:693
void SetDefTabInMm100(sal_Int32 nSet, bool bNoModify=false)
Definition: usrpref.hxx:245
#define COMPLEX
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
Definition: view.hxx:144
SwView * GetView()
Definition: swmodule.hxx:146
void ApplyUsrPref(const SwViewOption &, SwView *, SvViewOpt nDest=SvViewOpt::DestView)
Definition: swmodul1.cxx:137