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