xref: /aoo42x/main/sc/source/ui/inc/pvfundlg.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_PVFUNDLG_HXX
25cdf0e10cSrcweir #define SC_PVFUNDLG_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/sheet/DataPilotFieldReference.hpp>
28cdf0e10cSrcweir #include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <vcl/fixed.hxx>
31cdf0e10cSrcweir #include <vcl/lstbox.hxx>
32cdf0e10cSrcweir #include <vcl/dialog.hxx>
33cdf0e10cSrcweir #include <vcl/button.hxx>
34cdf0e10cSrcweir #include <vcl/morebtn.hxx>
35cdf0e10cSrcweir #include <vcl/field.hxx>
36cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
37cdf0e10cSrcweir #include <svx/checklbx.hxx>
38cdf0e10cSrcweir #include <sfx2/itemconnect.hxx>
39cdf0e10cSrcweir #include "pivot.hxx"
40cdf0e10cSrcweir 
41cdf0e10cSrcweir #include <hash_map>
42cdf0e10cSrcweir 
43cdf0e10cSrcweir // ============================================================================
44cdf0e10cSrcweir 
45cdf0e10cSrcweir typedef sfx::ListBoxWrapper< sal_Int32 > ScDPListBoxWrapper;
46cdf0e10cSrcweir 
47cdf0e10cSrcweir class ScDPObject;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir // ============================================================================
50cdf0e10cSrcweir 
51cdf0e10cSrcweir class ScDPFunctionListBox : public MultiListBox
52cdf0e10cSrcweir {
53cdf0e10cSrcweir public:
54cdf0e10cSrcweir     explicit            ScDPFunctionListBox( Window* pParent, const ResId& rResId );
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     void                SetSelection( sal_uInt16 nFuncMask );
57cdf0e10cSrcweir     sal_uInt16              GetSelection() const;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir private:
60cdf0e10cSrcweir     void                FillFunctionNames();
61cdf0e10cSrcweir };
62cdf0e10cSrcweir 
63cdf0e10cSrcweir // ============================================================================
64cdf0e10cSrcweir 
65cdf0e10cSrcweir class ScDPFunctionDlg : public ModalDialog
66cdf0e10cSrcweir {
67cdf0e10cSrcweir public:
68cdf0e10cSrcweir     explicit            ScDPFunctionDlg( Window* pParent, const ScDPLabelDataVector& rLabelVec,
69cdf0e10cSrcweir                             const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData );
70cdf0e10cSrcweir 
71cdf0e10cSrcweir     sal_uInt16              GetFuncMask() const;
72cdf0e10cSrcweir     ::com::sun::star::sheet::DataPilotFieldReference GetFieldRef() const;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir private:
75cdf0e10cSrcweir     void                Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData );
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     DECL_LINK( SelectHdl, ListBox* );
78cdf0e10cSrcweir     DECL_LINK( DblClickHdl, MultiListBox* );
79cdf0e10cSrcweir 
80cdf0e10cSrcweir private:
81cdf0e10cSrcweir     FixedLine           maFlFunc;
82cdf0e10cSrcweir     ScDPFunctionListBox maLbFunc;
83cdf0e10cSrcweir     FixedText           maFtNameLabel;
84cdf0e10cSrcweir     FixedInfo           maFtName;
85cdf0e10cSrcweir     FixedLine           maFlDisplay;
86cdf0e10cSrcweir     FixedText           maFtType;
87cdf0e10cSrcweir     ListBox             maLbType;
88cdf0e10cSrcweir     FixedText           maFtBaseField;
89cdf0e10cSrcweir     ListBox             maLbBaseField;
90cdf0e10cSrcweir     FixedText           maFtBaseItem;
91cdf0e10cSrcweir     ListBox             maLbBaseItem;
92cdf0e10cSrcweir     OKButton            maBtnOk;
93cdf0e10cSrcweir     CancelButton        maBtnCancel;
94cdf0e10cSrcweir     HelpButton          maBtnHelp;
95cdf0e10cSrcweir     MoreButton          maBtnMore;
96cdf0e10cSrcweir 
97cdf0e10cSrcweir     ScDPListBoxWrapper  maLbTypeWrp;        /// Wrapper for direct usage of API constants.
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     const ScDPLabelDataVector& mrLabelVec;  /// Data of all labels.
100cdf0e10cSrcweir     bool                mbEmptyItem;        /// true = Empty base item in listbox.
101cdf0e10cSrcweir };
102cdf0e10cSrcweir 
103cdf0e10cSrcweir // ============================================================================
104cdf0e10cSrcweir 
105cdf0e10cSrcweir class ScDPSubtotalDlg : public ModalDialog
106cdf0e10cSrcweir {
107cdf0e10cSrcweir public:
108cdf0e10cSrcweir     explicit            ScDPSubtotalDlg( Window* pParent, ScDPObject& rDPObj,
109cdf0e10cSrcweir                             const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData,
110cdf0e10cSrcweir                             const ScDPNameVec& rDataFields, bool bEnableLayout );
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     sal_uInt16              GetFuncMask() const;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     void                FillLabelData( ScDPLabelData& rLabelData ) const;
115cdf0e10cSrcweir 
116cdf0e10cSrcweir private:
117cdf0e10cSrcweir     void                Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData );
118cdf0e10cSrcweir 
119cdf0e10cSrcweir     DECL_LINK( DblClickHdl, MultiListBox* );
120cdf0e10cSrcweir     DECL_LINK( RadioClickHdl, RadioButton* );
121cdf0e10cSrcweir     DECL_LINK( ClickHdl, PushButton* );
122cdf0e10cSrcweir 
123cdf0e10cSrcweir private:
124cdf0e10cSrcweir     FixedLine           maFlSubt;
125cdf0e10cSrcweir     RadioButton         maRbNone;
126cdf0e10cSrcweir     RadioButton         maRbAuto;
127cdf0e10cSrcweir     RadioButton         maRbUser;
128cdf0e10cSrcweir     ScDPFunctionListBox maLbFunc;
129cdf0e10cSrcweir     FixedText           maFtNameLabel;
130cdf0e10cSrcweir     FixedInfo           maFtName;
131cdf0e10cSrcweir     CheckBox            maCbShowAll;
132cdf0e10cSrcweir     OKButton            maBtnOk;
133cdf0e10cSrcweir     CancelButton        maBtnCancel;
134cdf0e10cSrcweir     HelpButton          maBtnHelp;
135cdf0e10cSrcweir     PushButton          maBtnOptions;
136cdf0e10cSrcweir 
137cdf0e10cSrcweir     ScDPObject&         mrDPObj;            /// The DataPilot object (for member names).
138cdf0e10cSrcweir     const ScDPNameVec&  mrDataFields;       /// The list of all data field names.
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     ScDPLabelData       maLabelData;        /// Cache for sub dialog.
141cdf0e10cSrcweir     bool                mbEnableLayout;     /// true = Enable Layout mode controls.
142cdf0e10cSrcweir };
143cdf0e10cSrcweir 
144cdf0e10cSrcweir // ============================================================================
145cdf0e10cSrcweir 
146cdf0e10cSrcweir class ScDPSubtotalOptDlg : public ModalDialog
147cdf0e10cSrcweir {
148cdf0e10cSrcweir public:
149cdf0e10cSrcweir     explicit            ScDPSubtotalOptDlg( Window* pParent, ScDPObject& rDPObj,
150cdf0e10cSrcweir                             const ScDPLabelData& rLabelData, const ScDPNameVec& rDataFields,
151cdf0e10cSrcweir                             bool bEnableLayout );
152cdf0e10cSrcweir 
153cdf0e10cSrcweir     void                FillLabelData( ScDPLabelData& rLabelData ) const;
154cdf0e10cSrcweir 
155cdf0e10cSrcweir private:
156cdf0e10cSrcweir     void                Init( const ScDPNameVec& rDataFields, bool bEnableLayout );
157cdf0e10cSrcweir     void                InitHideListBox();
158cdf0e10cSrcweir 
159cdf0e10cSrcweir     DECL_LINK( RadioClickHdl, RadioButton* );
160cdf0e10cSrcweir     DECL_LINK( CheckHdl, CheckBox* );
161cdf0e10cSrcweir     DECL_LINK( SelectHdl, ListBox* );
162cdf0e10cSrcweir 
163cdf0e10cSrcweir private:
164cdf0e10cSrcweir     FixedLine           maFlSortBy;
165cdf0e10cSrcweir     ListBox             maLbSortBy;
166cdf0e10cSrcweir     RadioButton         maRbSortAsc;
167cdf0e10cSrcweir     RadioButton         maRbSortDesc;
168cdf0e10cSrcweir     RadioButton         maRbSortMan;
169cdf0e10cSrcweir     FixedLine           maFlLayout;
170cdf0e10cSrcweir     FixedText           maFtLayout;
171cdf0e10cSrcweir     ListBox             maLbLayout;
172cdf0e10cSrcweir     CheckBox            maCbLayoutEmpty;
173cdf0e10cSrcweir     FixedLine           maFlAutoShow;
174cdf0e10cSrcweir     CheckBox            maCbShow;
175cdf0e10cSrcweir     NumericField        maNfShow;
176cdf0e10cSrcweir     FixedText           maFtShow;
177cdf0e10cSrcweir     FixedText           maFtShowFrom;
178cdf0e10cSrcweir     ListBox             maLbShowFrom;
179cdf0e10cSrcweir     FixedText           maFtShowUsing;
180cdf0e10cSrcweir     ListBox             maLbShowUsing;
181cdf0e10cSrcweir     FixedLine           maFlHide;
182cdf0e10cSrcweir     SvxCheckListBox     maLbHide;
183cdf0e10cSrcweir     FixedText           maFtHierarchy;
184cdf0e10cSrcweir     ListBox             maLbHierarchy;
185cdf0e10cSrcweir     OKButton            maBtnOk;
186cdf0e10cSrcweir     CancelButton        maBtnCancel;
187cdf0e10cSrcweir     HelpButton          maBtnHelp;
188cdf0e10cSrcweir 
189cdf0e10cSrcweir     ScDPListBoxWrapper  maLbLayoutWrp;      /// Wrapper for direct usage of API constants.
190cdf0e10cSrcweir     ScDPListBoxWrapper  maLbShowFromWrp;    /// Wrapper for direct usage of API constants.
191cdf0e10cSrcweir 
192cdf0e10cSrcweir     ScDPObject&         mrDPObj;            /// The DataPilot object (for member names).
193cdf0e10cSrcweir     ScDPLabelData       maLabelData;        /// Cache for members data.
194cdf0e10cSrcweir };
195cdf0e10cSrcweir 
196cdf0e10cSrcweir // ============================================================================
197cdf0e10cSrcweir 
198cdf0e10cSrcweir class ScDPShowDetailDlg : public ModalDialog
199cdf0e10cSrcweir {
200cdf0e10cSrcweir public:
201cdf0e10cSrcweir     explicit            ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, sal_uInt16 nOrient );
202cdf0e10cSrcweir 
203cdf0e10cSrcweir     virtual short       Execute();
204cdf0e10cSrcweir 
205cdf0e10cSrcweir     /**
206cdf0e10cSrcweir      * @return String internal name of the selected field.  Note that this may
207cdf0e10cSrcweir      *         be different from the name displayed in the dialog if the field
208cdf0e10cSrcweir      *         has a layout name.
209cdf0e10cSrcweir      */
210cdf0e10cSrcweir     String              GetDimensionName() const;
211cdf0e10cSrcweir 
212cdf0e10cSrcweir private:
213cdf0e10cSrcweir     DECL_LINK( DblClickHdl, ListBox* );
214cdf0e10cSrcweir 
215cdf0e10cSrcweir private:
216cdf0e10cSrcweir     FixedText           maFtDims;
217cdf0e10cSrcweir     ListBox             maLbDims;
218cdf0e10cSrcweir     OKButton            maBtnOk;
219cdf0e10cSrcweir     CancelButton        maBtnCancel;
220cdf0e10cSrcweir     HelpButton          maBtnHelp;
221cdf0e10cSrcweir 
222cdf0e10cSrcweir     typedef ::std::hash_map<String, long, ScStringHashCode> DimNameIndexMap;
223cdf0e10cSrcweir     DimNameIndexMap     maNameIndexMap;
224cdf0e10cSrcweir     ScDPObject&         mrDPObj;
225cdf0e10cSrcweir };
226cdf0e10cSrcweir 
227cdf0e10cSrcweir // ============================================================================
228cdf0e10cSrcweir 
229cdf0e10cSrcweir #endif
230cdf0e10cSrcweir 
231