1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
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"
23 #include <boost/scoped_ptr.hpp>
27 class ScOrcusXMLContext
;
29 class ScXMLSourceTree
: public SvTreeListBox
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
;
50 CancelButton maBtnCancel
;
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
;
65 formula::RefEdit
* mpActiveEdit
;
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();
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
);
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;
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*);
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */