LibreOffice Module sc (master) 1
PivotLayoutDialog.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 */
10
11#pragma once
12
13#include "anyrefdg.hxx"
14#include <dpobject.hxx>
15#include "viewdata.hxx"
16
20
21class ScItemValue final
22{
23public:
24 OUString maName;
27
28 ScItemValue(OUString aName, SCCOL nColumn, PivotFunc nFunctionMask);
29 ScItemValue(const ScItemValue* pInputItemValue);
30
32};
33
35{
36public:
38
40
41private:
44
46
49
51 std::unique_ptr<ScPivotLayoutTreeListLabel> mxListBoxField;
52 std::unique_ptr<ScPivotLayoutTreeList> mxListBoxPage;
53 std::unique_ptr<ScPivotLayoutTreeList> mxListBoxColumn;
54 std::unique_ptr<ScPivotLayoutTreeList> mxListBoxRow;
55 std::unique_ptr<ScPivotLayoutTreeListData> mxListBoxData;
56
57 std::unique_ptr<weld::CheckButton> mxCheckIgnoreEmptyRows;
58 std::unique_ptr<weld::CheckButton> mxCheckTotalColumns;
59 std::unique_ptr<weld::CheckButton> mxCheckAddFilter;
60 std::unique_ptr<weld::CheckButton> mxCheckIdentifyCategories;
61 std::unique_ptr<weld::CheckButton> mxCheckTotalRows;
62 std::unique_ptr<weld::CheckButton> mxCheckDrillToDetail;
63 std::unique_ptr<weld::CheckButton> mxCheckExpandCollapse;
64
65 std::unique_ptr<weld::RadioButton> mxSourceRadioNamedRange;
66 std::unique_ptr<weld::RadioButton> mxSourceRadioSelection;
67
68 std::unique_ptr<weld::ComboBox> mxSourceListBox;
69 std::unique_ptr<formula::RefEdit> mxSourceEdit;
70 std::unique_ptr<formula::RefButton> mxSourceButton;
71
72 std::unique_ptr<weld::RadioButton> mxDestinationRadioNewSheet;
73 std::unique_ptr<weld::RadioButton> mxDestinationRadioNamedRange;
74 std::unique_ptr<weld::RadioButton> mxDestinationRadioSelection;
75
76 std::unique_ptr<weld::ComboBox> mxDestinationListBox;
77 std::unique_ptr<formula::RefEdit> mxDestinationEdit;
78 std::unique_ptr<formula::RefButton> mxDestinationButton;
79
80 std::unique_ptr<weld::Button> mxBtnOK;
81 std::unique_ptr<weld::Button> mxBtnCancel;
82
83 std::unique_ptr<weld::Frame> mxSourceFrame;
84 std::unique_ptr<weld::Label> mxSourceLabel;
85 std::unique_ptr<weld::Frame> mxDestFrame;
86 std::unique_ptr<weld::Label> mxDestLabel;
87
88 DECL_LINK(CancelClicked, weld::Button&, void);
89 DECL_LINK(OKClicked, weld::Button&, void);
90 DECL_LINK(GetEditFocusHandler, formula::RefEdit&, void);
91 DECL_LINK(GetButtonFocusHandler, formula::RefButton&, void);
92 DECL_LINK(LoseEditFocusHandler, formula::RefEdit&, void);
93 DECL_LINK(LoseButtonFocusHandler, formula::RefButton&, void);
96 DECL_LINK(SourceListSelected, weld::ComboBox&, void);
97 DECL_LINK(SourceEditModified, formula::RefEdit&, void);
98 void ToggleSource();
99 void ToggleDestination();
100 virtual void Close() override;
101
103
104 // UI
105 void SetupSource();
106 void SetupDestination();
108
109 // Other
110 bool GetDestination(ScRange& aDestinationRange, bool& bToNewSheet);
111
112public:
113 ScPivotLayoutDialog(SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow, weld::Window* pParent,
114 ScViewData* pViewData, const ScDPObject* pPivotTableObject, bool bCreateNewPivotTable);
115 virtual ~ScPivotLayoutDialog() override;
116
117 virtual void SetReference(const ScRange& rReferenceRange, ScDocument& rDocument) override;
118 virtual void SetActive() override;
119 virtual bool IsRefInputMode() const override;
120
122
123 void UpdateSourceRange();
124
125 void ApplyChanges();
126 void ApplySaveData(ScDPSaveData& rSaveData);
127 void ApplyLabelData(const ScDPSaveData& rSaveData);
128
129 ScItemValue* GetItem(SCCOL nColumn);
130 bool IsDataElement(SCCOL nColumn);
131
134 void PushDataFieldNames(std::vector<ScDPName>& rDataFieldNames);
135};
136
137/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
138
ScPivotFuncData maFunctionData
ScItemValue(OUString aName, SCCOL nColumn, PivotFunc nFunctionMask)
ScItemValue * mpOriginalItemValue
DECL_LINK(ToggleDestination, weld::Toggleable &, void)
DECL_LINK(OKClicked, weld::Button &, void)
void ItemInserted(const ScItemValue *pItemValue, ScPivotLayoutTreeList::SvPivotTreeListType eType)
DECL_LINK(CancelClicked, weld::Button &, void)
std::unique_ptr< formula::RefButton > mxDestinationButton
DECL_LINK(LoseButtonFocusHandler, formula::RefButton &, void)
std::unique_ptr< weld::CheckButton > mxCheckExpandCollapse
std::unique_ptr< ScPivotLayoutTreeList > mxListBoxColumn
DECL_LINK(SourceListSelected, weld::ComboBox &, void)
std::unique_ptr< weld::CheckButton > mxCheckIdentifyCategories
std::unique_ptr< weld::CheckButton > mxCheckAddFilter
void ApplyLabelData(const ScDPSaveData &rSaveData)
std::unique_ptr< weld::RadioButton > mxDestinationRadioNewSheet
DECL_LINK(SourceEditModified, formula::RefEdit &, void)
std::unique_ptr< ScPivotLayoutTreeListData > mxListBoxData
std::unique_ptr< weld::RadioButton > mxDestinationRadioNamedRange
std::unique_ptr< weld::RadioButton > mxSourceRadioNamedRange
virtual void SetActive() override
std::unique_ptr< formula::RefEdit > mxDestinationEdit
virtual void Close() override
std::unique_ptr< weld::ComboBox > mxDestinationListBox
std::unique_ptr< weld::RadioButton > mxDestinationRadioSelection
ScDPLabelDataVector & GetLabelDataVector()
virtual ~ScPivotLayoutDialog() override
std::unique_ptr< ScPivotLayoutTreeListLabel > mxListBoxField
std::unique_ptr< weld::ComboBox > mxSourceListBox
void ApplySaveData(ScDPSaveData &rSaveData)
std::unique_ptr< weld::Button > mxBtnCancel
std::unique_ptr< weld::CheckButton > mxCheckTotalRows
ScAddress::Details maAddressDetails
std::unique_ptr< weld::CheckButton > mxCheckTotalColumns
DECL_LINK(GetEditFocusHandler, formula::RefEdit &, void)
std::unique_ptr< weld::Button > mxBtnOK
ScDPLabelData & GetLabelData(SCCOL nColumn)
ScPivotLayoutDialog(SfxBindings *pSfxBindings, SfxChildWindow *pChildWindow, weld::Window *pParent, ScViewData *pViewData, const ScDPObject *pPivotTableObject, bool bCreateNewPivotTable)
ScPivotParam maPivotParameters
std::unique_ptr< ScPivotLayoutTreeList > mxListBoxRow
DECL_LINK(GetButtonFocusHandler, formula::RefButton &, void)
std::unique_ptr< weld::Label > mxSourceLabel
bool GetDestination(ScRange &aDestinationRange, bool &bToNewSheet)
std::unique_ptr< weld::CheckButton > mxCheckDrillToDetail
std::unique_ptr< weld::Label > mxDestLabel
virtual void SetReference(const ScRange &rReferenceRange, ScDocument &rDocument) override
ScPivotLayoutTreeListBase * mpPreviouslyFocusedListBox
bool IsDataElement(SCCOL nColumn)
std::unique_ptr< weld::Frame > mxSourceFrame
std::unique_ptr< formula::RefEdit > mxSourceEdit
std::unique_ptr< weld::Frame > mxDestFrame
std::unique_ptr< weld::RadioButton > mxSourceRadioSelection
std::unique_ptr< weld::CheckButton > mxCheckIgnoreEmptyRows
std::unique_ptr< formula::RefButton > mxSourceButton
formula::RefEdit * mpActiveEdit
std::unique_ptr< ScPivotLayoutTreeList > mxListBoxPage
DECL_LINK(LoseEditFocusHandler, formula::RefEdit &, void)
DECL_LINK(ToggleSource, weld::Toggleable &, void)
virtual bool IsRefInputMode() const override
ScItemValue * GetItem(SCCOL nColumn)
void PushDataFieldNames(std::vector< ScDPName > &rDataFieldNames)
PivotFunc
Definition: dpglobal.hxx:24
std::vector< std::unique_ptr< ScDPLabelData > > ScDPLabelDataVector
Definition: pivot.hxx:113
ScDPLabelDataVector maLabelArray
Definition: pivot.hxx:137
sal_Int16 SCCOL
Definition: types.hxx:21