LibreOffice Module sc (master) 1
xmlsourcedlg.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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 */
9
10#pragma once
11
12#include "anyrefdg.hxx"
13#include <orcusxml.hxx>
14
15#include <set>
16#include <memory>
17
18class ScDocument;
19class ScRange;
21
23{
26 : mrLbTree(rLbTree)
27 {
28 }
29 bool operator()(const std::unique_ptr<weld::TreeIter>& lhs,
30 const std::unique_ptr<weld::TreeIter>& rhs) const
31 {
32 return mrLbTree.iter_compare(*lhs, *rhs) == -1;
33 }
34};
35
37{
38 OUString maSrcPath;
39
41 std::unique_ptr<weld::TreeIter> mxCurRefEntry;
42 std::unique_ptr<ScOrcusXMLContext> mpXMLContext;
43
46
48 std::unique_ptr<weld::Button> mxBtnSelectSource;
49 std::unique_ptr<weld::Label> mxFtSourceFile;
50
51 std::unique_ptr<weld::Container> mxMapGrid;
52
53 std::unique_ptr<weld::TreeView> mxLbTree;
54 std::unique_ptr<formula::RefEdit> mxRefEdit;
55 std::unique_ptr<formula::RefButton> mxRefBtn;
56
57 std::unique_ptr<weld::Button> mxBtnOk;
58 std::unique_ptr<weld::Button> mxBtnCancel;
59
61
62 std::set<std::unique_ptr<weld::TreeIter>, CustomCompare> maCellLinks;
63 std::set<std::unique_ptr<weld::TreeIter>, CustomCompare> maRangeLinks;
64
65public:
67 virtual ~ScXMLSourceDlg() override;
68
69 virtual bool IsRefInputMode() const override;
70 virtual void SetReference(const ScRange& rRange, ScDocument& rDoc) override;
71 virtual void Deactivate() override;
72 virtual void SetActive() override;
73 virtual void Close() override;
74
75private:
76 void SelectSourceFile();
77 void LoadSourceFileStructure(const OUString& rPath);
78 void TreeItemSelected();
79 void DefaultElementSelected(const weld::TreeIter& rEntry);
80 void RepeatElementSelected(const weld::TreeIter& rEntry);
81 void AttributeSelected(const weld::TreeIter& rEntry);
82
83 void SetNonLinkable();
84 void SetSingleLinkable();
85 void SetRangeLinkable();
86 void SelectAllChildEntries(const weld::TreeIter& rEntry);
87
93 bool IsParentDirty(const weld::TreeIter* pEntry) const;
94
95 bool IsChildrenDirty(const weld::TreeIter* pEntry) const;
96
97 void OkPressed();
98 void CancelPressed();
99 void RefEditModified();
100
101 DECL_LINK(BtnPressedHdl, weld::Button&, void);
102 DECL_LINK(TreeItemSelectHdl, weld::TreeView&, void);
103 DECL_LINK(RefModifiedHdl, formula::RefEdit&, void);
104};
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::set< std::unique_ptr< weld::TreeIter >, CustomCompare > maRangeLinks
void SetRangeLinkable()
std::unique_ptr< formula::RefButton > mxRefBtn
std::unique_ptr< weld::Button > mxBtnCancel
ScDocument * mpDoc
bool IsChildrenDirty(const weld::TreeIter *pEntry) const
CustomCompare maCustomCompare
std::set< std::unique_ptr< weld::TreeIter >, CustomCompare > maCellLinks
ScXMLSourceDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, ScDocument *pDoc)
formula::RefEdit * mpActiveEdit
void RefEditModified()
virtual void Close() override
DECL_LINK(RefModifiedHdl, formula::RefEdit &, void)
std::unique_ptr< weld::TreeView > mxLbTree
virtual bool IsRefInputMode() const override
virtual void Deactivate() override
void SelectSourceFile()
DECL_LINK(TreeItemSelectHdl, weld::TreeView &, void)
void SetSingleLinkable()
void SelectAllChildEntries(const weld::TreeIter &rEntry)
std::unique_ptr< weld::Button > mxBtnSelectSource
virtual ~ScXMLSourceDlg() override
void RepeatElementSelected(const weld::TreeIter &rEntry)
void LoadSourceFileStructure(const OUString &rPath)
std::unique_ptr< weld::Button > mxBtnOk
virtual void SetReference(const ScRange &rRange, ScDocument &rDoc) override
std::unique_ptr< formula::RefEdit > mxRefEdit
bool IsParentDirty(const weld::TreeIter *pEntry) const
Check if any of its parents is linked or repeated.
std::unique_ptr< ScOrcusXMLContext > mpXMLContext
ScOrcusXMLTreeParam maXMLParam
virtual void SetActive() override
std::unique_ptr< weld::Label > mxFtSourceFile
void DefaultElementSelected(const weld::TreeIter &rEntry)
DECL_LINK(BtnPressedHdl, weld::Button &, void)
void AttributeSelected(const weld::TreeIter &rEntry)
std::unique_ptr< weld::Container > mxMapGrid
void TreeItemSelected()
OUString maSrcPath
std::unique_ptr< weld::TreeIter > mxCurRefEntry
virtual int iter_compare(const TreeIter &a, const TreeIter &b) const=0
CustomCompare(weld::TreeView &rLbTree)
weld::TreeView & mrLbTree
bool operator()(const std::unique_ptr< weld::TreeIter > &lhs, const std::unique_ptr< weld::TreeIter > &rhs) const
Parameter used during call to ScOrcusFilters::loadXMLStructure().
Definition: orcusxml.hxx:27