From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- sc/source/ui/inc/PivotLayoutDialog.hxx | 140 +++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sc/source/ui/inc/PivotLayoutDialog.hxx (limited to 'sc/source/ui/inc/PivotLayoutDialog.hxx') diff --git a/sc/source/ui/inc/PivotLayoutDialog.hxx b/sc/source/ui/inc/PivotLayoutDialog.hxx new file mode 100644 index 000000000..0ce026bf4 --- /dev/null +++ b/sc/source/ui/inc/PivotLayoutDialog.hxx @@ -0,0 +1,140 @@ +/* -*- 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/. + * + */ + +#pragma once + +#include "anyrefdg.hxx" +#include +#include "viewdata.hxx" + +#include "PivotLayoutTreeList.hxx" +#include "PivotLayoutTreeListData.hxx" +#include "PivotLayoutTreeListLabel.hxx" + +class ScItemValue final +{ +public: + OUString maName; + ScPivotFuncData maFunctionData; + ScItemValue* mpOriginalItemValue; + + ScItemValue(OUString const & aName, SCCOL nColumn, PivotFunc nFunctionMask); + ScItemValue(const ScItemValue* pInputItemValue); + + ~ScItemValue(); +}; + +class ScPivotLayoutDialog : public ScAnyRefDlgController +{ +public: + ScDPObject maPivotTableObject; + + ScPivotLayoutTreeListBase* mpPreviouslyFocusedListBox; + +private: + ScViewData* mpViewData; + ScDocument& mrDocument; + + bool mbNewPivotTable; + + ScAddress::Details maAddressDetails; + bool mbDialogLostFocus; + + formula::RefEdit* mpActiveEdit; + std::unique_ptr mxListBoxField; + std::unique_ptr mxListBoxPage; + std::unique_ptr mxListBoxColumn; + std::unique_ptr mxListBoxRow; + std::unique_ptr mxListBoxData; + + std::unique_ptr mxCheckIgnoreEmptyRows; + std::unique_ptr mxCheckTotalColumns; + std::unique_ptr mxCheckAddFilter; + std::unique_ptr mxCheckIdentifyCategories; + std::unique_ptr mxCheckTotalRows; + std::unique_ptr mxCheckDrillToDetail; + + std::unique_ptr mxSourceRadioNamedRange; + std::unique_ptr mxSourceRadioSelection; + + std::unique_ptr mxSourceListBox; + std::unique_ptr mxSourceEdit; + std::unique_ptr mxSourceButton; + + std::unique_ptr mxDestinationRadioNewSheet; + std::unique_ptr mxDestinationRadioNamedRange; + std::unique_ptr mxDestinationRadioSelection; + + std::unique_ptr mxDestinationListBox; + std::unique_ptr mxDestinationEdit; + std::unique_ptr mxDestinationButton; + + std::unique_ptr mxBtnOK; + std::unique_ptr mxBtnCancel; + + std::unique_ptr mxSourceFrame; + std::unique_ptr mxSourceLabel; + std::unique_ptr mxDestFrame; + std::unique_ptr mxDestLabel; + + std::unique_ptr mxOptions; + std::unique_ptr mxMore; + + DECL_LINK(CancelClicked, weld::Button&, void); + DECL_LINK(OKClicked, weld::Button&, void); + DECL_LINK(GetEditFocusHandler, formula::RefEdit&, void); + DECL_LINK(GetButtonFocusHandler, formula::RefButton&, void); + DECL_LINK(LoseEditFocusHandler, formula::RefEdit&, void); + DECL_LINK(LoseButtonFocusHandler, formula::RefButton&, void); + DECL_LINK(ToggleSource, weld::Toggleable&, void); + DECL_LINK(ToggleDestination, weld::Toggleable&, void); + DECL_LINK(SourceListSelected, weld::ComboBox&, void); + DECL_LINK(SourceEditModified, formula::RefEdit&, void); + void ToggleSource(); + void ToggleDestination(); + virtual void Close() override; + + ScPivotParam maPivotParameters; + + // UI + void SetupSource(); + void SetupDestination(); + void FillValuesToListBoxes(); + + // Other + bool GetDestination(ScRange& aDestinationRange, bool& bToNewSheet); + +public: + ScPivotLayoutDialog(SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow, weld::Window* pParent, + ScViewData* pViewData, const ScDPObject* pPivotTableObject, bool bCreateNewPivotTable); + virtual ~ScPivotLayoutDialog() override; + + virtual void SetReference(const ScRange& rReferenceRange, ScDocument& rDocument) 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); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ + -- cgit v1.2.3