nss: upgrade to release 3.73
[LibreOffice.git] / sc / source / ui / inc / tpsort.hxx
blob1c59ef1a2f1a6a22898ab8bda4d07e8304be55c3
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 <svtools/collatorres.hxx>
27 #include <svx/langbox.hxx>
28 #include <unotools/collatorwrapper.hxx>
29 #include <vcl/idle.hxx>
31 #include "sortkeydlg.hxx"
33 #include <address.hxx>
34 #include <sortparam.hxx>
36 // +1 because one field is reserved for the "- undefined -" entry
37 #define SC_MAXFIELDS MAXCOLCOUNT+1
39 class ScViewData;
41 // Sort Criteria
43 class ScTabPageSortFields : public SfxTabPage
45 public:
46 ScTabPageSortFields(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
47 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rArgSet);
48 virtual ~ScTabPageSortFields() override;
50 virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
51 virtual void Reset ( const SfxItemSet* rArgSet ) override;
53 protected:
54 virtual void ActivatePage ( const SfxItemSet& rSet ) override;
55 virtual DeactivateRC DeactivatePage ( SfxItemSet* pSet ) override;
57 private:
58 Idle m_aIdle;
60 OUString aStrUndefined;
61 OUString aStrColumn;
62 OUString aStrRow;
64 const sal_uInt16 nWhichSort;
65 ScViewData* pViewData;
66 ScSortParam aSortData;
67 std::vector<SCCOLROW> nFieldArr;
68 sal_uInt16 nFieldCount;
69 sal_uInt16 nSortKeyCount;
71 bool bHasHeader;
72 bool bSortByRows;
74 std::unique_ptr<weld::ScrolledWindow> m_xScrolledWindow;
75 std::unique_ptr<weld::Container> m_xBox;
76 ScSortKeyWindow m_aSortWin;
78 void AddSortKey( sal_uInt16 nItem );
80 private:
81 void Init ();
82 void FillFieldLists ( sal_uInt16 nStartField );
83 sal_uInt16 GetFieldSelPos ( SCCOLROW nField );
84 void SetLastSortKey( sal_uInt16 nItem );
86 // Handler ------------------------
87 DECL_LINK(SelectHdl, weld::ComboBox&, void);
88 DECL_LINK(ScrollToEndHdl, Timer*, void);
91 // Sort Options
93 class ScDocument;
95 class ScTabPageSortOptions : public SfxTabPage
97 public:
98 ScTabPageSortOptions(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
99 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* pArgSet);
101 virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
102 virtual void Reset ( const SfxItemSet* rArgSet ) override;
104 protected:
105 virtual void ActivatePage ( const SfxItemSet& rSet ) override;
106 virtual DeactivateRC DeactivatePage ( SfxItemSet* pSet ) override;
108 private:
109 OUString aStrRowLabel;
110 OUString aStrColLabel;
111 OUString aStrUndefined;
113 const sal_uInt16 nWhichSort;
114 ScSortParam aSortData;
115 ScViewData* pViewData;
116 ScDocument* pDoc;
117 ScAddress theOutPos;
119 std::unique_ptr<CollatorResource> m_xColRes;
120 std::unique_ptr<CollatorWrapper> m_xColWrap;
122 std::unique_ptr<weld::CheckButton> m_xBtnCase;
123 std::unique_ptr<weld::CheckButton> m_xBtnHeader;
124 std::unique_ptr<weld::CheckButton> m_xBtnFormats;
125 std::unique_ptr<weld::CheckButton> m_xBtnNaturalSort;
126 std::unique_ptr<weld::CheckButton> m_xBtnCopyResult;
127 std::unique_ptr<weld::ComboBox> m_xLbOutPos;
128 std::unique_ptr<weld::Entry> m_xEdOutPos;
129 std::unique_ptr<weld::CheckButton> m_xBtnSortUser;
130 std::unique_ptr<weld::ComboBox> m_xLbSortUser;
131 std::unique_ptr<SvxLanguageBox> m_xLbLanguage;
132 std::unique_ptr<weld::Label> m_xFtAlgorithm;
133 std::unique_ptr<weld::ComboBox> m_xLbAlgorithm;
134 std::unique_ptr<weld::RadioButton> m_xBtnTopDown;
135 std::unique_ptr<weld::RadioButton> m_xBtnLeftRight;
136 std::unique_ptr<weld::CheckButton> m_xBtnIncComments;
137 std::unique_ptr<weld::CheckButton> m_xBtnIncImages;
139 private:
140 void Init ();
141 void FillUserSortListBox ();
143 // Handler ------------------------
144 DECL_LINK( EnableHdl, weld::ToggleButton&, void );
145 DECL_LINK( SelOutPosHdl, weld::ComboBox&, void );
146 void EdOutPosModHdl();
147 DECL_LINK( SortDirHdl, weld::ToggleButton&, void );
148 void FillAlgor();
149 DECL_LINK( FillAlgorHdl, weld::ComboBox&, void );
152 #endif // INCLUDED_SC_SOURCE_UI_INC_TPSORT_HXX
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */