Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / tpsort.hxx
blobb23058136ba602e719117aef57adc951d80add5a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef SC_TPSORT_HXX
21 #define SC_TPSORT_HXX
23 #include <vector>
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"
34 #include "global.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
43 class ScViewData;
44 class ScSortDlg;
45 struct ScSortParam;
47 //========================================================================
48 // Sort Criteria
50 class ScTabPageSortFields : public SfxTabPage
52 public:
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);
66 protected:
67 virtual void ActivatePage ( const SfxItemSet& rSet );
68 using SfxTabPage::ActivatePage;
69 using SfxTabPage::DeactivatePage;
70 virtual int DeactivatePage ( SfxItemSet* pSet = 0);
72 private:
73 OUString aStrUndefined;
74 OUString aStrColumn;
75 OUString aStrRow;
77 const sal_uInt16 nWhichSort;
78 ScSortDlg* pDlg;
79 ScViewData* pViewData;
80 ScSortParam aSortData;
81 std::vector<SCCOLROW> nFieldArr;
82 sal_uInt16 nFieldCount;
83 sal_uInt16 nSortKeyCount;
85 SCCOL nFirstCol;
86 SCROW nFirstRow;
87 sal_Bool bHasHeader;
88 sal_Bool bSortByRows;
90 ScSortKeyItems maSortKeyItems;
91 ScSortKeyCtrl maSortKeyCtrl;
93 #ifdef _TPSORT_CXX
94 private:
95 void Init ();
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 * );
102 #endif
105 //========================================================================
106 // Sort Options
108 class ScDocument;
109 class CollatorResource;
110 class CollatorWrapper;
112 class ScTabPageSortOptions : public SfxTabPage
114 public:
115 ScTabPageSortOptions( Window* pParent,
116 const SfxItemSet& rArgSet );
117 virtual ~ScTabPageSortOptions();
119 #undef SfxTabPage
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 );
126 protected:
127 virtual void ActivatePage ( const SfxItemSet& rSet );
128 using SfxTabPage::ActivatePage;
129 using SfxTabPage::DeactivatePage;
130 virtual int DeactivatePage ( SfxItemSet* pSet = 0);
132 private:
134 CheckBox* m_pBtnCase;
135 CheckBox* m_pBtnHeader;
136 CheckBox* m_pBtnFormats;
137 CheckBox* m_pBtnNaturalSort;
139 CheckBox* m_pBtnCopyResult;
140 ListBox* m_pLbOutPos;
141 Edit* m_pEdOutPos;
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;
161 ScDocument* pDoc;
162 ScSortDlg* pDlg;
163 ScAddress theOutPos;
165 CollatorResource* pColRes;
166 CollatorWrapper* pColWrap;
168 #ifdef _TPSORT_CXX
169 private:
170 void Init ();
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 * );
180 #endif
183 #endif // SC_TPSORT_HXX
185 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */