LibreOffice Module sw (master)  1
unomod.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 <com/sun/star/beans/PropertyAttribute.hpp>
21 #include <com/sun/star/view/DocumentZoomType.hpp>
24 #include <o3tl/any.hxx>
25 #include <osl/diagnose.h>
26 #include <rtl/ustrbuf.hxx>
27 #include <svl/itemprop.hxx>
28 #include <tools/urlobj.hxx>
29 #include <vcl/svapp.hxx>
30 
31 #include <unomod.hxx>
32 #include <usrpref.hxx>
33 #include <prtopt.hxx>
34 #include <swmodule.hxx>
35 #include <view.hxx>
36 #include <docsh.hxx>
37 #include <wrtsh.hxx>
38 #include <viewopt.hxx>
39 #include <doc.hxx>
41 #include <edtwin.hxx>
42 using namespace ::com::sun::star;
43 using namespace ::com::sun::star::uno;
44 using namespace ::com::sun::star::beans;
45 using namespace ::com::sun::star::lang;
46 using namespace ::comphelper;
47 
48 namespace {
49 
51 {
52  HANDLE_VIEWSET_ANNOTATIONS,
53  HANDLE_VIEWSET_BREAKS,
54  HANDLE_VIEWSET_DRAWINGS,
55  HANDLE_VIEWSET_FIELD_COMMANDS,
56  HANDLE_VIEWSET_FOOTNOTE_BACKGROUND,
57  HANDLE_VIEWSET_GRAPHICS,
58  HANDLE_VIEWSET_HIDDEN_CHARACTERS,
59  HANDLE_VIEWSET_HIDDEN_PARAGRAPHS,
60  HANDLE_VIEWSET_HIDDEN_TEXT,
61  HANDLE_VIEWSET_HRULER,
62  HANDLE_VIEWSET_HSCROLL,
63  HANDLE_VIEWSET_INDEX_MARK_BACKGROUND,
64  HANDLE_VIEWSET_NONPRINTING_CHARACTERS,
65  HANDLE_VIEWSET_ONLINE_LAYOUT,
66  HANDLE_VIEWSET_PARA_BREAKS,
67  HANDLE_VIEWSET_PROTECTED_SPACES,
68  HANDLE_VIEWSET_SOFT_HYPHENS,
69  HANDLE_VIEWSET_SPACES,
70  HANDLE_VIEWSET_TABLE_BOUNDARIES,
71  HANDLE_VIEWSET_TABLES,
72  HANDLE_VIEWSET_TABSTOPS,
73  HANDLE_VIEWSET_TEXT_BOUNDARIES,
74  HANDLE_VIEWSET_TEXT_FIELD_BACKGROUND,
75  HANDLE_VIEWSET_VRULER,
76  HANDLE_VIEWSET_VSCROLL,
77  HANDLE_VIEWSET_SMOOTH_SCROLLING,
78  HANDLE_VIEWSET_ZOOM_TYPE,
79  HANDLE_VIEWSET_ZOOM,
80  HANDLE_VIEWSET_SHOW_CONTENT_TIPS,
81  HANDLE_VIEWSET_HELP_URL,
82  HANDLE_VIEWSET_VRULER_RIGHT,
83  HANDLE_VIEWSET_SHOW_RULER,
84  HANDLE_VIEWSET_IS_RASTER_VISIBLE,
85  HANDLE_VIEWSET_IS_SNAP_TO_RASTER,
86  HANDLE_VIEWSET_RASTER_RESOLUTION_X,
87  HANDLE_VIEWSET_RASTER_RESOLUTION_Y,
88  HANDLE_VIEWSET_RASTER_SUBDIVISION_X,
89  HANDLE_VIEWSET_RASTER_SUBDIVISION_Y,
90  HANDLE_VIEWSET_HORI_RULER_METRIC,
91  HANDLE_VIEWSET_VERT_RULER_METRIC,
92  HANDLE_VIEWSET_SCROLLBAR_TIPS,
93  HANDLE_VIEWSET_INLINECHANGES_TIPS,
94  HANDLE_VIEWSET_HIDE_WHITESPACE,
95  HANDLE_VIEWSET_USE_HEADERFOOTERMENU,
96  HANDLE_VIEWSET_BOOKMARKS,
97 };
98 
100 {
101  HANDLE_PRINTSET_ANNOTATION_MODE,
102  HANDLE_PRINTSET_BLACK_FONTS,
103  HANDLE_PRINTSET_CONTROLS,
104  HANDLE_PRINTSET_DRAWINGS,
105  HANDLE_PRINTSET_GRAPHICS,
106  HANDLE_PRINTSET_LEFT_PAGES,
107  HANDLE_PRINTSET_PAGE_BACKGROUND,
108  HANDLE_PRINTSET_PROSPECT,
109  HANDLE_PRINTSET_REVERSED,
110  HANDLE_PRINTSET_RIGHT_PAGES,
111  HANDLE_PRINTSET_FAX_NAME,
112  HANDLE_PRINTSET_PAPER_FROM_SETUP,
113  HANDLE_PRINTSET_TABLES,
114  HANDLE_PRINTSET_SINGLE_JOBS,
115  HANDLE_PRINTSET_EMPTY_PAGES,
116  HANDLE_PRINTSET_PROSPECT_RTL,
117  HANDLE_PRINTSET_PLACEHOLDER,
118  HANDLE_PRINTSET_HIDDEN_TEXT
119 };
120 
121 }
122 
123 static ChainablePropertySetInfo * lcl_createViewSettingsInfo()
124 {
125  static PropertyInfo const aViewSettingsMap_Impl[] =
126  {
127  { OUString( "HelpURL" ), HANDLE_VIEWSET_HELP_URL , cppu::UnoType<OUString>::get(), PROPERTY_NONE},
128  { OUString( "HorizontalRulerMetric"),HANDLE_VIEWSET_HORI_RULER_METRIC , cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE},
129  { OUString( "IsRasterVisible"), HANDLE_VIEWSET_IS_RASTER_VISIBLE, cppu::UnoType<bool>::get(), PROPERTY_NONE},
130  { OUString( "IsSnapToRaster"), HANDLE_VIEWSET_IS_SNAP_TO_RASTER, cppu::UnoType<bool>::get(), PROPERTY_NONE},
131  { OUString( "IsVertRulerRightAligned"),HANDLE_VIEWSET_VRULER_RIGHT , cppu::UnoType<bool>::get(), PROPERTY_NONE},
132  { OUString( "ShowContentTips" ), HANDLE_VIEWSET_SHOW_CONTENT_TIPS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
133  { OUString( "ShowInlineTooltips" ), HANDLE_VIEWSET_INLINECHANGES_TIPS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
134  { OUString( "UseHeaderFooterMenu" ), HANDLE_VIEWSET_USE_HEADERFOOTERMENU , cppu::UnoType<bool>::get(), PROPERTY_NONE},
135  { OUString( "RasterResolutionX"), HANDLE_VIEWSET_RASTER_RESOLUTION_X, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE},
136  { OUString( "RasterResolutionY"), HANDLE_VIEWSET_RASTER_RESOLUTION_Y, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE},
137  { OUString( "RasterSubdivisionX"), HANDLE_VIEWSET_RASTER_SUBDIVISION_X, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE},
138  { OUString( "RasterSubdivisionY"), HANDLE_VIEWSET_RASTER_SUBDIVISION_Y, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE},
139  { OUString( "ShowAnnotations" ), HANDLE_VIEWSET_ANNOTATIONS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
140  { OUString( "ShowBookmarks" ), HANDLE_VIEWSET_BOOKMARKS, cppu::UnoType<bool>::get(), PROPERTY_NONE },
141  { OUString( "ShowBreaks"), HANDLE_VIEWSET_BREAKS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
142  { OUString( "ShowDrawings"), HANDLE_VIEWSET_DRAWINGS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
143  { OUString( "ShowFieldCommands"), HANDLE_VIEWSET_FIELD_COMMANDS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
144  { OUString( "ShowFootnoteBackground"),HANDLE_VIEWSET_FOOTNOTE_BACKGROUND , cppu::UnoType<bool>::get(), PROPERTY_NONE},
145  { OUString( "ShowGraphics"), HANDLE_VIEWSET_GRAPHICS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
146  { OUString( "ShowHiddenCharacters"), HANDLE_VIEWSET_HIDDEN_CHARACTERS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
147  { OUString( "HideWhitespace"), HANDLE_VIEWSET_HIDE_WHITESPACE , cppu::UnoType<bool>::get(), PROPERTY_NONE},
148  { OUString( "ShowHiddenParagraphs"), HANDLE_VIEWSET_HIDDEN_PARAGRAPHS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
149  { OUString( "ShowHiddenText"), HANDLE_VIEWSET_HIDDEN_TEXT , cppu::UnoType<bool>::get(), PROPERTY_NONE},
150  { OUString( "ShowHoriRuler"), HANDLE_VIEWSET_HRULER , cppu::UnoType<bool>::get(), PROPERTY_NONE},
151  { OUString( "ShowHoriScrollBar"), HANDLE_VIEWSET_HSCROLL , cppu::UnoType<bool>::get(), PROPERTY_NONE},
152  { OUString( "ShowIndexMarkBackground"),HANDLE_VIEWSET_INDEX_MARK_BACKGROUND, cppu::UnoType<bool>::get(),PROPERTY_NONE},
153  { OUString( "ShowNonprintingCharacters"),HANDLE_VIEWSET_NONPRINTING_CHARACTERS, cppu::UnoType<bool>::get(),PROPERTY_NONE},
154  { OUString( "ShowOnlineLayout"), HANDLE_VIEWSET_ONLINE_LAYOUT , cppu::UnoType<bool>::get(), PropertyAttribute::MAYBEVOID},
155  { OUString( "ShowParaBreaks"), HANDLE_VIEWSET_PARA_BREAKS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
156  { OUString( "ShowProtectedSpaces"), HANDLE_VIEWSET_PROTECTED_SPACES , cppu::UnoType<bool>::get(), PROPERTY_NONE},
157  { OUString( "ShowRulers"), HANDLE_VIEWSET_SHOW_RULER , cppu::UnoType<bool>::get(), PROPERTY_NONE},
158  { OUString( "ShowScrollBarTips"), HANDLE_VIEWSET_SCROLLBAR_TIPS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
159  { OUString( "ShowSoftHyphens"), HANDLE_VIEWSET_SOFT_HYPHENS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
160  { OUString( "ShowSpaces"), HANDLE_VIEWSET_SPACES , cppu::UnoType<bool>::get(), PROPERTY_NONE},
161  { OUString( "ShowTableBoundaries"), HANDLE_VIEWSET_TABLE_BOUNDARIES , cppu::UnoType<bool>::get(), PROPERTY_NONE},
162  { OUString( "ShowTables"), HANDLE_VIEWSET_TABLES , cppu::UnoType<bool>::get(), PROPERTY_NONE},
163  { OUString( "ShowTabstops"), HANDLE_VIEWSET_TABSTOPS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
164  { OUString( "ShowTextBoundaries"), HANDLE_VIEWSET_TEXT_BOUNDARIES , cppu::UnoType<bool>::get(), PROPERTY_NONE},
165  { OUString( "ShowTextFieldBackground"),HANDLE_VIEWSET_TEXT_FIELD_BACKGROUND, cppu::UnoType<bool>::get(),PROPERTY_NONE},
166  { OUString( "ShowVertRuler"), HANDLE_VIEWSET_VRULER , cppu::UnoType<bool>::get(), PROPERTY_NONE},
167  { OUString( "ShowVertScrollBar"), HANDLE_VIEWSET_VSCROLL , cppu::UnoType<bool>::get(), PROPERTY_NONE},
168  { OUString( "SmoothScrolling"), HANDLE_VIEWSET_SMOOTH_SCROLLING , cppu::UnoType<bool>::get(), PROPERTY_NONE},
169  { OUString( "VerticalRulerMetric"), HANDLE_VIEWSET_VERT_RULER_METRIC , cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE},
170  { OUString( "ZoomType"), HANDLE_VIEWSET_ZOOM_TYPE , cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE},
171  { OUString( "ZoomValue"), HANDLE_VIEWSET_ZOOM , cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE},
172  { OUString(), 0, css::uno::Type(), 0 }
173  };
174  return new ChainablePropertySetInfo ( aViewSettingsMap_Impl );
175 }
176 
177 static ChainablePropertySetInfo * lcl_createPrintSettingsInfo()
178 {
179  static PropertyInfo const aPrintSettingsMap_Impl[] =
180  {
181  { OUString( "PrintAnnotationMode" ), HANDLE_PRINTSET_ANNOTATION_MODE , cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE},
182  { OUString( "PrintBlackFonts" ), HANDLE_PRINTSET_BLACK_FONTS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
183  { OUString( "PrintControls" ), HANDLE_PRINTSET_CONTROLS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
184  { OUString( "PrintDrawings" ), HANDLE_PRINTSET_DRAWINGS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
185  { OUString( "PrintGraphics" ), HANDLE_PRINTSET_GRAPHICS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
186  { OUString( "PrintHiddenText"), HANDLE_PRINTSET_HIDDEN_TEXT , cppu::UnoType<bool>::get(), PROPERTY_NONE},
187  { OUString( "PrintLeftPages" ), HANDLE_PRINTSET_LEFT_PAGES , cppu::UnoType<bool>::get(), PROPERTY_NONE},
188  { OUString( "PrintPageBackground" ), HANDLE_PRINTSET_PAGE_BACKGROUND , cppu::UnoType<bool>::get(), PROPERTY_NONE},
189  { OUString( "PrintProspect" ), HANDLE_PRINTSET_PROSPECT , cppu::UnoType<bool>::get(), PROPERTY_NONE},
190  { OUString( "PrintProspectRTL" ), HANDLE_PRINTSET_PROSPECT_RTL , cppu::UnoType<bool>::get(), PROPERTY_NONE},
191  { OUString( "PrintReversed" ), HANDLE_PRINTSET_REVERSED , cppu::UnoType<bool>::get(), PROPERTY_NONE},
192  { OUString( "PrintRightPages" ), HANDLE_PRINTSET_RIGHT_PAGES , cppu::UnoType<bool>::get(), PROPERTY_NONE},
193  { OUString( "PrintFaxName" ), HANDLE_PRINTSET_FAX_NAME , cppu::UnoType<OUString>::get(), PROPERTY_NONE},
194  { OUString( "PrintPaperFromSetup" ), HANDLE_PRINTSET_PAPER_FROM_SETUP , cppu::UnoType<bool>::get(), PROPERTY_NONE},
195  { OUString( "PrintTables" ), HANDLE_PRINTSET_TABLES , cppu::UnoType<bool>::get(), PROPERTY_NONE},
196  { OUString( "PrintTextPlaceholder"), HANDLE_PRINTSET_PLACEHOLDER , cppu::UnoType<bool>::get(), PROPERTY_NONE},
197  { OUString( "PrintSingleJobs" ), HANDLE_PRINTSET_SINGLE_JOBS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
198  { OUString( "PrintEmptyPages" ), HANDLE_PRINTSET_EMPTY_PAGES , cppu::UnoType<bool>::get(), PROPERTY_NONE},
199  { OUString(), 0, css::uno::Type(), 0}
200  };
201  return new ChainablePropertySetInfo ( aPrintSettingsMap_Impl );
202 }
203 
205  mxViewSettings(),
206  mxPrintSettings()
207 {
208 }
209 
211 {
212 }
213 
214 Reference< XPropertySet > SwXModule::getViewSettings()
215 {
216  SolarMutexGuard aGuard;
217  if(!mxViewSettings.is())
218  {
219  OSL_FAIL("Web or Text?");
220  mxViewSettings = new SwXViewSettings( nullptr );
221  }
222  return mxViewSettings;
223 }
224 
225 Reference< XPropertySet > SwXModule::getPrintSettings()
226 {
227  SolarMutexGuard aGuard;
228  if(!mxPrintSettings.is())
229  {
230  OSL_FAIL("Web or Text?");
232  }
233  return mxPrintSettings;
234 }
235 
237 {
238  return "SwXModule";
239 }
240 
241 sal_Bool SwXModule::supportsService(const OUString& rServiceName)
242 {
243  return cppu::supportsService(this, rServiceName);
244 }
245 
247 {
248  return { "com.sun.star.text.GlobalSettings" };
249 }
250 
252 : ChainablePropertySet ( lcl_createPrintSettingsInfo (), &Application::GetSolarMutex() )
253 , meType(eType)
254 , mpPrtOpt ( nullptr )
255 , mpDoc ( pDoc )
256 {
257 }
258 
260  throw()
261 {
262 }
263 
265 {
266  switch (meType)
267  {
269  mpPrtOpt = SW_MOD()->GetPrtOptions( false );
270  break;
272  {
273  if (!mpDoc)
274  throw IllegalArgumentException ();
276  }
277  break;
278  }
279 }
280 
281 namespace
282 {
283  bool tryBoolAccess(const uno::Any &rValue)
284  {
285  const auto xPrSet = o3tl::tryAccess<bool>(rValue);
286  if (!xPrSet)
287  throw lang::IllegalArgumentException();
288  return *xPrSet;
289  }
290 }
291 
293 {
294  switch( rInfo.mnHandle )
295  {
296  case HANDLE_PRINTSET_LEFT_PAGES:
297  {
298  mpPrtOpt->SetPrintLeftPage(tryBoolAccess(rValue));
299  }
300  break;
301  case HANDLE_PRINTSET_RIGHT_PAGES:
302  {
303  mpPrtOpt->SetPrintRightPage(tryBoolAccess(rValue));
304  }
305  break;
306  case HANDLE_PRINTSET_REVERSED:
307  {
308  mpPrtOpt->SetPrintReverse(tryBoolAccess(rValue));
309  }
310  break;
311  case HANDLE_PRINTSET_PROSPECT:
312  {
313  mpPrtOpt->SetPrintProspect(tryBoolAccess(rValue));
314  }
315  break;
316  case HANDLE_PRINTSET_GRAPHICS:
317  {
318  mpPrtOpt->SetPrintGraphic(tryBoolAccess(rValue));
319  }
320  break;
321  case HANDLE_PRINTSET_TABLES:
322  {
323  mpPrtOpt->SetPrintTable(tryBoolAccess(rValue));
324  }
325  break;
326  case HANDLE_PRINTSET_DRAWINGS:
327  {
328  mpPrtOpt->SetPrintDraw(tryBoolAccess(rValue));
329  }
330  break;
331  case HANDLE_PRINTSET_CONTROLS:
332  {
333  mpPrtOpt->SetPrintControl(tryBoolAccess(rValue));
334  }
335  break;
336  case HANDLE_PRINTSET_PAGE_BACKGROUND:
337  {
338  mpPrtOpt->SetPrintPageBackground(tryBoolAccess(rValue));
339  }
340  break;
341  case HANDLE_PRINTSET_BLACK_FONTS:
342  {
343  mpPrtOpt->SetPrintBlackFont(tryBoolAccess(rValue));
344  }
345  break;
346  case HANDLE_PRINTSET_SINGLE_JOBS:
347  {
348  mpPrtOpt->SetPrintSingleJobs(tryBoolAccess(rValue));
349  }
350  break;
351  case HANDLE_PRINTSET_PAPER_FROM_SETUP:
352  {
353  mpPrtOpt->SetPaperFromSetup(tryBoolAccess(rValue));
354  }
355  break;
356  case HANDLE_PRINTSET_ANNOTATION_MODE:
357  {
358  sal_Int16 nTmp = 0;
359  rValue >>= nTmp;
360  SwPostItMode nVal = static_cast<SwPostItMode>(nTmp);
361  if(nVal > SwPostItMode::EndPage)
362  throw lang::IllegalArgumentException();
363 
364  mpPrtOpt->SetPrintPostIts(nVal);
365  }
366  break;
367  case HANDLE_PRINTSET_EMPTY_PAGES:
368  {
369  mpPrtOpt->SetPrintEmptyPages(tryBoolAccess(rValue));
370  }
371  break;
372  case HANDLE_PRINTSET_FAX_NAME:
373  {
374  OUString sString;
375  if ( !(rValue >>= sString))
376  throw lang::IllegalArgumentException();
377 
378  mpPrtOpt->SetFaxName(sString);
379  }
380  break;
381  case HANDLE_PRINTSET_PROSPECT_RTL:
382  {
383  mpPrtOpt->SetPrintProspect_RTL(tryBoolAccess(rValue));
384  }
385  break;
386  case HANDLE_PRINTSET_PLACEHOLDER:
387  {
388  mpPrtOpt->SetPrintTextPlaceholder(tryBoolAccess(rValue));
389  }
390  break;
391  case HANDLE_PRINTSET_HIDDEN_TEXT:
392  {
393  mpPrtOpt->SetPrintHiddenText(tryBoolAccess(rValue));
394  }
395  break;
396  default:
397  throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
398  }
399 }
400 
402 {
403  mpPrtOpt = nullptr;
404 }
405 
407 {
408  switch (meType)
409  {
411  mpPrtOpt = SW_MOD()->GetPrtOptions( false );
412  break;
414  {
415  if (!mpDoc)
416  throw IllegalArgumentException ();
418  }
419  break;
420  }
421 }
422 
424 {
425  switch( rInfo.mnHandle )
426  {
427  case HANDLE_PRINTSET_LEFT_PAGES:
428  rValue <<= mpPrtOpt->IsPrintLeftPage();
429  break;
430  case HANDLE_PRINTSET_RIGHT_PAGES:
431  rValue <<= mpPrtOpt->IsPrintRightPage();
432  break;
433  case HANDLE_PRINTSET_REVERSED:
434  rValue <<= mpPrtOpt->IsPrintReverse();
435  break;
436  case HANDLE_PRINTSET_PROSPECT:
437  rValue <<= mpPrtOpt->IsPrintProspect();
438  break;
439  case HANDLE_PRINTSET_GRAPHICS:
440  rValue <<= mpPrtOpt->IsPrintGraphic();
441  break;
442  case HANDLE_PRINTSET_TABLES:
443  rValue <<= mpPrtOpt->IsPrintTable();
444  break;
445  case HANDLE_PRINTSET_DRAWINGS:
446  rValue <<= mpPrtOpt->IsPrintDraw();
447  break;
448  case HANDLE_PRINTSET_CONTROLS:
449  rValue <<= mpPrtOpt->IsPrintControl();
450  break;
451  case HANDLE_PRINTSET_PAGE_BACKGROUND:
452  rValue <<= mpPrtOpt->IsPrintPageBackground();
453  break;
454  case HANDLE_PRINTSET_BLACK_FONTS:
455  rValue <<= mpPrtOpt->IsPrintBlackFont();
456  break;
457  case HANDLE_PRINTSET_SINGLE_JOBS:
458  rValue <<= mpPrtOpt->IsPrintSingleJobs();
459  break;
460  case HANDLE_PRINTSET_EMPTY_PAGES:
461  rValue <<= mpPrtOpt->IsPrintEmptyPages();
462  break;
463  case HANDLE_PRINTSET_PAPER_FROM_SETUP:
464  rValue <<= mpPrtOpt->IsPaperFromSetup();
465  break;
466  case HANDLE_PRINTSET_ANNOTATION_MODE:
467  {
468  rValue <<= static_cast < sal_Int16 > ( mpPrtOpt->GetPrintPostIts() );
469  }
470  break;
471  case HANDLE_PRINTSET_FAX_NAME :
472  {
473  rValue <<= mpPrtOpt->GetFaxName();
474  }
475  break;
476  case HANDLE_PRINTSET_PROSPECT_RTL:
477  {
478  rValue <<= mpPrtOpt->IsPrintProspectRTL();
479  }
480  break;
481  case HANDLE_PRINTSET_PLACEHOLDER:
482  {
483  rValue <<= mpPrtOpt->IsPrintTextPlaceholder();
484  }
485  break;
486  case HANDLE_PRINTSET_HIDDEN_TEXT:
487  {
488  rValue <<= mpPrtOpt->IsPrintHiddenText();
489  }
490  break;
491  default:
492  throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
493  }
494 }
495 
497 {
498  mpPrtOpt = nullptr;
499 }
500 
502 {
503  return "SwXPrintSettings";
504 }
505 
506 sal_Bool SwXPrintSettings::supportsService(const OUString& rServiceName)
507 {
508  return cppu::supportsService(this, rServiceName);
509 }
510 
512 {
513  Sequence<OUString> aRet { "com.sun.star.text.PrintSettings" };
514  return aRet;
515 }
516 
518  : ChainablePropertySet( lcl_createViewSettingsInfo (), &Application::GetSolarMutex() )
519  , pView(pVw)
520  , mpConstViewOption(nullptr)
521  , bObjectValid(true)
522  , mbApplyZoom(false)
523  , eHRulerUnit(FieldUnit::CM)
524  , mbApplyHRulerMetric(false)
525  , eVRulerUnit(FieldUnit::CM)
526  , mbApplyVRulerMetric(false)
527 {
528  // This property only exists if we have a view (ie, not at the module )
529  if ( !pView )
530  mxInfo->remove ( "HelpURL" );
531 
532 }
533 
535  throw()
536 {
537 
538 }
539 
541 {
542  const SwViewOption* pVOpt = nullptr;
543  if(pView)
544  {
545  if(!IsValid())
546  return;
547  pVOpt = pView->GetWrtShell().GetViewOptions();
548  }
549  else
550  pVOpt = SW_MOD()->GetViewOption(false);
551 
552  mpViewOption.reset( new SwViewOption (*pVOpt) );
553  mbApplyZoom = false;
554  if(pView)
555  mpViewOption->SetStarOneSetting(true);
556 }
557 
559 {
560  // the API flag should not be set to the application's view settings
561  switch( rInfo.mnHandle )
562  {
563  case HANDLE_VIEWSET_SHOW_RULER : mpViewOption->SetViewAnyRuler(*o3tl::doAccess<bool>(rValue)); break;
564  case HANDLE_VIEWSET_HRULER : mpViewOption->SetViewHRuler(*o3tl::doAccess<bool>(rValue)); break;
565  case HANDLE_VIEWSET_VRULER : mpViewOption->SetViewVRuler(*o3tl::doAccess<bool>(rValue));break;
566  case HANDLE_VIEWSET_VRULER_RIGHT : mpViewOption->SetVRulerRight(*o3tl::doAccess<bool>(rValue));break;
567  case HANDLE_VIEWSET_HSCROLL : mpViewOption->SetViewHScrollBar(*o3tl::doAccess<bool>(rValue));break;
568  case HANDLE_VIEWSET_VSCROLL : mpViewOption->SetViewVScrollBar(*o3tl::doAccess<bool>(rValue));break;
569  case HANDLE_VIEWSET_GRAPHICS : mpViewOption->SetGraphic(*o3tl::doAccess<bool>(rValue));break;
570  case HANDLE_VIEWSET_TABLES : mpViewOption->SetTable(*o3tl::doAccess<bool>(rValue)); break;
571  case HANDLE_VIEWSET_DRAWINGS : mpViewOption->SetDraw(*o3tl::doAccess<bool>(rValue)); break;
572  case HANDLE_VIEWSET_FIELD_COMMANDS : mpViewOption->SetFieldName(*o3tl::doAccess<bool>(rValue)); break;
573  case HANDLE_VIEWSET_ANNOTATIONS : mpViewOption->SetPostIts(*o3tl::doAccess<bool>(rValue)); break;
574  case HANDLE_VIEWSET_INDEX_MARK_BACKGROUND : SwViewOption::SetAppearanceFlag(ViewOptFlags::FieldShadings, *o3tl::doAccess<bool>(rValue), true); break;
575  case HANDLE_VIEWSET_NONPRINTING_CHARACTERS: mpViewOption->SetViewMetaChars( *o3tl::doAccess<bool>(rValue) ); break;
576  case HANDLE_VIEWSET_FOOTNOTE_BACKGROUND : SwViewOption::SetAppearanceFlag(ViewOptFlags::FieldShadings, *o3tl::doAccess<bool>(rValue), true); break;
577  case HANDLE_VIEWSET_TEXT_FIELD_BACKGROUND : SwViewOption::SetAppearanceFlag(ViewOptFlags::FieldShadings, *o3tl::doAccess<bool>(rValue), true); break;
578  case HANDLE_VIEWSET_PARA_BREAKS : mpViewOption->SetParagraph(*o3tl::doAccess<bool>(rValue)); break;
579  case HANDLE_VIEWSET_SOFT_HYPHENS : mpViewOption->SetSoftHyph(*o3tl::doAccess<bool>(rValue)); break;
580  case HANDLE_VIEWSET_SPACES : mpViewOption->SetBlank(*o3tl::doAccess<bool>(rValue)); break;
581  case HANDLE_VIEWSET_PROTECTED_SPACES : mpViewOption->SetHardBlank(*o3tl::doAccess<bool>(rValue)); break;
582  case HANDLE_VIEWSET_TABSTOPS : mpViewOption->SetTab(*o3tl::doAccess<bool>(rValue)); break;
583  case HANDLE_VIEWSET_BREAKS : mpViewOption->SetLineBreak(*o3tl::doAccess<bool>(rValue)); break;
584  case HANDLE_VIEWSET_BOOKMARKS : mpViewOption->SetShowBookmarks(*o3tl::doAccess<bool>(rValue)); break;
585  case HANDLE_VIEWSET_HIDDEN_TEXT : mpViewOption->SetShowHiddenField(*o3tl::doAccess<bool>(rValue)); break;
586  case HANDLE_VIEWSET_HIDDEN_CHARACTERS : mpViewOption->SetShowHiddenChar(*o3tl::doAccess<bool>(rValue)); break;
587  case HANDLE_VIEWSET_HIDDEN_PARAGRAPHS : mpViewOption->SetShowHiddenPara(*o3tl::doAccess<bool>(rValue)); break;
588  case HANDLE_VIEWSET_TABLE_BOUNDARIES : SwViewOption::SetAppearanceFlag(ViewOptFlags::TableBoundaries, *o3tl::doAccess<bool>(rValue), true); break;
589  case HANDLE_VIEWSET_TEXT_BOUNDARIES : SwViewOption::SetDocBoundaries(*o3tl::doAccess<bool>(rValue)); break;
590  case HANDLE_VIEWSET_SMOOTH_SCROLLING : mpViewOption->SetSmoothScroll(*o3tl::doAccess<bool>(rValue)); break;
591  case HANDLE_VIEWSET_SHOW_CONTENT_TIPS : mpViewOption->SetShowContentTips(*o3tl::doAccess<bool>(rValue)); break;
592  case HANDLE_VIEWSET_IS_RASTER_VISIBLE : mpViewOption->SetGridVisible(*o3tl::doAccess<bool>(rValue)); break;
593  case HANDLE_VIEWSET_IS_SNAP_TO_RASTER : mpViewOption->SetSnap(*o3tl::doAccess<bool>(rValue)); break;
594  case HANDLE_VIEWSET_SCROLLBAR_TIPS : mpViewOption->SetShowScrollBarTips(*o3tl::doAccess<bool>(rValue)); break;
595  case HANDLE_VIEWSET_INLINECHANGES_TIPS : mpViewOption->SetShowInlineTooltips(*o3tl::doAccess<bool>(rValue)); break;
596  case HANDLE_VIEWSET_USE_HEADERFOOTERMENU : mpViewOption->SetUseHeaderFooterMenu(*o3tl::doAccess<bool>(rValue)); break;
597  case HANDLE_VIEWSET_RASTER_RESOLUTION_X :
598  {
599  sal_Int32 nTmp = 0;
600  if(!(rValue >>= nTmp) || nTmp < 10)
601  throw IllegalArgumentException();
602  Size aSize( mpViewOption->GetSnapSize() );
603  aSize.setWidth( convertMm100ToTwip( nTmp ) );
604  mpViewOption->SetSnapSize( aSize );
605  }
606  break;
607  case HANDLE_VIEWSET_RASTER_RESOLUTION_Y :
608  {
609  sal_Int32 nTmp = 0;
610  if(!(rValue >>= nTmp) || nTmp < 10)
611  throw IllegalArgumentException();
612  Size aSize( mpViewOption->GetSnapSize() );
613  aSize.setHeight( convertMm100ToTwip( nTmp ) );
614  mpViewOption->SetSnapSize( aSize );
615  }
616  break;
617  case HANDLE_VIEWSET_RASTER_SUBDIVISION_X :
618  {
619  sal_Int32 nTmp = 0;
620  if(!(rValue >>= nTmp) || !(0 <= nTmp && nTmp < 100))
621  throw IllegalArgumentException();
622  mpViewOption->SetDivisionX( static_cast<short>(nTmp) );
623  }
624  break;
625  case HANDLE_VIEWSET_RASTER_SUBDIVISION_Y :
626  {
627  sal_Int32 nTmp = 0;
628  if(!(rValue >>= nTmp) || !(0 <= nTmp && nTmp < 100))
629  throw IllegalArgumentException();
630  mpViewOption->SetDivisionY( static_cast<short>(nTmp) );
631  }
632  break;
633  case HANDLE_VIEWSET_ZOOM :
634  {
635  sal_Int16 nZoom = 0;
636  if(!(rValue >>= nZoom) || nZoom > MAXZOOM || nZoom < MINZOOM)
637  throw lang::IllegalArgumentException();
638  mpViewOption->SetZoom(static_cast<sal_uInt16>(nZoom));
639  mbApplyZoom = true;
640  }
641  break;
642  case HANDLE_VIEWSET_ZOOM_TYPE:
643  {
644  sal_Int16 nZoom = 0;
645  if(!(rValue >>= nZoom))
646  throw IllegalArgumentException();
647  SvxZoomType eZoom;
648  switch (nZoom)
649  {
650  case view::DocumentZoomType::OPTIMAL:
651  eZoom = SvxZoomType::OPTIMAL;
652  break;
653  case view::DocumentZoomType::PAGE_WIDTH:
654  eZoom = SvxZoomType::PAGEWIDTH;
655  break;
656  case view::DocumentZoomType::ENTIRE_PAGE:
657  eZoom = SvxZoomType::WHOLEPAGE;
658  break;
659  case view::DocumentZoomType::BY_VALUE:
660  eZoom = SvxZoomType::PERCENT;
661  break;
662  case view::DocumentZoomType::PAGE_WIDTH_EXACT:
663  eZoom = SvxZoomType::PAGEWIDTH_NOBORDER;
664  break;
665  default:
666  throw IllegalArgumentException(
667  "SwXViewSettings: invalid zoom type", nullptr, 0);
668  }
669  mpViewOption->SetZoomType( eZoom );
670  mbApplyZoom = true;
671  }
672  break;
673  case HANDLE_VIEWSET_ONLINE_LAYOUT :
674  {
675  if ( pView )
676  {
677  bool bVal = *o3tl::doAccess<bool>(rValue);
679  if (!bVal != !aOpt.getBrowseMode())
680  {
681  aOpt.setBrowseMode( bVal );
683 
684  // must be set in mpViewOption as this will overwrite settings in _post!
685  if(mpViewOption)
686  mpViewOption->setBrowseMode(bVal);
687 
689  }
690  }
691  }
692  break;
693  case HANDLE_VIEWSET_HIDE_WHITESPACE:
694  {
695  if ( pView )
696  {
697  bool bVal = *o3tl::doAccess<bool>(rValue);
699  if (!bVal != !aOpt.IsHideWhitespaceMode())
700  {
701  aOpt.SetHideWhitespaceMode( bVal );
703 
704  // must be set in mpViewOption as this will overwrite settings in _post!
705  if(mpViewOption)
706  mpViewOption->SetHideWhitespaceMode(bVal);
707  }
708  }
709  }
710  break;
711  case HANDLE_VIEWSET_HELP_URL:
712  {
713  if ( !pView )
714  throw UnknownPropertyException();
715 
716  OUString sHelpURL;
717  if ( ! ( rValue >>= sHelpURL ) )
718  throw IllegalArgumentException();
719 
720  INetURLObject aHID( sHelpURL );
721  if ( aHID.GetProtocol() != INetProtocol::Hid )
722  throw IllegalArgumentException ();
723 
724  pView->GetEditWin().SetHelpId( OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ) );
725  }
726  break;
727  case HANDLE_VIEWSET_HORI_RULER_METRIC:
728  case HANDLE_VIEWSET_VERT_RULER_METRIC:
729  {
730  sal_uInt16 nUnit;
731  if( rValue >>= nUnit )
732  switch (static_cast<FieldUnit>(nUnit))
733  {
734  case FieldUnit::MM:
735  case FieldUnit::CM:
736  case FieldUnit::POINT:
737  case FieldUnit::PICA:
738  case FieldUnit::INCH:
739  if( rInfo.mnHandle == HANDLE_VIEWSET_HORI_RULER_METRIC )
740  {
741  eHRulerUnit = static_cast<FieldUnit>(nUnit);
742  mbApplyHRulerMetric = true;
743  }
744  else
745  {
746  eVRulerUnit = static_cast<FieldUnit>(nUnit);
747  mbApplyVRulerMetric = true;
748  }
749  break;
750  default:
751  throw IllegalArgumentException();
752  }
753  }
754  break;
755  default:
756  throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
757  }
758 }
759 
761 {
762  if( pView )
763  {
764  if(mbApplyZoom )
765  pView->SetZoom( mpViewOption->GetZoomType(),
766  mpViewOption->GetZoom(), true );
771 
772  }
773  else
774  {
776  SW_MOD()->ApplyRulerMetric( eHRulerUnit, true, false );
778  SW_MOD()->ApplyRulerMetric( eVRulerUnit, false, false );
779  }
780 
783 
784  mpViewOption.reset();
785 }
786 
788 {
789  if(pView)
790  {
791  if(!IsValid())
792  return;
794  }
795  else
796  mpConstViewOption = SW_MOD()->GetViewOption(false);
797 }
798 
800 {
801  bool bBool = true;
802  bool bBoolVal = false;
803  switch( rInfo.mnHandle )
804  {
805  case HANDLE_VIEWSET_SHOW_RULER: bBoolVal = mpConstViewOption->IsViewAnyRuler(); break;
806  case HANDLE_VIEWSET_HRULER : bBoolVal = mpConstViewOption->IsViewHRuler(true); break;
807  case HANDLE_VIEWSET_VRULER : bBoolVal = mpConstViewOption->IsViewVRuler(true);break;
808  case HANDLE_VIEWSET_VRULER_RIGHT : bBoolVal = mpConstViewOption->IsVRulerRight();break;
809  case HANDLE_VIEWSET_HSCROLL: bBoolVal = mpConstViewOption->IsViewHScrollBar();break;
810  case HANDLE_VIEWSET_VSCROLL: bBoolVal = mpConstViewOption->IsViewVScrollBar();break;
811  case HANDLE_VIEWSET_GRAPHICS : bBoolVal = mpConstViewOption->IsGraphic();break;
812  case HANDLE_VIEWSET_TABLES : bBoolVal = mpConstViewOption->IsTable(); break;
813  case HANDLE_VIEWSET_DRAWINGS : bBoolVal = mpConstViewOption->IsDraw(); break;
814  case HANDLE_VIEWSET_FIELD_COMMANDS : bBoolVal = mpConstViewOption->IsFieldName(); break;
815  case HANDLE_VIEWSET_ANNOTATIONS : bBoolVal = mpConstViewOption->IsPostIts(); break;
816  case HANDLE_VIEWSET_INDEX_MARK_BACKGROUND : bBoolVal = SwViewOption::IsFieldShadings(); break;
817  case HANDLE_VIEWSET_NONPRINTING_CHARACTERS: bBoolVal = mpConstViewOption->IsViewMetaChars(); break;
818  case HANDLE_VIEWSET_FOOTNOTE_BACKGROUND : bBoolVal = SwViewOption::IsFieldShadings(); break;
819  case HANDLE_VIEWSET_TEXT_FIELD_BACKGROUND : bBoolVal = SwViewOption::IsFieldShadings(); break;
820  case HANDLE_VIEWSET_PARA_BREAKS : bBoolVal = mpConstViewOption->IsParagraph(true); break;
821  case HANDLE_VIEWSET_SOFT_HYPHENS : bBoolVal = mpConstViewOption->IsSoftHyph(); break;
822  case HANDLE_VIEWSET_SPACES : bBoolVal = mpConstViewOption->IsBlank(true); break;
823  case HANDLE_VIEWSET_PROTECTED_SPACES : bBoolVal = mpConstViewOption->IsHardBlank(); break;
824  case HANDLE_VIEWSET_TABSTOPS : bBoolVal = mpConstViewOption->IsTab(true); break;
825  case HANDLE_VIEWSET_BREAKS : bBoolVal = mpConstViewOption->IsLineBreak(true); break;
826  case HANDLE_VIEWSET_BOOKMARKS : bBoolVal = mpConstViewOption->IsShowBookmarks(true); break;
827  case HANDLE_VIEWSET_HIDDEN_TEXT : bBoolVal = mpConstViewOption->IsShowHiddenField(); break;
828  case HANDLE_VIEWSET_HIDDEN_CHARACTERS : bBoolVal = mpConstViewOption->IsShowHiddenChar(true); break;
829  case HANDLE_VIEWSET_HIDE_WHITESPACE : bBoolVal = mpConstViewOption->IsHideWhitespaceMode(); break;
830  case HANDLE_VIEWSET_HIDDEN_PARAGRAPHS : bBoolVal = mpConstViewOption->IsShowHiddenPara(); break;
831  case HANDLE_VIEWSET_TABLE_BOUNDARIES : bBoolVal = SwViewOption::IsTableBoundaries(); break;
832  case HANDLE_VIEWSET_TEXT_BOUNDARIES : bBoolVal = SwViewOption::IsDocBoundaries(); break;
833  case HANDLE_VIEWSET_SMOOTH_SCROLLING : bBoolVal = mpConstViewOption->IsSmoothScroll(); break;
834  case HANDLE_VIEWSET_SHOW_CONTENT_TIPS : bBoolVal = mpConstViewOption->IsShowContentTips(); break;
835  case HANDLE_VIEWSET_INLINECHANGES_TIPS : bBoolVal = mpConstViewOption->IsShowInlineTooltips(); break;
836  case HANDLE_VIEWSET_IS_RASTER_VISIBLE : bBoolVal = mpConstViewOption->IsGridVisible(); break;
837  case HANDLE_VIEWSET_IS_SNAP_TO_RASTER : bBoolVal = mpConstViewOption->IsSnap(); break;
838  case HANDLE_VIEWSET_SCROLLBAR_TIPS : bBoolVal = mpConstViewOption->IsShowScrollBarTips(); break;
839  case HANDLE_VIEWSET_RASTER_RESOLUTION_X :
840  bBool = false;
841  rValue <<= static_cast<sal_Int32>(convertTwipToMm100(mpConstViewOption->GetSnapSize().Width()));
842  break;
843  case HANDLE_VIEWSET_RASTER_RESOLUTION_Y :
844  bBool = false;
845  rValue <<= static_cast<sal_Int32>(convertTwipToMm100(mpConstViewOption->GetSnapSize().Height()));
846  break;
847  case HANDLE_VIEWSET_RASTER_SUBDIVISION_X :
848  bBool = false;
849  rValue <<= static_cast<sal_Int32>(mpConstViewOption->GetDivisionX());
850  break;
851  case HANDLE_VIEWSET_RASTER_SUBDIVISION_Y :
852  bBool = false;
853  rValue <<= static_cast<sal_Int32>(mpConstViewOption->GetDivisionY());
854  break;
855  case HANDLE_VIEWSET_ZOOM :
856  bBool = false;
857  rValue <<= static_cast<sal_Int16>(mpConstViewOption->GetZoom());
858  break;
859  case HANDLE_VIEWSET_ZOOM_TYPE:
860  {
861  bBool = false;
862  sal_Int16 nRet(0);
863  switch (mpConstViewOption->GetZoomType())
864  {
865  case SvxZoomType::OPTIMAL:
866  nRet = view::DocumentZoomType::OPTIMAL;
867  break;
868  case SvxZoomType::PAGEWIDTH:
869  nRet = view::DocumentZoomType::PAGE_WIDTH;
870  break;
871  case SvxZoomType::WHOLEPAGE:
872  nRet = view::DocumentZoomType::ENTIRE_PAGE;
873  break;
874  case SvxZoomType::PERCENT:
875  nRet = view::DocumentZoomType::BY_VALUE;
876  break;
877  case SvxZoomType::PAGEWIDTH_NOBORDER:
878  nRet = view::DocumentZoomType::PAGE_WIDTH_EXACT;
879  break;
880  default:
881  OSL_FAIL("SwXViewSettings: invalid zoom type");
882  break;
883  }
884  rValue <<= nRet;
885  }
886  break;
887  case HANDLE_VIEWSET_ONLINE_LAYOUT:
888  if(pView)
889  bBoolVal = pView->GetWrtShell().GetViewOptions()->getBrowseMode();
890  break;
891  case HANDLE_VIEWSET_HELP_URL :
892  {
893  if ( !pView )
894  throw UnknownPropertyException();
895 
896  bBool = false;
897  OUStringBuffer sHelpURL;
898  sHelpURL.append ( INET_HID_SCHEME );
899  SwEditWin &rEditWin = pView->GetEditWin();
900  sHelpURL.append( OUString::fromUtf8( rEditWin.GetHelpId() ) );
901  rValue <<= sHelpURL.makeStringAndClear();
902  }
903  break;
904  case HANDLE_VIEWSET_HORI_RULER_METRIC:
905  {
906  if ( pView )
907  {
908  FieldUnit eUnit;
909  pView->GetHRulerMetric( eUnit );
910  rValue <<= static_cast<sal_Int32>(eUnit);
911  }
912  else
913  {
914  const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( false );
915  rValue <<= static_cast<sal_Int32>(pUsrPref->GetHScrollMetric());
916  }
917  bBool = false;
918  }
919  break;
920  case HANDLE_VIEWSET_VERT_RULER_METRIC:
921  {
922  if ( pView )
923  {
924  FieldUnit eUnit;
925  pView->GetVRulerMetric( eUnit );
926  rValue <<= static_cast<sal_Int32>(eUnit);
927  }
928  else
929  {
930  const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( false );
931  rValue <<= static_cast<sal_Int32>(pUsrPref->GetVScrollMetric());
932  }
933  bBool = false;
934  }
935  break;
936  default: OSL_FAIL("there is no such ID!");
937  }
938  if( bBool )
939  rValue <<= bBoolVal;
940 }
941 
943 {
944  mpConstViewOption = nullptr;
945 }
946 
948 {
949  return "SwXViewSettings";
950 }
951 
952 sal_Bool SwXViewSettings::supportsService(const OUString& rServiceName)
953 {
954  return cppu::supportsService(this, rServiceName);
955 }
956 
958 {
959  Sequence<OUString> aRet { "com.sun.star.text.ViewSettings" };
960  return aRet;
961 }
962 
963 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
964 SwXModule_get_implementation(css::uno::XComponentContext*,
965  css::uno::Sequence<css::uno::Any> const &)
966 {
967  return cppu::acquire(new SwXModule());
968 }
969 
970 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsPaperFromSetup() const
Definition: printdata.hxx:138
css::uno::Reference< css::beans::XPropertySet > mxPrintSettings
Definition: unomod.hxx:47
void SetPrintPostIts(SwPostItMode n)
Definition: printdata.hxx:159
long Width() const
#define MAXZOOM
Definition: view.hxx:83
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unomod.cxx:241
static ChainablePropertySetInfo * lcl_createPrintSettingsInfo()
Definition: unomod.cxx:177
bool IsViewMetaChars() const
Definition: viewopt.hxx:348
bool IsSmoothScroll() const
Definition: viewopt.hxx:376
#define MINZOOM
Definition: view.hxx:82
FieldUnit
SwXPrintSettingsType meType
Definition: unomod.hxx:76
bool IsShowScrollBarTips() const
Definition: viewopt.hxx:516
static ChainablePropertySetInfo * lcl_createViewSettingsInfo()
Definition: unomod.cxx:123
void GetHRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:593
FieldUnit GetVScrollMetric() const
Definition: usrpref.hxx:225
void SetPrintLeftPage(bool b)
Definition: printdata.hxx:154
void SetPrintRightPage(bool b)
Definition: printdata.hxx:155
static bool IsDocBoundaries()
Definition: viewopt.hxx:638
SwPostItMode GetPrintPostIts() const
Definition: printdata.hxx:145
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unomod.cxx:506
bool IsShowContentTips() const
Definition: viewopt.hxx:512
bool IsViewAnyRuler() const
Definition: viewopt.hxx:554
SwXModule()
Definition: unomod.cxx:204
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:237
void ToggleLayoutMode(SwView *pView)
Definition: docsh2.cxx:149
long Height() const
void SetPrintControl(bool b)
Definition: printdata.hxx:153
bool IsGraphic() const
Definition: viewopt.hxx:306
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:570
OUString GetURLPath(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
void SetPrintTextPlaceholder(bool b)
Definition: printdata.hxx:167
bool IsPostIts() const
Definition: viewopt.hxx:268
static void SetDocBoundaries(bool bSet)
Definition: viewopt.hxx:650
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getPrintSettings() override
Definition: unomod.cxx:225
FieldUnit eVRulerUnit
Definition: unomod.hxx:111
Definition: doc.hxx:186
bool IsPrintTable() const
Definition: printdata.hxx:132
bool IsHardBlank() const
Definition: viewopt.hxx:226
SwEditWin & GetEditWin()
Definition: view.hxx:403
virtual ~SwXViewSettings() override
Definition: unomod.cxx:534
void SetHelpId(const OString &)
bool IsShowHiddenPara() const
Definition: viewopt.hxx:370
virtual OUString SAL_CALL getImplementationName() override
Definition: unomod.cxx:501
bool IsPrintProspectRTL() const
Definition: printdata.hxx:141
void SetPrintGraphic(bool b)
Definition: printdata.hxx:150
bool mbApplyZoom
Definition: unomod.hxx:107
bool IsPrintHiddenText() const
Definition: printdata.hxx:147
FieldUnit GetHScrollMetric() const
Definition: usrpref.hxx:217
SwWrtShell & GetWrtShell() const
Definition: view.hxx:400
virtual void _postSetValues() override
Definition: unomod.cxx:760
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:519
bool IsPrintReverse() const
Definition: printdata.hxx:137
virtual void _preGetValues() override
Definition: unomod.cxx:787
SwXPrintSettingsType
Definition: unomod.hxx:66
SwXPrintSettings(SwXPrintSettingsType eType, SwDoc *pDoc=nullptr)
Definition: unomod.cxx:251
bool IsFieldName() const
Definition: viewopt.hxx:264
SwXViewSettings(SwView *pView)
Definition: unomod.cxx:517
const OUString & GetFaxName() const
Definition: printdata.hxx:146
short GetDivisionX() const
Definition: viewopt.hxx:417
bool getBrowseMode() const
Definition: viewopt.hxx:445
short GetDivisionY() const
Definition: viewopt.hxx:419
virtual ~SwXPrintSettings() override
Definition: unomod.cxx:259
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
void setBrowseMode(bool bSet)
Definition: viewopt.hxx:446
bool mbApplyHRulerMetric
Definition: unomod.hxx:110
bool IsViewVScrollBar() const
Definition: viewopt.hxx:492
bool IsPrintGraphic() const
Definition: printdata.hxx:131
virtual void _preSetValues() override
Definition: unomod.cxx:264
void SetPrintEmptyPages(bool b)
Definition: printdata.hxx:158
bool IsViewHRuler(bool bDirect=false) const
Definition: viewopt.hxx:565
void SetFaxName(const OUString &rSet)
Definition: printdata.hxx:165
bool IsPrintPageBackground() const
Definition: printdata.hxx:142
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unomod.cxx:957
#define INET_HID_SCHEME
bool IsBlank(bool bHard=false) const
Definition: viewopt.hxx:220
virtual void _postGetValues() override
Definition: unomod.cxx:942
void SetHideWhitespaceMode(bool bMode)
Definition: viewopt.hxx:457
static void SetAppearanceFlag(ViewOptFlags nFlag, bool bSet, bool bSaveInConfig=false)
Definition: viewopt.cxx:521
void SetPrintProspect_RTL(bool b)
Definition: printdata.hxx:161
const OString & GetHelpId() const
void SetPrintBlackFont(bool b)
Definition: printdata.hxx:163
bool IsPrintRightPage() const
Definition: printdata.hxx:136
virtual void _setSingleValue(const comphelper::PropertyInfo &rInfo, const css::uno::Any &rValue) override
Definition: unomod.cxx:558
bool IsDraw() const
Definition: viewopt.hxx:321
#define SW_MOD()
Definition: swmodule.hxx:256
void SetPrintHiddenText(bool b)
Definition: printdata.hxx:166
virtual const SwPrintData & getPrintData() const =0
Returns the PrintData.
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
bool IsPrintSingleJobs() const
Definition: printdata.hxx:144
void SetPrintReverse(bool b)
Definition: printdata.hxx:156
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getViewSettings() override
Definition: unomod.cxx:214
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:231
bool IsViewVRuler(bool bDirect=false) const
Definition: viewopt.hxx:579
void SetPrintTable(bool b)
Definition: printdata.hxx:151
bool mbApplyVRulerMetric
Definition: unomod.hxx:112
unsigned char sal_Bool
bool IsTab(bool bHard=false) const
Definition: viewopt.hxx:214
SwView * pView
Definition: unomod.hxx:104
void SetPaperFromSetup(bool b)
Definition: printdata.hxx:157
bool IsPrintControl() const
Definition: printdata.hxx:134
virtual OUString SAL_CALL getImplementationName() override
Definition: unomod.cxx:236
css::uno::Type const & get()
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:247
virtual void _postGetValues() override
Definition: unomod.cxx:496
void SetPrintPageBackground(bool b)
Definition: printdata.hxx:162
bool IsPrintTextPlaceholder() const
Definition: printdata.hxx:148
static bool IsFieldShadings()
Definition: viewopt.hxx:644
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unomod.cxx:511
bool IsPrintBlackFont() const
Definition: printdata.hxx:143
SwPostItMode
this must match the definitions in css::text::NotePrintMode
Definition: printdata.hxx:42
SwDocShell * GetDocShell()
Definition: view.cxx:1107
bool IsTable() const
Definition: viewopt.hxx:316
const SwViewOption * mpConstViewOption
Definition: unomod.hxx:106
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
bool IsHideWhitespaceMode() const
Definition: viewopt.hxx:456
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unomod.cxx:952
virtual OUString SAL_CALL getImplementationName() override
Definition: unomod.cxx:947
bool IsVRulerRight() const
Definition: viewopt.hxx:600
void SetZoom(SvxZoomType eZoomType, short nFactor=100, bool bViewOnly=false)
Definition: viewmdi.cxx:72
virtual ~SwXModule() override
Definition: unomod.cxx:210
virtual void _getSingleValue(const comphelper::PropertyInfo &rInfo, css::uno::Any &rValue) override
Definition: unomod.cxx:423
SwPrintSettingsPropertyHandles
Definition: unomod.cxx:99
constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
void SetPrintSingleJobs(bool b)
Definition: printdata.hxx:164
bool IsPrintDraw() const
Definition: printdata.hxx:133
#define PROPERTY_NONE
bool IsShowInlineTooltips() const
Definition: viewopt.hxx:283
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:426
bool IsPrintEmptyPages() const
Definition: printdata.hxx:139
bool IsValid() const
Definition: unomod.hxx:132
const Size & GetSnapSize() const
Definition: viewopt.hxx:337
INetProtocol GetProtocol() const
SwPrintData * mpPrtOpt
Definition: unomod.hxx:77
css::uno::Reference< css::beans::XPropertySet > mxViewSettings
Definition: unomod.hxx:46
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:579
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:478
static bool IsTableBoundaries()
Definition: viewopt.hxx:640
virtual void _preSetValues() override
Definition: unomod.cxx:540
void GetVRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:588
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unomod.cxx:246
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
virtual void _getSingleValue(const comphelper::PropertyInfo &rInfo, css::uno::Any &rValue) override
Definition: unomod.cxx:799
bool IsSoftHyph() const
Definition: viewopt.hxx:259
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:241
void SetPrintProspect(bool b)
Definition: printdata.hxx:160
rtl::Reference< ChainablePropertySetInfo > mxInfo
bool IsGridVisible() const
Definition: viewopt.hxx:339
std::unique_ptr< SwViewOption > mpViewOption
Definition: unomod.hxx:105
SwViewSettingsPropertyHandles
Definition: unomod.cxx:50
detail::Optional< bool >::type tryAccess< bool >(css::uno::Any const &any)
SvxZoomType
FieldUnit eHRulerUnit
Definition: unomod.hxx:109
bool IsShowHiddenChar(bool bHard=false) const
Definition: viewopt.hxx:294
SwDoc * mpDoc
Definition: unomod.hxx:78
bool IsShowHiddenField() const
Definition: viewopt.hxx:301
bool IsPrintLeftPage() const
Definition: printdata.hxx:135
virtual void _preGetValues() override
Definition: unomod.cxx:406
bool IsPrintProspect() const
Definition: printdata.hxx:140
bool IsSnap() const
Definition: viewopt.hxx:331
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: wrtsh1.cxx:1783
void SetPrintDraw(bool b)
Definition: printdata.hxx:152
bool IsViewHScrollBar() const
Definition: viewopt.hxx:500
virtual void _postSetValues() override
Definition: unomod.cxx:401
void setWidth(long nWidth)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SwXModule_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
Definition: unomod.cxx:964
virtual void _setSingleValue(const comphelper::PropertyInfo &rInfo, const css::uno::Any &rValue) override
Definition: unomod.cxx:292
RedlineType meType
sal_Int32 const mnHandle
Definition: view.hxx:146
void setHeight(long nHeight)