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
20#pragma once
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>
29#include <tools/fldunit.hxx>
30
31class SwView;
32class SwViewOption;
33class SwPrintData;
34class SwDoc;
35
36css::uno::Reference< css::uno::XInterface > SAL_CALL SwXModule_CreateInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & );
37
38class SwXModule final : 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 virtual ~SwXModule() override;
50public:
51 SwXModule();
52
53 //XViewSettings
54 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getViewSettings() override;
55
56 //XPrintSettings
57 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getPrintSettings() override;
58
59 //XServiceInfo
60 virtual OUString SAL_CALL getImplementationName() override;
61 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
62 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
63};
64
66{
67 Module,
69};
70
72{
73 friend class SwXDocumentSettings;
74
78
79 virtual void _preSetValues () override;
80 virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const css::uno::Any &rValue ) override;
81 virtual void _postSetValues () override;
82
83 virtual void _preGetValues () override;
84
85 virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, css::uno::Any & rValue ) override;
86 virtual void _postGetValues () override;
87
88 virtual ~SwXPrintSettings()
89 noexcept override;
90public:
91 SwXPrintSettings( SwXPrintSettingsType eType, SwDoc * pDoc = nullptr );
92
93 //XServiceInfo
94 virtual OUString SAL_CALL getImplementationName() override;
95 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
96 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
97};
98
104{
106
108 std::unique_ptr<SwViewOption> mpViewOption;
110 bool m_bObjectValid:1, mbApplyZoom;
111
116
117 virtual void _preSetValues () override;
118 virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const css::uno::Any &rValue ) override;
119 virtual void _postSetValues() override;
120
121 virtual void _preGetValues () override;
122 virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, css::uno::Any & rValue ) override;
123 virtual void _postGetValues () override;
124
125 virtual ~SwXViewSettings()
126 noexcept override;
127public:
128 SwXViewSettings(SwView* pView);
129
130 //XServiceInfo
131 virtual OUString SAL_CALL getImplementationName() override;
132 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
133 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
134
135 bool IsValid() const {return m_bObjectValid;}
136 void Invalidate() {m_bObjectValid = false;}
137};
138
139/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
Definition: view.hxx:146
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getViewSettings() override
Definition: unomod.cxx:218
virtual ~SwXModule() override
Definition: unomod.cxx:214
css::uno::Reference< css::beans::XPropertySet > mxViewSettings
Definition: unomod.hxx:46
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getPrintSettings() override
Definition: unomod.cxx:229
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unomod.cxx:250
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unomod.cxx:245
virtual OUString SAL_CALL getImplementationName() override
Definition: unomod.cxx:240
SwXModule()
Definition: unomod.cxx:210
css::uno::Reference< css::beans::XPropertySet > mxPrintSettings
Definition: unomod.hxx:47
virtual void _getSingleValue(const comphelper::PropertyInfo &rInfo, css::uno::Any &rValue) override
Definition: unomod.cxx:427
virtual void _postGetValues() override
Definition: unomod.cxx:500
virtual ~SwXPrintSettings() noexcept override
Definition: unomod.cxx:263
SwPrintData * mpPrtOpt
Definition: unomod.hxx:76
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unomod.cxx:510
SwDoc * mpDoc
Definition: unomod.hxx:77
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unomod.cxx:515
virtual void _postSetValues() override
Definition: unomod.cxx:405
SwXPrintSettingsType meType
Definition: unomod.hxx:75
virtual void _setSingleValue(const comphelper::PropertyInfo &rInfo, const css::uno::Any &rValue) override
Definition: unomod.cxx:296
virtual OUString SAL_CALL getImplementationName() override
Definition: unomod.cxx:505
virtual void _preGetValues() override
Definition: unomod.cxx:410
virtual void _preSetValues() override
Definition: unomod.cxx:268
Implements com.sun.star.text.ViewSettings: UNO access to per-view settings (e.g.
Definition: unomod.hxx:104
bool m_bObjectValid
Definition: unomod.hxx:110
std::unique_ptr< SwViewOption > mpViewOption
Definition: unomod.hxx:108
const SwViewOption * mpConstViewOption
Definition: unomod.hxx:109
FieldUnit m_eHRulerUnit
Definition: unomod.hxx:112
FieldUnit m_eVRulerUnit
Definition: unomod.hxx:114
bool mbApplyVRulerMetric
Definition: unomod.hxx:115
bool mbApplyHRulerMetric
Definition: unomod.hxx:113
SwView * m_pView
Definition: unomod.hxx:107
void Invalidate()
Definition: unomod.hxx:136
ChainablePropertySet(comphelper::ChainablePropertySetInfo *pInfo, SolarMutex *pMutex) noexcept
FieldUnit
unsigned char sal_Bool
css::uno::Reference< css::uno::XInterface > SAL_CALL SwXModule_CreateInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > &)
SwXPrintSettingsType
Definition: unomod.hxx:66