xref: /aoo42x/main/sc/source/ui/inc/tpsubt.hxx (revision cdf0e10c)
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_TPSUBT_HXX
29*cdf0e10cSrcweir #define SC_TPSUBT_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
32*cdf0e10cSrcweir #include <svx/checklbx.hxx>
33*cdf0e10cSrcweir #include <vcl/fixed.hxx>
34*cdf0e10cSrcweir #include "global.hxx"
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir //------------------------------------------------------------------------
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir // +1 because one field is reserved for the "- none -" entry
39*cdf0e10cSrcweir #define SC_MAXFIELDS	MAXCOLCOUNT+1
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir class ScViewData;
42*cdf0e10cSrcweir class ScDocument;
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir //========================================================================
45*cdf0e10cSrcweir // Gruppenseiten: Basisklasse
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir class ScTpSubTotalGroup : public SfxTabPage
48*cdf0e10cSrcweir {
49*cdf0e10cSrcweir protected:
50*cdf0e10cSrcweir 			ScTpSubTotalGroup( Window* pParent, sal_uInt16 nResId,
51*cdf0e10cSrcweir 							   const SfxItemSet& rArgSet );
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir public:
54*cdf0e10cSrcweir 	virtual ~ScTpSubTotalGroup();
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir 	static sal_uInt16*	GetRanges		();
57*cdf0e10cSrcweir 	sal_Bool			DoReset			( sal_uInt16			nGroupNo,
58*cdf0e10cSrcweir 									  const SfxItemSet&	rArgSet  );
59*cdf0e10cSrcweir 	sal_Bool			DoFillItemSet	( sal_uInt16		nGroupNo,
60*cdf0e10cSrcweir 									  SfxItemSet&	rArgSet  );
61*cdf0e10cSrcweir protected:
62*cdf0e10cSrcweir 	FixedText		aFtGroup;
63*cdf0e10cSrcweir 	ListBox			aLbGroup;
64*cdf0e10cSrcweir 	FixedText		aFtColumns;
65*cdf0e10cSrcweir 	SvxCheckListBox	aLbColumns;
66*cdf0e10cSrcweir 	FixedText		aFtFunctions;
67*cdf0e10cSrcweir 	ListBox			aLbFunctions;
68*cdf0e10cSrcweir 	const String	aStrNone;
69*cdf0e10cSrcweir 	const String	aStrColumn;
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir 	ScViewData*				pViewData;
72*cdf0e10cSrcweir 	ScDocument*				pDoc;
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir 	const sal_uInt16			nWhichSubTotals;
75*cdf0e10cSrcweir 	const ScSubTotalParam&	rSubTotalData;
76*cdf0e10cSrcweir 	SCCOL					nFieldArr[SC_MAXFIELDS];
77*cdf0e10cSrcweir 	const sal_uInt16			nFieldCount;
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir private:
80*cdf0e10cSrcweir 	void 			Init			();
81*cdf0e10cSrcweir 	void 			FillListBoxes	();
82*cdf0e10cSrcweir 	ScSubTotalFunc	LbPosToFunc		( sal_uInt16 nPos );
83*cdf0e10cSrcweir 	sal_uInt16			FuncToLbPos		( ScSubTotalFunc eFunc );
84*cdf0e10cSrcweir 	sal_uInt16			GetFieldSelPos	( SCCOL nField );
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 	// Handler ------------------------
87*cdf0e10cSrcweir 	DECL_LINK( SelectHdl, ListBox * );
88*cdf0e10cSrcweir 	DECL_LINK( CheckHdl, ListBox * );
89*cdf0e10cSrcweir };
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir //------------------------------------------------------------------------
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir class ScTpSubTotalGroup1 : public ScTpSubTotalGroup
94*cdf0e10cSrcweir {
95*cdf0e10cSrcweir protected:
96*cdf0e10cSrcweir 			ScTpSubTotalGroup1( Window*				 pParent,
97*cdf0e10cSrcweir 								const SfxItemSet&	 rArgSet );
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir public:
100*cdf0e10cSrcweir 	virtual ~ScTpSubTotalGroup1();
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir 	static	SfxTabPage*	Create		( Window*				pParent,
103*cdf0e10cSrcweir 									  const SfxItemSet& 	rArgSet );
104*cdf0e10cSrcweir 	virtual	sal_Bool		FillItemSet	( SfxItemSet& rArgSet );
105*cdf0e10cSrcweir 	virtual	void		Reset		( const SfxItemSet& rArgSet );
106*cdf0e10cSrcweir };
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir //------------------------------------------------------------------------
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir class ScTpSubTotalGroup2 : public ScTpSubTotalGroup
111*cdf0e10cSrcweir {
112*cdf0e10cSrcweir protected:
113*cdf0e10cSrcweir 			ScTpSubTotalGroup2( Window*				 pParent,
114*cdf0e10cSrcweir 								const SfxItemSet&	 rArgSet );
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir public:
117*cdf0e10cSrcweir 	virtual ~ScTpSubTotalGroup2();
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir 	static	SfxTabPage*	Create		( Window*				pParent,
120*cdf0e10cSrcweir 									  const SfxItemSet& 	rArgSet );
121*cdf0e10cSrcweir 	virtual	sal_Bool		FillItemSet	( SfxItemSet& rArgSet );
122*cdf0e10cSrcweir 	virtual	void		Reset		( const SfxItemSet& rArgSet );
123*cdf0e10cSrcweir };
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir //------------------------------------------------------------------------
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir class ScTpSubTotalGroup3 : public ScTpSubTotalGroup
128*cdf0e10cSrcweir {
129*cdf0e10cSrcweir protected:
130*cdf0e10cSrcweir 			ScTpSubTotalGroup3( Window*				 pParent,
131*cdf0e10cSrcweir 								const SfxItemSet&	 rArgSet );
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir public:
134*cdf0e10cSrcweir 	virtual ~ScTpSubTotalGroup3();
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir 	static	SfxTabPage*	Create		( Window*				pParent,
137*cdf0e10cSrcweir 									  const SfxItemSet& 	rArgSet );
138*cdf0e10cSrcweir 	virtual	sal_Bool		FillItemSet	( SfxItemSet& rArgSet );
139*cdf0e10cSrcweir 	virtual	void		Reset		( const SfxItemSet& rArgSet );
140*cdf0e10cSrcweir };
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir //========================================================================
143*cdf0e10cSrcweir // Optionen:
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir class ScTpSubTotalOptions : public SfxTabPage
146*cdf0e10cSrcweir {
147*cdf0e10cSrcweir protected:
148*cdf0e10cSrcweir 			ScTpSubTotalOptions( Window*			 pParent,
149*cdf0e10cSrcweir 								  const SfxItemSet&  rArgSet );
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir public:
152*cdf0e10cSrcweir 	virtual ~ScTpSubTotalOptions();
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir 	static sal_uInt16*		GetRanges	();
155*cdf0e10cSrcweir 	static SfxTabPage*	Create		( Window*				pParent,
156*cdf0e10cSrcweir 									  const SfxItemSet& 	rArgSet );
157*cdf0e10cSrcweir 	virtual	sal_Bool		FillItemSet	( SfxItemSet& rArgSet );
158*cdf0e10cSrcweir 	virtual	void		Reset		( const SfxItemSet& rArgSet );
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir private:
161*cdf0e10cSrcweir     FixedLine   aFlGroup;
162*cdf0e10cSrcweir 	CheckBox	aBtnPagebreak;
163*cdf0e10cSrcweir 	CheckBox	aBtnCase;
164*cdf0e10cSrcweir 	CheckBox	aBtnSort;
165*cdf0e10cSrcweir     FixedLine   aFlSort;
166*cdf0e10cSrcweir 	RadioButton	aBtnAscending;
167*cdf0e10cSrcweir 	RadioButton	aBtnDescending;
168*cdf0e10cSrcweir 	CheckBox	aBtnFormats;
169*cdf0e10cSrcweir 	CheckBox	aBtnUserDef;
170*cdf0e10cSrcweir 	ListBox		aLbUserDef;
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir 	ScViewData*				pViewData;
173*cdf0e10cSrcweir 	ScDocument*				pDoc;
174*cdf0e10cSrcweir 	const sal_uInt16			nWhichSubTotals;
175*cdf0e10cSrcweir 	const ScSubTotalParam&	rSubTotalData;
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir private:
178*cdf0e10cSrcweir 	void Init					();
179*cdf0e10cSrcweir 	void FillUserSortListBox	();
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir 	// Handler ------------------------
182*cdf0e10cSrcweir 	DECL_LINK( CheckHdl, CheckBox * );
183*cdf0e10cSrcweir };
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir #endif // SC_TPSORT_HXX
188*cdf0e10cSrcweir 
189