Bump version to 21.06.18.1
[LibreOffice.git] / sw / inc / unosett.hxx
blob9a118f99cdec5895a19ca81b3ca9879e59e001bc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_INC_UNOSETT_HXX
20 #define INCLUDED_SW_INC_UNOSETT_HXX
22 #include "swtypes.hxx"
23 #include <com/sun/star/text/XTextColumns.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/lang/XUnoTunnel.hpp>
26 #include <com/sun/star/container/XIndexReplace.hpp>
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <com/sun/star/container/XNamed.hpp>
29 #include <com/sun/star/style/VerticalAlignment.hpp>
30 #include <cppuhelper/implbase2.hxx>
31 #include <cppuhelper/implbase4.hxx>
32 #include <cppuhelper/implbase5.hxx>
33 #include <tools/color.hxx>
34 #include "unobaseclass.hxx"
36 class SwDoc;
37 class SwFormatCol;
38 class SwDocShell;
39 class SwNumRule;
40 class SwNumFormat;
41 class SfxItemPropertySet;
42 namespace com::sun::star::beans { struct PropertyValue; }
44 class SwXFootnoteProperties final : public cppu::WeakAggImplHelper2
46 css::beans::XPropertySet,
47 css::lang::XServiceInfo
50 SwDoc* m_pDoc;
51 const SfxItemPropertySet* m_pPropertySet;
53 virtual ~SwXFootnoteProperties() override;
54 public:
55 SwXFootnoteProperties(SwDoc* pDoc);
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;
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;
71 void Invalidate() {m_pDoc = nullptr;}
74 class SwXEndnoteProperties final : public cppu::WeakAggImplHelper2
76 css::beans::XPropertySet,
77 css::lang::XServiceInfo
80 SwDoc* m_pDoc;
81 const SfxItemPropertySet* m_pPropertySet;
83 virtual ~SwXEndnoteProperties() override;
84 public:
85 SwXEndnoteProperties(SwDoc* pDoc);
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;
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;
101 void Invalidate() {m_pDoc = nullptr;}
104 class SwXLineNumberingProperties final : public cppu::WeakAggImplHelper2
106 css::beans::XPropertySet,
107 css::lang::XServiceInfo
110 SwDoc* m_pDoc;
111 const SfxItemPropertySet* m_pPropertySet;
113 virtual ~SwXLineNumberingProperties() override;
114 public:
115 SwXLineNumberingProperties(SwDoc* pDoc);
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;
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;
131 void Invalidate() {m_pDoc = nullptr;}
134 class SwXNumberingRules : public cppu::WeakAggImplHelper5
136 css::container::XIndexReplace,
137 css::lang::XUnoTunnel,
138 css::beans::XPropertySet,
139 css::container::XNamed,
140 css::lang::XServiceInfo
143 private:
144 class Impl;
145 ::sw::UnoImplPtr<Impl> m_pImpl;
147 OUString m_sNewCharStyleNames[MAXLEVEL];
148 OUString m_sNewBulletFontNames[MAXLEVEL];
149 OUString m_sCreatedNumRuleName; //connects to a numbering in SwDoc
150 SwDoc* m_pDoc; // Only if *not* used as chapter numbering.
151 SwDocShell* m_pDocShell; // Only if used as chapter numbering.
152 SwNumRule* m_pNumRule;
153 const SfxItemPropertySet* m_pPropertySet;
154 bool m_bOwnNumRuleCreated;
155 protected:
156 SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering
157 virtual ~SwXNumberingRules() override;
159 public:
160 SwXNumberingRules(const SwNumRule& rRule, SwDoc* doc = nullptr); // NumRule for paragraphs, numbering styles
161 SwXNumberingRules(SwDoc& rDoc); //create a new instance
163 static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
165 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
167 //XIndexReplace
168 virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const css::uno::Any& Element ) override;
170 //XIndexAccess
171 virtual sal_Int32 SAL_CALL getCount( ) override;
172 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override;
174 //XElementAccess
175 virtual css::uno::Type SAL_CALL getElementType( ) override;
176 virtual sal_Bool SAL_CALL hasElements( ) override;
178 //XPropertySet
179 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
180 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
181 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
182 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
183 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
184 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
185 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
187 //XNamed
188 virtual OUString SAL_CALL getName() override;
189 virtual void SAL_CALL setName(const OUString& Name_) override;
191 //XServiceInfo
192 virtual OUString SAL_CALL getImplementationName() override;
193 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
194 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
196 css::uno::Sequence< css::beans::PropertyValue>
197 GetNumberingRuleByIndex(const SwNumRule& rNumRule, sal_Int32 nIndex)const;
198 /// @throws css::uno::RuntimeException
199 /// @throws css::lang::IllegalArgumentException
200 void SetNumberingRuleByIndex(SwNumRule& rNumRule,
201 const css::uno::Sequence< css::beans::PropertyValue>& rProperties, sal_Int32 nIndex);
203 const OUString* GetNewCharStyleNames() const {return m_sNewCharStyleNames;}
204 const OUString* GetBulletFontNames() const {return m_sNewBulletFontNames;}
205 const SwNumRule* GetNumRule() const {return m_pNumRule;}
207 static bool isInvalidStyle(const OUString &rName);
208 void Invalidate() {m_pDocShell = nullptr;}
209 const OUString& GetCreatedNumRuleName() const {return m_sCreatedNumRuleName;}
211 static css::uno::Sequence<css::beans::PropertyValue> GetPropertiesForNumFormat(
212 const SwNumFormat& rFormat, OUString const& rCharFormatName,
213 OUString const* pHeadingStyleName, OUString const & referer);
214 static void SetPropertiesToNumFormat(
215 SwNumFormat & aFormat,
216 OUString & rCharStyleName,
217 OUString *const pBulletFontName,
218 OUString *const pHeadingStyleName,
219 OUString *const pParagraphStyleName,
220 SwDoc *const pDoc,
221 SwDocShell *const pDocShell,
222 css::uno::Sequence<css::beans::PropertyValue> const& rProperties);
226 class SwXChapterNumbering final : public SwXNumberingRules
229 virtual ~SwXChapterNumbering() override;
230 public:
231 SwXChapterNumbering(SwDocShell& rDocSh);
233 using SwXNumberingRules::Invalidate;
235 //XServiceInfo
236 virtual OUString SAL_CALL getImplementationName() override;
237 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
238 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
242 #endif
244 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */