1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tpsort.hxx,v $
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 ************************************************************************/
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>
44 #include "address.hxx"
46 //------------------------------------------------------------------------
48 // +1 because one field is reserved for the "- undefined -" entry
49 #define SC_MAXFIELDS MAXCOLCOUNT+1
55 //========================================================================
56 // Kriterien (Sort Criteria)
58 class ScTabPageSortFields
: public SfxTabPage
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
);
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);
83 RadioButton aBtnDown1
;
88 RadioButton aBtnDown2
;
93 RadioButton aBtnDown3
;
99 const USHORT nWhichSort
;
101 ScViewData
* pViewData
;
102 const ScSortParam
& rSortData
;
103 SCCOLROW nFieldArr
[SC_MAXFIELDS
];
110 ListBox
* aSortLbArr
[3];
111 RadioButton
* aDirBtnArr
[3][2];
112 FixedLine
* aFlArr
[3];
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
* );
127 //========================================================================
128 // Sortieroptionen (Sort Options)
132 class CollatorRessource
;
133 class CollatorWrapper
;
135 #include <sfx2/layout.hxx>
136 #include <layout/layout-pre.hxx>
138 class ScTabPageSortOptions
: public SfxTabPage
141 ScTabPageSortOptions( Window
* pParent
,
142 const SfxItemSet
& rArgSet
);
143 ~ScTabPageSortOptions();
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
);
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);
165 CheckBox aBtnFormats
;
166 CheckBox aBtnCopyResult
;
168 CheckBox aBtnNaturalSort
;
172 CheckBox aBtnSortUser
;
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
;
190 String aStrAreaLabel
;
192 const USHORT nWhichSort
;
193 const ScSortParam
& rSortData
;
194 ScViewData
* pViewData
;
199 CollatorRessource
* pColRes
;
200 CollatorWrapper
* pColWrap
;
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 * );
217 #include <layout/layout-post.hxx>
219 #endif // SC_TPSORT_HXX