1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _XMLOFF_PERSATTRLISTTCONTEXT_HXX
30 #define _XMLOFF_PERSATTRLISTTCONTEXT_HXX
32 #include <xmloff/xmltoken.hxx>
33 #include "TransformerContext.hxx"
36 class XMLPersAttrListTContext
: public XMLTransformerContext
39 ::com::sun::star::uno::Reference
<
40 ::com::sun::star::xml::sax::XAttributeList
> m_xAttrList
;
41 ::rtl::OUString m_aElemQName
;
42 sal_uInt16 m_nActionMap
;
46 void SetExportQName( const ::rtl::OUString
& r
) { m_aElemQName
= r
; }
51 // A contexts constructor does anything that is required if an element
52 // starts. Namespace processing has been done already.
53 // Note that virtual methods cannot be used inside constructors. Use
54 // StartElement instead if this is required.
55 XMLPersAttrListTContext( XMLTransformerBase
& rTransformer
,
56 const ::rtl::OUString
& rQName
);
58 // attr list persistence + attribute processing
59 XMLPersAttrListTContext( XMLTransformerBase
& rTransformer
,
60 const ::rtl::OUString
& rQName
,
61 sal_uInt16 nActionMap
);
63 // attr list persistence + renaming
64 XMLPersAttrListTContext( XMLTransformerBase
& rTransformer
,
65 const ::rtl::OUString
& rQName
,
67 ::xmloff::token::XMLTokenEnum eToken
);
69 // attr list persistence + renaming + attribute processing
70 XMLPersAttrListTContext( XMLTransformerBase
& rTransformer
,
71 const ::rtl::OUString
& rQName
,
73 ::xmloff::token::XMLTokenEnum eToken
,
74 sal_uInt16 nActionMap
);
76 // A contexts destructor does anything that is required if an element
77 // ends. By default, nothing is done.
78 // Note that virtual methods cannot be used inside destructors. Use
79 // EndElement instead if this is required.
80 virtual ~XMLPersAttrListTContext();
82 // Create a children element context. By default, the import's
83 // CreateContext method is called to create a new default context.
84 virtual XMLTransformerContext
*CreateChildContext( sal_uInt16 nPrefix
,
85 const ::rtl::OUString
& rLocalName
,
86 const ::rtl::OUString
& rQName
,
87 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
89 // StartElement is called after a context has been constructed and
90 // before a elements context is parsed. It may be used for actions that
91 // require virtual methods. The default is to do nothing.
92 virtual void StartElement( const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
94 // EndElement is called before a context will be destructed, but
95 // after a elements context has been parsed. It may be used for actions
96 // that require virtual methods. The default is to do nothing.
97 virtual void EndElement();
99 // This method is called for all characters that are contained in the
101 virtual void Characters( const ::rtl::OUString
& rChars
);
103 virtual sal_Bool
IsPersistent() const;
104 virtual void Export();
105 virtual void ExportContent();
107 const ::rtl::OUString
& GetExportQName() const { return m_aElemQName
; }
109 void AddAttribute( sal_uInt16 nAPrefix
,
110 ::xmloff::token::XMLTokenEnum eAToken
,
111 ::xmloff::token::XMLTokenEnum eVToken
);
113 void AddAttribute( sal_uInt16 nAPrefix
,
114 ::xmloff::token::XMLTokenEnum eAToken
,
115 const ::rtl::OUString
& rValue
);
117 ::com::sun::star::uno::Reference
<
118 ::com::sun::star::xml::sax::XAttributeList
>
122 #endif // _XMLOFF_PERSATTRLISTTCONTEXT_HXX
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */