1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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>
38 #include <vcl/fixed.hxx>
41 #include <vcl/lstbox.hxx>
44 #include <vcl/dialog.hxx>
47 #include <vcl/button.hxx>
50 #include <vcl/morebtn.hxx>
52 #include <vcl/field.hxx>
53 #include <svtools/stdctrl.hxx>
54 #include <svx/checklbx.hxx>
55 #include <sfx2/itemconnect.hxx>
60 // ============================================================================
62 typedef sfx::ListBoxWrapper
< sal_Int32
> ScDPListBoxWrapper
;
66 // ============================================================================
68 class ScDPFunctionListBox
: public MultiListBox
71 explicit ScDPFunctionListBox( Window
* pParent
, const ResId
& rResId
);
73 void SetSelection( USHORT nFuncMask
);
74 USHORT
GetSelection() const;
77 void FillFunctionNames();
80 // ============================================================================
82 class ScDPFunctionDlg
: public ModalDialog
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;
92 void Init( const ScDPLabelData
& rLabelData
, const ScDPFuncData
& rFuncData
);
94 DECL_LINK( SelectHdl
, ListBox
* );
95 DECL_LINK( DblClickHdl
, MultiListBox
* );
99 ScDPFunctionListBox maLbFunc
;
100 FixedText maFtNameLabel
;
102 FixedLine maFlDisplay
;
105 FixedText maFtBaseField
;
106 ListBox maLbBaseField
;
107 FixedText maFtBaseItem
;
108 ListBox maLbBaseItem
;
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
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;
134 void Init( const ScDPLabelData
& rLabelData
, const ScDPFuncData
& rFuncData
);
136 DECL_LINK( DblClickHdl
, MultiListBox
* );
137 DECL_LINK( RadioClickHdl
, RadioButton
* );
138 DECL_LINK( ClickHdl
, PushButton
* );
142 RadioButton maRbNone
;
143 RadioButton maRbAuto
;
144 RadioButton maRbUser
;
145 ScDPFunctionListBox maLbFunc
;
146 FixedText maFtNameLabel
;
148 CheckBox maCbShowAll
;
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
166 explicit ScDPSubtotalOptDlg( Window
* pParent
, ScDPObject
& rDPObj
,
167 const ScDPLabelData
& rLabelData
, const ScDPNameVec
& rDataFields
,
168 bool bEnableLayout
);
170 void FillLabelData( ScDPLabelData
& rLabelData
) const;
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
* );
181 FixedLine maFlSortBy
;
183 RadioButton maRbSortAsc
;
184 RadioButton maRbSortDesc
;
185 RadioButton maRbSortMan
;
186 FixedLine maFlLayout
;
187 FixedText maFtLayout
;
189 CheckBox maCbLayoutEmpty
;
190 FixedLine maFlAutoShow
;
192 NumericField maNfShow
;
194 FixedText maFtShowFrom
;
195 ListBox maLbShowFrom
;
196 FixedText maFtShowUsing
;
197 ListBox maLbShowUsing
;
199 SvxCheckListBox maLbHide
;
200 FixedText maFtHierarchy
;
201 ListBox maLbHierarchy
;
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
218 explicit ScDPShowDetailDlg( Window
* pParent
, ScDPObject
& rDPObj
, USHORT nOrient
);
220 virtual short Execute();
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
227 String
GetDimensionName() const;
230 DECL_LINK( DblClickHdl
, ListBox
* );
236 CancelButton maBtnCancel
;
237 HelpButton maBtnHelp
;
239 typedef ::std::hash_map
<String
, long, ScStringHashCode
> DimNameIndexMap
;
240 DimNameIndexMap maNameIndexMap
;
244 // ============================================================================