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 INCLUDED_SC_SOURCE_UI_INC_XMLSOURCEDLG_HXX
11 #define INCLUDED_SC_SOURCE_UI_INC_XMLSOURCEDLG_HXX
13 #include <vcl/button.hxx>
14 #include <vcl/fixed.hxx>
15 #include <vcl/layout.hxx>
16 #include <svtools/treelistbox.hxx>
18 #include "anyrefdg.hxx"
19 #include "orcusxml.hxx"
23 #include <boost/scoped_ptr.hpp>
27 class ScOrcusXMLContext
;
29 class ScXMLSourceDlg
: public ScAnyRefDlg
31 VclPtr
<PushButton
> mpBtnSelectSource
;
32 VclPtr
<FixedText
> mpFtSourceFile
;
34 VclPtr
<VclContainer
> mpMapGrid
;
36 VclPtr
<SvTreeListBox
> mpLbTree
;
37 VclPtr
<formula::RefEdit
> mpRefEdit
;
38 VclPtr
<formula::RefButton
> mpRefBtn
;
40 VclPtr
<PushButton
> mpBtnOk
;
41 VclPtr
<CancelButton
> mpBtnCancel
;
45 ScOrcusXMLTreeParam maXMLParam
;
46 std::set
<const SvTreeListEntry
*> maCellLinks
;
47 std::set
<const SvTreeListEntry
*> maRangeLinks
;
48 std::vector
<SvTreeListEntry
*> maHighlightedEntries
;
49 SvTreeListEntry
* mpCurRefEntry
;
50 boost::scoped_ptr
<ScOrcusXMLContext
> mpXMLContext
;
54 VclPtr
<formula::RefEdit
> mpActiveEdit
;
59 SfxBindings
* pB
, SfxChildWindow
* pCW
, vcl::Window
* pParent
, ScDocument
* pDoc
);
60 virtual ~ScXMLSourceDlg();
61 virtual void dispose() SAL_OVERRIDE
;
63 virtual bool IsRefInputMode() const SAL_OVERRIDE
;
64 virtual void SetReference(const ScRange
& rRange
, ScDocument
* pDoc
) SAL_OVERRIDE
;
65 virtual void Deactivate() SAL_OVERRIDE
;
66 virtual void SetActive() SAL_OVERRIDE
;
67 virtual bool Close() SAL_OVERRIDE
;
71 void SelectSourceFile();
72 void LoadSourceFileStructure(const OUString
& rPath
);
73 void HandleGetFocus(Control
* pCtrl
);
74 void TreeItemSelected();
75 void DefaultElementSelected(SvTreeListEntry
& rEntry
);
76 void RepeatElementSelected(SvTreeListEntry
& rEntry
);
77 void AttributeSelected(SvTreeListEntry
& rEntry
);
79 void SetNonLinkable();
80 void SetSingleLinkable();
81 void SetRangeLinkable();
82 void SelectAllChildEntries(SvTreeListEntry
& rEntry
);
85 * Check if any of its parents is linked or repeated. The passed entry is
86 * not checked; its parent is the first one to be checked, then all its
87 * parents get checked all the way to the root.
89 bool IsParentDirty(SvTreeListEntry
* pEntry
) const;
91 bool IsChildrenDirty(SvTreeListEntry
* pEntry
) const;
95 void RefEditModified();
97 DECL_LINK(GetFocusHdl
, Control
*);
98 DECL_LINK(BtnPressedHdl
, Button
*);
99 DECL_LINK(TreeItemSelectHdl
, void*);
100 DECL_LINK(RefModifiedHdl
, void*);
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */