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:
116
122
123 std::unique_ptr<CollatorResource> m_xColRes;
124 std::unique_ptr<CollatorWrapper> m_xColWrap;
125
126 std::unique_ptr<weld::CheckButton> m_xBtnCase;
127 std::unique_ptr<weld::CheckButton> m_xBtnFormats;
128 std::unique_ptr<weld::CheckButton> m_xBtnNaturalSort;
129 std::unique_ptr<weld::CheckButton> m_xBtnCopyResult;
130 std::unique_ptr<weld::ComboBox> m_xLbOutPos;
131 std::unique_ptr<weld::Entry> m_xEdOutPos;
132 std::unique_ptr<weld::CheckButton> m_xBtnSortUser;
133 std::unique_ptr<weld::ComboBox> m_xLbSortUser;
134 std::unique_ptr<SvxLanguageBox> m_xLbLanguage;
135 std::unique_ptr<weld::Label> m_xFtAlgorithm;
136 std::unique_ptr<weld::ComboBox> m_xLbAlgorithm;
137 std::unique_ptr<weld::CheckButton> m_xBtnIncComments;
138 std::unique_ptr<weld::CheckButton> m_xBtnIncImages;
139
140private:
141 void Init ();
142 void FillUserSortListBox ();
143
144 // Handler ------------------------
145 DECL_LINK( EnableHdl, weld::Toggleable&, void );
146 DECL_LINK( SelOutPosHdl, weld::ComboBox&, void );
147 void EdOutPosModHdl();
148 void FillAlgor();
149 DECL_LINK( FillAlgorHdl, weld::ComboBox&, void );
150};
151
152/* 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:123
ScViewData * pViewData
Definition: tpsort.hxx:119
void FillUserSortListBox()
Definition: tpsort.cxx:733
std::unique_ptr< weld::CheckButton > m_xBtnSortUser
Definition: tpsort.hxx:132
std::unique_ptr< weld::ComboBox > m_xLbOutPos
Definition: tpsort.hxx:130
ScSortParam aSortData
Definition: tpsort.hxx:118
std::unique_ptr< weld::CheckButton > m_xBtnNaturalSort
Definition: tpsort.hxx:128
std::unique_ptr< weld::CheckButton > m_xBtnFormats
Definition: tpsort.hxx:127
std::unique_ptr< weld::CheckButton > m_xBtnIncComments
Definition: tpsort.hxx:137
std::unique_ptr< CollatorWrapper > m_xColWrap
Definition: tpsort.hxx:124
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsort.cxx:630
std::unique_ptr< weld::ComboBox > m_xLbSortUser
Definition: tpsort.hxx:133
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tpsort.cxx:686
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tpsort.cxx:677
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsort.cxx:573
std::unique_ptr< SvxLanguageBox > m_xLbLanguage
Definition: tpsort.hxx:134
std::unique_ptr< weld::Label > m_xFtAlgorithm
Definition: tpsort.hxx:135
std::unique_ptr< weld::CheckButton > m_xBtnIncImages
Definition: tpsort.hxx:138
ScAddress theOutPos
Definition: tpsort.hxx:121
DECL_LINK(SelOutPosHdl, weld::ComboBox &, void)
ScDocument * pDoc
Definition: tpsort.hxx:120
DECL_LINK(EnableHdl, weld::Toggleable &, void)
TypedWhichId< ScSortItem > nWhichSort
Definition: tpsort.hxx:117
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:568
std::unique_ptr< weld::CheckButton > m_xBtnCase
Definition: tpsort.hxx:126
DECL_LINK(FillAlgorHdl, weld::ComboBox &, void)
std::unique_ptr< weld::Entry > m_xEdOutPos
Definition: tpsort.hxx:131
OUString aStrUndefined
Definition: tpsort.hxx:115
std::unique_ptr< weld::ComboBox > m_xLbAlgorithm
Definition: tpsort.hxx:136
std::unique_ptr< weld::CheckButton > m_xBtnCopyResult
Definition: tpsort.hxx:129
const SfxItemSet * pSet
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