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