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: tpsubt.hxx,v $
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 ************************************************************************/
34 #include <sfx2/tabdlg.hxx>
35 #include <svx/checklbx.hxx>
36 #include <vcl/fixed.hxx>
39 //------------------------------------------------------------------------
41 // +1 because one field is reserved for the "- none -" entry
42 #define SC_MAXFIELDS MAXCOLCOUNT+1
47 //========================================================================
48 // Gruppenseiten: Basisklasse
50 class ScTpSubTotalGroup
: public SfxTabPage
53 ScTpSubTotalGroup( Window
* pParent
, USHORT nResId
,
54 const SfxItemSet
& rArgSet
);
57 virtual ~ScTpSubTotalGroup();
59 static USHORT
* GetRanges ();
60 BOOL
DoReset ( USHORT nGroupNo
,
61 const SfxItemSet
& rArgSet
);
62 BOOL
DoFillItemSet ( USHORT nGroupNo
,
63 SfxItemSet
& rArgSet
);
68 SvxCheckListBox aLbColumns
;
69 FixedText aFtFunctions
;
71 const String aStrNone
;
72 const String aStrColumn
;
74 ScViewData
* pViewData
;
77 const USHORT nWhichSubTotals
;
78 const ScSubTotalParam
& rSubTotalData
;
79 SCCOL nFieldArr
[SC_MAXFIELDS
];
80 const USHORT nFieldCount
;
84 void FillListBoxes ();
85 ScSubTotalFunc
LbPosToFunc ( USHORT nPos
);
86 USHORT
FuncToLbPos ( ScSubTotalFunc eFunc
);
87 USHORT
GetFieldSelPos ( SCCOL nField
);
89 // Handler ------------------------
90 DECL_LINK( SelectHdl
, ListBox
* );
91 DECL_LINK( CheckHdl
, ListBox
* );
94 //------------------------------------------------------------------------
96 class ScTpSubTotalGroup1
: public ScTpSubTotalGroup
99 ScTpSubTotalGroup1( Window
* pParent
,
100 const SfxItemSet
& rArgSet
);
103 virtual ~ScTpSubTotalGroup1();
105 static SfxTabPage
* Create ( Window
* pParent
,
106 const SfxItemSet
& rArgSet
);
107 virtual BOOL
FillItemSet ( SfxItemSet
& rArgSet
);
108 virtual void Reset ( const SfxItemSet
& rArgSet
);
111 //------------------------------------------------------------------------
113 class ScTpSubTotalGroup2
: public ScTpSubTotalGroup
116 ScTpSubTotalGroup2( Window
* pParent
,
117 const SfxItemSet
& rArgSet
);
120 virtual ~ScTpSubTotalGroup2();
122 static SfxTabPage
* Create ( Window
* pParent
,
123 const SfxItemSet
& rArgSet
);
124 virtual BOOL
FillItemSet ( SfxItemSet
& rArgSet
);
125 virtual void Reset ( const SfxItemSet
& rArgSet
);
128 //------------------------------------------------------------------------
130 class ScTpSubTotalGroup3
: public ScTpSubTotalGroup
133 ScTpSubTotalGroup3( Window
* pParent
,
134 const SfxItemSet
& rArgSet
);
137 virtual ~ScTpSubTotalGroup3();
139 static SfxTabPage
* Create ( Window
* pParent
,
140 const SfxItemSet
& rArgSet
);
141 virtual BOOL
FillItemSet ( SfxItemSet
& rArgSet
);
142 virtual void Reset ( const SfxItemSet
& rArgSet
);
145 //========================================================================
148 class ScTpSubTotalOptions
: public SfxTabPage
151 ScTpSubTotalOptions( Window
* pParent
,
152 const SfxItemSet
& rArgSet
);
155 virtual ~ScTpSubTotalOptions();
157 static USHORT
* GetRanges ();
158 static SfxTabPage
* Create ( Window
* pParent
,
159 const SfxItemSet
& rArgSet
);
160 virtual BOOL
FillItemSet ( SfxItemSet
& rArgSet
);
161 virtual void Reset ( const SfxItemSet
& rArgSet
);
165 CheckBox aBtnPagebreak
;
169 RadioButton aBtnAscending
;
170 RadioButton aBtnDescending
;
171 CheckBox aBtnFormats
;
172 CheckBox aBtnUserDef
;
175 ScViewData
* pViewData
;
177 const USHORT nWhichSubTotals
;
178 const ScSubTotalParam
& rSubTotalData
;
182 void FillUserSortListBox ();
184 // Handler ------------------------
185 DECL_LINK( CheckHdl
, CheckBox
* );
190 #endif // SC_TPSORT_HXX