merge the formfield patch from ooo-build
[ooovba.git] / binfilter / inc / bf_xmloff / xmlictxt.hxx
blob571b9fa60634aa95a7daf6ed62ec95f935fd3a5f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlictxt.hxx,v $
10 * $Revision: 1.6 $
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_XMLICTXT_HXX
32 #define _XMLOFF_XMLICTXT_HXX
34 #ifndef _COM_SUN_STAR_XML_SAX_XATTRIBUTELIST_HPP_
35 #include <com/sun/star/xml/sax/XAttributeList.hpp>
36 #endif
38 #ifndef _SOLAR_H
39 #include <tools/solar.h>
40 #endif
41 #ifndef _REF_HXX
42 #include <tools/ref.hxx>
43 #endif
44 #ifndef _RTTI_HXX
45 #include <tools/rtti.hxx>
46 #endif
47 namespace binfilter {
49 class SvXMLNamespaceMap;
50 class SvXMLImport;
52 class SvXMLImportContext : public SvRefBase
54 friend class SvXMLImport;
56 SvXMLImport& rImport;
58 USHORT nPrefix;
59 ::rtl::OUString aLocalName;
61 SvXMLNamespaceMap *pRewindMap;
63 SvXMLNamespaceMap *GetRewindMap() const { return pRewindMap; }
64 void SetRewindMap( SvXMLNamespaceMap *p ) { pRewindMap = p; }
66 protected:
68 SvXMLImport& GetImport() { return rImport; }
69 const SvXMLImport& GetImport() const { return rImport; }
71 public:
72 TYPEINFO();
74 USHORT GetPrefix() const { return nPrefix; }
75 const ::rtl::OUString& GetLocalName() const { return aLocalName; }
77 // A contexts constructor does anything that is required if an element
78 // starts. Namespace processing has been done already.
79 // Note that virtual methods cannot be used inside constructors. Use
80 // StartElement instead if this is required.
81 SvXMLImportContext( SvXMLImport& rImport, USHORT nPrfx,
82 const ::rtl::OUString& rLName );
84 // A contexts destructor does anything that is required if an element
85 // ends. By default, nothing is done.
86 // Note that virtual methods cannot be used inside destructors. Use
87 // EndElement instead if this is required.
88 virtual ~SvXMLImportContext();
90 // Create a childs element context. By default, the import's
91 // CreateContext method is called to create a new default context.
92 virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
93 const ::rtl::OUString& rLocalName,
94 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
96 // StartElement is called after a context has been constructed and
97 // before a elements context is parsed. It may be used for actions that
98 // require virtual methods. The default is to do nothing.
99 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
101 // EndElement is called before a context will be destructed, but
102 // after a elements context has been parsed. It may be used for actions
103 // that require virtual methods. The default is to do nothing.
104 virtual void EndElement();
106 // This method is called for all characters that are contained in the
107 // current element. The default is to ignore them.
108 virtual void Characters( const ::rtl::OUString& rChars );
111 SV_DECL_REF( SvXMLImportContext )
112 SV_IMPL_REF( SvXMLImportContext )
114 }//end of namespace binfilter
115 #endif // _XMLOFF_XMLICTXT_HXX