LibreOffice Module sw (master) 1
unosett.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_INC_UNOSETT_HXX
20#define INCLUDED_SW_INC_UNOSETT_HXX
21
22#include <sal/config.h>
23
24#include <string_view>
25
26#include "swtypes.hxx"
27#include <com/sun/star/text/XTextColumns.hpp>
28#include <com/sun/star/lang/XServiceInfo.hpp>
29#include <com/sun/star/container/XIndexReplace.hpp>
30#include <com/sun/star/beans/XPropertySet.hpp>
31#include <com/sun/star/container/XNamed.hpp>
34#include "unobaseclass.hxx"
35
36class SwDoc;
37class SwFormatCol;
38class SwDocShell;
39class SwNumRule;
40class SwNumFormat;
42namespace com::sun::star::beans { struct PropertyValue; }
43
45<
46 css::beans::XPropertySet,
47 css::lang::XServiceInfo
48>
49{
52
53 virtual ~SwXFootnoteProperties() override;
54public:
56
57 //XPropertySet
58 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
59 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
60 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
61 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
62 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
63 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
64 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
65
66 //XServiceInfo
67 virtual OUString SAL_CALL getImplementationName() override;
68 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
69 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
70
71 void Invalidate() {m_pDoc = nullptr;}
72};
73
75<
76 css::beans::XPropertySet,
77 css::lang::XServiceInfo
78>
79{
82
83 virtual ~SwXEndnoteProperties() override;
84public:
86
87 //XPropertySet
88 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
89 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
90 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
91 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
92 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
93 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
94 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
95
96 //XServiceInfo
97 virtual OUString SAL_CALL getImplementationName() override;
98 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
99 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
100
101 void Invalidate() {m_pDoc = nullptr;}
102};
103
105<
106 css::beans::XPropertySet,
107 css::lang::XServiceInfo
108>
109{
112
113 virtual ~SwXLineNumberingProperties() override;
114public:
116
117 //XPropertySet
118 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
119 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
120 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
121 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
122 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
123 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
124 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
125
126 //XServiceInfo
127 virtual OUString SAL_CALL getImplementationName() override;
128 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
129 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
130
131 void Invalidate() {m_pDoc = nullptr;}
132};
133
135<
136 css::container::XIndexReplace,
137 css::beans::XPropertySet,
138 css::container::XNamed,
139 css::lang::XServiceInfo
140>
141{
142private:
143 class Impl;
145
148 OUString m_sCreatedNumRuleName; //connects to a numbering in SwDoc
149 SwDoc* m_pDoc; // Only if *not* used as chapter numbering.
150 SwDocShell* m_pDocShell; // Only if used as chapter numbering.
154protected:
155 SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering
156 virtual ~SwXNumberingRules() override;
157
158public:
159 SwXNumberingRules(const SwNumRule& rRule, SwDoc* doc = nullptr); // NumRule for paragraphs, numbering styles
160 SwXNumberingRules(SwDoc& rDoc); //create a new instance
161
162 //XIndexReplace
163 virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const css::uno::Any& Element ) override;
164
165 //XIndexAccess
166 virtual sal_Int32 SAL_CALL getCount( ) override;
167 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override;
168
169 //XElementAccess
170 virtual css::uno::Type SAL_CALL getElementType( ) override;
171 virtual sal_Bool SAL_CALL hasElements( ) override;
172
173 //XPropertySet
174 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
175 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
176 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
177 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
178 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
179 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
180 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
181
182 //XNamed
183 virtual OUString SAL_CALL getName() override;
184 virtual void SAL_CALL setName(const OUString& Name_) override;
185
186 //XServiceInfo
187 virtual OUString SAL_CALL getImplementationName() override;
188 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
189 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
190
191 css::uno::Sequence< css::beans::PropertyValue>
192 GetNumberingRuleByIndex(const SwNumRule& rNumRule, sal_Int32 nIndex)const;
195 void SetNumberingRuleByIndex(SwNumRule& rNumRule,
196 const css::uno::Sequence< css::beans::PropertyValue>& rProperties, sal_Int32 nIndex);
197
198 const OUString* GetNewCharStyleNames() const {return m_sNewCharStyleNames;}
199 const OUString* GetBulletFontNames() const {return m_sNewBulletFontNames;}
200 const SwNumRule* GetNumRule() const {return m_pNumRule;}
201
202 static bool isInvalidStyle(std::u16string_view rName);
203 void Invalidate() {m_pDocShell = nullptr;}
204 const OUString& GetCreatedNumRuleName() const {return m_sCreatedNumRuleName;}
205
206 static css::uno::Sequence<css::beans::PropertyValue> GetPropertiesForNumFormat(
207 const SwNumFormat& rFormat, OUString const& rCharFormatName,
208 OUString const* pHeadingStyleName, OUString const & referer);
209 static void SetPropertiesToNumFormat(
210 SwNumFormat & aFormat,
211 OUString & rCharStyleName,
212 OUString *const pBulletFontName,
213 OUString *const pHeadingStyleName,
214 OUString *const pParagraphStyleName,
215 SwDoc *const pDoc,
216 SwDocShell *const pDocShell,
217 css::uno::Sequence<css::beans::PropertyValue> const& rProperties);
218
219};
220
222{
223
224 virtual ~SwXChapterNumbering() override;
225public:
227
229
230 //XServiceInfo
231 virtual OUString SAL_CALL getImplementationName() override;
232 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
233 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
234
235};
236
237#endif
238
239/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
Definition: doc.hxx:197
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:2102
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:2107
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:2112
SwXChapterNumbering(SwDocShell &rDocSh)
Definition: unosett.cxx:2117
virtual ~SwXChapterNumbering() override
Definition: unosett.cxx:2122
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:726
virtual ~SwXEndnoteProperties() override
Definition: unosett.cxx:551
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:81
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:720
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:561
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:708
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:714
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:534
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:529
SwXEndnoteProperties(SwDoc *pDoc)
Definition: unosett.cxx:545
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:555
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:635
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:539
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:282
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:517
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:523
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:51
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:276
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:254
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:402
virtual ~SwXFootnoteProperties() override
Definition: unosett.cxx:271
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:505
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:511
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:259
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:249
SwXFootnoteProperties(SwDoc *pDoc)
Definition: unosett.cxx:265
virtual ~SwXLineNumberingProperties() override
Definition: unosett.cxx:753
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:963
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:741
SwXLineNumberingProperties(SwDoc *pDoc)
Definition: unosett.cxx:747
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:973
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:731
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:877
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:968
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:111
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:736
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:763
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:978
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:757
bool m_bOwnNumRuleCreated
Definition: unosett.hxx:153
const OUString & GetCreatedNumRuleName() const
Definition: unosett.hxx:204
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:999
virtual OUString SAL_CALL getName() override
Definition: unosett.cxx:2065
const OUString * GetBulletFontNames() const
Definition: unosett.hxx:199
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:2050
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:2055
virtual ~SwXNumberingRules() override
Definition: unosett.cxx:1070
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:2060
virtual sal_Bool SAL_CALL hasElements() override
Definition: unosett.cxx:1185
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unosett.cxx:1180
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:2045
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Definition: unosett.cxx:1152
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:152
const SwNumRule * GetNumRule() const
Definition: unosett.hxx:200
void SetNumberingRuleByIndex(SwNumRule &rNumRule, const css::uno::Sequence< css::beans::PropertyValue > &rProperties, sal_Int32 nIndex)
Definition: unosett.cxx:1434
SwDocShell * m_pDocShell
Definition: unosett.hxx:150
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:1937
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:1009
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:1004
SwNumRule * m_pNumRule
Definition: unosett.hxx:151
virtual void SAL_CALL setName(const OUString &Name_) override
Definition: unosett.cxx:2084
css::uno::Sequence< css::beans::PropertyValue > GetNumberingRuleByIndex(const SwNumRule &rNumRule, sal_Int32 nIndex) const
Definition: unosett.cxx:1204
static bool isInvalidStyle(std::u16string_view rName)
Definition: unosett.cxx:994
OUString m_sNewBulletFontNames[MAXLEVEL]
Definition: unosett.hxx:147
static css::uno::Sequence< css::beans::PropertyValue > GetPropertiesForNumFormat(const SwNumFormat &rFormat, OUString const &rCharFormatName, OUString const *pHeadingStyleName, OUString const &referer)
Definition: unosett.cxx:1267
static void SetPropertiesToNumFormat(SwNumFormat &aFormat, OUString &rCharStyleName, OUString *const pBulletFontName, OUString *const pHeadingStyleName, OUString *const pParagraphStyleName, SwDoc *const pDoc, SwDocShell *const pDocShell, css::uno::Sequence< css::beans::PropertyValue > const &rProperties)
Definition: unosett.cxx:1490
virtual sal_Int32 SAL_CALL getCount() override
Definition: unosett.cxx:1147
OUString m_sNewCharStyleNames[MAXLEVEL]
Definition: unosett.hxx:146
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unosett.hxx:143
OUString m_sCreatedNumRuleName
Definition: unosett.hxx:148
const OUString * GetNewCharStyleNames() const
Definition: unosett.hxx:198
virtual void SAL_CALL replaceByIndex(sal_Int32 Index, const css::uno::Any &Element) override
Definition: unosett.cxx:1079
SwXNumberingRules(SwDocShell &rDocSh)
Definition: unosett.cxx:1044
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:2005
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:1931
std::unique_ptr< T, UnoImplPtrDeleter< T > > UnoImplPtr
Smart pointer class ensuring that the pointed object is deleted with a locked SolarMutex.
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
unsigned char sal_Bool