1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
10 * Sun Microsystems Inc., October, 2000
12 * GNU Lesser General Public License Version 2.1
13 * =============================================
14 * Copyright 2000 by Sun Microsystems, Inc.
15 * 901 San Antonio Road, Palo Alto, CA 94303, USA
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License version 2.1, as published by the Free Software Foundation.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 * Sun Industry Standards Source License Version 1.1
33 * =================================================
34 * The contents of this file are subject to the Sun Industry Standards
35 * Source License Version 1.1 (the "License"); You may not use this file
36 * except in compliance with the License. You may obtain a copy of the
37 * License at http://www.openoffice.org/license.html.
39 * Software provided under this License is provided on an "AS IS" basis,
40 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 * See the License for the specific provisions governing your rights and
44 * obligations concerning the Software.
46 * The Initial Developer of the Original Code is: IBM Corporation
48 * Copyright: 2008 by IBM Corporation
50 * All Rights Reserved.
52 * Contributor(s): _______________________________________
55 ************************************************************************/
56 /*************************************************************************
59 ************************************************************************/
60 #ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFOOTNOTECONFIG_HXX
61 #define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFOOTNOTECONFIG_HXX
63 #include <xfilter/ixfattrlist.hxx>
64 #include <xfilter/xfstyle.hxx>
66 class XFFootnoteConfig
: public XFStyle
72 void SetMasterPage(const OUString
& masterPage
);
74 void SetStartValue(sal_Int32 value
);
76 void SetRestartOnPage();
78 void SetNumPrefix(const OUString
& numprefix
);
80 void SetNumSuffix(const OUString
& numsuffix
);
82 void SetMessageOn(const OUString
& message
);
84 void SetMessageFrom(const OUString
& message
);
86 virtual void ToXml(IXFStream
*pStrm
) override
;
89 OUString m_strBodyStyle
;
90 OUString m_strCitationStyle
;
91 OUString m_strDefaultStyle
;
92 OUString m_strMasterPage
;
94 OUString m_strNumPrefix
;
95 OUString m_strNumSuffix
;
96 OUString m_strMessageFrom
;
97 OUString m_strMessageOn
;
98 sal_Int32 m_nStartValue
;
99 sal_Int32 m_nRestartType
;
100 bool m_bInsertInPage
;
104 inline XFFootnoteConfig::XFFootnoteConfig()
109 m_bInsertInPage
= true;
110 m_strDefaultStyle
= "Footnote";
111 m_strMasterPage
= "Footnote";
112 m_strCitationStyle
= "Footnote Symbol";
113 m_strBodyStyle
= "Footnote anchor";
114 m_bIsFootnote
= true;
117 inline void XFFootnoteConfig::SetMasterPage(const OUString
& masterPage
)
119 m_strMasterPage
= masterPage
;
122 inline void XFFootnoteConfig::SetStartValue(sal_Int32 value
)
126 m_nStartValue
= value
;
129 inline void XFFootnoteConfig::SetRestartOnPage()
134 inline void XFFootnoteConfig::SetNumPrefix(const OUString
& numprefix
)
136 m_strNumPrefix
= numprefix
;
139 inline void XFFootnoteConfig::SetNumSuffix(const OUString
& numsuffix
)
141 m_strNumSuffix
= numsuffix
;
144 inline void XFFootnoteConfig::SetMessageOn(const OUString
& message
)
146 m_strMessageOn
= message
;
149 inline void XFFootnoteConfig::SetMessageFrom(const OUString
& message
)
151 m_strMessageFrom
= message
;
154 inline void XFFootnoteConfig::ToXml(IXFStream
*pStrm
)
156 IXFAttrList
*pAttrList
= pStrm
->GetAttrList();
159 if( !m_strCitationStyle
.isEmpty() )
160 pAttrList
->AddAttribute( "text:citation-style-name", m_strCitationStyle
);
162 if( !m_strBodyStyle
.isEmpty() )
163 pAttrList
->AddAttribute( "text:citation-body-style-name", m_strBodyStyle
);
165 if( !m_strNumPrefix
.isEmpty() )
166 pAttrList
->AddAttribute( "style:num-prefix", m_strNumPrefix
);
168 if( !m_strNumSuffix
.isEmpty() )
169 pAttrList
->AddAttribute( "style:num-suffix", m_strNumSuffix
);
171 if( !m_strNumFmt
.isEmpty() )
172 pAttrList
->AddAttribute( "style:num-format", m_strNumFmt
);
174 if( !m_strDefaultStyle
.isEmpty() )
175 pAttrList
->AddAttribute( "text:default-style-name", m_strDefaultStyle
);
177 if( !m_strMasterPage
.isEmpty() )
178 pAttrList
->AddAttribute( "text:master-page-name", m_strMasterPage
);
180 pAttrList
->AddAttribute( "text:start-value", OUString::number(m_nStartValue
) );
184 if( m_nRestartType
== -1 )
185 pAttrList
->AddAttribute( "text:start-numbering-at", "document" );
186 else if( m_nRestartType
== 0 )
187 pAttrList
->AddAttribute( "text:start-numbering-at", "page" );
188 else if( m_nRestartType
== 1 )
189 pAttrList
->AddAttribute( "text:start-numbering-at", "chapter" );
191 if( m_bInsertInPage
)
192 pAttrList
->AddAttribute( "text:footnotes-position", "page" );
194 pAttrList
->AddAttribute( "text:footnotes-position", "document" );
199 pStrm
->StartElement( "text:footnotes-configuration" );
200 if( !m_strMessageOn
.isEmpty() )
202 pStrm
->StartElement( "text:footnote-continuation-notice-forward" );
203 pStrm
->Characters(m_strMessageOn
);
204 pStrm
->EndElement( "text:footnote-continuation-notice-forward" );
207 if( !m_strMessageFrom
.isEmpty() )
209 pStrm
->StartElement( "text:footnote-continuation-notice-backward" );
210 pStrm
->Characters(m_strMessageFrom
);
211 pStrm
->EndElement( "text:footnote-continuation-notice-backward" );
214 pStrm
->EndElement( "text:footnotes-configuration" );
218 pStrm
->StartElement( "text:endnotes-configuration" );
219 pStrm
->EndElement( "text:endnotes-configuration" );
225 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */