Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sc / inc / orcusxml.hxx
blob5b9e830aadc0bd94d86a546bc9a63e3e709edf7c
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 #ifndef INCLUDED_SC_INC_ORCUSXML_HXX
11 #define INCLUDED_SC_INC_ORCUSXML_HXX
13 #include "scdllapi.h"
14 #include "address.hxx"
15 #include <vcl/image.hxx>
17 #include <vector>
18 #include <memory>
20 class SvTreeListEntry;
22 /**
23 * Parameter used during call to ScOrcusFilters::loadXMLStructure().
25 struct ScOrcusXMLTreeParam
27 enum EntryType { ElementDefault, ElementRepeat, Attribute };
29 /** Custom data stored with each tree item. */
30 struct EntryData
32 size_t mnNamespaceID; /// numerical ID for xml namespace
33 EntryType meType;
34 ScAddress maLinkedPos; /// linked cell position (invalid if unlinked)
35 bool mbRangeParent:1;
36 bool mbLeafNode:1; /// Leaf if it has no child elements. Child Attributes don't count.
38 SC_DLLPUBLIC EntryData(EntryType eType);
41 typedef std::vector<std::unique_ptr<EntryData>> UserDataStoreType;
43 Image maImgElementDefault;
44 Image maImgElementRepeat;
45 Image maImgAttribute;
47 /**
48 * Store all custom data instances since the tree control doesn't manage
49 * the life cycle of user datas.
51 UserDataStoreType m_UserDataStore;
53 static SC_DLLPUBLIC EntryData* getUserData(const SvTreeListEntry& rEntry);
56 struct ScOrcusImportXMLParam
58 struct CellLink
60 ScAddress maPos;
61 OString maPath;
63 CellLink(const ScAddress& rPos, const OString& rPath);
66 struct RangeLink
68 ScAddress maPos;
69 std::vector<OString> maFieldPaths;
72 typedef std::vector<CellLink> CellLinksType;
73 typedef std::vector<RangeLink> RangeLinksType;
75 std::vector<size_t> maNamespaces;
76 CellLinksType maCellLinks;
77 RangeLinksType maRangeLinks;
80 #endif
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */