/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __SC_XMLSOURCEDLG_HXX__ #define __SC_XMLSOURCEDLG_HXX__ #include #include #include #include "svtools/treelistbox.hxx" #include "anyrefdg.hxx" #include "orcusxml.hxx" #include #include #include class ScDocument; class ScRange; class ScOrcusXMLContext; class ScXMLSourceDlg : public ScAnyRefDlg { PushButton* mpBtnSelectSource; FixedText* mpFtSourceFile; VclContainer* mpMapGrid; SvTreeListBox* mpLbTree; formula::RefEdit* mpRefEdit; formula::RefButton* mpRefBtn; PushButton* mpBtnOk; CancelButton* mpBtnCancel; OUString maSrcPath; ScOrcusXMLTreeParam maXMLParam; std::set maCellLinks; std::set maRangeLinks; std::vector maHighlightedEntries; SvTreeListEntry* mpCurRefEntry; boost::scoped_ptr mpXMLContext; ScDocument* mpDoc; formula::RefEdit* mpActiveEdit; bool mbDlgLostFocus; public: ScXMLSourceDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, ScDocument* pDoc); virtual bool IsRefInputMode() const SAL_OVERRIDE; virtual void SetReference(const ScRange& rRange, ScDocument* pDoc) SAL_OVERRIDE; virtual void Deactivate() SAL_OVERRIDE; virtual void SetActive() SAL_OVERRIDE; virtual bool Close() SAL_OVERRIDE; private: void SelectSourceFile(); void LoadSourceFileStructure(const OUString& rPath); void HandleGetFocus(Control* pCtrl); void HandleLoseFocus(Control* pCtrl); void TreeItemSelected(); void DefaultElementSelected(SvTreeListEntry& rEntry); void RepeatElementSelected(SvTreeListEntry& rEntry); void AttributeSelected(SvTreeListEntry& rEntry); void SetNonLinkable(); void SetSingleLinkable(); void SetRangeLinkable(); void SelectAllChildEntries(SvTreeListEntry& rEntry); /** * Check if any of its parents is linked or repeated. The passed entry is * not checked; its parent is the first one to be checked, then all its * parents get checked all the way to the root. */ bool IsParentDirty(SvTreeListEntry* pEntry) const; bool IsChildrenDirty(SvTreeListEntry* pEntry) const; void OkPressed(); void CancelPressed(); void RefEditModified(); DECL_LINK(GetFocusHdl, Control*); DECL_LINK(LoseFocusHdl, Control*); DECL_LINK(BtnPressedHdl, Button*); DECL_LINK(TreeItemSelectHdl, void*); DECL_LINK(RefModifiedHdl, void*); }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */