1 #ifndef INCLUDED_NUMBERINGMANAGER_HXX
2 #define INCLUDED_NUMBERINGMANAGER_HXX
4 #include "PropertyMap.hxx"
6 #include <WriterFilterDllApi.hxx>
7 #include <dmapper/DomainMapper.hxx>
8 #include <resourcemodel/WW8ResourceModel.hxx>
10 #include <com/sun/star/container/XIndexReplace.hpp>
12 namespace writerfilter
{
16 class StyleSheetEntry
;
19 /** Class representing the numbering level properties.
21 class ListLevel
: public PropertyMap
23 sal_Int32 m_nIStartAt
; //LN_ISTARTAT
24 sal_Int32 m_nNFC
; //LN_NFC
25 sal_Int32 m_nJC
; //LN_JC
26 sal_Int32 m_nFLegal
; //LN_FLEGAL
27 sal_Int32 m_nFNoRestart
; //LN_FNORESTART
28 sal_Int32 m_nFPrev
; //LN_FPREV
29 sal_Int32 m_nFPrevSpace
; //LN_FPREVSPACE
30 sal_Int32 m_nFWord6
; //LN_FWORD6
31 ::rtl::OUString m_sRGBXchNums
; //LN_RGBXCHNUMS
32 sal_Int32 m_nXChFollow
; //LN_IXCHFOLLOW
33 ::rtl::OUString m_sBulletChar
;
35 boost::shared_ptr
< StyleSheetEntry
> m_pParaStyle
;
39 typedef boost::shared_ptr
< ListLevel
> Pointer
;
56 // Setters for the import
57 void SetValue( Id nId
, sal_Int32 nValue
);
58 void SetBulletChar( rtl::OUString sValue
) { m_sBulletChar
= sValue
; };
59 void SetParaStyle( boost::shared_ptr
< StyleSheetEntry
> pStyle
)
61 m_pParaStyle
= pStyle
;
63 void AddRGBXchNums( rtl::OUString sValue
) { m_sRGBXchNums
+= sValue
; };
66 rtl::OUString
GetBulletChar( ) { return m_sBulletChar
; };
67 boost::shared_ptr
< StyleSheetEntry
> GetParaStyle( ) { return m_pParaStyle
; };
69 // UNO mapping functions
71 // rPrefix and rSuffix are out parameters
72 static sal_Int16
GetParentNumbering( rtl::OUString sText
, sal_Int16 nLevel
,
73 rtl::OUString
& rPrefix
, rtl::OUString
& rSuffix
);
75 com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>
78 com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>
79 GetCharStyleProperties( );
82 com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>
83 GetLevelProperties( );
85 com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>
92 sal_Int32 m_nTPLC
; //LN_TPLC
93 ::rtl::OUString m_sRGISTD
; //LN_RGISTD
94 sal_Int32 m_nSimpleList
; //LN_FSIMPLELIST
95 sal_Int32 m_nRestart
; //LN_FRESTARTHDN
96 sal_Int32 m_nUnsigned
; //LN_UNSIGNED26_2
98 // The ID member reflects either the abstractNumId or the numId
99 // depending on the use of the class
102 // Properties of each level. This can also reflect the overridden
103 // levels of a numbering.
104 ::std::vector
< ListLevel::Pointer
> m_aLevels
;
106 // Only used during the numberings import
107 ListLevel::Pointer m_pCurrentLevel
;
110 typedef boost::shared_ptr
< AbstractListDef
> Pointer
;
115 // Setters using during the import
116 void SetId( sal_Int32 nId
) { m_nId
= nId
; };
117 void SetValue( sal_uInt32 nSprmId
, sal_Int32 nValue
);
118 void AddRGISTD( rtl::OUString sValue
) { m_sRGISTD
+= sValue
; };
121 sal_Int32
GetId( ) { return m_nId
; };
123 sal_Int16
Size( ) { return sal_Int16( m_aLevels
.size( ) ); };
124 ListLevel::Pointer
GetLevel( sal_uInt16 nLvl
);
127 ListLevel::Pointer
GetCurrentLevel( ) { return m_pCurrentLevel
; };
129 virtual com::sun::star::uno::Sequence
<
130 com::sun::star::uno::Sequence
<
131 com::sun::star::beans::PropertyValue
> > GetPropertyValues( );
134 class ListDef
: public AbstractListDef
137 // Pointer to the abstract numbering
138 AbstractListDef::Pointer m_pAbstractDef
;
140 // Cache for the UNO numbering rules
141 uno::Reference
< container::XIndexReplace
> m_xNumRules
;
144 typedef boost::shared_ptr
< ListDef
> Pointer
;
150 void SetAbstractDefinition( AbstractListDef::Pointer pAbstract
) { m_pAbstractDef
= pAbstract
; };
151 AbstractListDef::Pointer
GetAbstractDefinition( ) { return m_pAbstractDef
; };
154 static rtl::OUString
GetStyleName( sal_Int32 nId
);
156 com::sun::star::uno::Sequence
<
157 com::sun::star::uno::Sequence
<
158 com::sun::star::beans::PropertyValue
> > GetPropertyValues( );
160 void CreateNumberingRules(
161 DomainMapper
& rDMapper
,
162 com::sun::star::uno::Reference
<
163 com::sun::star::lang::XMultiServiceFactory
> xFactory
);
165 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexReplace
>
166 GetNumberingRules( ) { return m_xNumRules
; };
170 /** This class provides access to the defined numbering styles.
172 class WRITERFILTER_DLLPRIVATE ListsManager
:
178 DomainMapper
& m_rDMapper
;
179 com::sun::star::uno::Reference
<
180 com::sun::star::lang::XMultiServiceFactory
> m_xFactory
;
182 // The numbering entries
183 std::vector
< AbstractListDef::Pointer
> m_aAbstractLists
;
184 std::vector
< ListDef::Pointer
> m_aLists
;
187 // These members are used for import only
188 AbstractListDef::Pointer m_pCurrentDefinition
;
194 DomainMapper
& rDMapper
,
195 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> xFactory
);
196 virtual ~ListsManager();
198 typedef boost::shared_ptr
< ListsManager
> Pointer
;
201 virtual void attribute( Id nName
, Value
& rVal
);
202 virtual void sprm(Sprm
& sprm
);
205 virtual void entry(int pos
, writerfilter::Reference
<Properties
>::Pointer_t ref
);
208 void SetLFOImport( bool bLFOImport
) { m_bIsLFOImport
= bLFOImport
; };
210 // Numberings accessors
211 AbstractListDef::Pointer
GetCurrentDef( ) { return m_pCurrentDefinition
; };
213 sal_uInt32
Size() const
214 { return sal_uInt32( m_aLists
.size( ) ); };
215 ListDef::Pointer
GetList( sal_Int32 nId
);
218 void CreateNumberingRules( );