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 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_TPSUBT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_TPSUBT_HXX
23 #include <sfx2/tabdlg.hxx>
24 #include <svx/checklbx.hxx>
25 #include <vcl/fixed.hxx>
26 #include <vcl/lstbox.hxx>
29 // +1 because one field is reserved for the "- none -" entry
30 #define SC_MAXFIELDS MAXCOLCOUNT+1
34 struct ScSubTotalParam
;
36 class ScTpSubTotalGroup
: public SfxTabPage
39 ScTpSubTotalGroup( vcl::Window
* pParent
,
40 const SfxItemSet
& rArgSet
);
43 virtual ~ScTpSubTotalGroup();
44 virtual void dispose() SAL_OVERRIDE
;
46 bool DoReset ( sal_uInt16 nGroupNo
,
47 const SfxItemSet
& rArgSet
);
48 bool DoFillItemSet ( sal_uInt16 nGroupNo
,
49 SfxItemSet
& rArgSet
);
51 VclPtr
<ListBox
> mpLbGroup
;
52 VclPtr
<SvxCheckListBox
> mpLbColumns
;
53 VclPtr
<ListBox
> mpLbFunctions
;
54 const OUString aStrNone
;
55 const OUString aStrColumn
;
57 ScViewData
* pViewData
;
60 const sal_uInt16 nWhichSubTotals
;
61 const ScSubTotalParam
& rSubTotalData
;
62 SCCOL nFieldArr
[SC_MAXFIELDS
];
63 const sal_uInt16 nFieldCount
;
67 void FillListBoxes ();
68 static ScSubTotalFunc
LbPosToFunc ( sal_uInt16 nPos
);
69 static sal_uInt16
FuncToLbPos ( ScSubTotalFunc eFunc
);
70 sal_uInt16
GetFieldSelPos ( SCCOL nField
);
72 // Handler ------------------------
73 DECL_LINK( SelectHdl
, void * );
74 DECL_LINK( CheckHdl
, void * );
77 class ScTpSubTotalGroup1
: public ScTpSubTotalGroup
79 friend class VclPtr
<ScTpSubTotalGroup1
>;
81 ScTpSubTotalGroup1( vcl::Window
* pParent
,
82 const SfxItemSet
& rArgSet
);
85 virtual ~ScTpSubTotalGroup1();
87 static VclPtr
<SfxTabPage
> Create ( vcl::Window
* pParent
,
88 const SfxItemSet
* rArgSet
);
89 virtual bool FillItemSet ( SfxItemSet
* rArgSet
) SAL_OVERRIDE
;
90 virtual void Reset ( const SfxItemSet
* rArgSet
) SAL_OVERRIDE
;
93 class ScTpSubTotalGroup2
: public ScTpSubTotalGroup
95 friend class VclPtr
<ScTpSubTotalGroup2
>;
97 ScTpSubTotalGroup2( vcl::Window
* pParent
,
98 const SfxItemSet
& rArgSet
);
101 virtual ~ScTpSubTotalGroup2();
103 static VclPtr
<SfxTabPage
> Create ( vcl::Window
* pParent
,
104 const SfxItemSet
* rArgSet
);
105 virtual bool FillItemSet ( SfxItemSet
* rArgSet
) SAL_OVERRIDE
;
106 virtual void Reset ( const SfxItemSet
* rArgSet
) SAL_OVERRIDE
;
109 class ScTpSubTotalGroup3
: public ScTpSubTotalGroup
111 friend class VclPtr
<ScTpSubTotalGroup3
>;
113 ScTpSubTotalGroup3( vcl::Window
* pParent
,
114 const SfxItemSet
& rArgSet
);
117 virtual ~ScTpSubTotalGroup3();
119 static VclPtr
<SfxTabPage
> Create ( vcl::Window
* pParent
,
120 const SfxItemSet
* rArgSet
);
121 virtual bool FillItemSet ( SfxItemSet
* rArgSet
) SAL_OVERRIDE
;
122 virtual void Reset ( const SfxItemSet
* rArgSet
) SAL_OVERRIDE
;
125 class ScTpSubTotalOptions
: public SfxTabPage
127 friend class VclPtr
<ScTpSubTotalOptions
>;
129 ScTpSubTotalOptions( vcl::Window
* pParent
,
130 const SfxItemSet
& rArgSet
);
133 virtual ~ScTpSubTotalOptions();
134 virtual void dispose() SAL_OVERRIDE
;
135 static VclPtr
<SfxTabPage
> Create ( vcl::Window
* pParent
,
136 const SfxItemSet
* rArgSet
);
137 virtual bool FillItemSet ( SfxItemSet
* rArgSet
) SAL_OVERRIDE
;
138 virtual void Reset ( const SfxItemSet
* rArgSet
) SAL_OVERRIDE
;
141 VclPtr
<CheckBox
> pBtnPagebreak
;
142 VclPtr
<CheckBox
> pBtnCase
;
143 VclPtr
<CheckBox
> pBtnSort
;
144 VclPtr
<FixedText
> pFlSort
;
145 VclPtr
<RadioButton
> pBtnAscending
;
146 VclPtr
<RadioButton
> pBtnDescending
;
147 VclPtr
<CheckBox
> pBtnFormats
;
148 VclPtr
<CheckBox
> pBtnUserDef
;
149 VclPtr
<ListBox
> pLbUserDef
;
151 ScViewData
* pViewData
;
153 const sal_uInt16 nWhichSubTotals
;
154 const ScSubTotalParam
& rSubTotalData
;
158 void FillUserSortListBox ();
160 // Handler ------------------------
161 DECL_LINK( CheckHdl
, CheckBox
* );
164 #endif // INCLUDED_SC_SOURCE_UI_INC_TPSUBT_HXX
166 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */