Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / ui / inc / tpsort.hxx
blob35be32afa3b2b3a21492d101a9e20f4940b5a0cb
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 <svx/langbox.hxx>
27 #include <unotools/collatorwrapper.hxx>
28 #include <svtools/collatorres.hxx>
30 #include "sortkeydlg.hxx"
32 #include <address.hxx>
33 #include <sortparam.hxx>
35 // +1 because one field is reserved for the "- undefined -" entry
36 #define SC_MAXFIELDS MAXCOLCOUNT+1
38 class ScViewData;
40 // Sort Criteria
42 class ScTabPageSortFields : public SfxTabPage
44 public:
45 ScTabPageSortFields(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
46 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rArgSet);
47 virtual ~ScTabPageSortFields() override;
49 virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
50 virtual void Reset ( const SfxItemSet* rArgSet ) override;
52 protected:
53 virtual void ActivatePage ( const SfxItemSet& rSet ) override;
54 virtual DeactivateRC DeactivatePage ( SfxItemSet* pSet ) override;
56 private:
57 Idle m_aIdle;
59 OUString const aStrUndefined;
60 OUString const aStrColumn;
61 OUString const aStrRow;
63 const sal_uInt16 nWhichSort;
64 ScViewData* pViewData;
65 ScSortParam aSortData;
66 std::vector<SCCOLROW> nFieldArr;
67 sal_uInt16 nFieldCount;
68 sal_uInt16 nSortKeyCount;
70 bool bHasHeader;
71 bool bSortByRows;
73 std::unique_ptr<weld::ScrolledWindow> m_xScrolledWindow;
74 std::unique_ptr<weld::Container> m_xBox;
75 ScSortKeyWindow m_aSortWin;
77 void AddSortKey( sal_uInt16 nItem );
79 private:
80 void Init ();
81 void FillFieldLists ( sal_uInt16 nStartField );
82 sal_uInt16 GetFieldSelPos ( SCCOLROW nField );
83 void SetLastSortKey( sal_uInt16 nItem );
85 // Handler ------------------------
86 DECL_LINK(SelectHdl, weld::ComboBox&, void);
87 DECL_LINK(ScrollToEndHdl, Timer*, void);
90 // Sort Options
92 class ScDocument;
94 class ScTabPageSortOptions : public SfxTabPage
96 public:
97 ScTabPageSortOptions(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
98 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* pArgSet);
100 virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
101 virtual void Reset ( const SfxItemSet* rArgSet ) override;
103 protected:
104 virtual void ActivatePage ( const SfxItemSet& rSet ) override;
105 virtual DeactivateRC DeactivatePage ( SfxItemSet* pSet ) override;
107 private:
108 OUString const aStrRowLabel;
109 OUString const aStrColLabel;
110 OUString const aStrUndefined;
112 const sal_uInt16 nWhichSort;
113 ScSortParam aSortData;
114 ScViewData* pViewData;
115 ScDocument* pDoc;
116 ScAddress theOutPos;
118 std::unique_ptr<CollatorResource> m_xColRes;
119 std::unique_ptr<CollatorWrapper> m_xColWrap;
121 std::unique_ptr<weld::CheckButton> m_xBtnCase;
122 std::unique_ptr<weld::CheckButton> m_xBtnHeader;
123 std::unique_ptr<weld::CheckButton> m_xBtnFormats;
124 std::unique_ptr<weld::CheckButton> m_xBtnNaturalSort;
125 std::unique_ptr<weld::CheckButton> m_xBtnCopyResult;
126 std::unique_ptr<weld::ComboBox> m_xLbOutPos;
127 std::unique_ptr<weld::Entry> m_xEdOutPos;
128 std::unique_ptr<weld::CheckButton> m_xBtnSortUser;
129 std::unique_ptr<weld::ComboBox> m_xLbSortUser;
130 std::unique_ptr<SvxLanguageBox> m_xLbLanguage;
131 std::unique_ptr<weld::Label> m_xFtAlgorithm;
132 std::unique_ptr<weld::ComboBox> m_xLbAlgorithm;
133 std::unique_ptr<weld::RadioButton> m_xBtnTopDown;
134 std::unique_ptr<weld::RadioButton> m_xBtnLeftRight;
135 std::unique_ptr<weld::CheckButton> m_xBtnIncComments;
136 std::unique_ptr<weld::CheckButton> m_xBtnIncImages;
138 private:
139 void Init ();
140 void FillUserSortListBox ();
142 // Handler ------------------------
143 DECL_LINK( EnableHdl, weld::ToggleButton&, void );
144 DECL_LINK( SelOutPosHdl, weld::ComboBox&, void );
145 void EdOutPosModHdl();
146 DECL_LINK( SortDirHdl, weld::ToggleButton&, void );
147 void FillAlgor();
148 DECL_LINK( FillAlgorHdl, weld::ComboBox&, void );
151 #endif // INCLUDED_SC_SOURCE_UI_INC_TPSORT_HXX
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */