xref: /aoo41x/main/xmloff/source/text/txtparai.hxx (revision ecfe53c5)
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_TEXTPARAI_HXX_
24 #define _XMLOFF_TEXTPARAI_HXX_
25 
26 
27 #include <com/sun/star/uno/Reference.h>
28 #include <xmloff/xmlictxt.hxx>
29 
30 class XMLHints_Impl;
31 namespace com { namespace sun { namespace star {
32 namespace text {  class XTextRange; }
33 namespace xml { namespace sax { class XAttributeList; } }
34 } } }
35 
36 #define CONV_FROM_STAR_BATS 1
37 #define CONV_FROM_STAR_MATH 2
38 #define CONV_STAR_FONT_FLAGS_VALID 4
39 
40 class XMLParaContext : public SvXMLImportContext
41 {
42 	::com::sun::star::uno::Reference <
43 		::com::sun::star::text::XTextRange > xStart;	// xub_StrLen nStart;
44 	::rtl::OUString				sStyleName;
45     ::rtl::OUString             m_sXmlId;
46     ::rtl::OUString             m_sAbout;
47     ::rtl::OUString             m_sProperty;
48     ::rtl::OUString             m_sContent;
49     ::rtl::OUString             m_sDatatype;
50     bool                        m_bHaveAbout;
51 	sal_Int8 				nOutlineLevel;
52 	XMLHints_Impl			*pHints;
53     // --> OD 2007-07-25 #i73509#
54     sal_Bool                mbOutlineLevelAttrFound;
55     // <--
56 	sal_Bool				bIgnoreLeadingSpace;
57 	sal_Bool				bHeading;
58     sal_Bool                bIsListHeader;
59     sal_Bool                bIsRestart;
60     sal_Int16               nStartValue;
61 	sal_uInt8				nStarFontsConvFlags;
62 
63 public:
64 
65 	TYPEINFO();
66 
67 	XMLParaContext( SvXMLImport& rImport,
68 			sal_uInt16 nPrfx,
69 			const ::rtl::OUString& rLName,
70 			const ::com::sun::star::uno::Reference<
71 				::com::sun::star::xml::sax::XAttributeList > & xAttrList,
72 			sal_Bool bHeading );
73 
74 	virtual ~XMLParaContext();
75 
76 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
77 			const ::rtl::OUString& rLocalName,
78 			const ::com::sun::star::uno::Reference<
79 				::com::sun::star::xml::sax::XAttributeList > & xAttrList );
80 
81 	virtual void Characters( const ::rtl::OUString& rChars );
82 
83 };
84 
85 class XMLNumberedParaContext : public SvXMLImportContext
86 {
87     /// text:list-level MINUS 1
88     sal_Int16 m_Level;
89     /// text:start-value
90     sal_Int16 m_StartValue;
91     /// xml:id
92     ::rtl::OUString m_XmlId;
93     /// text:list-id
94     ::rtl::OUString m_ListId;
95     /// text:style-name
96     ::com::sun::star::uno::Reference <
97         ::com::sun::star::container::XIndexReplace > m_xNumRules;
98 
99 public:
100 
101     TYPEINFO();
102 
103     XMLNumberedParaContext( SvXMLImport& i_rImport,
104             sal_uInt16 i_nPrefix,
105             const ::rtl::OUString& i_rLocalName,
106             const ::com::sun::star::uno::Reference<
107                 ::com::sun::star::xml::sax::XAttributeList > & i_xAttrList );
108 
109     virtual ~XMLNumberedParaContext();
110 
111     virtual void EndElement();
112 
113     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 i_nPrefix,
114             const ::rtl::OUString& i_rLocalName,
115             const ::com::sun::star::uno::Reference<
116                 ::com::sun::star::xml::sax::XAttributeList > & i_xAttrList );
117 
GetLevel() const118     sal_Int16 GetLevel() const { return m_Level; }
119     const ::com::sun::star::uno::Reference <
GetNumRules() const120         ::com::sun::star::container::XIndexReplace >& GetNumRules() const
121         { return m_xNumRules; }
GetListId() const122     const ::rtl::OUString& GetListId() const { return m_ListId; }
GetStartValue() const123     sal_Int16 GetStartValue() const { return m_StartValue; }
124 
125 };
126 
127 #endif
128