1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <sfx2/tabdlg.hxx>
24 #include <svx/checklbx.hxx>
25 #include <vcl/fixed.hxx>
28 //------------------------------------------------------------------------
30 // +1 because one field is reserved for the "- none -" entry
31 #define SC_MAXFIELDS MAXCOLCOUNT+1
35 struct ScSubTotalParam
;
37 //========================================================================
39 class ScTpSubTotalGroup
: public SfxTabPage
42 ScTpSubTotalGroup( Window
* pParent
, sal_uInt16 nResId
,
43 const SfxItemSet
& rArgSet
);
46 virtual ~ScTpSubTotalGroup();
48 bool DoReset ( sal_uInt16 nGroupNo
,
49 const SfxItemSet
& rArgSet
);
50 bool DoFillItemSet ( sal_uInt16 nGroupNo
,
51 SfxItemSet
& rArgSet
);
56 SvxCheckListBox aLbColumns
;
57 FixedText aFtFunctions
;
59 const OUString aStrNone
;
60 const OUString aStrColumn
;
62 ScViewData
* pViewData
;
65 const sal_uInt16 nWhichSubTotals
;
66 const ScSubTotalParam
& rSubTotalData
;
67 SCCOL nFieldArr
[SC_MAXFIELDS
];
68 const sal_uInt16 nFieldCount
;
72 void FillListBoxes ();
73 ScSubTotalFunc
LbPosToFunc ( sal_uInt16 nPos
);
74 sal_uInt16
FuncToLbPos ( ScSubTotalFunc eFunc
);
75 sal_uInt16
GetFieldSelPos ( SCCOL nField
);
77 // Handler ------------------------
78 DECL_LINK( SelectHdl
, ListBox
* );
79 DECL_LINK( CheckHdl
, ListBox
* );
82 //------------------------------------------------------------------------
84 class ScTpSubTotalGroup1
: public ScTpSubTotalGroup
87 ScTpSubTotalGroup1( Window
* pParent
,
88 const SfxItemSet
& rArgSet
);
91 virtual ~ScTpSubTotalGroup1();
93 static SfxTabPage
* Create ( Window
* pParent
,
94 const SfxItemSet
& rArgSet
);
95 virtual sal_Bool
FillItemSet ( SfxItemSet
& rArgSet
);
96 virtual void Reset ( const SfxItemSet
& rArgSet
);
99 //------------------------------------------------------------------------
101 class ScTpSubTotalGroup2
: public ScTpSubTotalGroup
104 ScTpSubTotalGroup2( Window
* pParent
,
105 const SfxItemSet
& rArgSet
);
108 virtual ~ScTpSubTotalGroup2();
110 static SfxTabPage
* Create ( Window
* pParent
,
111 const SfxItemSet
& rArgSet
);
112 virtual sal_Bool
FillItemSet ( SfxItemSet
& rArgSet
);
113 virtual void Reset ( const SfxItemSet
& rArgSet
);
116 //------------------------------------------------------------------------
118 class ScTpSubTotalGroup3
: public ScTpSubTotalGroup
121 ScTpSubTotalGroup3( Window
* pParent
,
122 const SfxItemSet
& rArgSet
);
125 virtual ~ScTpSubTotalGroup3();
127 static SfxTabPage
* Create ( Window
* pParent
,
128 const SfxItemSet
& rArgSet
);
129 virtual sal_Bool
FillItemSet ( SfxItemSet
& rArgSet
);
130 virtual void Reset ( const SfxItemSet
& rArgSet
);
133 //========================================================================
135 class ScTpSubTotalOptions
: public SfxTabPage
138 ScTpSubTotalOptions( Window
* pParent
,
139 const SfxItemSet
& rArgSet
);
142 virtual ~ScTpSubTotalOptions();
144 static SfxTabPage
* Create ( Window
* pParent
,
145 const SfxItemSet
& rArgSet
);
146 virtual sal_Bool
FillItemSet ( SfxItemSet
& rArgSet
);
147 virtual void Reset ( const SfxItemSet
& rArgSet
);
150 CheckBox
* pBtnPagebreak
;
154 RadioButton
* pBtnAscending
;
155 RadioButton
* pBtnDescending
;
156 CheckBox
* pBtnFormats
;
157 CheckBox
* pBtnUserDef
;
160 ScViewData
* pViewData
;
162 const sal_uInt16 nWhichSubTotals
;
163 const ScSubTotalParam
& rSubTotalData
;
167 void FillUserSortListBox ();
169 // Handler ------------------------
170 DECL_LINK( CheckHdl
, CheckBox
* );
175 #endif // SC_TPSORT_HXX
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */