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/lang/XUnoTunnel.hpp>
30 #include <com/sun/star/container/XIndexReplace.hpp>
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/container/XNamed.hpp>
33 #include <cppuhelper/implbase2.hxx>
34 #include <cppuhelper/implbase5.hxx>
35 #include "unobaseclass.hxx"
36 
37 class SwDoc;
38 class SwFormatCol;
39 class SwDocShell;
40 class SwNumRule;
41 class SwNumFormat;
42 class SfxItemPropertySet;
43 namespace com::sun::star::beans { struct PropertyValue; }
44 
46 <
47  css::beans::XPropertySet,
48  css::lang::XServiceInfo
49 >
50 {
53 
54  virtual ~SwXFootnoteProperties() override;
55 public:
57 
58  //XPropertySet
59  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
60  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
61  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
62  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
63  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
64  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
65  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
66 
67  //XServiceInfo
68  virtual OUString SAL_CALL getImplementationName() override;
69  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
70  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
71 
72  void Invalidate() {m_pDoc = nullptr;}
73 };
74 
76 <
77  css::beans::XPropertySet,
78  css::lang::XServiceInfo
79 >
80 {
83 
84  virtual ~SwXEndnoteProperties() override;
85 public:
87 
88  //XPropertySet
89  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
90  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
91  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
92  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
93  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
94  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
95  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
96 
97  //XServiceInfo
98  virtual OUString SAL_CALL getImplementationName() override;
99  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
100  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
101 
102  void Invalidate() {m_pDoc = nullptr;}
103 };
104 
106 <
107  css::beans::XPropertySet,
108  css::lang::XServiceInfo
109 >
110 {
113 
114  virtual ~SwXLineNumberingProperties() override;
115 public:
117 
118  //XPropertySet
119  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
120  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
121  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
122  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
123  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
124  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
125  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
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  void Invalidate() {m_pDoc = nullptr;}
133 };
134 
136 <
137  css::container::XIndexReplace,
138  css::lang::XUnoTunnel,
139  css::beans::XPropertySet,
140  css::container::XNamed,
141  css::lang::XServiceInfo
142 >
143 {
144 private:
145  class Impl;
147 
150  OUString m_sCreatedNumRuleName; //connects to a numbering in SwDoc
151  SwDoc* m_pDoc; // Only if *not* used as chapter numbering.
152  SwDocShell* m_pDocShell; // Only if used as chapter numbering.
156 protected:
157  SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering
158  virtual ~SwXNumberingRules() override;
159 
160 public:
161  SwXNumberingRules(const SwNumRule& rRule, SwDoc* doc = nullptr); // NumRule for paragraphs, numbering styles
162  SwXNumberingRules(SwDoc& rDoc); //create a new instance
163 
164  static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
165 
166  virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
167 
168  //XIndexReplace
169  virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const css::uno::Any& Element ) override;
170 
171  //XIndexAccess
172  virtual sal_Int32 SAL_CALL getCount( ) override;
173  virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override;
174 
175  //XElementAccess
176  virtual css::uno::Type SAL_CALL getElementType( ) override;
177  virtual sal_Bool SAL_CALL hasElements( ) override;
178 
179  //XPropertySet
180  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
181  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
182  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
183  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
184  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
185  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
186  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
187 
188  //XNamed
189  virtual OUString SAL_CALL getName() override;
190  virtual void SAL_CALL setName(const OUString& Name_) override;
191 
192  //XServiceInfo
193  virtual OUString SAL_CALL getImplementationName() override;
194  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
195  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
196 
197  css::uno::Sequence< css::beans::PropertyValue>
198  GetNumberingRuleByIndex(const SwNumRule& rNumRule, sal_Int32 nIndex)const;
201  void SetNumberingRuleByIndex(SwNumRule& rNumRule,
202  const css::uno::Sequence< css::beans::PropertyValue>& rProperties, sal_Int32 nIndex);
203 
204  const OUString* GetNewCharStyleNames() const {return m_sNewCharStyleNames;}
205  const OUString* GetBulletFontNames() const {return m_sNewBulletFontNames;}
206  const SwNumRule* GetNumRule() const {return m_pNumRule;}
207 
208  static bool isInvalidStyle(std::u16string_view rName);
209  void Invalidate() {m_pDocShell = nullptr;}
210  const OUString& GetCreatedNumRuleName() const {return m_sCreatedNumRuleName;}
211 
212  static css::uno::Sequence<css::beans::PropertyValue> GetPropertiesForNumFormat(
213  const SwNumFormat& rFormat, OUString const& rCharFormatName,
214  OUString const* pHeadingStyleName, OUString const & referer);
215  static void SetPropertiesToNumFormat(
216  SwNumFormat & aFormat,
217  OUString & rCharStyleName,
218  OUString *const pBulletFontName,
219  OUString *const pHeadingStyleName,
220  OUString *const pParagraphStyleName,
221  SwDoc *const pDoc,
222  SwDocShell *const pDocShell,
223  css::uno::Sequence<css::beans::PropertyValue> const& rProperties);
224 
225 };
226 
228 {
229 
230  virtual ~SwXChapterNumbering() override;
231 public:
233 
235 
236  //XServiceInfo
237  virtual OUString SAL_CALL getImplementationName() override;
238  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
239  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
240 
241 };
242 
243 #endif
244 
245 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwXFootnoteProperties(SwDoc *pDoc)
Definition: unosett.cxx:279
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:771
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:273
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:1029
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:263
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:416
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:891
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:2062
virtual ~SwXFootnoteProperties() override
Definition: unosett.cxx:285
Definition: doc.hxx:187
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
SwXEndnoteProperties(SwDoc *pDoc)
Definition: unosett.cxx:559
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:112
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:1034
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:2129
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:2067
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:569
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:537
virtual ~SwXNumberingRules() override
Definition: unosett.cxx:1100
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Definition: unosett.cxx:1183
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: unosett.cxx:1024
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:575
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:2072
bool m_bOwnNumRuleCreated
Definition: unosett.hxx:155
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:82
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:977
virtual void SAL_CALL replaceByIndex(sal_Int32 Index, const css::uno::Any &Element) override
Definition: unosett.cxx:1109
void SetNumberingRuleByIndex(SwNumRule &rNumRule, const css::uno::Sequence< css::beans::PropertyValue > &rProperties, sal_Int32 nIndex)
Definition: unosett.cxx:1462
const OUString & GetCreatedNumRuleName() const
Definition: unosett.hxx:210
std::unique_ptr< T, UnoImplPtrDeleter< T > > UnoImplPtr
Smart pointer class ensuring that the pointed object is deleted with a locked SolarMutex.
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:992
virtual ~SwXChapterNumbering() override
Definition: unosett.cxx:2139
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:525
virtual void SAL_CALL setName(const OUString &Name_) override
Definition: unosett.cxx:2101
OUString m_sNewCharStyleNames[MAXLEVEL]
Definition: unosett.hxx:148
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:296
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:1954
OUString m_sNewBulletFontNames[MAXLEVEL]
Definition: unosett.hxx:149
const OUString * GetBulletFontNames() const
Definition: unosett.hxx:205
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:740
const OUString * GetNewCharStyleNames() const
Definition: unosett.hxx:204
SwXChapterNumbering(SwDocShell &rDocSh)
Definition: unosett.cxx:2134
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:1039
virtual OUString SAL_CALL getName() override
Definition: unosett.cxx:2082
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:722
const SwNumRule * GetNumRule() const
Definition: unosett.hxx:206
unsigned char sal_Bool
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:519
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:745
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:553
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:543
static css::uno::Sequence< css::beans::PropertyValue > GetPropertiesForNumFormat(const SwNumFormat &rFormat, OUString const &rCharFormatName, OUString const *pHeadingStyleName, OUString const &referer)
Definition: unosett.cxx:1298
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unosett.cxx:1017
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:1518
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:2124
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:2077
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:734
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:987
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:2119
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:52
SwXLineNumberingProperties(SwDoc *pDoc)
Definition: unosett.cxx:761
virtual sal_Int32 SAL_CALL getCount() override
Definition: unosett.cxx:1178
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unosett.cxx:1211
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:1948
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:531
virtual sal_Bool SAL_CALL hasElements() override
Definition: unosett.cxx:1216
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:755
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:777
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:154
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:290
virtual ~SwXLineNumberingProperties() override
Definition: unosett.cxx:767
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:649
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:750
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:2022
SwNumRule * m_pNumRule
Definition: unosett.hxx:153
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:268
css::uno::Sequence< css::beans::PropertyValue > GetNumberingRuleByIndex(const SwNumRule &rNumRule, sal_Int32 nIndex) const
Definition: unosett.cxx:1235
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:982
static bool isInvalidStyle(std::u16string_view rName)
Definition: unosett.cxx:1008
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unosett.hxx:145
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:728
SwXNumberingRules(SwDocShell &rDocSh)
Definition: unosett.cxx:1074
struct _ADOIndex Index
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:548
SwDocShell * m_pDocShell
Definition: unosett.hxx:152
virtual ~SwXEndnoteProperties() override
Definition: unosett.cxx:565
OUString m_sCreatedNumRuleName
Definition: unosett.hxx:150