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 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_TPSORT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_TPSORT_HXX
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
43 class ScTabPageSortFields
: public SfxTabPage
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
;
54 virtual void ActivatePage ( const SfxItemSet
& rSet
) override
;
55 virtual DeactivateRC
DeactivatePage ( SfxItemSet
* pSet
) override
;
60 OUString aStrUndefined
;
64 const sal_uInt16 nWhichSort
;
65 ScViewData
* pViewData
;
66 ScSortParam aSortData
;
67 std::vector
<SCCOLROW
> nFieldArr
;
68 sal_uInt16 nFieldCount
;
69 sal_uInt16 nSortKeyCount
;
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
);
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);
95 class ScTabPageSortOptions
: public SfxTabPage
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
;
105 virtual void ActivatePage ( const SfxItemSet
& rSet
) override
;
106 virtual DeactivateRC
DeactivatePage ( SfxItemSet
* pSet
) override
;
109 OUString aStrRowLabel
;
110 OUString aStrColLabel
;
111 OUString aStrUndefined
;
113 const sal_uInt16 nWhichSort
;
114 ScSortParam aSortData
;
115 ScViewData
* pViewData
;
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
;
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 );
149 DECL_LINK( FillAlgorHdl
, weld::ComboBox
&, void );
152 #endif // INCLUDED_SC_SOURCE_UI_INC_TPSORT_HXX
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */