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() 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_TYPED( SelectListBoxHdl
, ListBox
&, void );
74 DECL_LINK_TYPED( SelectTreeListBoxHdl
, SvTreeListBox
*, void );
75 DECL_LINK_TYPED( CheckHdl
, SvTreeListBox
*, void );
76 void SelectHdl(void *);
79 class ScTpSubTotalGroup1
: public ScTpSubTotalGroup
81 friend class VclPtr
<ScTpSubTotalGroup1
>;
83 ScTpSubTotalGroup1( vcl::Window
* pParent
,
84 const SfxItemSet
& rArgSet
);
87 virtual ~ScTpSubTotalGroup1();
89 static VclPtr
<SfxTabPage
> Create ( vcl::Window
* pParent
,
90 const SfxItemSet
* rArgSet
);
91 virtual bool FillItemSet ( SfxItemSet
* rArgSet
) override
;
92 virtual void Reset ( const SfxItemSet
* rArgSet
) override
;
95 class ScTpSubTotalGroup2
: public ScTpSubTotalGroup
97 friend class VclPtr
<ScTpSubTotalGroup2
>;
99 ScTpSubTotalGroup2( vcl::Window
* pParent
,
100 const SfxItemSet
& rArgSet
);
103 virtual ~ScTpSubTotalGroup2();
105 static VclPtr
<SfxTabPage
> Create ( vcl::Window
* pParent
,
106 const SfxItemSet
* rArgSet
);
107 virtual bool FillItemSet ( SfxItemSet
* rArgSet
) override
;
108 virtual void Reset ( const SfxItemSet
* rArgSet
) override
;
111 class ScTpSubTotalGroup3
: public ScTpSubTotalGroup
113 friend class VclPtr
<ScTpSubTotalGroup3
>;
115 ScTpSubTotalGroup3( vcl::Window
* pParent
,
116 const SfxItemSet
& rArgSet
);
119 virtual ~ScTpSubTotalGroup3();
121 static VclPtr
<SfxTabPage
> Create ( vcl::Window
* pParent
,
122 const SfxItemSet
* rArgSet
);
123 virtual bool FillItemSet ( SfxItemSet
* rArgSet
) override
;
124 virtual void Reset ( const SfxItemSet
* rArgSet
) override
;
127 class ScTpSubTotalOptions
: public SfxTabPage
129 friend class VclPtr
<ScTpSubTotalOptions
>;
131 ScTpSubTotalOptions( vcl::Window
* pParent
,
132 const SfxItemSet
& rArgSet
);
135 virtual ~ScTpSubTotalOptions();
136 virtual void dispose() override
;
137 static VclPtr
<SfxTabPage
> Create ( vcl::Window
* pParent
,
138 const SfxItemSet
* rArgSet
);
139 virtual bool FillItemSet ( SfxItemSet
* rArgSet
) override
;
140 virtual void Reset ( const SfxItemSet
* rArgSet
) override
;
143 VclPtr
<CheckBox
> pBtnPagebreak
;
144 VclPtr
<CheckBox
> pBtnCase
;
145 VclPtr
<CheckBox
> pBtnSort
;
146 VclPtr
<FixedText
> pFlSort
;
147 VclPtr
<RadioButton
> pBtnAscending
;
148 VclPtr
<RadioButton
> pBtnDescending
;
149 VclPtr
<CheckBox
> pBtnFormats
;
150 VclPtr
<CheckBox
> pBtnUserDef
;
151 VclPtr
<ListBox
> pLbUserDef
;
153 ScViewData
* pViewData
;
155 const sal_uInt16 nWhichSubTotals
;
156 const ScSubTotalParam
& rSubTotalData
;
160 void FillUserSortListBox ();
162 // Handler ------------------------
163 DECL_LINK_TYPED( CheckHdl
, Button
*, void );
166 #endif // INCLUDED_SC_SOURCE_UI_INC_TPSUBT_HXX
168 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */