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 #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
145 ScTabPageSortOptions( Window
* pParent
,
146 const SfxItemSet
& rArgSet
);
147 ~ScTabPageSortOptions();
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
);
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);
169 CheckBox aBtnFormats
;
170 CheckBox aBtnNaturalSort
;
172 CheckBox aBtnCopyResult
;
176 CheckBox aBtnSortUser
;
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
;
194 String aStrAreaLabel
;
196 const USHORT nWhichSort
;
197 const ScSortParam
& rSortData
;
198 ScViewData
* pViewData
;
203 CollatorRessource
* pColRes
;
204 CollatorWrapper
* pColWrap
;
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 * );
221 #if ENABLE_LAYOUT_EXPERIMENTAL
222 #include <layout/layout-post.hxx>
223 #endif /* ENABLE_LAYOUT_EXPERIMENTAL */
225 #endif // SC_TPSORT_HXX