Fix build
[LibreOffice.git] / sc / inc / orcusxml.hxx
blobc59bf100b32e57a3ea9bb6ca1e4046bd509ef547
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 "scdllapi.h"
13 #include "address.hxx"
15 #include <vector>
16 #include <memory>
18 namespace weld {
19 class TreeIter;
20 class TreeView;
23 /**
24 * Parameter used during call to ScOrcusFilters::loadXMLStructure().
26 struct ScOrcusXMLTreeParam
28 enum EntryType { ElementDefault, ElementRepeat, Attribute };
30 /** Custom data stored with each tree item. */
31 struct EntryData
33 size_t mnNamespaceID; /// numerical ID for xml namespace
34 EntryType meType;
35 ScAddress maLinkedPos; /// linked cell position (invalid if unlinked)
36 bool mbRangeParent:1;
37 bool mbLeafNode:1; /// Leaf if it has no child elements. Child Attributes don't count.
39 SC_DLLPUBLIC EntryData(EntryType eType);
42 typedef std::vector<std::unique_ptr<EntryData>> UserDataStoreType;
44 OUString maImgElementDefault;
45 OUString maImgElementRepeat;
46 OUString maImgAttribute;
48 /**
49 * Store all custom data instances since the tree control doesn't manage
50 * the life cycle of user data.
52 UserDataStoreType m_UserDataStore;
54 static EntryData* getUserData(const weld::TreeView& rControl, const weld::TreeIter& rEntry);
57 struct ScOrcusImportXMLParam
59 struct CellLink
61 ScAddress maPos;
62 OString maPath;
64 CellLink(const ScAddress& rPos, OString aPath);
67 struct RangeLink
69 ScAddress maPos;
70 std::vector<OString> maFieldPaths;
71 std::vector<OString> maRowGroups;
74 std::vector<size_t> maNamespaces;
75 std::vector<CellLink> maCellLinks;
76 std::vector<RangeLink> maRangeLinks;
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */