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 #ifndef INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTDIALOG_HXX
12 #define INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTDIALOG_HXX
13 
14 #include "anyrefdg.hxx"
15 #include <dpobject.hxx>
16 #include "viewdata.hxx"
17 
18 #include "PivotLayoutTreeList.hxx"
21 
22 class ScItemValue final
23 {
24 public:
25  OUString maName;
28 
29  ScItemValue(OUString const & aName, SCCOL nColumn, PivotFunc nFunctionMask);
30  ScItemValue(const ScItemValue* pInputItemValue);
31 
32  ~ScItemValue();
33 };
34 
36 {
37 public:
39 
41 
42 private:
45 
47 
50 
52  std::unique_ptr<ScPivotLayoutTreeListLabel> mxListBoxField;
53  std::unique_ptr<ScPivotLayoutTreeList> mxListBoxPage;
54  std::unique_ptr<ScPivotLayoutTreeList> mxListBoxColumn;
55  std::unique_ptr<ScPivotLayoutTreeList> mxListBoxRow;
56  std::unique_ptr<ScPivotLayoutTreeListData> mxListBoxData;
57 
58  std::unique_ptr<weld::CheckButton> mxCheckIgnoreEmptyRows;
59  std::unique_ptr<weld::CheckButton> mxCheckTotalColumns;
60  std::unique_ptr<weld::CheckButton> mxCheckAddFilter;
61  std::unique_ptr<weld::CheckButton> mxCheckIdentifyCategories;
62  std::unique_ptr<weld::CheckButton> mxCheckTotalRows;
63  std::unique_ptr<weld::CheckButton> mxCheckDrillToDetail;
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  std::unique_ptr<weld::Expander> mxOptions;
89  std::unique_ptr<weld::Expander> mxMore;
90 
91  DECL_LINK(CancelClicked, weld::Button&, void);
92  DECL_LINK(OKClicked, weld::Button&, void);
93  DECL_LINK(GetEditFocusHandler, formula::RefEdit&, void);
94  DECL_LINK(GetButtonFocusHandler, formula::RefButton&, void);
95  DECL_LINK(LoseEditFocusHandler, formula::RefEdit&, void);
96  DECL_LINK(LoseButtonFocusHandler, formula::RefButton&, void);
99  DECL_LINK(SourceListSelected, weld::ComboBox&, void);
100  DECL_LINK(SourceEditModified, formula::RefEdit&, void);
101  void ToggleSource();
102  void ToggleDestination();
103  virtual void Close() override;
104 
106 
107  // UI
108  void SetupSource();
109  void SetupDestination();
110  void FillValuesToListBoxes();
111 
112  // Other
113  bool GetDestination(ScRange& aDestinationRange, bool& bToNewSheet);
114 
115 public:
116  ScPivotLayoutDialog(SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow, weld::Window* pParent,
117  ScViewData* pViewData, const ScDPObject* pPivotTableObject, bool bCreateNewPivotTable);
118  virtual ~ScPivotLayoutDialog() override;
119 
120  virtual void SetReference(const ScRange& rReferenceRange, ScDocument& rDocument) override;
121  virtual void SetActive() override;
122  virtual bool IsRefInputMode() const override;
123 
125 
126  void UpdateSourceRange();
127 
128  void ApplyChanges();
129  void ApplySaveData(ScDPSaveData& rSaveData);
130  void ApplyLabelData(const ScDPSaveData& rSaveData);
131 
132  ScItemValue* GetItem(SCCOL nColumn);
133  bool IsDataElement(SCCOL nColumn);
134 
135  ScDPLabelData& GetLabelData(SCCOL nColumn);
136  ScDPLabelDataVector& GetLabelDataVector() { return maPivotParameters.maLabelArray;}
137  void PushDataFieldNames(std::vector<ScDPName>& rDataFieldNames);
138 };
139 
140 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
141 
142 #endif
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:25
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:22
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)