fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / dbaccess / source / core / recovery / settingsimport.hxx
blobdfd0ada474680d2345573d02a99354c2a31c1e3d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_CORE_RECOVERY_SETTINGSIMPORT_HXX
21 #define INCLUDED_DBACCESS_SOURCE_CORE_RECOVERY_SETTINGSIMPORT_HXX
23 #include <com/sun/star/xml/sax/XAttributeList.hpp>
25 #include <comphelper/namedvaluecollection.hxx>
26 #include <rtl/ref.hxx>
27 #include <rtl/ustrbuf.hxx>
28 #include <salhelper/simplereferenceobject.hxx>
30 namespace dbaccess
33 // SettingsImport
34 /** a simplified version of xmloff/DocumentSettingsContext
36 It would be nice if the DocumentSettingsContext would not be that tightly interwoven with the SvXMLImport
37 class, so we could re-use it here ...
39 class SettingsImport : public salhelper::SimpleReferenceObject
41 public:
42 SettingsImport();
44 // own overridables
45 virtual ::rtl::Reference< SettingsImport > nextState(
46 const OUString& i_rElementName
47 ) = 0;
48 void startElement(
49 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& i_rAttributes
51 virtual void endElement();
52 void characters( const OUString& i_rCharacters );
54 protected:
55 virtual ~SettingsImport();
57 protected:
58 static void split( const OUString& i_rElementName, OUString& o_rNamespace, OUString& o_rLocalName );
60 protected:
61 const OUString& getItemName() const { return m_sItemName; }
62 const OUString& getItemType() const { return m_sItemType; }
63 const OUStringBuffer& getAccumulatedCharacters() const { return m_aCharacters; }
65 private:
66 // value of the config:name attribute, if any
67 OUString m_sItemName;
68 // value of the config:type attribute, if any
69 OUString m_sItemType;
70 // accumulated characters, if any
71 OUStringBuffer m_aCharacters;
74 // IgnoringSettingsImport
75 class IgnoringSettingsImport : public SettingsImport
77 public:
78 IgnoringSettingsImport()
82 // SettingsImport overridables
83 virtual ::rtl::Reference< SettingsImport > nextState(
84 const OUString& i_rElementName
85 ) SAL_OVERRIDE;
87 private:
88 virtual ~IgnoringSettingsImport()
93 // OfficeSettingsImport
94 class OfficeSettingsImport : public SettingsImport
96 public:
97 OfficeSettingsImport( ::comphelper::NamedValueCollection& o_rSettings );
99 // SettingsImport overridables
100 virtual ::rtl::Reference< SettingsImport > nextState(
101 const OUString& i_rElementName
102 ) SAL_OVERRIDE;
104 protected:
105 virtual ~OfficeSettingsImport();
107 private:
108 // the settings collection to which |this| will contribute a single setting
109 ::comphelper::NamedValueCollection& m_rSettings;
112 // ConfigItemSetImport
113 class ConfigItemImport : public SettingsImport
115 public:
116 ConfigItemImport( ::comphelper::NamedValueCollection& o_rSettings );
118 protected:
119 virtual ~ConfigItemImport();
121 public:
122 // SettingsImport overridables
123 virtual ::rtl::Reference< SettingsImport > nextState(
124 const OUString& i_rElementName
125 ) SAL_OVERRIDE;
126 virtual void endElement() SAL_OVERRIDE;
128 protected:
129 // own overridables
130 /// retrieves the value represented by the element
131 virtual void getItemValue( ::com::sun::star::uno::Any& o_rValue ) const;
133 private:
134 // the settings collection to which |this| will contribute a single setting
135 ::comphelper::NamedValueCollection& m_rSettings;
138 // ConfigItemSetImport
139 class ConfigItemSetImport : public ConfigItemImport
141 public:
142 ConfigItemSetImport( ::comphelper::NamedValueCollection& o_rSettings );
144 protected:
145 virtual ~ConfigItemSetImport();
147 public:
148 // SettingsImport overridables
149 virtual ::rtl::Reference< SettingsImport > nextState(
150 const OUString& i_rElementName
151 ) SAL_OVERRIDE;
153 protected:
154 // ConfigItemImport overridables
155 virtual void getItemValue( ::com::sun::star::uno::Any& o_rValue ) const SAL_OVERRIDE;
157 private:
158 /// the settings represented by our child elements
159 ::comphelper::NamedValueCollection m_aChildSettings;
162 } // namespace dbaccess
164 #endif // INCLUDED_DBACCESS_SOURCE_CORE_RECOVERY_SETTINGSIMPORT_HXX
166 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */