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 
17 #include "PivotLayoutTreeList.hxx"
20 
21 class ScItemValue final
22 {
23 public:
24  OUString maName;
27 
28  ScItemValue(OUString const & aName, SCCOL nColumn, PivotFunc nFunctionMask);
29  ScItemValue(const ScItemValue* pInputItemValue);
30 
31  ~ScItemValue();
32 };
33 
35 {
36 public:
38 
40 
41 private:
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 
64  std::unique_ptr<weld::RadioButton> mxSourceRadioNamedRange;
65  std::unique_ptr<weld::RadioButton> mxSourceRadioSelection;
66 
67  std::unique_ptr<weld::ComboBox> mxSourceListBox;
68  std::unique_ptr<formula::RefEdit> mxSourceEdit;
69  std::unique_ptr<formula::RefButton> mxSourceButton;
70 
71  std::unique_ptr<weld::RadioButton> mxDestinationRadioNewSheet;
72  std::unique_ptr<weld::RadioButton> mxDestinationRadioNamedRange;
73  std::unique_ptr<weld::RadioButton> mxDestinationRadioSelection;
74 
75  std::unique_ptr<weld::ComboBox> mxDestinationListBox;
76  std::unique_ptr<formula::RefEdit> mxDestinationEdit;
77  std::unique_ptr<formula::RefButton> mxDestinationButton;
78 
79  std::unique_ptr<weld::Button> mxBtnOK;
80  std::unique_ptr<weld::Button> mxBtnCancel;
81 
82  std::unique_ptr<weld::Frame> mxSourceFrame;
83  std::unique_ptr<weld::Label> mxSourceLabel;
84  std::unique_ptr<weld::Frame> mxDestFrame;
85  std::unique_ptr<weld::Label> mxDestLabel;
86 
87  std::unique_ptr<weld::Expander> mxOptions;
88  std::unique_ptr<weld::Expander> mxMore;
89 
90  DECL_LINK(CancelClicked, weld::Button&, void);
91  DECL_LINK(OKClicked, weld::Button&, void);
92  DECL_LINK(GetEditFocusHandler, formula::RefEdit&, void);
93  DECL_LINK(GetButtonFocusHandler, formula::RefButton&, void);
94  DECL_LINK(LoseEditFocusHandler, formula::RefEdit&, void);
95  DECL_LINK(LoseButtonFocusHandler, formula::RefButton&, void);
98  DECL_LINK(SourceListSelected, weld::ComboBox&, void);
99  DECL_LINK(SourceEditModified, formula::RefEdit&, void);
100  void ToggleSource();
101  void ToggleDestination();
102  virtual void Close() override;
103 
105 
106  // UI
107  void SetupSource();
108  void SetupDestination();
109  void FillValuesToListBoxes();
110 
111  // Other
112  bool GetDestination(ScRange& aDestinationRange, bool& bToNewSheet);
113 
114 public:
115  ScPivotLayoutDialog(SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow, weld::Window* pParent,
116  ScViewData* pViewData, const ScDPObject* pPivotTableObject, bool bCreateNewPivotTable);
117  virtual ~ScPivotLayoutDialog() override;
118 
119  virtual void SetReference(const ScRange& rReferenceRange, ScDocument& rDocument) override;
120  virtual void SetActive() override;
121  virtual bool IsRefInputMode() const override;
122 
124 
125  void UpdateSourceRange();
126 
127  void ApplyChanges();
128  void ApplySaveData(ScDPSaveData& rSaveData);
129  void ApplyLabelData(const ScDPSaveData& rSaveData);
130 
131  ScItemValue* GetItem(SCCOL nColumn);
132  bool IsDataElement(SCCOL nColumn);
133 
134  ScDPLabelData& GetLabelData(SCCOL nColumn);
135  ScDPLabelDataVector& GetLabelDataVector() { return maPivotParameters.maLabelArray;}
136  void PushDataFieldNames(std::vector<ScDPName>& rDataFieldNames);
137 };
138 
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
140 
std::unique_ptr< ScPivotLayoutTreeListData > mxListBoxData
std::unique_ptr< weld::CheckButton > mxCheckAddFilter
virtual bool IsRefInputMode() const override
DECL_LINK(CancelClicked, weld::Button &, void)
ScDPLabelData & GetLabelData(SCCOL nColumn)
std::unique_ptr< weld::Expander > mxMore
std::unique_ptr< ScPivotLayoutTreeList > mxListBoxPage
std::unique_ptr< formula::RefEdit > mxSourceEdit
std::unique_ptr< ScPivotLayoutTreeListLabel > mxListBoxField
std::unique_ptr< weld::Frame > mxDestFrame
bool IsDataElement(SCCOL nColumn)
std::unique_ptr< weld::ComboBox > mxSourceListBox
std::unique_ptr< formula::RefButton > mxDestinationButton
std::unique_ptr< weld::RadioButton > mxDestinationRadioNamedRange
ScPivotLayoutDialog(SfxBindings *pSfxBindings, SfxChildWindow *pChildWindow, weld::Window *pParent, ScViewData *pViewData, const ScDPObject *pPivotTableObject, bool bCreateNewPivotTable)
virtual void SetActive() override
std::unique_ptr< weld::Label > mxSourceLabel
void ApplyLabelData(const ScDPSaveData &rSaveData)
std::unique_ptr< weld::RadioButton > mxDestinationRadioNewSheet
ScAddress::Details maAddressDetails
std::unique_ptr< weld::RadioButton > mxSourceRadioSelection
void PushDataFieldNames(std::vector< ScDPName > &rDataFieldNames)
PivotFunc
Definition: dpglobal.hxx:24
std::unique_ptr< weld::Expander > mxOptions
formula::RefEdit * mpActiveEdit
ScItemValue(OUString const &aName, SCCOL nColumn, PivotFunc nFunctionMask)
ScPivotLayoutTreeListBase * mpPreviouslyFocusedListBox
ScPivotParam maPivotParameters
virtual void Close() override
ScItemValue * mpOriginalItemValue
ScDPLabelDataVector maLabelArray
Definition: pivot.hxx:137
std::unique_ptr< weld::Button > mxBtnCancel
std::unique_ptr< weld::ComboBox > mxDestinationListBox
std::unique_ptr< weld::CheckButton > mxCheckTotalRows
std::vector< std::unique_ptr< ScDPLabelData > > ScDPLabelDataVector
Definition: pivot.hxx:113
std::unique_ptr< weld::CheckButton > mxCheckIdentifyCategories
std::unique_ptr< weld::CheckButton > mxCheckTotalColumns
virtual ~ScPivotLayoutDialog() override
sal_Int16 SCCOL
Definition: types.hxx:21
std::unique_ptr< ScPivotLayoutTreeList > mxListBoxColumn
ScPivotFuncData maFunctionData
void ApplySaveData(ScDPSaveData &rSaveData)
std::unique_ptr< weld::Button > mxBtnOK
std::unique_ptr< ScPivotLayoutTreeList > mxListBoxRow
ScItemValue * GetItem(SCCOL nColumn)
virtual void SetReference(const ScRange &rReferenceRange, ScDocument &rDocument) override
std::unique_ptr< weld::CheckButton > mxCheckIgnoreEmptyRows
std::unique_ptr< weld::Label > mxDestLabel
void ItemInserted(const ScItemValue *pItemValue, ScPivotLayoutTreeList::SvPivotTreeListType eType)
ScDPLabelDataVector & GetLabelDataVector()
std::unique_ptr< weld::RadioButton > mxSourceRadioNamedRange
std::unique_ptr< formula::RefButton > mxSourceButton
std::unique_ptr< weld::Frame > mxSourceFrame
std::unique_ptr< formula::RefEdit > mxDestinationEdit
std::unique_ptr< weld::RadioButton > mxDestinationRadioSelection
std::unique_ptr< weld::CheckButton > mxCheckDrillToDetail
bool GetDestination(ScRange &aDestinationRange, bool &bToNewSheet)