fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / tpsort.hxx
blob631ccc62244877a691a0e2789abe2d2bb6813275
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 INCLUDED_SC_SOURCE_UI_INC_TPSORT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_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 // +1 because one field is reserved for the "- undefined -" entry
39 #define SC_MAXFIELDS MAXCOLCOUNT+1
41 class ScViewData;
42 class ScSortDlg;
43 struct ScSortParam;
45 // Sort Criteria
47 class ScTabPageSortFields : public SfxTabPage
49 public:
50 ScTabPageSortFields( vcl::Window* pParent,
51 const SfxItemSet& rArgSet );
52 virtual ~ScTabPageSortFields();
53 virtual void dispose() SAL_OVERRIDE;
54 static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
55 const SfxItemSet* rArgSet );
56 virtual bool FillItemSet ( SfxItemSet* rArgSet ) SAL_OVERRIDE;
57 virtual void Reset ( const SfxItemSet* rArgSet ) SAL_OVERRIDE;
59 virtual void SetPosSizePixel(const Point& rAllocPos, const Size& rAllocation) SAL_OVERRIDE;
60 virtual void SetSizePixel(const Size& rAllocation) SAL_OVERRIDE;
61 virtual void SetPosPixel(const Point& rAllocPos) SAL_OVERRIDE;
63 protected:
64 virtual void ActivatePage ( const SfxItemSet& rSet ) SAL_OVERRIDE;
65 using SfxTabPage::ActivatePage;
66 using SfxTabPage::DeactivatePage;
67 virtual sfxpg DeactivatePage ( SfxItemSet* pSet = 0) SAL_OVERRIDE;
69 private:
70 OUString aStrUndefined;
71 OUString aStrColumn;
72 OUString aStrRow;
74 const sal_uInt16 nWhichSort;
75 VclPtr<ScSortDlg> pDlg;
76 ScViewData* pViewData;
77 ScSortParam aSortData;
78 std::vector<SCCOLROW> nFieldArr;
79 sal_uInt16 nFieldCount;
80 sal_uInt16 nSortKeyCount;
82 SCCOL nFirstCol;
83 SCROW nFirstRow;
84 bool bHasHeader;
85 bool bSortByRows;
87 ScSortKeyItems maSortKeyItems;
88 ScSortKeyCtrl maSortKeyCtrl;
90 private:
91 void Init ();
92 void FillFieldLists ( sal_uInt16 nStartField );
93 sal_uInt16 GetFieldSelPos ( SCCOLROW nField );
94 void SetLastSortKey( sal_uInt16 nItem );
96 // Handler ------------------------
97 DECL_LINK( SelectHdl, ListBox * );
100 // Sort Options
102 class ScDocument;
103 class CollatorResource;
104 class CollatorWrapper;
106 class ScTabPageSortOptions : public SfxTabPage
108 public:
109 ScTabPageSortOptions( vcl::Window* pParent,
110 const SfxItemSet& rArgSet );
111 virtual ~ScTabPageSortOptions();
112 virtual void dispose() SAL_OVERRIDE;
114 #undef SfxTabPage
115 #define SfxTabPage ::SfxTabPage
116 static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
117 const SfxItemSet* rArgSet );
118 virtual bool FillItemSet ( SfxItemSet* rArgSet ) SAL_OVERRIDE;
119 virtual void Reset ( const SfxItemSet* rArgSet ) SAL_OVERRIDE;
121 protected:
122 virtual void ActivatePage ( const SfxItemSet& rSet ) SAL_OVERRIDE;
123 using SfxTabPage::ActivatePage;
124 using SfxTabPage::DeactivatePage;
125 virtual sfxpg DeactivatePage ( SfxItemSet* pSet = 0) SAL_OVERRIDE;
127 private:
129 VclPtr<CheckBox> m_pBtnCase;
130 VclPtr<CheckBox> m_pBtnHeader;
131 VclPtr<CheckBox> m_pBtnFormats;
132 VclPtr<CheckBox> m_pBtnNaturalSort;
134 VclPtr<CheckBox> m_pBtnCopyResult;
135 VclPtr<ListBox> m_pLbOutPos;
136 VclPtr<Edit> m_pEdOutPos;
138 VclPtr<CheckBox> m_pBtnSortUser;
139 VclPtr<ListBox> m_pLbSortUser;
141 VclPtr<SvxLanguageBox> m_pLbLanguage;
142 VclPtr<FixedText> m_pFtAlgorithm;
143 VclPtr<ListBox> m_pLbAlgorithm;
145 VclPtr<RadioButton> m_pBtnTopDown;
146 VclPtr<RadioButton> m_pBtnLeftRight;
148 OUString aStrRowLabel;
149 OUString aStrColLabel;
150 OUString aStrUndefined;
151 OUString aStrAreaLabel;
153 const sal_uInt16 nWhichSort;
154 ScSortParam aSortData;
155 ScViewData* pViewData;
156 ScDocument* pDoc;
157 VclPtr<ScSortDlg> pDlg;
158 ScAddress theOutPos;
160 CollatorResource* pColRes;
161 CollatorWrapper* pColWrap;
163 private:
164 void Init ();
165 void FillUserSortListBox ();
166 void FillOutPosList ();
168 // Handler ------------------------
169 DECL_LINK( EnableHdl, CheckBox * );
170 DECL_LINK( SelOutPosHdl, ListBox * );
171 void EdOutPosModHdl ( Edit* pEd );
172 DECL_LINK( SortDirHdl, RadioButton * );
173 DECL_LINK( FillAlgorHdl, void * );
176 #endif // INCLUDED_SC_SOURCE_UI_INC_TPSORT_HXX
178 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */