update dev300-m58
[ooovba.git] / toolkit / workben / layout / tpsort.hxx
blob2b79bd0271fd5cb0316c8ec97701c3c3df65585d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tpsort.hxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_TPSORT_HXX
32 #define SC_TPSORT_HXX
35 #include <sfx2/tabdlg.hxx>
36 #include <vcl/edit.hxx>
37 #include <vcl/fixed.hxx>
38 #include <vcl/lstbox.hxx>
39 #include <svtools/stdctrl.hxx>
40 #include <svx/langbox.hxx>
43 #include "global.hxx"
44 #include "address.hxx"
46 //------------------------------------------------------------------------
48 // +1 because one field is reserved for the "- undefined -" entry
49 #define SC_MAXFIELDS MAXCOLCOUNT+1
51 class ScViewData;
52 class ScSortDlg;
53 struct ScSortParam;
55 //========================================================================
56 // Kriterien (Sort Criteria)
58 class ScTabPageSortFields : public SfxTabPage
60 public:
61 ScTabPageSortFields( Window* pParent,
62 const SfxItemSet& rArgSet );
63 ~ScTabPageSortFields();
65 static SfxTabPage* Create ( Window* pParent,
66 const SfxItemSet& rArgSet );
67 static USHORT* GetRanges ();
68 virtual BOOL FillItemSet ( SfxItemSet& rArgSet );
69 virtual void Reset ( const SfxItemSet& rArgSet );
71 protected:
72 // fuer Datenaustausch (sollte noch umgestellt werden!)
73 // virtual void ActivatePage ( const SfxItemSet& rSet );
74 using SfxTabPage::ActivatePage;
75 using SfxTabPage::DeactivatePage;
76 virtual void ActivatePage ();
77 virtual int DeactivatePage ( SfxItemSet* pSet = 0);
79 private:
80 FixedLine aFlSort1;
81 ListBox aLbSort1;
82 RadioButton aBtnUp1;
83 RadioButton aBtnDown1;
85 FixedLine aFlSort2;
86 ListBox aLbSort2;
87 RadioButton aBtnUp2;
88 RadioButton aBtnDown2;
90 FixedLine aFlSort3;
91 ListBox aLbSort3;
92 RadioButton aBtnUp3;
93 RadioButton aBtnDown3;
95 String aStrUndefined;
96 String aStrColumn;
97 String aStrRow;
99 const USHORT nWhichSort;
100 ScSortDlg* pDlg;
101 ScViewData* pViewData;
102 const ScSortParam& rSortData;
103 SCCOLROW nFieldArr[SC_MAXFIELDS];
104 USHORT nFieldCount;
105 SCCOL nFirstCol;
106 SCROW nFirstRow;
107 BOOL bHasHeader;
108 BOOL bSortByRows;
110 ListBox* aSortLbArr[3];
111 RadioButton* aDirBtnArr[3][2];
112 FixedLine* aFlArr[3];
114 #ifdef _TPSORT_CXX
115 private:
116 void Init ();
117 void DisableField ( USHORT nField );
118 void EnableField ( USHORT nField );
119 void FillFieldLists ();
120 USHORT GetFieldSelPos ( SCCOLROW nField );
122 // Handler ------------------------
123 DECL_LINK( SelectHdl, ListBox * );
124 #endif
127 //========================================================================
128 // Sortieroptionen (Sort Options)
130 class ScDocument;
131 class ScRangeData;
132 class CollatorRessource;
133 class CollatorWrapper;
135 #include <sfx2/layout.hxx>
136 #include <layout/layout-pre.hxx>
138 class ScTabPageSortOptions : public SfxTabPage
140 public:
141 ScTabPageSortOptions( Window* pParent,
142 const SfxItemSet& rArgSet );
143 ~ScTabPageSortOptions();
145 #undef SfxTabPage
146 #define SfxTabPage ::SfxTabPage
147 static SfxTabPage* Create ( Window* pParent,
148 const SfxItemSet& rArgSet );
149 static USHORT* GetRanges ();
150 virtual BOOL FillItemSet ( SfxItemSet& rArgSet );
151 virtual void Reset ( const SfxItemSet& rArgSet );
153 protected:
154 // fuer Datenaustausch (sollte noch umgestellt werden!)
155 // virtual void ActivatePage ( const SfxItemSet& rSet );
156 using SfxTabPage::ActivatePage;
157 using SfxTabPage::DeactivatePage;
158 virtual void ActivatePage ();
159 virtual int DeactivatePage ( SfxItemSet* pSet = 0);
161 private:
163 CheckBox aBtnCase;
164 CheckBox aBtnHeader;
165 CheckBox aBtnFormats;
166 CheckBox aBtnCopyResult;
168 CheckBox aBtnNaturalSort;
169 ListBox aLbOutPos;
170 Edit aEdOutPos;
172 CheckBox aBtnSortUser;
173 ListBox aLbSortUser;
175 FixedText aFtLanguage;
176 SvxLanguageBox aLbLanguage;
177 FixedText aFtAlgorithm;
178 ListBox aLbAlgorithm;
180 FixedLine aLineDirection;
181 RadioButton aBtnTopDown;
182 RadioButton aBtnLeftRight;
184 // FixedText aFtAreaLabel;
185 // FixedInfo aFtArea;
186 LocalizedString aStrRowLabel;
187 LocalizedString aStrColLabel;
188 LocalizedString aStrUndefined;
189 String aStrNoName;
190 String aStrAreaLabel;
192 const USHORT nWhichSort;
193 const ScSortParam& rSortData;
194 ScViewData* pViewData;
195 ScDocument* pDoc;
196 ScSortDlg* pDlg;
197 ScAddress theOutPos;
199 CollatorRessource* pColRes;
200 CollatorWrapper* pColWrap;
202 #ifdef _TPSORT_CXX
203 private:
204 void Init ();
205 void FillUserSortListBox ();
206 void FillOutPosList ();
208 // Handler ------------------------
209 DECL_LINK( EnableHdl, CheckBox * );
210 DECL_LINK( SelOutPosHdl, ListBox * );
211 void EdOutPosModHdl ( Edit* pEd );
212 DECL_LINK( SortDirHdl, RadioButton * );
213 DECL_LINK( FillAlgorHdl, void * );
214 #endif
217 #include <layout/layout-post.hxx>
219 #endif // SC_TPSORT_HXX