LibreOffice Module sc (master) 1
tpsort.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <vector>
23
24#include <sfx2/tabdlg.hxx>
26#include <svx/langbox.hxx>
28#include <vcl/idle.hxx>
29
30#include "sortkeydlg.hxx"
31
32#include <address.hxx>
33#include <sheetlimits.hxx>
34#include <sortparam.hxx>
35
36// +1 because one field is reserved for the "- undefined -" entry
37inline SCCOL SC_MAXFIELDS(const ScSheetLimits& rLimits) { return rLimits.GetMaxColCount() + 1; }
38
39class ScSortItem;
40class ScViewData;
41
42// Sort Criteria
43
45{
46public:
47 ScTabPageSortFields(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
48 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rArgSet);
49 virtual ~ScTabPageSortFields() override;
50
51 virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
52 virtual void Reset ( const SfxItemSet* rArgSet ) override;
53
54protected:
55 virtual void ActivatePage ( const SfxItemSet& rSet ) override;
56 virtual DeactivateRC DeactivatePage ( SfxItemSet* pSet ) override;
57
58private:
60
61 OUString aStrUndefined;
62 OUString aStrColumn;
63 OUString aStrRow;
64 OUString aStrRowLabel;
65 OUString aStrColLabel;
66
70 std::vector<SCCOLROW> nFieldArr;
71 sal_uInt16 nFieldCount;
72 sal_uInt16 nSortKeyCount;
73
74 std::unique_ptr<weld::Container> m_xTop;
75 std::unique_ptr<weld::CheckButton> m_xBtnHeader;
76 std::unique_ptr<weld::RadioButton> m_xBtnTopDown;
77 std::unique_ptr<weld::RadioButton> m_xBtnLeftRight;
78 std::unique_ptr<weld::ScrolledWindow> m_xScrolledWindow;
79 std::unique_ptr<weld::Container> m_xBox;
81
82 void AddSortKey( sal_uInt16 nItem );
83
84private:
85 void Init ();
86 void FillFieldLists ( sal_uInt16 nStartField );
87 sal_uInt16 GetFieldSelPos ( SCCOLROW nField );
88 void SetLastSortKey( sal_uInt16 nItem );
89
90 // Handler ------------------------
91 DECL_LINK(SelectHdl, weld::ComboBox&, void);
92 DECL_LINK(ScrollToEndHdl, Timer*, void);
93 DECL_LINK(SortDirHdl, weld::Toggleable&, void);
94
95};
96
97// Sort Options
98
99class ScDocument;
100
102{
103public:
104 ScTabPageSortOptions(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
105 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* pArgSet);
106
107 virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
108 virtual void Reset ( const SfxItemSet* rArgSet ) override;
109
110protected:
111 virtual void ActivatePage ( const SfxItemSet& rSet ) override;
112 virtual DeactivateRC DeactivatePage ( SfxItemSet* pSet ) override;
113
114private:
120
126
127 std::unique_ptr<CollatorResource> m_xColRes;
128 std::optional<CollatorWrapper> m_oColWrap;
129
130 std::unique_ptr<weld::CheckButton> m_xBtnCase;
131 std::unique_ptr<weld::CheckButton> m_xBtnFormats;
132 std::unique_ptr<weld::CheckButton> m_xBtnNaturalSort;
133 std::unique_ptr<weld::CheckButton> m_xBtnCopyResult;
134 std::unique_ptr<weld::ComboBox> m_xLbOutPos;
135 std::unique_ptr<weld::Entry> m_xEdOutPos;
136 std::unique_ptr<weld::CheckButton> m_xBtnSortUser;
137 std::unique_ptr<weld::ComboBox> m_xLbSortUser;
138 std::unique_ptr<SvxLanguageBox> m_xLbLanguage;
139 std::unique_ptr<weld::Label> m_xFtAlgorithm;
140 std::unique_ptr<weld::ComboBox> m_xLbAlgorithm;
141 std::unique_ptr<weld::CheckButton> m_xBtnIncComments;
142 std::unique_ptr<weld::CheckButton> m_xBtnIncImages;
143
144private:
145 void Init ();
146 void FillUserSortListBox ();
147
148 // Handler ------------------------
149 DECL_LINK( EnableHdl, weld::Toggleable&, void );
150 DECL_LINK( SelOutPosHdl, weld::ComboBox&, void );
151 void EdOutPosModHdl();
152 void FillAlgor();
153 DECL_LINK( FillAlgorHdl, weld::ComboBox&, void );
154};
155
156/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~ScTabPageSortFields() override
Definition: tpsort.cxx:109
ScViewData * pViewData
Definition: tpsort.hxx:68
OUString aStrColLabel
Definition: tpsort.hxx:65
std::unique_ptr< weld::Container > m_xTop
Definition: tpsort.hxx:74
sal_uInt16 nSortKeyCount
Definition: tpsort.hxx:72
DECL_LINK(ScrollToEndHdl, Timer *, void)
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tpsort.cxx:288
ScSortParam aSortData
Definition: tpsort.hxx:69
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsort.cxx:158
void FillFieldLists(sal_uInt16 nStartField)
Definition: tpsort.cxx:306
void AddSortKey(sal_uInt16 nItem)
Definition: tpsort.cxx:484
sal_uInt16 GetFieldSelPos(SCCOLROW nField)
Definition: tpsort.cxx:375
OUString aStrRowLabel
Definition: tpsort.hxx:64
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsort.cxx:239
OUString aStrColumn
Definition: tpsort.hxx:62
OUString aStrRow
Definition: tpsort.hxx:63
ScTabPageSortFields(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsort.cxx:71
TypedWhichId< ScSortItem > nWhichSort
Definition: tpsort.hxx:67
OUString aStrUndefined
Definition: tpsort.hxx:61
std::vector< SCCOLROW > nFieldArr
Definition: tpsort.hxx:70
void SetLastSortKey(sal_uInt16 nItem)
Definition: tpsort.cxx:392
std::unique_ptr< weld::Container > m_xBox
Definition: tpsort.hxx:79
sal_uInt16 nFieldCount
Definition: tpsort.hxx:71
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsort.cxx:163
DECL_LINK(SortDirHdl, weld::Toggleable &, void)
DECL_LINK(SelectHdl, weld::ComboBox &, void)
ScSortKeyWindow m_aSortWin
Definition: tpsort.hxx:80
std::unique_ptr< weld::CheckButton > m_xBtnHeader
Definition: tpsort.hxx:75
std::unique_ptr< weld::RadioButton > m_xBtnLeftRight
Definition: tpsort.hxx:77
std::unique_ptr< weld::RadioButton > m_xBtnTopDown
Definition: tpsort.hxx:76
std::unique_ptr< weld::ScrolledWindow > m_xScrolledWindow
Definition: tpsort.hxx:78
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tpsort.cxx:298
std::unique_ptr< CollatorResource > m_xColRes
Definition: tpsort.hxx:127
ScViewData * pViewData
Definition: tpsort.hxx:123
void FillUserSortListBox()
Definition: tpsort.cxx:751
std::unique_ptr< weld::CheckButton > m_xBtnSortUser
Definition: tpsort.hxx:136
OUString aStrCommentsRowLabel
Definition: tpsort.hxx:116
std::unique_ptr< weld::ComboBox > m_xLbOutPos
Definition: tpsort.hxx:134
ScSortParam aSortData
Definition: tpsort.hxx:122
std::unique_ptr< weld::CheckButton > m_xBtnNaturalSort
Definition: tpsort.hxx:132
std::unique_ptr< weld::CheckButton > m_xBtnFormats
Definition: tpsort.hxx:131
std::unique_ptr< weld::CheckButton > m_xBtnIncComments
Definition: tpsort.hxx:141
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsort.cxx:637
std::unique_ptr< weld::ComboBox > m_xLbSortUser
Definition: tpsort.hxx:137
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tpsort.cxx:704
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tpsort.cxx:684
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsort.cxx:580
OUString aStrImgRowLabel
Definition: tpsort.hxx:118
std::unique_ptr< SvxLanguageBox > m_xLbLanguage
Definition: tpsort.hxx:138
OUString aStrImgColLabel
Definition: tpsort.hxx:119
std::unique_ptr< weld::Label > m_xFtAlgorithm
Definition: tpsort.hxx:139
std::unique_ptr< weld::CheckButton > m_xBtnIncImages
Definition: tpsort.hxx:142
ScAddress theOutPos
Definition: tpsort.hxx:125
DECL_LINK(SelOutPosHdl, weld::ComboBox &, void)
OUString aStrCommentsColLabel
Definition: tpsort.hxx:117
ScDocument * pDoc
Definition: tpsort.hxx:124
DECL_LINK(EnableHdl, weld::Toggleable &, void)
TypedWhichId< ScSortItem > nWhichSort
Definition: tpsort.hxx:121
ScTabPageSortOptions(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsort.cxx:492
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *pArgSet)
Definition: tpsort.cxx:575
std::unique_ptr< weld::CheckButton > m_xBtnCase
Definition: tpsort.hxx:130
DECL_LINK(FillAlgorHdl, weld::ComboBox &, void)
std::unique_ptr< weld::Entry > m_xEdOutPos
Definition: tpsort.hxx:135
OUString aStrUndefined
Definition: tpsort.hxx:115
std::unique_ptr< weld::ComboBox > m_xLbAlgorithm
Definition: tpsort.hxx:140
std::unique_ptr< weld::CheckButton > m_xBtnCopyResult
Definition: tpsort.hxx:133
std::optional< CollatorWrapper > m_oColWrap
Definition: tpsort.hxx:128
static SfxItemSet & rSet
SCCOL GetMaxColCount() const
Definition: sheetlimits.hxx:68
DeactivateRC
SCCOL SC_MAXFIELDS(const ScSheetLimits &rLimits)
Definition: tpsort.hxx:37
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCCOL
Definition: types.hxx:21