Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / xmlsourcedlg.hxx
blob7c227d67260ab84ef5f4c52e7124b46ed1bc3bb5
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 __SC_XMLSOURCEDLG_HXX__
11 #define __SC_XMLSOURCEDLG_HXX__
13 #include "vcl/button.hxx"
14 #include "vcl/fixed.hxx"
15 #include "svtools/treelistbox.hxx"
17 #include "expftext.hxx"
18 #include "anyrefdg.hxx"
19 #include "orcusxml.hxx"
21 #include <set>
22 #include <vector>
23 #include <boost/scoped_ptr.hpp>
25 class ScDocument;
26 class ScRange;
27 class ScOrcusXMLContext;
29 class ScXMLSourceTree : public SvTreeListBox
31 public:
32 ScXMLSourceTree(Window* pParent, const ResId& rResId);
35 class ScXMLSourceDlg : public ScAnyRefDlg
37 FixedLine maFlSourceFile;
38 ImageButton maBtnSelectSource;
39 ScExpandedFixedText maFtSourceFile;
41 FixedLine maFtMapXmlDoc;
43 FixedText maFtMappedCellTitle;
45 ScXMLSourceTree maLbTree;
46 formula::RefEdit maRefEdit;
47 formula::RefButton maRefBtn;
49 OKButton maBtnOk;
50 CancelButton maBtnCancel;
52 Image maImgFileOpen;
54 OUString maSrcPath;
56 ScOrcusXMLTreeParam maXMLParam;
57 std::set<const SvTreeListEntry*> maCellLinks;
58 std::set<const SvTreeListEntry*> maRangeLinks;
59 std::vector<SvTreeListEntry*> maHighlightedEntries;
60 SvTreeListEntry* mpCurRefEntry;
61 boost::scoped_ptr<ScOrcusXMLContext> mpXMLContext;
63 ScDocument* mpDoc;
65 formula::RefEdit* mpActiveEdit;
66 bool mbDlgLostFocus;
68 public:
69 ScXMLSourceDlg(
70 SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, ScDocument* pDoc);
71 virtual ~ScXMLSourceDlg();
73 virtual sal_Bool IsRefInputMode() const;
74 virtual void SetReference(const ScRange& rRange, ScDocument* pDoc);
75 virtual void Deactivate();
76 virtual void SetActive();
77 virtual sal_Bool Close();
79 private:
81 void SelectSourceFile();
82 void LoadSourceFileStructure(const OUString& rPath);
83 void HandleGetFocus(Control* pCtrl);
84 void HandleLoseFocus(Control* pCtrl);
85 void TreeItemSelected();
86 void DefaultElementSelected(SvTreeListEntry& rEntry);
87 void RepeatElementSelected(SvTreeListEntry& rEntry);
88 void AttributeSelected(SvTreeListEntry& rEntry);
90 void SetNonLinkable();
91 void SetSingleLinkable();
92 void SetRangeLinkable();
93 void SelectAllChildEntries(SvTreeListEntry& rEntry);
95 /**
96 * Check if any of its parents is linked or repeated. The passed entry is
97 * not checked; its parent is the first one to be checked, then all its
98 * parents get checked all the way to the root.
100 bool IsParentDirty(SvTreeListEntry* pEntry) const;
102 bool IsChildrenDirty(SvTreeListEntry* pEntry) const;
104 void OkPressed();
105 void CancelPressed();
106 void RefEditModified();
108 DECL_LINK(GetFocusHdl, Control*);
109 DECL_LINK(LoseFocusHdl, Control*);
110 DECL_LINK(BtnPressedHdl, Button*);
111 DECL_LINK(TreeItemSelectHdl, void*);
112 DECL_LINK(RefModifiedHdl, void*);
115 #endif
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */