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 <com/sun/star/style/VerticalAlignment.hpp>
34 #include <cppuhelper/implbase2.hxx>
35 #include <cppuhelper/implbase4.hxx>
36 #include <cppuhelper/implbase5.hxx>
37 #include <tools/color.hxx>
38 #include "unobaseclass.hxx"
39 
40 class SwDoc;
41 class SwFormatCol;
42 class SwDocShell;
43 class SwNumRule;
44 class SwNumFormat;
45 class SfxItemPropertySet;
46 namespace com::sun::star::beans { struct PropertyValue; }
47 
49 <
50  css::beans::XPropertySet,
51  css::lang::XServiceInfo
52 >
53 {
56 
57  virtual ~SwXFootnoteProperties() override;
58 public:
60 
61  //XPropertySet
62  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
63  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
64  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
65  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
66  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
67  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
68  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
69 
70  //XServiceInfo
71  virtual OUString SAL_CALL getImplementationName() override;
72  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
73  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
74 
75  void Invalidate() {m_pDoc = nullptr;}
76 };
77 
79 <
80  css::beans::XPropertySet,
81  css::lang::XServiceInfo
82 >
83 {
86 
87  virtual ~SwXEndnoteProperties() override;
88 public:
90 
91  //XPropertySet
92  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
93  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
94  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
95  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
96  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
97  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
98  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
99 
100  //XServiceInfo
101  virtual OUString SAL_CALL getImplementationName() override;
102  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
103  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
104 
105  void Invalidate() {m_pDoc = nullptr;}
106 };
107 
109 <
110  css::beans::XPropertySet,
111  css::lang::XServiceInfo
112 >
113 {
116 
117  virtual ~SwXLineNumberingProperties() override;
118 public:
120 
121  //XPropertySet
122  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
123  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
124  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
125  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
126  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
127  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
128  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
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  void Invalidate() {m_pDoc = nullptr;}
136 };
137 
139 <
140  css::container::XIndexReplace,
141  css::lang::XUnoTunnel,
142  css::beans::XPropertySet,
143  css::container::XNamed,
144  css::lang::XServiceInfo
145 >
146 {
147 private:
148  class Impl;
150 
153  OUString m_sCreatedNumRuleName; //connects to a numbering in SwDoc
154  SwDoc* m_pDoc; // Only if *not* used as chapter numbering.
155  SwDocShell* m_pDocShell; // Only if used as chapter numbering.
159 protected:
160  SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering
161  virtual ~SwXNumberingRules() override;
162 
163 public:
164  SwXNumberingRules(const SwNumRule& rRule, SwDoc* doc = nullptr); // NumRule for paragraphs, numbering styles
165  SwXNumberingRules(SwDoc& rDoc); //create a new instance
166 
167  static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
168 
169  virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
170 
171  //XIndexReplace
172  virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const css::uno::Any& Element ) override;
173 
174  //XIndexAccess
175  virtual sal_Int32 SAL_CALL getCount( ) override;
176  virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override;
177 
178  //XElementAccess
179  virtual css::uno::Type SAL_CALL getElementType( ) override;
180  virtual sal_Bool SAL_CALL hasElements( ) override;
181 
182  //XPropertySet
183  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
184  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
185  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
186  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
187  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
188  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
189  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
190 
191  //XNamed
192  virtual OUString SAL_CALL getName() override;
193  virtual void SAL_CALL setName(const OUString& Name_) override;
194 
195  //XServiceInfo
196  virtual OUString SAL_CALL getImplementationName() override;
197  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
198  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
199 
200  css::uno::Sequence< css::beans::PropertyValue>
201  GetNumberingRuleByIndex(const SwNumRule& rNumRule, sal_Int32 nIndex)const;
204  void SetNumberingRuleByIndex(SwNumRule& rNumRule,
205  const css::uno::Sequence< css::beans::PropertyValue>& rProperties, sal_Int32 nIndex);
206 
207  const OUString* GetNewCharStyleNames() const {return m_sNewCharStyleNames;}
208  const OUString* GetBulletFontNames() const {return m_sNewBulletFontNames;}
209  const SwNumRule* GetNumRule() const {return m_pNumRule;}
210 
211  static bool isInvalidStyle(std::u16string_view rName);
212  void Invalidate() {m_pDocShell = nullptr;}
213  const OUString& GetCreatedNumRuleName() const {return m_sCreatedNumRuleName;}
214 
215  static css::uno::Sequence<css::beans::PropertyValue> GetPropertiesForNumFormat(
216  const SwNumFormat& rFormat, OUString const& rCharFormatName,
217  OUString const* pHeadingStyleName, OUString const & referer);
218  static void SetPropertiesToNumFormat(
219  SwNumFormat & aFormat,
220  OUString & rCharStyleName,
221  OUString *const pBulletFontName,
222  OUString *const pHeadingStyleName,
223  OUString *const pParagraphStyleName,
224  SwDoc *const pDoc,
225  SwDocShell *const pDocShell,
226  css::uno::Sequence<css::beans::PropertyValue> const& rProperties);
227 
228 };
229 
231 {
232 
233  virtual ~SwXChapterNumbering() override;
234 public:
236 
238 
239  //XServiceInfo
240  virtual OUString SAL_CALL getImplementationName() override;
241  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
242  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
243 
244 };
245 
246 #endif
247 
248 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwXFootnoteProperties(SwDoc *pDoc)
Definition: unosett.cxx:283
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:775
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:277
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:1037
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:267
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:420
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:895
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:2083
virtual ~SwXFootnoteProperties() override
Definition: unosett.cxx:289
Definition: doc.hxx:187
SwXEndnoteProperties(SwDoc *pDoc)
Definition: unosett.cxx:563
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:115
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:1042
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:2150
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:2088
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:573
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:541
virtual ~SwXNumberingRules() override
Definition: unosett.cxx:1108
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Definition: unosett.cxx:1191
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: unosett.cxx:1028
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:579
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:2093
bool m_bOwnNumRuleCreated
Definition: unosett.hxx:158
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:85
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:981
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
virtual void SAL_CALL replaceByIndex(sal_Int32 Index, const css::uno::Any &Element) override
Definition: unosett.cxx:1117
void SetNumberingRuleByIndex(SwNumRule &rNumRule, const css::uno::Sequence< css::beans::PropertyValue > &rProperties, sal_Int32 nIndex)
Definition: unosett.cxx:1470
const OUString & GetCreatedNumRuleName() const
Definition: unosett.hxx:213
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:996
virtual ~SwXChapterNumbering() override
Definition: unosett.cxx:2160
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:529
virtual void SAL_CALL setName(const OUString &Name_) override
Definition: unosett.cxx:2122
OUString m_sNewCharStyleNames[MAXLEVEL]
Definition: unosett.hxx:151
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:300
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:1975
OUString m_sNewBulletFontNames[MAXLEVEL]
Definition: unosett.hxx:152
const OUString * GetBulletFontNames() const
Definition: unosett.hxx:208
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:744
const OUString * GetNewCharStyleNames() const
Definition: unosett.hxx:207
SwXChapterNumbering(SwDocShell &rDocSh)
Definition: unosett.cxx:2155
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:1047
virtual OUString SAL_CALL getName() override
Definition: unosett.cxx:2103
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:726
const SwNumRule * GetNumRule() const
Definition: unosett.hxx:209
unsigned char sal_Bool
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:523
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:749
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:557
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:547
static css::uno::Sequence< css::beans::PropertyValue > GetPropertiesForNumFormat(const SwNumFormat &rFormat, OUString const &rCharFormatName, OUString const *pHeadingStyleName, OUString const &referer)
Definition: unosett.cxx:1306
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unosett.cxx:1021
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:1526
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:2145
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:2098
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:738
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:991
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:2140
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:55
SwXLineNumberingProperties(SwDoc *pDoc)
Definition: unosett.cxx:765
virtual sal_Int32 SAL_CALL getCount() override
Definition: unosett.cxx:1186
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unosett.cxx:1219
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:1969
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:535
virtual sal_Bool SAL_CALL hasElements() override
Definition: unosett.cxx:1224
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:759
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:781
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:157
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:294
virtual ~SwXLineNumberingProperties() override
Definition: unosett.cxx:771
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:653
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:754
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:2043
SwNumRule * m_pNumRule
Definition: unosett.hxx:156
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:272
css::uno::Sequence< css::beans::PropertyValue > GetNumberingRuleByIndex(const SwNumRule &rNumRule, sal_Int32 nIndex) const
Definition: unosett.cxx:1243
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:986
static bool isInvalidStyle(std::u16string_view rName)
Definition: unosett.cxx:1012
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unosett.hxx:148
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:732
SwXNumberingRules(SwDocShell &rDocSh)
Definition: unosett.cxx:1082
struct _ADOIndex Index
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:552
SwDocShell * m_pDocShell
Definition: unosett.hxx:155
virtual ~SwXEndnoteProperties() override
Definition: unosett.cxx:569
OUString m_sCreatedNumRuleName
Definition: unosett.hxx:153