xref: /AOO41X/main/sc/source/ui/inc/tpsubt.hxx (revision 38d50f7b14e1cf975d8c6468d9633894cd59b523)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_TPSUBT_HXX
25cdf0e10cSrcweir #define SC_TPSUBT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
28cdf0e10cSrcweir #include <svx/checklbx.hxx>
29cdf0e10cSrcweir #include <vcl/fixed.hxx>
30cdf0e10cSrcweir #include "global.hxx"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir //------------------------------------------------------------------------
33cdf0e10cSrcweir 
34cdf0e10cSrcweir // +1 because one field is reserved for the "- none -" entry
35cdf0e10cSrcweir #define SC_MAXFIELDS    MAXCOLCOUNT+1
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class ScViewData;
38cdf0e10cSrcweir class ScDocument;
39cdf0e10cSrcweir 
40cdf0e10cSrcweir //========================================================================
41cdf0e10cSrcweir // Gruppenseiten: Basisklasse
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class ScTpSubTotalGroup : public SfxTabPage
44cdf0e10cSrcweir {
45cdf0e10cSrcweir protected:
46cdf0e10cSrcweir             ScTpSubTotalGroup( Window* pParent, sal_uInt16 nResId,
47cdf0e10cSrcweir                                const SfxItemSet& rArgSet );
48cdf0e10cSrcweir 
49cdf0e10cSrcweir public:
50cdf0e10cSrcweir     virtual ~ScTpSubTotalGroup();
51cdf0e10cSrcweir 
52cdf0e10cSrcweir     static sal_uInt16*  GetRanges       ();
53cdf0e10cSrcweir     sal_Bool            DoReset         ( sal_uInt16            nGroupNo,
54cdf0e10cSrcweir                                       const SfxItemSet& rArgSet  );
55cdf0e10cSrcweir     sal_Bool            DoFillItemSet   ( sal_uInt16        nGroupNo,
56cdf0e10cSrcweir                                       SfxItemSet&   rArgSet  );
57cdf0e10cSrcweir protected:
58cdf0e10cSrcweir     FixedText       aFtGroup;
59cdf0e10cSrcweir     ListBox         aLbGroup;
60cdf0e10cSrcweir     FixedText       aFtColumns;
61cdf0e10cSrcweir     SvxCheckListBox aLbColumns;
62cdf0e10cSrcweir     FixedText       aFtFunctions;
63cdf0e10cSrcweir     ListBox         aLbFunctions;
64cdf0e10cSrcweir     const String    aStrNone;
65cdf0e10cSrcweir     const String    aStrColumn;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     ScViewData*             pViewData;
68cdf0e10cSrcweir     ScDocument*             pDoc;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir     const sal_uInt16            nWhichSubTotals;
71cdf0e10cSrcweir     const ScSubTotalParam&  rSubTotalData;
72cdf0e10cSrcweir     SCCOL                   nFieldArr[SC_MAXFIELDS];
73cdf0e10cSrcweir     const sal_uInt16            nFieldCount;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir private:
76cdf0e10cSrcweir     void            Init            ();
77cdf0e10cSrcweir     void            FillListBoxes   ();
78cdf0e10cSrcweir     ScSubTotalFunc  LbPosToFunc     ( sal_uInt16 nPos );
79cdf0e10cSrcweir     sal_uInt16          FuncToLbPos     ( ScSubTotalFunc eFunc );
80cdf0e10cSrcweir     sal_uInt16          GetFieldSelPos  ( SCCOL nField );
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     // Handler ------------------------
83cdf0e10cSrcweir     DECL_LINK( SelectHdl, ListBox * );
84cdf0e10cSrcweir     DECL_LINK( CheckHdl, ListBox * );
85cdf0e10cSrcweir };
86cdf0e10cSrcweir 
87cdf0e10cSrcweir //------------------------------------------------------------------------
88cdf0e10cSrcweir 
89cdf0e10cSrcweir class ScTpSubTotalGroup1 : public ScTpSubTotalGroup
90cdf0e10cSrcweir {
91cdf0e10cSrcweir protected:
92cdf0e10cSrcweir             ScTpSubTotalGroup1( Window*              pParent,
93cdf0e10cSrcweir                                 const SfxItemSet&    rArgSet );
94cdf0e10cSrcweir 
95cdf0e10cSrcweir public:
96cdf0e10cSrcweir     virtual ~ScTpSubTotalGroup1();
97cdf0e10cSrcweir 
98cdf0e10cSrcweir     static  SfxTabPage* Create      ( Window*               pParent,
99cdf0e10cSrcweir                                       const SfxItemSet&     rArgSet );
100cdf0e10cSrcweir     virtual sal_Bool        FillItemSet ( SfxItemSet& rArgSet );
101cdf0e10cSrcweir     virtual void        Reset       ( const SfxItemSet& rArgSet );
102cdf0e10cSrcweir };
103cdf0e10cSrcweir 
104cdf0e10cSrcweir //------------------------------------------------------------------------
105cdf0e10cSrcweir 
106cdf0e10cSrcweir class ScTpSubTotalGroup2 : public ScTpSubTotalGroup
107cdf0e10cSrcweir {
108cdf0e10cSrcweir protected:
109cdf0e10cSrcweir             ScTpSubTotalGroup2( Window*              pParent,
110cdf0e10cSrcweir                                 const SfxItemSet&    rArgSet );
111cdf0e10cSrcweir 
112cdf0e10cSrcweir public:
113cdf0e10cSrcweir     virtual ~ScTpSubTotalGroup2();
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     static  SfxTabPage* Create      ( Window*               pParent,
116cdf0e10cSrcweir                                       const SfxItemSet&     rArgSet );
117cdf0e10cSrcweir     virtual sal_Bool        FillItemSet ( SfxItemSet& rArgSet );
118cdf0e10cSrcweir     virtual void        Reset       ( const SfxItemSet& rArgSet );
119cdf0e10cSrcweir };
120cdf0e10cSrcweir 
121cdf0e10cSrcweir //------------------------------------------------------------------------
122cdf0e10cSrcweir 
123cdf0e10cSrcweir class ScTpSubTotalGroup3 : public ScTpSubTotalGroup
124cdf0e10cSrcweir {
125cdf0e10cSrcweir protected:
126cdf0e10cSrcweir             ScTpSubTotalGroup3( Window*              pParent,
127cdf0e10cSrcweir                                 const SfxItemSet&    rArgSet );
128cdf0e10cSrcweir 
129cdf0e10cSrcweir public:
130cdf0e10cSrcweir     virtual ~ScTpSubTotalGroup3();
131cdf0e10cSrcweir 
132cdf0e10cSrcweir     static  SfxTabPage* Create      ( Window*               pParent,
133cdf0e10cSrcweir                                       const SfxItemSet&     rArgSet );
134cdf0e10cSrcweir     virtual sal_Bool        FillItemSet ( SfxItemSet& rArgSet );
135cdf0e10cSrcweir     virtual void        Reset       ( const SfxItemSet& rArgSet );
136cdf0e10cSrcweir };
137cdf0e10cSrcweir 
138cdf0e10cSrcweir //========================================================================
139cdf0e10cSrcweir // Optionen:
140cdf0e10cSrcweir 
141cdf0e10cSrcweir class ScTpSubTotalOptions : public SfxTabPage
142cdf0e10cSrcweir {
143cdf0e10cSrcweir protected:
144cdf0e10cSrcweir             ScTpSubTotalOptions( Window*             pParent,
145cdf0e10cSrcweir                                   const SfxItemSet&  rArgSet );
146cdf0e10cSrcweir 
147cdf0e10cSrcweir public:
148cdf0e10cSrcweir     virtual ~ScTpSubTotalOptions();
149cdf0e10cSrcweir 
150cdf0e10cSrcweir     static sal_uInt16*      GetRanges   ();
151cdf0e10cSrcweir     static SfxTabPage*  Create      ( Window*               pParent,
152cdf0e10cSrcweir                                       const SfxItemSet&     rArgSet );
153cdf0e10cSrcweir     virtual sal_Bool        FillItemSet ( SfxItemSet& rArgSet );
154cdf0e10cSrcweir     virtual void        Reset       ( const SfxItemSet& rArgSet );
155cdf0e10cSrcweir 
156cdf0e10cSrcweir private:
157cdf0e10cSrcweir     FixedLine   aFlGroup;
158cdf0e10cSrcweir     CheckBox    aBtnPagebreak;
159cdf0e10cSrcweir     CheckBox    aBtnCase;
160cdf0e10cSrcweir     CheckBox    aBtnSort;
161cdf0e10cSrcweir     FixedLine   aFlSort;
162cdf0e10cSrcweir     RadioButton aBtnAscending;
163cdf0e10cSrcweir     RadioButton aBtnDescending;
164cdf0e10cSrcweir     CheckBox    aBtnFormats;
165cdf0e10cSrcweir     CheckBox    aBtnUserDef;
166cdf0e10cSrcweir     ListBox     aLbUserDef;
167cdf0e10cSrcweir 
168cdf0e10cSrcweir     ScViewData*             pViewData;
169cdf0e10cSrcweir     ScDocument*             pDoc;
170cdf0e10cSrcweir     const sal_uInt16            nWhichSubTotals;
171cdf0e10cSrcweir     const ScSubTotalParam&  rSubTotalData;
172cdf0e10cSrcweir 
173cdf0e10cSrcweir private:
174cdf0e10cSrcweir     void Init                   ();
175cdf0e10cSrcweir     void FillUserSortListBox    ();
176cdf0e10cSrcweir 
177cdf0e10cSrcweir     // Handler ------------------------
178cdf0e10cSrcweir     DECL_LINK( CheckHdl, CheckBox * );
179cdf0e10cSrcweir };
180cdf0e10cSrcweir 
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 
183cdf0e10cSrcweir #endif // SC_TPSORT_HXX
184cdf0e10cSrcweir 
185