1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
25 #include <sfx2/tabdlg.hxx>
26 #include <vcl/edit.hxx>
27 #include <vcl/fixed.hxx>
28 #include <vcl/lstbox.hxx>
29 #include <svtools/stdctrl.hxx>
30 #include <svx/langbox.hxx>
32 #include "sortkeydlg.hxx"
35 #include "address.hxx"
36 #include "sortparam.hxx"
38 //------------------------------------------------------------------------
40 // +1 because one field is reserved for the "- undefined -" entry
41 #define SC_MAXFIELDS MAXCOLCOUNT+1
47 //========================================================================
50 class ScTabPageSortFields
: public SfxTabPage
53 ScTabPageSortFields( Window
* pParent
,
54 const SfxItemSet
& rArgSet
);
55 virtual ~ScTabPageSortFields();
57 static SfxTabPage
* Create ( Window
* pParent
,
58 const SfxItemSet
& rArgSet
);
59 virtual sal_Bool
FillItemSet ( SfxItemSet
& rArgSet
);
60 virtual void Reset ( const SfxItemSet
& rArgSet
);
62 virtual void SetPosSizePixel(const Point
& rAllocPos
, const Size
& rAllocation
);
63 virtual void SetSizePixel(const Size
& rAllocation
);
64 virtual void SetPosPixel(const Point
& rAllocPos
);
67 virtual void ActivatePage ( const SfxItemSet
& rSet
);
68 using SfxTabPage::ActivatePage
;
69 using SfxTabPage::DeactivatePage
;
70 virtual int DeactivatePage ( SfxItemSet
* pSet
= 0);
73 OUString aStrUndefined
;
77 const sal_uInt16 nWhichSort
;
79 ScViewData
* pViewData
;
80 ScSortParam aSortData
;
81 std::vector
<SCCOLROW
> nFieldArr
;
82 sal_uInt16 nFieldCount
;
83 sal_uInt16 nSortKeyCount
;
90 ScSortKeyItems maSortKeyItems
;
91 ScSortKeyCtrl maSortKeyCtrl
;
96 void FillFieldLists ( sal_uInt16 nStartField
);
97 sal_uInt16
GetFieldSelPos ( SCCOLROW nField
);
98 void SetLastSortKey( sal_uInt16 nItem
);
100 // Handler ------------------------
101 DECL_LINK( SelectHdl
, ListBox
* );
105 //========================================================================
109 class CollatorResource
;
110 class CollatorWrapper
;
112 class ScTabPageSortOptions
: public SfxTabPage
115 ScTabPageSortOptions( Window
* pParent
,
116 const SfxItemSet
& rArgSet
);
117 virtual ~ScTabPageSortOptions();
120 #define SfxTabPage ::SfxTabPage
121 static SfxTabPage
* Create ( Window
* pParent
,
122 const SfxItemSet
& rArgSet
);
123 virtual sal_Bool
FillItemSet ( SfxItemSet
& rArgSet
);
124 virtual void Reset ( const SfxItemSet
& rArgSet
);
127 virtual void ActivatePage ( const SfxItemSet
& rSet
);
128 using SfxTabPage::ActivatePage
;
129 using SfxTabPage::DeactivatePage
;
130 virtual int DeactivatePage ( SfxItemSet
* pSet
= 0);
134 CheckBox
* m_pBtnCase
;
135 CheckBox
* m_pBtnHeader
;
136 CheckBox
* m_pBtnFormats
;
137 CheckBox
* m_pBtnNaturalSort
;
139 CheckBox
* m_pBtnCopyResult
;
140 ListBox
* m_pLbOutPos
;
143 CheckBox
* m_pBtnSortUser
;
144 ListBox
* m_pLbSortUser
;
146 SvxLanguageBox
* m_pLbLanguage
;
147 FixedText
* m_pFtAlgorithm
;
148 ListBox
* m_pLbAlgorithm
;
150 RadioButton
* m_pBtnTopDown
;
151 RadioButton
* m_pBtnLeftRight
;
153 OUString aStrRowLabel
;
154 OUString aStrColLabel
;
155 OUString aStrUndefined
;
156 OUString aStrAreaLabel
;
158 const sal_uInt16 nWhichSort
;
159 ScSortParam aSortData
;
160 ScViewData
* pViewData
;
165 CollatorResource
* pColRes
;
166 CollatorWrapper
* pColWrap
;
171 void FillUserSortListBox ();
172 void FillOutPosList ();
174 // Handler ------------------------
175 DECL_LINK( EnableHdl
, CheckBox
* );
176 DECL_LINK( SelOutPosHdl
, ListBox
* );
177 void EdOutPosModHdl ( Edit
* pEd
);
178 DECL_LINK( SortDirHdl
, RadioButton
* );
179 DECL_LINK( FillAlgorHdl
, void * );
183 #endif // SC_TPSORT_HXX
185 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */