xref: /AOO41X/main/xmloff/inc/xmloff/xmlnume.hxx (revision ecfe53c5d1886e1e0d215b0d140d05282ab1c477)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _XMLOFF_XMLNUME_HXX
25 #define _XMLOFF_XMLNUME_HXX
26 
27 #include <rtl/ustring.hxx>
28 #include <tools/mapunit.hxx>
29 #include <xmloff/XMLStringVector.hxx>
30 #include <xmloff/attrlist.hxx>
31 
32 namespace com { namespace sun { namespace star {
33     namespace frame { class XModel; }
34     namespace style { class XStyle; }
35     namespace container { class XIndexReplace; }
36     namespace beans { struct PropertyValue; }
37 } } }
38 
39 class SvXMLNamespaceMap;
40 class SvXMLUnitConverter;
41 class SvXMLExportItemMapper;
42 class SvXMLExport;
43 class XMLTextListAutoStylePool;
44 
45 class SvxXMLNumRuleExport
46 {
47     SvXMLExport& rExport;
48     const ::rtl::OUString sCDATA;
49     const ::rtl::OUString sWS;
50     const ::rtl::OUString sNumberingRules;
51     const ::rtl::OUString sIsPhysical;
52     const ::rtl::OUString sIsContinuousNumbering;
53     // --> OD 2008-06-06 #i89178#
54     // Boolean indicating, if properties for position-and-space-mode LABEL_ALIGNEMNT
55     // are exported or not.
56     // These properties have been introduced in ODF 1.2. Thus, its export have
57     // to be suppressed on writing ODF 1.0 respectively ODF 1.1
58     bool mbExportPositionAndSpaceModeLabelAlignment;
59     // <--
60 
61     void exportLevelStyles(
62             const ::com::sun::star::uno::Reference<
63                 ::com::sun::star::container::XIndexReplace > & xNumRule,
64             sal_Bool bOutline=sal_False );
65 
66     void exportLevelStyle(
67             sal_Int32 nLevel,
68             const ::com::sun::star::uno::Sequence<
69                 ::com::sun::star::beans::PropertyValue>& rProps,
70             sal_Bool bOutline=sal_False );
71 
72 protected:
73 
74     // This method may be overloaded to add attributes to the <list-style>
75     // element.
76     virtual void AddListStyleAttributes();
77 
78     sal_Bool exportStyle( const ::com::sun::star::uno::Reference<
79                             ::com::sun::star::style::XStyle >& rStyle );
80     void exportOutline();
81 
GetExport()82     SvXMLExport& GetExport() { return rExport; }
83 
84     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace >  GetUNONumRule() const;
85 
86 public:
87 
88     SvxXMLNumRuleExport( SvXMLExport& rExport );
89     virtual ~SvxXMLNumRuleExport();
90 
91     void exportStyles( sal_Bool bUsed,
92                        XMLTextListAutoStylePool *pPool,
93                        sal_Bool bExportChapterNumbering = sal_True );
94     void exportNumberingRule(
95             const ::rtl::OUString& rName,
96             const ::com::sun::star::uno::Reference<
97                 ::com::sun::star::container::XIndexReplace > & xNumRule );
98 
99     // --> OD 2008-06-17 #i90780#
100     // refactoring: removing unused methods
101 //    void Export( const ::rtl::OUString& rOutline, sal_Bool bContNumbering );
102 //    void ExportOutline();
103     // <--
104 
105     static sal_Bool GetOutlineStyles( XMLStringVector& rStyleNames,
106                const ::com::sun::star::uno::Reference<
107                             ::com::sun::star::frame::XModel > & rModel );
108 
109 };
110 
111 #endif  //  _XMLOFF_XMLNUME_HXX
112 
113