Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / tpsubt.hxx
blob4b6b1f2922032bc93a09f3f0b7fcfa0b236d51a2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 SC_TPSUBT_HXX
21 #define SC_TPSUBT_HXX
23 #include <sfx2/tabdlg.hxx>
24 #include <svx/checklbx.hxx>
25 #include <vcl/fixed.hxx>
26 #include "global.hxx"
28 //------------------------------------------------------------------------
30 // +1 because one field is reserved for the "- none -" entry
31 #define SC_MAXFIELDS MAXCOLCOUNT+1
33 class ScViewData;
34 class ScDocument;
35 struct ScSubTotalParam;
37 //========================================================================
39 class ScTpSubTotalGroup : public SfxTabPage
41 protected:
42 ScTpSubTotalGroup( Window* pParent, sal_uInt16 nResId,
43 const SfxItemSet& rArgSet );
45 public:
46 virtual ~ScTpSubTotalGroup();
48 bool DoReset ( sal_uInt16 nGroupNo,
49 const SfxItemSet& rArgSet );
50 bool DoFillItemSet ( sal_uInt16 nGroupNo,
51 SfxItemSet& rArgSet );
52 protected:
53 FixedText aFtGroup;
54 ListBox aLbGroup;
55 FixedText aFtColumns;
56 SvxCheckListBox aLbColumns;
57 FixedText aFtFunctions;
58 ListBox aLbFunctions;
59 const OUString aStrNone;
60 const OUString aStrColumn;
62 ScViewData* pViewData;
63 ScDocument* pDoc;
65 const sal_uInt16 nWhichSubTotals;
66 const ScSubTotalParam& rSubTotalData;
67 SCCOL nFieldArr[SC_MAXFIELDS];
68 const sal_uInt16 nFieldCount;
70 private:
71 void Init ();
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
86 protected:
87 ScTpSubTotalGroup1( Window* pParent,
88 const SfxItemSet& rArgSet );
90 public:
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
103 protected:
104 ScTpSubTotalGroup2( Window* pParent,
105 const SfxItemSet& rArgSet );
107 public:
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
120 protected:
121 ScTpSubTotalGroup3( Window* pParent,
122 const SfxItemSet& rArgSet );
124 public:
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
137 protected:
138 ScTpSubTotalOptions( Window* pParent,
139 const SfxItemSet& rArgSet );
141 public:
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 );
149 private:
150 CheckBox* pBtnPagebreak;
151 CheckBox* pBtnCase;
152 CheckBox* pBtnSort;
153 FixedText* pFlSort;
154 RadioButton* pBtnAscending;
155 RadioButton* pBtnDescending;
156 CheckBox* pBtnFormats;
157 CheckBox* pBtnUserDef;
158 ListBox* pLbUserDef;
160 ScViewData* pViewData;
161 ScDocument* pDoc;
162 const sal_uInt16 nWhichSubTotals;
163 const ScSubTotalParam& rSubTotalData;
165 private:
166 void Init ();
167 void FillUserSortListBox ();
169 // Handler ------------------------
170 DECL_LINK( CheckHdl, CheckBox * );
175 #endif // SC_TPSORT_HXX
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */