LibreOffice Module sw (master)  1
unomod.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_UNOMOD_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_UNOMOD_HXX
21 
22 #include <com/sun/star/beans/XPropertySet.hpp>
23 #include <com/sun/star/view/XPrintSettingsSupplier.hpp>
24 #include <com/sun/star/view/XViewSettingsSupplier.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
27 #include <cppuhelper/implbase.hxx>
29 #include <tools/fldunit.hxx>
30 
31 class SwView;
32 class SwViewOption;
33 class SwPrintData;
34 class SwDoc;
35 
36 css::uno::Reference< css::uno::XInterface > SAL_CALL SwXModule_CreateInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & );
37 
38 class SwXModule : public cppu::WeakImplHelper
39 <
40  css::view::XViewSettingsSupplier,
41  css::view::XPrintSettingsSupplier,
42  css::lang::XServiceInfo
43 >
44 {
45 
46  css::uno::Reference< css::beans::XPropertySet > mxViewSettings;
47  css::uno::Reference< css::beans::XPropertySet > mxPrintSettings;
48 
49 protected:
50  virtual ~SwXModule() override;
51 public:
52  SwXModule();
53 
54  //XViewSettings
55  virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getViewSettings() override;
56 
57  //XPrintSettings
58  virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getPrintSettings() override;
59 
60  //XServiceInfo
61  virtual OUString SAL_CALL getImplementationName() override;
62  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
63  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
64 };
65 
67 {
68  Module,
69  Document
70 };
71 
73 {
74  friend class SwXDocumentSettings;
75 
79 
80  virtual void _preSetValues () override;
81  virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const css::uno::Any &rValue ) override;
82  virtual void _postSetValues () override;
83 
84  virtual void _preGetValues () override;
85 
86  virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, css::uno::Any & rValue ) override;
87  virtual void _postGetValues () override;
88 
89  virtual ~SwXPrintSettings()
90  throw() override;
91 public:
92  SwXPrintSettings( SwXPrintSettingsType eType, SwDoc * pDoc = nullptr );
93 
94  //XServiceInfo
95  virtual OUString SAL_CALL getImplementationName() override;
96  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
97  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
98 };
99 
101 {
102  friend class SwXDocumentSettings;
103 
105  std::unique_ptr<SwViewOption> mpViewOption;
107  bool bObjectValid:1, mbApplyZoom;
108 
113 
114  virtual void _preSetValues () override;
115  virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const css::uno::Any &rValue ) override;
116  virtual void _postSetValues() override;
117 
118  virtual void _preGetValues () override;
119  virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, css::uno::Any & rValue ) override;
120  virtual void _postGetValues () override;
121 
122  virtual ~SwXViewSettings()
123  throw() override;
124 public:
125  SwXViewSettings(SwView* pView);
126 
127  //XServiceInfo
128  virtual OUString SAL_CALL getImplementationName() override;
129  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
130  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
131 
132  bool IsValid() const {return bObjectValid;}
133  void Invalidate() {bObjectValid = false;}
134 };
135 
136 #endif
137 
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::beans::XPropertySet > mxPrintSettings
Definition: unomod.hxx:47
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unomod.cxx:243
FieldUnit
css::uno::Reference< css::uno::XInterface > SAL_CALL SwXModule_CreateInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > &)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unomod.cxx:508
SwXPrintSettingsType const meType
Definition: unomod.hxx:76
SwXModule()
Definition: unomod.cxx:206
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getPrintSettings() override
Definition: unomod.cxx:227
FieldUnit eVRulerUnit
Definition: unomod.hxx:111
Definition: doc.hxx:185
virtual OUString SAL_CALL getImplementationName() override
Definition: unomod.cxx:503
bool mbApplyZoom
Definition: unomod.hxx:107
SwXPrintSettingsType
Definition: unomod.hxx:66
ChainablePropertySet(comphelper::ChainablePropertySetInfo *pInfo, SolarMutex *pMutex)
virtual ~SwXPrintSettings() override
Definition: unomod.cxx:261
bool mbApplyHRulerMetric
Definition: unomod.hxx:110
virtual void _preSetValues() override
Definition: unomod.cxx:266
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getViewSettings() override
Definition: unomod.cxx:216
bool mbApplyVRulerMetric
Definition: unomod.hxx:112
unsigned char sal_Bool
SwView * pView
Definition: unomod.hxx:104
virtual OUString SAL_CALL getImplementationName() override
Definition: unomod.cxx:238
virtual void _postGetValues() override
Definition: unomod.cxx:498
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unomod.cxx:513
const SwViewOption * mpConstViewOption
Definition: unomod.hxx:106
virtual ~SwXModule() override
Definition: unomod.cxx:212
virtual void _getSingleValue(const comphelper::PropertyInfo &rInfo, css::uno::Any &rValue) override
Definition: unomod.cxx:425
SwPrintData * mpPrtOpt
Definition: unomod.hxx:77
css::uno::Reference< css::beans::XPropertySet > mxViewSettings
Definition: unomod.hxx:46
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unomod.cxx:248
std::unique_ptr< SwViewOption > mpViewOption
Definition: unomod.hxx:105
FieldUnit eHRulerUnit
Definition: unomod.hxx:109
SwDoc * mpDoc
Definition: unomod.hxx:78
void Invalidate()
Definition: unomod.hxx:133
virtual void _preGetValues() override
Definition: unomod.cxx:408
virtual void _postSetValues() override
Definition: unomod.cxx:403
virtual void _setSingleValue(const comphelper::PropertyInfo &rInfo, const css::uno::Any &rValue) override
Definition: unomod.cxx:294
Definition: view.hxx:146