update dev300-m58
[ooovba.git] / sc / source / ui / inc / pvfundlg.hxx
blob1707cd63ed8b1232a6c9acd527e12b9417633d89
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pvfundlg.hxx,v $
10 * $Revision: 1.7.32.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_PVFUNDLG_HXX
32 #define SC_PVFUNDLG_HXX
34 #include <com/sun/star/sheet/DataPilotFieldReference.hpp>
35 #include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp>
37 #ifndef _FIXED_HXX
38 #include <vcl/fixed.hxx>
39 #endif
40 #ifndef _LSTBOX_HXX
41 #include <vcl/lstbox.hxx>
42 #endif
43 #ifndef _DIALOG_HXX
44 #include <vcl/dialog.hxx>
45 #endif
46 #ifndef _BUTTON_HXX
47 #include <vcl/button.hxx>
48 #endif
49 #ifndef _MOREBTN_HXX
50 #include <vcl/morebtn.hxx>
51 #endif
52 #include <vcl/field.hxx>
53 #include <svtools/stdctrl.hxx>
54 #include <svx/checklbx.hxx>
55 #include <sfx2/itemconnect.hxx>
56 #include "pivot.hxx"
58 #include <hash_map>
60 // ============================================================================
62 typedef sfx::ListBoxWrapper< sal_Int32 > ScDPListBoxWrapper;
64 class ScDPObject;
66 // ============================================================================
68 class ScDPFunctionListBox : public MultiListBox
70 public:
71 explicit ScDPFunctionListBox( Window* pParent, const ResId& rResId );
73 void SetSelection( USHORT nFuncMask );
74 USHORT GetSelection() const;
76 private:
77 void FillFunctionNames();
80 // ============================================================================
82 class ScDPFunctionDlg : public ModalDialog
84 public:
85 explicit ScDPFunctionDlg( Window* pParent, const ScDPLabelDataVec& rLabelVec,
86 const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData );
88 USHORT GetFuncMask() const;
89 ::com::sun::star::sheet::DataPilotFieldReference GetFieldRef() const;
91 private:
92 void Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData );
94 DECL_LINK( SelectHdl, ListBox* );
95 DECL_LINK( DblClickHdl, MultiListBox* );
97 private:
98 FixedLine maFlFunc;
99 ScDPFunctionListBox maLbFunc;
100 FixedText maFtNameLabel;
101 FixedInfo maFtName;
102 FixedLine maFlDisplay;
103 FixedText maFtType;
104 ListBox maLbType;
105 FixedText maFtBaseField;
106 ListBox maLbBaseField;
107 FixedText maFtBaseItem;
108 ListBox maLbBaseItem;
109 OKButton maBtnOk;
110 CancelButton maBtnCancel;
111 HelpButton maBtnHelp;
112 MoreButton maBtnMore;
114 ScDPListBoxWrapper maLbTypeWrp; /// Wrapper for direct usage of API constants.
116 const ScDPLabelDataVec& mrLabelVec; /// Data of all labels.
117 bool mbEmptyItem; /// true = Empty base item in listbox.
120 // ============================================================================
122 class ScDPSubtotalDlg : public ModalDialog
124 public:
125 explicit ScDPSubtotalDlg( Window* pParent, ScDPObject& rDPObj,
126 const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData,
127 const ScDPNameVec& rDataFields, bool bEnableLayout );
129 USHORT GetFuncMask() const;
131 void FillLabelData( ScDPLabelData& rLabelData ) const;
133 private:
134 void Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData );
136 DECL_LINK( DblClickHdl, MultiListBox* );
137 DECL_LINK( RadioClickHdl, RadioButton* );
138 DECL_LINK( ClickHdl, PushButton* );
140 private:
141 FixedLine maFlSubt;
142 RadioButton maRbNone;
143 RadioButton maRbAuto;
144 RadioButton maRbUser;
145 ScDPFunctionListBox maLbFunc;
146 FixedText maFtNameLabel;
147 FixedInfo maFtName;
148 CheckBox maCbShowAll;
149 OKButton maBtnOk;
150 CancelButton maBtnCancel;
151 HelpButton maBtnHelp;
152 PushButton maBtnOptions;
154 ScDPObject& mrDPObj; /// The DataPilot object (for member names).
155 const ScDPNameVec& mrDataFields; /// The list of all data field names.
157 ScDPLabelData maLabelData; /// Cache for sub dialog.
158 bool mbEnableLayout; /// true = Enable Layout mode controls.
161 // ============================================================================
163 class ScDPSubtotalOptDlg : public ModalDialog
165 public:
166 explicit ScDPSubtotalOptDlg( Window* pParent, ScDPObject& rDPObj,
167 const ScDPLabelData& rLabelData, const ScDPNameVec& rDataFields,
168 bool bEnableLayout );
170 void FillLabelData( ScDPLabelData& rLabelData ) const;
172 private:
173 void Init( const ScDPNameVec& rDataFields, bool bEnableLayout );
174 void InitHideListBox();
176 DECL_LINK( RadioClickHdl, RadioButton* );
177 DECL_LINK( CheckHdl, CheckBox* );
178 DECL_LINK( SelectHdl, ListBox* );
180 private:
181 FixedLine maFlSortBy;
182 ListBox maLbSortBy;
183 RadioButton maRbSortAsc;
184 RadioButton maRbSortDesc;
185 RadioButton maRbSortMan;
186 FixedLine maFlLayout;
187 FixedText maFtLayout;
188 ListBox maLbLayout;
189 CheckBox maCbLayoutEmpty;
190 FixedLine maFlAutoShow;
191 CheckBox maCbShow;
192 NumericField maNfShow;
193 FixedText maFtShow;
194 FixedText maFtShowFrom;
195 ListBox maLbShowFrom;
196 FixedText maFtShowUsing;
197 ListBox maLbShowUsing;
198 FixedLine maFlHide;
199 SvxCheckListBox maLbHide;
200 FixedText maFtHierarchy;
201 ListBox maLbHierarchy;
202 OKButton maBtnOk;
203 CancelButton maBtnCancel;
204 HelpButton maBtnHelp;
206 ScDPListBoxWrapper maLbLayoutWrp; /// Wrapper for direct usage of API constants.
207 ScDPListBoxWrapper maLbShowFromWrp; /// Wrapper for direct usage of API constants.
209 ScDPObject& mrDPObj; /// The DataPilot object (for member names).
210 ScDPLabelData maLabelData; /// Cache for members data.
213 // ============================================================================
215 class ScDPShowDetailDlg : public ModalDialog
217 public:
218 explicit ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHORT nOrient );
220 virtual short Execute();
222 /**
223 * @return String internal name of the selected field. Note that this may
224 * be different from the name displayed in the dialog if the field
225 * has a layout name.
227 String GetDimensionName() const;
229 private:
230 DECL_LINK( DblClickHdl, ListBox* );
232 private:
233 FixedText maFtDims;
234 ListBox maLbDims;
235 OKButton maBtnOk;
236 CancelButton maBtnCancel;
237 HelpButton maBtnHelp;
239 typedef ::std::hash_map<String, long, ScStringHashCode> DimNameIndexMap;
240 DimNameIndexMap maNameIndexMap;
241 ScDPObject& mrDPObj;
244 // ============================================================================
246 #endif