Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / xmloff / source / forms / attriblistmerge.hxx
blobe2d24f52fe90f083533186952166c6b92cc8e001
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_XMLOFF_SOURCE_FORMS_ATTRIBLISTMERGE_HXX
21 #define INCLUDED_XMLOFF_SOURCE_FORMS_ATTRIBLISTMERGE_HXX
23 #include <sal/config.h>
25 #include <vector>
27 #include <cppuhelper/implbase.hxx>
28 #include <osl/mutex.hxx>
29 #include <com/sun/star/xml/sax/XAttributeList.hpp>
31 namespace xmloff
34 //= OAttribListMerger
35 typedef ::cppu::WeakImplHelper < css::xml::sax::XAttributeList
36 > OAttribListMerger_Base;
37 /** implements the XAttributeList list by merging different source attribute lists
39 <p>Currently, the time behaviour is O(n), though it would be possible to change it to O(log n).</p>
41 class OAttribListMerger : public OAttribListMerger_Base
43 protected:
44 typedef std::vector< css::uno::Reference< css::xml::sax::XAttributeList > > AttributeListArray;
45 AttributeListArray m_aLists;
47 virtual ~OAttribListMerger() { }
49 public:
50 OAttribListMerger() { }
52 // attribute list handling
53 // (very thin at the moment... only adding lists is allowed... add more if you need it :)
54 void addList(const css::uno::Reference< css::xml::sax::XAttributeList >& _rList);
56 // XAttributeList
57 virtual sal_Int16 SAL_CALL getLength( ) throw(css::uno::RuntimeException, std::exception) override;
58 virtual OUString SAL_CALL getNameByIndex( sal_Int16 i ) throw(css::uno::RuntimeException, std::exception) override;
59 virtual OUString SAL_CALL getTypeByIndex( sal_Int16 i ) throw(css::uno::RuntimeException, std::exception) override;
60 virtual OUString SAL_CALL getTypeByName( const OUString& aName ) throw(css::uno::RuntimeException, std::exception) override;
61 virtual OUString SAL_CALL getValueByIndex( sal_Int16 i ) throw(css::uno::RuntimeException, std::exception) override;
62 virtual OUString SAL_CALL getValueByName( const OUString& aName ) throw(css::uno::RuntimeException, std::exception) override;
64 protected:
65 bool seekToIndex(sal_Int16 _nGlobalIndex, css::uno::Reference< css::xml::sax::XAttributeList >& _rSubList, sal_Int16& _rLocalIndex);
66 bool seekToName(const OUString& _rName, css::uno::Reference< css::xml::sax::XAttributeList >& _rSubList, sal_Int16& _rLocalIndex);
69 } // namespace xmloff
71 #endif // INCLUDED_XMLOFF_SOURCE_FORMS_ATTRIBLISTMERGE_HXX
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */