Version 7.5.1.1, tag libreoffice-7.5.1.1
[LibreOffice.git] / xmloff / source / core / SvXMLAttrCollection.hxx
bloba99b149650a7784f1493e7e8fb5184c51ff5178b
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/.
8 */
10 #pragma once
12 #include "SvXMLAttr.hxx"
14 #include <xmloff/namespacemap.hxx>
15 #include <rtl/ustring.hxx>
16 #include <sal/types.h>
17 #include <vector>
19 class SvXMLAttrCollection
21 public:
22 SvXMLNamespaceMap aNamespaceMap;
23 std::vector<SvXMLAttr> aAttrs;
25 bool operator==(const SvXMLAttrCollection &rCmp) const;
26 bool AddAttr( const OUString& rLName,
27 const OUString& rValue );
28 bool AddAttr( const OUString& rPrefix,
29 const OUString& rNamespace,
30 const OUString& rLName,
31 const OUString& rValue );
32 bool AddAttr( const OUString& rPrefix,
33 const OUString& rLName,
34 const OUString& rValue );
36 bool SetAt( size_t i,
37 const OUString& rLName,
38 const OUString& rValue );
39 bool SetAt( size_t i,
40 const OUString& rPrefix,
41 const OUString& rNamespace,
42 const OUString& rLName,
43 const OUString& rValue );
44 bool SetAt( size_t i,
45 const OUString& rPrefix,
46 const OUString& rLName,
47 const OUString& rValue );
49 void Remove( size_t i );
51 size_t GetAttrCount() const;
52 const OUString& GetAttrLName(size_t i) const;
53 const OUString& GetAttrValue(size_t i) const;
54 OUString GetAttrNamespace( size_t i ) const;
55 OUString GetAttrPrefix( size_t i ) const;
56 const OUString& GetNamespace( sal_uInt16 i ) const;
57 const OUString& GetPrefix( sal_uInt16 i ) const;
58 sal_uInt16 GetFirstNamespaceIndex() const;
59 sal_uInt16 GetNextNamespaceIndex( sal_uInt16 nIdx ) const;
61 private:
62 sal_uInt16 GetPrefixPos( size_t i ) const;
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */