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_PERSATTRLISTTCONTEXT_HXX
30 : : #define _XMLOFF_PERSATTRLISTTCONTEXT_HXX
31 : :
32 : : #include <xmloff/xmltoken.hxx>
33 : : #include "TransformerContext.hxx"
34 : :
35 : :
36 : : class XMLPersAttrListTContext : public XMLTransformerContext
37 : : {
38 : :
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;
43 : :
44 : : protected:
45 : :
46 : 8 : void SetExportQName( const ::rtl::OUString& r ) { m_aElemQName = r; }
47 : :
48 : : public:
49 : : TYPEINFO();
50 : :
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 );
57 : :
58 : : // attr list persistence + attribute processing
59 : : XMLPersAttrListTContext( XMLTransformerBase& rTransformer,
60 : : const ::rtl::OUString& rQName,
61 : : sal_uInt16 nActionMap );
62 : :
63 : : // attr list persistence + renaming
64 : : XMLPersAttrListTContext( XMLTransformerBase& rTransformer,
65 : : const ::rtl::OUString& rQName,
66 : : sal_uInt16 nPrefix,
67 : : ::xmloff::token::XMLTokenEnum eToken );
68 : :
69 : : // attr list persistence + renaming + attribute processing
70 : : XMLPersAttrListTContext( XMLTransformerBase& rTransformer,
71 : : const ::rtl::OUString& rQName,
72 : : sal_uInt16 nPrefix,
73 : : ::xmloff::token::XMLTokenEnum eToken,
74 : : sal_uInt16 nActionMap );
75 : :
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();
81 : :
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 );
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.
101 : : virtual void Characters( const ::rtl::OUString& rChars );
102 : :
103 : : virtual sal_Bool IsPersistent() const;
104 : : virtual void Export();
105 : : virtual void ExportContent();
106 : :
107 : 2930 : const ::rtl::OUString& GetExportQName() const { return m_aElemQName; }
108 : :
109 : : void AddAttribute( sal_uInt16 nAPrefix,
110 : : ::xmloff::token::XMLTokenEnum eAToken,
111 : : ::xmloff::token::XMLTokenEnum eVToken );
112 : :
113 : : void AddAttribute( sal_uInt16 nAPrefix,
114 : : ::xmloff::token::XMLTokenEnum eAToken,
115 : : const ::rtl::OUString & rValue );
116 : :
117 : : ::com::sun::star::uno::Reference<
118 : : ::com::sun::star::xml::sax::XAttributeList >
119 : : GetAttrList() const;
120 : : };
121 : :
122 : : #endif // _XMLOFF_PERSATTRLISTTCONTEXT_HXX
123 : :
124 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|