merge the formfield patch from ooo-build
[ooovba.git] / sc / source / ui / inc / tpsubt.hxx
bloba94807335131ea571e9e6ef4adf7305324346480
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tpsubt.hxx,v $
10 * $Revision: 1.7 $
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 ************************************************************************/
31 #ifndef SC_TPSUBT_HXX
32 #define SC_TPSUBT_HXX
34 #include <sfx2/tabdlg.hxx>
35 #include <svx/checklbx.hxx>
36 #include <vcl/fixed.hxx>
37 #include "global.hxx"
39 //------------------------------------------------------------------------
41 // +1 because one field is reserved for the "- none -" entry
42 #define SC_MAXFIELDS MAXCOLCOUNT+1
44 class ScViewData;
45 class ScDocument;
47 //========================================================================
48 // Gruppenseiten: Basisklasse
50 class ScTpSubTotalGroup : public SfxTabPage
52 protected:
53 ScTpSubTotalGroup( Window* pParent, USHORT nResId,
54 const SfxItemSet& rArgSet );
56 public:
57 virtual ~ScTpSubTotalGroup();
59 static USHORT* GetRanges ();
60 BOOL DoReset ( USHORT nGroupNo,
61 const SfxItemSet& rArgSet );
62 BOOL DoFillItemSet ( USHORT nGroupNo,
63 SfxItemSet& rArgSet );
64 protected:
65 FixedText aFtGroup;
66 ListBox aLbGroup;
67 FixedText aFtColumns;
68 SvxCheckListBox aLbColumns;
69 FixedText aFtFunctions;
70 ListBox aLbFunctions;
71 const String aStrNone;
72 const String aStrColumn;
74 ScViewData* pViewData;
75 ScDocument* pDoc;
77 const USHORT nWhichSubTotals;
78 const ScSubTotalParam& rSubTotalData;
79 SCCOL nFieldArr[SC_MAXFIELDS];
80 const USHORT nFieldCount;
82 private:
83 void Init ();
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
98 protected:
99 ScTpSubTotalGroup1( Window* pParent,
100 const SfxItemSet& rArgSet );
102 public:
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
115 protected:
116 ScTpSubTotalGroup2( Window* pParent,
117 const SfxItemSet& rArgSet );
119 public:
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
132 protected:
133 ScTpSubTotalGroup3( Window* pParent,
134 const SfxItemSet& rArgSet );
136 public:
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 //========================================================================
146 // Optionen:
148 class ScTpSubTotalOptions : public SfxTabPage
150 protected:
151 ScTpSubTotalOptions( Window* pParent,
152 const SfxItemSet& rArgSet );
154 public:
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 );
163 private:
164 FixedLine aFlGroup;
165 CheckBox aBtnPagebreak;
166 CheckBox aBtnCase;
167 CheckBox aBtnSort;
168 FixedLine aFlSort;
169 RadioButton aBtnAscending;
170 RadioButton aBtnDescending;
171 CheckBox aBtnFormats;
172 CheckBox aBtnUserDef;
173 ListBox aLbUserDef;
175 ScViewData* pViewData;
176 ScDocument* pDoc;
177 const USHORT nWhichSubTotals;
178 const ScSubTotalParam& rSubTotalData;
180 private:
181 void Init ();
182 void FillUserSortListBox ();
184 // Handler ------------------------
185 DECL_LINK( CheckHdl, CheckBox * );
190 #endif // SC_TPSORT_HXX