xref: /aoo41x/main/sc/source/ui/inc/tpsubt.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_TPSUBT_HXX
25 #define SC_TPSUBT_HXX
26 
27 #include <sfx2/tabdlg.hxx>
28 #include <svx/checklbx.hxx>
29 #include <vcl/fixed.hxx>
30 #include "global.hxx"
31 
32 //------------------------------------------------------------------------
33 
34 // +1 because one field is reserved for the "- none -" entry
35 #define SC_MAXFIELDS	MAXCOLCOUNT+1
36 
37 class ScViewData;
38 class ScDocument;
39 
40 //========================================================================
41 // Gruppenseiten: Basisklasse
42 
43 class ScTpSubTotalGroup : public SfxTabPage
44 {
45 protected:
46 			ScTpSubTotalGroup( Window* pParent, sal_uInt16 nResId,
47 							   const SfxItemSet& rArgSet );
48 
49 public:
50 	virtual ~ScTpSubTotalGroup();
51 
52 	static sal_uInt16*	GetRanges		();
53 	sal_Bool			DoReset			( sal_uInt16			nGroupNo,
54 									  const SfxItemSet&	rArgSet  );
55 	sal_Bool			DoFillItemSet	( sal_uInt16		nGroupNo,
56 									  SfxItemSet&	rArgSet  );
57 protected:
58 	FixedText		aFtGroup;
59 	ListBox			aLbGroup;
60 	FixedText		aFtColumns;
61 	SvxCheckListBox	aLbColumns;
62 	FixedText		aFtFunctions;
63 	ListBox			aLbFunctions;
64 	const String	aStrNone;
65 	const String	aStrColumn;
66 
67 	ScViewData*				pViewData;
68 	ScDocument*				pDoc;
69 
70 	const sal_uInt16			nWhichSubTotals;
71 	const ScSubTotalParam&	rSubTotalData;
72 	SCCOL					nFieldArr[SC_MAXFIELDS];
73 	const sal_uInt16			nFieldCount;
74 
75 private:
76 	void 			Init			();
77 	void 			FillListBoxes	();
78 	ScSubTotalFunc	LbPosToFunc		( sal_uInt16 nPos );
79 	sal_uInt16			FuncToLbPos		( ScSubTotalFunc eFunc );
80 	sal_uInt16			GetFieldSelPos	( SCCOL nField );
81 
82 	// Handler ------------------------
83 	DECL_LINK( SelectHdl, ListBox * );
84 	DECL_LINK( CheckHdl, ListBox * );
85 };
86 
87 //------------------------------------------------------------------------
88 
89 class ScTpSubTotalGroup1 : public ScTpSubTotalGroup
90 {
91 protected:
92 			ScTpSubTotalGroup1( Window*				 pParent,
93 								const SfxItemSet&	 rArgSet );
94 
95 public:
96 	virtual ~ScTpSubTotalGroup1();
97 
98 	static	SfxTabPage*	Create		( Window*				pParent,
99 									  const SfxItemSet& 	rArgSet );
100 	virtual	sal_Bool		FillItemSet	( SfxItemSet& rArgSet );
101 	virtual	void		Reset		( const SfxItemSet& rArgSet );
102 };
103 
104 //------------------------------------------------------------------------
105 
106 class ScTpSubTotalGroup2 : public ScTpSubTotalGroup
107 {
108 protected:
109 			ScTpSubTotalGroup2( Window*				 pParent,
110 								const SfxItemSet&	 rArgSet );
111 
112 public:
113 	virtual ~ScTpSubTotalGroup2();
114 
115 	static	SfxTabPage*	Create		( Window*				pParent,
116 									  const SfxItemSet& 	rArgSet );
117 	virtual	sal_Bool		FillItemSet	( SfxItemSet& rArgSet );
118 	virtual	void		Reset		( const SfxItemSet& rArgSet );
119 };
120 
121 //------------------------------------------------------------------------
122 
123 class ScTpSubTotalGroup3 : public ScTpSubTotalGroup
124 {
125 protected:
126 			ScTpSubTotalGroup3( Window*				 pParent,
127 								const SfxItemSet&	 rArgSet );
128 
129 public:
130 	virtual ~ScTpSubTotalGroup3();
131 
132 	static	SfxTabPage*	Create		( Window*				pParent,
133 									  const SfxItemSet& 	rArgSet );
134 	virtual	sal_Bool		FillItemSet	( SfxItemSet& rArgSet );
135 	virtual	void		Reset		( const SfxItemSet& rArgSet );
136 };
137 
138 //========================================================================
139 // Optionen:
140 
141 class ScTpSubTotalOptions : public SfxTabPage
142 {
143 protected:
144 			ScTpSubTotalOptions( Window*			 pParent,
145 								  const SfxItemSet&  rArgSet );
146 
147 public:
148 	virtual ~ScTpSubTotalOptions();
149 
150 	static sal_uInt16*		GetRanges	();
151 	static SfxTabPage*	Create		( Window*				pParent,
152 									  const SfxItemSet& 	rArgSet );
153 	virtual	sal_Bool		FillItemSet	( SfxItemSet& rArgSet );
154 	virtual	void		Reset		( const SfxItemSet& rArgSet );
155 
156 private:
157     FixedLine   aFlGroup;
158 	CheckBox	aBtnPagebreak;
159 	CheckBox	aBtnCase;
160 	CheckBox	aBtnSort;
161     FixedLine   aFlSort;
162 	RadioButton	aBtnAscending;
163 	RadioButton	aBtnDescending;
164 	CheckBox	aBtnFormats;
165 	CheckBox	aBtnUserDef;
166 	ListBox		aLbUserDef;
167 
168 	ScViewData*				pViewData;
169 	ScDocument*				pDoc;
170 	const sal_uInt16			nWhichSubTotals;
171 	const ScSubTotalParam&	rSubTotalData;
172 
173 private:
174 	void Init					();
175 	void FillUserSortListBox	();
176 
177 	// Handler ------------------------
178 	DECL_LINK( CheckHdl, CheckBox * );
179 };
180 
181 
182 
183 #endif // SC_TPSORT_HXX
184 
185