1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XMLLineNumberingImportContext.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _XMLOFF_XMLLINENUMBERINGIMPORTCONTEXT_HXX_
32 #define _XMLOFF_XMLLINENUMBERINGIMPORTCONTEXT_HXX_
34 #include <xmloff/xmlstyle.hxx>
35 #include <rtl/ustring.hxx>
36 #include <com/sun/star/uno/Reference.h>
38 namespace com
{ namespace sun
{ namespace star
{
39 namespace xml
{ namespace sax
{ class XAttributeList
; } }
43 enum LineNumberingToken
45 XML_TOK_LINENUMBERING_STYLE_NAME
,
46 XML_TOK_LINENUMBERING_NUMBER_LINES
,
47 XML_TOK_LINENUMBERING_COUNT_EMPTY_LINES
,
48 XML_TOK_LINENUMBERING_COUNT_IN_TEXT_BOXES
,
49 XML_TOK_LINENUMBERING_RESTART_NUMBERING
,
50 XML_TOK_LINENUMBERING_OFFSET
,
51 XML_TOK_LINENUMBERING_NUM_FORMAT
,
52 XML_TOK_LINENUMBERING_NUM_LETTER_SYNC
,
53 XML_TOK_LINENUMBERING_NUMBER_POSITION
,
54 XML_TOK_LINENUMBERING_INCREMENT
55 // XML_TOK_LINENUMBERING_LINENUMBERING_CONFIGURATION,
56 // XML_TOK_LINENUMBERING_INCREMENT,
57 // XML_TOK_LINENUMBERING_LINENUMBERING_SEPARATOR,
61 /** import <text:linenumbering-configuration> elements */
62 class XMLLineNumberingImportContext
: public SvXMLStyleContext
64 const ::rtl::OUString sCharStyleName
;
65 const ::rtl::OUString sCountEmptyLines
;
66 const ::rtl::OUString sCountLinesInFrames
;
67 const ::rtl::OUString sDistance
;
68 const ::rtl::OUString sInterval
;
69 const ::rtl::OUString sSeparatorText
;
70 const ::rtl::OUString sNumberPosition
;
71 const ::rtl::OUString sNumberingType
;
72 const ::rtl::OUString sIsOn
;
73 const ::rtl::OUString sRestartAtEachPage
;
74 const ::rtl::OUString sSeparatorInterval
;
76 ::rtl::OUString sStyleName
;
77 ::rtl::OUString sNumFormat
;
78 ::rtl::OUString sNumLetterSync
;
79 ::rtl::OUString sSeparator
;
81 sal_Int16 nNumberPosition
;
83 sal_Int16 nSeparatorIncrement
;
84 sal_Bool bNumberLines
;
85 sal_Bool bCountEmptyLines
;
86 sal_Bool bCountInFloatingFrames
;
87 sal_Bool bRestartNumbering
;
93 XMLLineNumberingImportContext(
96 const ::rtl::OUString
& rLocalName
,
97 const ::com::sun::star::uno::Reference
<
98 ::com::sun::star::xml::sax::XAttributeList
> & xAttrList
);
100 ~XMLLineNumberingImportContext();
102 // to be used by child context: set separator info
103 void SetSeparatorText(const ::rtl::OUString
& sText
);
104 void SetSeparatorIncrement(sal_Int16 nIncr
);
108 virtual void StartElement(
109 const ::com::sun::star::uno::Reference
<
110 ::com::sun::star::xml::sax::XAttributeList
> & xAttrList
);
112 void ProcessAttribute(
113 enum LineNumberingToken eToken
,
114 ::rtl::OUString sValue
);
116 virtual void CreateAndInsert(sal_Bool bOverwrite
);
118 virtual SvXMLImportContext
*CreateChildContext(
120 const ::rtl::OUString
& rLocalName
,
121 const ::com::sun::star::uno::Reference
<
122 ::com::sun::star::xml::sax::XAttributeList
> & xAttrList
);
124 void ProcessAttribute(
125 const ::rtl::OUString sLocalName
,
126 const ::rtl::OUString sValue
);