LibreOffice Module xmloff (master)  1
PersAttrListTContext.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_XMLOFF_SOURCE_TRANSFORM_PERSATTRLISTTCONTEXT_HXX
21 #define INCLUDED_XMLOFF_SOURCE_TRANSFORM_PERSATTRLISTTCONTEXT_HXX
22 
23 #include <xmloff/xmltoken.hxx>
24 #include "TransformerContext.hxx"
25 
26 
28 {
29 
30  css::uno::Reference< css::xml::sax::XAttributeList > m_xAttrList;
31  OUString m_aElemQName;
32  sal_uInt16 const m_nActionMap;
33 
34 protected:
35 
36  void SetExportQName( const OUString& r ) { m_aElemQName = r; }
37 
38 public:
39  // A contexts constructor does anything that is required if an element
40  // starts. Namespace processing has been done already.
41  // Note that virtual methods cannot be used inside constructors. Use
42  // StartElement instead if this is required.
44  const OUString& rQName );
45 
46  // attr list persistence + attribute processing
48  const OUString& rQName,
49  sal_uInt16 nActionMap );
50 
51  // attr list persistence + renaming
53  const OUString& rQName,
54  sal_uInt16 nPrefix,
56 
57  // attr list persistence + renaming + attribute processing
59  const OUString& rQName,
60  sal_uInt16 nPrefix,
62  sal_uInt16 nActionMap );
63 
64  // Create a children element context. By default, the import's
65  // CreateContext method is called to create a new default context.
67  const OUString& rLocalName,
68  const OUString& rQName,
69  const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
70 
71  // StartElement is called after a context has been constructed and
72  // before an elements context is parsed. It may be used for actions that
73  // require virtual methods. The default is to do nothing.
74  virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
75 
76  // EndElement is called before a context will be destructed, but
77  // after an elements context has been parsed. It may be used for actions
78  // that require virtual methods. The default is to do nothing.
79  virtual void EndElement() override;
80 
81  // This method is called for all characters that are contained in the
82  // current element.
83  virtual void Characters( const OUString& rChars ) override;
84 
85  virtual bool IsPersistent() const override;
86  virtual void Export() override;
87  virtual void ExportContent() override;
88 
89  const OUString& GetExportQName() const { return m_aElemQName; }
90 
91  void AddAttribute( sal_uInt16 nAPrefix,
93  ::xmloff::token::XMLTokenEnum eVToken );
94 
95  void AddAttribute( sal_uInt16 nAPrefix,
97  const OUString & rValue );
98 
99  const css::uno::Reference< css::xml::sax::XAttributeList >&
100  GetAttrList() const { return m_xAttrList; }
101 
102 };
103 
104 #endif // INCLUDED_XMLOFF_SOURCE_TRANSFORM_PERSATTRLISTTCONTEXT_HXX
105 
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetExportQName(const OUString &r)
virtual void ExportContent() override
css::uno::Any const & rValue
Definition: ImageStyle.hxx:38
css::uno::Reference< css::xml::sax::XAttributeList > m_xAttrList
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
virtual rtl::Reference< XMLTransformerContext > CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const OUString &rQName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
virtual void Export() override
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
const OUString & GetExportQName() const
virtual void Characters(const OUString &rChars) override
const css::uno::Reference< css::xml::sax::XAttributeList > & GetAttrList() const
void AddAttribute(sal_uInt16 nAPrefix,::xmloff::token::XMLTokenEnum eAToken,::xmloff::token::XMLTokenEnum eVToken)
XMLPersAttrListTContext(XMLTransformerBase &rTransformer, const OUString &rQName)
virtual bool IsPersistent() const override
XMLTokenEnum eToken
Definition: xmltoken.cxx:40
virtual void EndElement() override