update dev300-m58
[ooovba.git] / sc / source / ui / inc / tpsort.hxx
blob89573fa0f5c6223c6ef94a8fe328df7790795fde
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 #if ENABLE_LAYOUT_EXPERIMENTAL
136 #include <sfx2/layout.hxx>
137 #include <layout/layout-pre.hxx>
138 #else /* !ENABLE_LAYOUT_EXPERIMENTAL */
139 #define LocalizedString String
140 #endif /* !ENABLE_LAYOUT_EXPERIMENTAL */
142 class ScTabPageSortOptions : public SfxTabPage
144 public:
145 ScTabPageSortOptions( Window* pParent,
146 const SfxItemSet& rArgSet );
147 ~ScTabPageSortOptions();
149 #undef SfxTabPage
150 #define SfxTabPage ::SfxTabPage
151 static SfxTabPage* Create ( Window* pParent,
152 const SfxItemSet& rArgSet );
153 static USHORT* GetRanges ();
154 virtual BOOL FillItemSet ( SfxItemSet& rArgSet );
155 virtual void Reset ( const SfxItemSet& rArgSet );
157 protected:
158 // fuer Datenaustausch (sollte noch umgestellt werden!)
159 // virtual void ActivatePage ( const SfxItemSet& rSet );
160 using SfxTabPage::ActivatePage;
161 using SfxTabPage::DeactivatePage;
162 virtual void ActivatePage ();
163 virtual int DeactivatePage ( SfxItemSet* pSet = 0);
165 private:
167 CheckBox aBtnCase;
168 CheckBox aBtnHeader;
169 CheckBox aBtnFormats;
170 CheckBox aBtnNaturalSort;
172 CheckBox aBtnCopyResult;
173 ListBox aLbOutPos;
174 Edit aEdOutPos;
176 CheckBox aBtnSortUser;
177 ListBox aLbSortUser;
179 FixedText aFtLanguage;
180 SvxLanguageBox aLbLanguage;
181 FixedText aFtAlgorithm;
182 ListBox aLbAlgorithm;
184 FixedLine aLineDirection;
185 RadioButton aBtnTopDown;
186 RadioButton aBtnLeftRight;
188 // FixedText aFtAreaLabel;
189 // FixedInfo aFtArea;
190 LocalizedString aStrRowLabel;
191 LocalizedString aStrColLabel;
192 LocalizedString aStrUndefined;
193 String aStrNoName;
194 String aStrAreaLabel;
196 const USHORT nWhichSort;
197 const ScSortParam& rSortData;
198 ScViewData* pViewData;
199 ScDocument* pDoc;
200 ScSortDlg* pDlg;
201 ScAddress theOutPos;
203 CollatorRessource* pColRes;
204 CollatorWrapper* pColWrap;
206 #ifdef _TPSORT_CXX
207 private:
208 void Init ();
209 void FillUserSortListBox ();
210 void FillOutPosList ();
212 // Handler ------------------------
213 DECL_LINK( EnableHdl, CheckBox * );
214 DECL_LINK( SelOutPosHdl, ListBox * );
215 void EdOutPosModHdl ( Edit* pEd );
216 DECL_LINK( SortDirHdl, RadioButton * );
217 DECL_LINK( FillAlgorHdl, void * );
218 #endif
221 #if ENABLE_LAYOUT_EXPERIMENTAL
222 #include <layout/layout-post.hxx>
223 #endif /* ENABLE_LAYOUT_EXPERIMENTAL */
225 #endif // SC_TPSORT_HXX