/* -*- 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 INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTDIALOG_HXX #define INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTDIALOG_HXX #include #include "anyrefdg.hxx" #include #include "viewdata.hxx" #include "PivotLayoutTreeList.hxx" #include "PivotLayoutTreeListData.hxx" #include "PivotLayoutTreeListLabel.hxx" class ScItemValue final { public: OUString const maName; ScPivotFuncData maFunctionData; ScItemValue* mpOriginalItemValue; ScItemValue(OUString const & aName, SCCOL nColumn, PivotFunc nFunctionMask); ScItemValue(const ScItemValue* pInputItemValue); ~ScItemValue(); }; class ScPivotLayoutDialog : public ScAnyRefDlg { public: ScDPObject maPivotTableObject; VclPtr mpPreviouslyFocusedListBox; private: ScViewData* mpViewData; ScDocument* const mpDocument; bool const mbNewPivotTable; VclPtr mpListBoxField; VclPtr mpListBoxPage; VclPtr mpListBoxColumn; VclPtr mpListBoxRow; VclPtr mpListBoxData; VclPtr mpCheckIgnoreEmptyRows; VclPtr mpCheckTotalColumns; VclPtr mpCheckAddFilter; VclPtr mpCheckIdentifyCategories; VclPtr mpCheckTotalRows; VclPtr mpCheckDrillToDetail; VclPtr mpSourceRadioNamedRange; VclPtr mpSourceRadioSelection; VclPtr mpSourceListBox; VclPtr mpSourceEdit; VclPtr mpSourceButton; VclPtr mpDestinationRadioNewSheet; VclPtr mpDestinationRadioNamedRange; VclPtr mpDestinationRadioSelection; VclPtr mpDestinationListBox; VclPtr mpDestinationEdit; VclPtr mpDestinationButton; VclPtr mpBtnOK; VclPtr mpBtnCancel; VclPtr mpActiveEdit; ScAddress::Details const maAddressDetails; bool mbDialogLostFocus; DECL_LINK(CancelClicked, Button*, void); DECL_LINK(OKClicked, Button*, void); DECL_LINK(GetFocusHandler, Control&, void); DECL_LINK(LoseFocusHandler, Control&, void); DECL_LINK(ToggleSource, RadioButton&, void); DECL_LINK(ToggleDestination, RadioButton&, void); DECL_LINK(SourceListSelected, ListBox&, void); DECL_LINK(SourceEditModified, Edit&, void); void ToggleSource(); void ToggleDestination(); virtual bool Close() override; ScPivotParam maPivotParameters; // UI void SetupSource(); void SetupDestination(); void FillValuesToListBoxes(); // Other bool GetDestination(ScRange& aDestinationRange, bool& bToNewSheet); public: ScPivotLayoutDialog(SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow, vcl::Window* pParent, ScViewData* pViewData, const ScDPObject* pPivotTableObject, bool bCreateNewPivotTable); virtual ~ScPivotLayoutDialog() override; virtual void dispose() override; virtual void SetReference(const ScRange& rReferenceRange, ScDocument* pDocument) override; virtual void SetActive() override; virtual bool IsRefInputMode() const override; void ItemInserted(const ScItemValue* pItemValue, ScPivotLayoutTreeList::SvPivotTreeListType eType); void UpdateSourceRange(); void ApplyChanges(); void ApplySaveData(ScDPSaveData& rSaveData); void ApplyLabelData(const ScDPSaveData& rSaveData); ScItemValue* GetItem(SCCOL nColumn); bool IsDataElement(SCCOL nColumn); ScDPLabelData& GetLabelData(SCCOL nColumn); ScDPLabelDataVector& GetLabelDataVector() { return maPivotParameters.maLabelArray;} void PushDataFieldNames(std::vector& rDataFieldNames); ScPivotLayoutTreeListBase* FindListBoxFor(const SvTreeListEntry *pEntry); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ #endif