1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
11 #ifndef INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTDIALOG_HXX
12 #define INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTDIALOG_HXX
14 #include <boost/ptr_container/ptr_vector.hpp>
16 #include <svx/checklbx.hxx>
17 #include <vcl/lstbox.hxx>
18 #include "anyrefdg.hxx"
19 #include "dpobject.hxx"
21 #include "dpshttab.hxx"
22 #include "document.hxx"
23 #include "viewdata.hxx"
25 #include "PivotLayoutTreeList.hxx"
26 #include "PivotLayoutTreeListData.hxx"
27 #include "PivotLayoutTreeListLabel.hxx"
33 ScPivotFuncData maFunctionData
;
34 ScItemValue
* mpOriginalItemValue
;
36 ScItemValue(OUString
const & aName
, SCCOL nColumn
, sal_uInt16 nFunctionMask
);
37 ScItemValue(ScItemValue
* pInputItemValue
);
39 virtual ~ScItemValue();
42 class ScPivotLayoutDialog
: public ScAnyRefDlg
45 ScDPObject maPivotTableObject
;
47 VclPtr
<ScPivotLayoutTreeListBase
> mpPreviouslyFocusedListBox
;
48 VclPtr
<ScPivotLayoutTreeListBase
> mpCurrentlyFocusedListBox
;
51 ScViewData
* mpViewData
;
52 ScDocument
* mpDocument
;
56 VclPtr
<ScPivotLayoutTreeListLabel
> mpListBoxField
;
57 VclPtr
<ScPivotLayoutTreeList
> mpListBoxPage
;
58 VclPtr
<ScPivotLayoutTreeList
> mpListBoxColumn
;
59 VclPtr
<ScPivotLayoutTreeList
> mpListBoxRow
;
60 VclPtr
<ScPivotLayoutTreeListData
> mpListBoxData
;
62 VclPtr
<CheckBox
> mpCheckIgnoreEmptyRows
;
63 VclPtr
<CheckBox
> mpCheckTotalColumns
;
64 VclPtr
<CheckBox
> mpCheckAddFilter
;
65 VclPtr
<CheckBox
> mpCheckIdentifyCategories
;
66 VclPtr
<CheckBox
> mpCheckTotalRows
;
67 VclPtr
<CheckBox
> mpCheckDrillToDetail
;
69 VclPtr
<RadioButton
> mpSourceRadioNamedRange
;
70 VclPtr
<RadioButton
> mpSourceRadioSelection
;
72 VclPtr
<ListBox
> mpSourceListBox
;
73 VclPtr
<formula::RefEdit
> mpSourceEdit
;
74 VclPtr
<formula::RefButton
> mpSourceButton
;
76 VclPtr
<RadioButton
> mpDestinationRadioNewSheet
;
77 VclPtr
<RadioButton
> mpDestinationRadioNamedRange
;
78 VclPtr
<RadioButton
> mpDestinationRadioSelection
;
80 VclPtr
<ListBox
> mpDestinationListBox
;
81 VclPtr
<formula::RefEdit
> mpDestinationEdit
;
82 VclPtr
<formula::RefButton
> mpDestinationButton
;
84 VclPtr
<PushButton
> mpBtnOK
;
85 VclPtr
<CancelButton
> mpBtnCancel
;
87 VclPtr
<formula::RefEdit
> mpActiveEdit
;
88 ScAddress::Details maAddressDetails
;
89 bool mbDialogLostFocus
;
91 DECL_LINK(CancelClicked
, PushButton
*);
92 DECL_LINK(OKClicked
, PushButton
*);
93 DECL_LINK(GetFocusHandler
, Control
*);
94 DECL_LINK(LoseFocusHandler
, void*);
95 DECL_LINK(ToggleSource
, void*);
96 DECL_LINK(ToggleDestination
, void*);
97 DECL_LINK(SourceEditModified
, void*);
98 virtual bool Close() SAL_OVERRIDE
;
100 ScPivotParam maPivotParameters
;
104 void SetupDestination();
105 void FillValuesToListBoxes();
108 bool GetDestination(ScRange
& aDestinationRange
, bool& bToNewSheet
);
111 ScPivotLayoutDialog(SfxBindings
* pSfxBindings
, SfxChildWindow
* pChildWindow
, vcl::Window
* pParent
,
112 ScViewData
* pViewData
, const ScDPObject
* pPivotTableObject
, bool bCreateNewPivotTable
);
113 virtual ~ScPivotLayoutDialog();
114 virtual void dispose() SAL_OVERRIDE
;
116 virtual void SetReference(const ScRange
& rReferenceRange
, ScDocument
* pDocument
) SAL_OVERRIDE
;
117 virtual void SetActive() SAL_OVERRIDE
;
118 virtual bool IsRefInputMode() const SAL_OVERRIDE
;
120 void ItemInserted(ScItemValue
* pItemValue
, ScPivotLayoutTreeList::SvPivotTreeListType eType
);
122 void UpdateSourceRange();
125 void ApplySaveData(ScDPSaveData
& rSaveData
);
126 void ApplyLabelData(ScDPSaveData
& rSaveData
);
128 ScItemValue
* GetItem(SCCOL nColumn
);
129 bool IsDataElement(SCCOL nColumn
);
131 ScDPLabelData
* GetLabelData(SCCOL nColumn
);
132 ScDPLabelDataVector
& GetLabelDataVector() { return maPivotParameters
.maLabelArray
;}
133 void PushDataFieldNames(std::vector
<ScDPName
>& rDataFieldNames
);
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */