xref: /AOO41X/main/xmloff/inc/xmloff/styleexp.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 #ifndef _XMLOFF_STYLEEXP_HXX_
24 #define _XMLOFF_STYLEEXP_HXX_
25 
26 #include "sal/config.h"
27 #include "xmloff/dllapi.h"
28 #include <rtl/ustring.hxx>
29 #include <com/sun/star/uno/Reference.h>
30 
31 #ifndef _VCL_MAPUNIT_HXX
32 //#include <tools/mapunit.hxx>
33 #endif
34 #include <xmloff/uniref.hxx>
35 
36 namespace com { namespace sun { namespace star
37 {
38     namespace style
39     {
40         class XStyle;
41     }
42     namespace beans
43     {
44         class XPropertySet;
45     }
46     namespace container     //#outline level,add by zhaojianwei
47     {
48         class XNameAccess;
49     }                       //<-end,zhaojianwei
50 
51 } } }
52 
53 class XMLPropertySetMapper;
54 class SvXMLExportPropertyMapper;
55 class SvXMLAutoStylePoolP;
56 class SvXMLExport;
57 
58 class XMLOFF_DLLPUBLIC XMLStyleExport : public UniRefBase
59 {
60     SvXMLExport& rExport;
61 protected:
62     const ::rtl::OUString sIsPhysical;
63     const ::rtl::OUString sIsAutoUpdate;
64     const ::rtl::OUString sFollowStyle;
65     const ::rtl::OUString sNumberingStyleName;
66     const ::rtl::OUString sOutlineLevel;    //#outline level,add by zhaojianwei
67 
GetExport()68     SvXMLExport& GetExport() { return rExport; }
GetExport() const69     const SvXMLExport& GetExport() const  { return rExport; }
70 
71 private:
72 
73     const ::rtl::OUString sPoolStyleName;
74 
75     SvXMLAutoStylePoolP *pAutoStylePool;
76 
77 protected:
78 
79     //virtual sal_Bool exportStyle(             //#outline level,zhaojianwei
80     //  const ::com::sun::star::uno::Reference<
81     //          ::com::sun::star::style::XStyle > & rStyle,
82     //  const ::rtl::OUString& rXMLFamily,
83     //  const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
84     //  const ::rtl::OUString* pPrefix = 0L );
85     virtual sal_Bool exportStyle(               //add by zhaojianwei
86         const ::com::sun::star::uno::Reference<
87         ::com::sun::star::style::XStyle > & rStyle,
88         const ::rtl::OUString& rXMLFamily,
89         const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
90         const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xStyles,
91         const ::rtl::OUString* pPrefix = 0L );  //<-end,zhaojianwei
92 
93     virtual void exportStyleAttributes(
94         const ::com::sun::star::uno::Reference<
95                 ::com::sun::star::style::XStyle > & rStyle );
96 
97     virtual void exportStyleContent(
98         const ::com::sun::star::uno::Reference<
99                 ::com::sun::star::style::XStyle > & rStyle );
100 public:
101     XMLStyleExport(
102         SvXMLExport& rExp,
103         const ::rtl::OUString& rPoolStyleName,
104         SvXMLAutoStylePoolP *pAutoStyleP=0 );
105     virtual ~XMLStyleExport();
106 
107 //  void exportStyleFamily(
108 //      const ::rtl::OUString& rFamily, const ::rtl::OUString& rXMLFamily,
109 //      const UniReference < XMLPropertySetMapper >& rPropMapper,
110 //      sal_Bool bUsed, sal_uInt16 nFamily = 0,
111 //      const ::rtl::OUString* pPrefix = 0L);
112 
113 //  void exportStyleFamily(
114 //      const sal_Char *pFamily, const ::rtl::OUString& rXMLFamily,
115 //      const UniReference < XMLPropertySetMapper >& rPropMapper,
116 //      sal_Bool bUsed, sal_uInt16 nFamily = 0,
117 //      const ::rtl::OUString* pPrefix = 0L);
118 
119     virtual sal_Bool exportDefaultStyle(
120         const ::com::sun::star::uno::Reference<
121                 ::com::sun::star::beans::XPropertySet > & xPropSet,
122         const ::rtl::OUString& rXMLFamily,
123         const UniReference < SvXMLExportPropertyMapper >& rPropMapper );
124 
125     void exportStyleFamily(
126         const ::rtl::OUString& rFamily, const ::rtl::OUString& rXMLFamily,
127         const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
128         sal_Bool bUsed, sal_uInt16 nFamily = 0,
129         const ::rtl::OUString* pPrefix = 0L);
130 
131     void exportStyleFamily(
132         const sal_Char *pFamily, const ::rtl::OUString& rXMLFamily,
133         const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
134         sal_Bool bUsed, sal_uInt16 nFamily = 0,
135         const ::rtl::OUString* pPrefix = 0L);
136 };
137 
138 #endif
139