Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
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.
15 : : *
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).
21 : : *
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.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _XMLOFF_XMLICTXT_HXX
30 : : #define _XMLOFF_XMLICTXT_HXX
31 : :
32 : : #include "sal/config.h"
33 : : #include "xmloff/dllapi.h"
34 : : #include "sal/types.h"
35 : : #include <com/sun/star/xml/sax/XAttributeList.hpp>
36 : : #include <tools/solar.h>
37 : : #include <tools/ref.hxx>
38 : : #include <rtl/ustring.hxx>
39 : : #include <tools/rtti.hxx>
40 : :
41 : : class SvXMLNamespaceMap;
42 : : class SvXMLImport;
43 : :
44 : 0 : class XMLOFF_DLLPUBLIC SvXMLImportContext : public SvRefBase
45 : : {
46 : : friend class SvXMLImport;
47 : :
48 : : SvXMLImport& mrImport;
49 : :
50 : : sal_uInt16 mnPrefix;
51 : : ::rtl::OUString maLocalName;
52 : :
53 : : SvXMLNamespaceMap *mpRewindMap;
54 : :
55 : : SAL_DLLPRIVATE SvXMLNamespaceMap *GetRewindMap() const
56 : : { return mpRewindMap; }
57 : : SAL_DLLPRIVATE void SetRewindMap( SvXMLNamespaceMap *p ) { mpRewindMap = p; }
58 : :
59 : : protected:
60 : :
61 : 147493 : SvXMLImport& GetImport() { return mrImport; }
62 : 4940 : const SvXMLImport& GetImport() const { return mrImport; }
63 : :
64 : : public:
65 : : TYPEINFO();
66 : :
67 : : sal_uInt16 GetPrefix() const { return mnPrefix; }
68 : 126 : const ::rtl::OUString& GetLocalName() const { return maLocalName; }
69 : :
70 : : // A contexts constructor does anything that is required if an element
71 : : // starts. Namespace processing has been done already.
72 : : // Note that virtual methods cannot be used inside constructors. Use
73 : : // StartElement instead if this is required.
74 : : SvXMLImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
75 : : const ::rtl::OUString& rLName );
76 : :
77 : : // A contexts destructor does anything that is required if an element
78 : : // ends. By default, nothing is done.
79 : : // Note that virtual methods cannot be used inside destructors. Use
80 : : // EndElement instead if this is required.
81 : : virtual ~SvXMLImportContext();
82 : :
83 : : // Create a children element context. By default, the import's
84 : : // CreateContext method is called to create a new default context.
85 : : virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
86 : : const ::rtl::OUString& rLocalName,
87 : : const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
88 : :
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 );
93 : :
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();
98 : :
99 : : // This method is called for all characters that are contained in the
100 : : // current element. The default is to ignore them.
101 : : virtual void Characters( const ::rtl::OUString& rChars );
102 : : };
103 : :
104 : 4580 : SV_DECL_REF( SvXMLImportContext )
105 [ + - ][ - + ]: 2625 : SV_IMPL_REF( SvXMLImportContext )
[ - + ][ + + ]
[ + + ]
106 : :
107 : :
108 : : #endif // _XMLOFF_XMLICTXT_HXX
109 : :
110 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|