1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <swtypes.hxx>
24 #include <com/sun/star/text/XTextColumns.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/lang/XUnoTunnel.hpp>
27 #include <com/sun/star/container/XIndexReplace.hpp>
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <com/sun/star/beans/PropertyValue.hpp>
30 #include <com/sun/star/container/XNamed.hpp>
31 #include <cppuhelper/implbase2.hxx>
32 #include <cppuhelper/implbase4.hxx>
33 #include <cppuhelper/implbase5.hxx>
34 #include <tools/string.hxx>
35 #include <svl/itemprop.hxx>
42 class SwXFootnoteProperties
: public cppu::WeakAggImplHelper2
44 ::com::sun::star::beans::XPropertySet
,
45 ::com::sun::star::lang::XServiceInfo
49 const SfxItemPropertySet
* m_pPropertySet
;
51 virtual ~SwXFootnoteProperties();
53 SwXFootnoteProperties(SwDoc
* pDoc
);
57 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
);
58 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
59 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
60 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
61 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
62 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
63 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
66 virtual OUString SAL_CALL
getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException
);
67 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
68 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException
);
70 void Invalidate() {pDoc
= 0;}
73 class SwXEndnoteProperties
: public cppu::WeakAggImplHelper2
75 ::com::sun::star::beans::XPropertySet
,
76 ::com::sun::star::lang::XServiceInfo
80 const SfxItemPropertySet
* m_pPropertySet
;
82 virtual ~SwXEndnoteProperties();
84 SwXEndnoteProperties(SwDoc
* pDoc
);
88 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
);
89 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
90 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
91 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
92 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
93 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
94 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
97 virtual OUString SAL_CALL
getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException
);
98 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
99 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException
);
101 void Invalidate() {pDoc
= 0;}
104 class SwXLineNumberingProperties
: public cppu::WeakAggImplHelper2
106 ::com::sun::star::beans::XPropertySet
,
107 ::com::sun::star::lang::XServiceInfo
111 const SfxItemPropertySet
* m_pPropertySet
;
113 virtual ~SwXLineNumberingProperties();
115 SwXLineNumberingProperties(SwDoc
* pDoc
);
119 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
);
120 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
121 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
122 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
123 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
124 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
125 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
128 virtual OUString SAL_CALL
getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException
);
129 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
130 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException
);
132 void Invalidate() {pDoc
= 0;}
135 class SwXNumberingRules
: public cppu::WeakAggImplHelper5
137 ::com::sun::star::container::XIndexReplace
,
138 ::com::sun::star::lang::XUnoTunnel
,
139 ::com::sun::star::beans::XPropertySet
,
140 ::com::sun::star::container::XNamed
,
141 ::com::sun::star::lang::XServiceInfo
145 String sNewCharStyleNames
[MAXLEVEL
];
146 String sNewBulletFontNames
[MAXLEVEL
];
147 String sCreatedNumRuleName
; //connects to a numbering in SwDoc
149 SwDocShell
* pDocShell
; // Only if used as chapter numbering.
151 const SfxItemPropertySet
* m_pPropertySet
;
152 sal_Bool bOwnNumRuleCreated
;
154 virtual ~SwXNumberingRules();
157 virtual void Modify( const SfxPoolItem
* pOld
, const SfxPoolItem
*pNew
);
160 SwXNumberingRules(SwDocShell
& rDocSh
); // chapter numbering
161 SwXNumberingRules(const SwNumRule
& rRule
, SwDoc
* doc
= NULL
); // NumRule for paragraphs, numbering styles
162 SwXNumberingRules(SwDoc
& rDoc
); //create a new instance
165 static const ::com::sun::star::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
167 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw(::com::sun::star::uno::RuntimeException
);
171 virtual void SAL_CALL
replaceByIndex( sal_Int32 Index
, const ::com::sun::star::uno::Any
& Element
) throw(::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
174 virtual sal_Int32 SAL_CALL
getCount( ) throw(::com::sun::star::uno::RuntimeException
);
175 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex(sal_Int32 nIndex
) throw( ::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
178 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType( ) throw(::com::sun::star::uno::RuntimeException
);
179 virtual sal_Bool SAL_CALL
hasElements( ) throw(::com::sun::star::uno::RuntimeException
);
182 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
);
183 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
184 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
185 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
186 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
187 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
188 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
191 virtual OUString SAL_CALL
getName(void) throw( ::com::sun::star::uno::RuntimeException
);
192 virtual void SAL_CALL
setName(const OUString
& Name_
) throw( ::com::sun::star::uno::RuntimeException
);
195 virtual OUString SAL_CALL
getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException
);
196 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
197 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException
);
199 ::com::sun::star::uno::Sequence
<
200 ::com::sun::star::beans::PropertyValue
>
201 GetNumberingRuleByIndex(const SwNumRule
& rNumRule
, sal_Int32 nIndex
)const;
202 void SetNumberingRuleByIndex(SwNumRule
& rNumRule
,
203 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& rProperties
, sal_Int32 nIndex
)
204 throw( ::com::sun::star::uno::RuntimeException
, ::com::sun::star::lang::IllegalArgumentException
);
206 const String
* GetNewCharStyleNames() const {return sNewCharStyleNames
;}
207 const String
* GetBulletFontNames() const {return sNewBulletFontNames
;}
208 const SwNumRule
* GetNumRule() {return pNumRule
;}
210 static bool isInvalidStyle(const OUString
&rName
);
211 void Invalidate() {pDocShell
= 0;}
212 const String
& GetCreatedNumRuleName() const{return sCreatedNumRuleName
; }
215 class SwXChapterNumbering
: public SwXNumberingRules
218 virtual ~SwXChapterNumbering();
220 SwXChapterNumbering(SwDocShell
& rDocSh
);
223 void Invalidate() {SwXNumberingRules::Invalidate();}
226 virtual OUString SAL_CALL
getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException
);
227 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
228 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException
);
232 class SwXTextColumns
: public cppu::WeakAggImplHelper4
235 ::com::sun::star::lang::XUnoTunnel
,
236 ::com::sun::star::beans::XPropertySet
,
237 ::com::sun::star::text::XTextColumns
,
238 ::com::sun::star::lang::XServiceInfo
241 sal_Int32 nReference
;
242 ::com::sun::star::uno::Sequence
< ::com::sun::star::text::TextColumn
> aTextColumns
;
243 sal_Bool bIsAutomaticWidth
;
244 sal_Int32 nAutoDistance
;
246 const SfxItemPropertySet
* m_pPropSet
;
249 sal_Int32 nSepLineWidth
;
250 sal_Int32 nSepLineColor
;
251 sal_Int8 nSepLineHeightRelative
;
252 sal_Int8 nSepLineVertAlign
;//style::VerticalAlignment
253 sal_Bool bSepLineIsOn
;
254 sal_Int8 nSepLineStyle
;
257 virtual ~SwXTextColumns();
259 SwXTextColumns(sal_uInt16 nColCount
);
260 SwXTextColumns(const SwFmtCol
& rFmtCol
);
264 static const ::com::sun::star::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
267 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw(::com::sun::star::uno::RuntimeException
);
270 virtual sal_Int32 SAL_CALL
getReferenceValue( ) throw(::com::sun::star::uno::RuntimeException
);
271 virtual sal_Int16 SAL_CALL
getColumnCount( ) throw(::com::sun::star::uno::RuntimeException
);
272 virtual void SAL_CALL
setColumnCount( sal_Int16 nColumns
) throw(::com::sun::star::uno::RuntimeException
);
273 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::text::TextColumn
> SAL_CALL
getColumns( ) throw(::com::sun::star::uno::RuntimeException
);
274 virtual void SAL_CALL
setColumns( const ::com::sun::star::uno::Sequence
< ::com::sun::star::text::TextColumn
>& Columns
) throw(::com::sun::star::uno::RuntimeException
);
277 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
);
278 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
279 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
280 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
281 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
282 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
283 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
286 virtual OUString SAL_CALL
getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException
);
287 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
288 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException
);
290 sal_Int32
GetSepLineWidth() const {return nSepLineWidth
;}
291 sal_Int32
GetSepLineColor() const {return nSepLineColor
;}
292 sal_Int8
GetSepLineHeightRelative() const {return nSepLineHeightRelative
;}
293 sal_Int8
GetSepLineVertAlign() const {return nSepLineVertAlign
;}
294 sal_Bool
GetSepLineIsOn() const {return bSepLineIsOn
;}
295 sal_Int8
GetSepLineStyle() const {return nSepLineStyle
;}
297 sal_Bool
IsAutomaticWidth() const {return bIsAutomaticWidth
;}
302 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */