LibreOffice Module sc (master) 1
tpsubt.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 <sfx2/tabdlg.hxx>
23#include <global.hxx>
24
25class ScViewData;
26class ScDocument;
27struct ScSubTotalParam;
28class ScSubTotalItem;
29
31{
32protected:
33 ScTpSubTotalGroup(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet, const sal_uInt16& nTabNumber);
34
35public:
36 virtual ~ScTpSubTotalGroup() override;
37
38 bool DoReset ( sal_uInt16 nGroupNo,
39 const SfxItemSet& rArgSet );
40 bool DoFillItemSet ( sal_uInt16 nGroupNo,
41 SfxItemSet& rArgSet );
42private:
43 void Init ();
44 void FillListBoxes ();
45 static ScSubTotalFunc LbPosToFunc ( sal_uInt16 nPos );
46 static sal_uInt16 FuncToLbPos ( ScSubTotalFunc eFunc );
47 sal_uInt16 GetFieldSelPos ( SCCOL nField );
48
49 // Handler ------------------------
50 DECL_LINK( SelectListBoxHdl, weld::ComboBox&, void );
51 DECL_LINK( SelectTreeListBoxHdl, weld::TreeView&, void );
52 DECL_LINK(CheckHdl, const weld::TreeView::iter_col&, void);
53 DECL_LINK(CheckBoxHdl, weld::Toggleable&, void);
54 void SelectHdl(const weld::Widget*);
55
56 const OUString aStrNone;
57 const OUString aStrColumn;
58
61
64 std::vector<SCCOL> mnFieldArr;
65 sal_uInt16 nFieldCount;
66
67 std::unique_ptr<weld::ComboBox> mxLbGroup;
68 std::unique_ptr<weld::TreeView> mxLbColumns;
69 std::unique_ptr<weld::TreeView> mxLbFunctions;
70 std::unique_ptr<weld::CheckButton> mxLbSelectAllColumns;
71};
72
74{
75public:
77 const SfxItemSet& rArgSet );
78 static std::unique_ptr<SfxTabPage> Create ( weld::Container* pPage, weld::DialogController* pController,
79 const SfxItemSet* rArgSet );
80 virtual ~ScTpSubTotalGroup1() override;
81
82 virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
83 virtual void Reset ( const SfxItemSet* rArgSet ) override;
84};
85
87{
88public:
90 const SfxItemSet& rArgSet );
91 static std::unique_ptr<SfxTabPage> Create ( weld::Container* pPage, weld::DialogController* pController,
92 const SfxItemSet* rArgSet );
93 virtual ~ScTpSubTotalGroup2() override;
94
95 virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
96 virtual void Reset ( const SfxItemSet* rArgSet ) override;
97};
98
100{
101public:
103 const SfxItemSet& rArgSet );
104 static std::unique_ptr<SfxTabPage> Create ( weld::Container* pPage, weld::DialogController* pController,
105 const SfxItemSet* rArgSet );
106 virtual ~ScTpSubTotalGroup3() override;
107
108 virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
109 virtual void Reset ( const SfxItemSet* rArgSet ) override;
110};
111
112class ScTpSubTotalOptions final : public SfxTabPage
113{
114public:
115 ScTpSubTotalOptions(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
116 static std::unique_ptr<SfxTabPage> Create ( weld::Container* pPage, weld::DialogController* pController,
117 const SfxItemSet* rArgSet );
118 virtual ~ScTpSubTotalOptions() override;
119
120 virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
121 virtual void Reset ( const SfxItemSet* rArgSet ) override;
122
123private:
124 void Init ();
125 void FillUserSortListBox ();
126
127 // Handler ------------------------
128 DECL_LINK(CheckHdl, weld::Toggleable&, void);
129
134
135 std::unique_ptr<weld::CheckButton> m_xBtnPagebreak;
136 std::unique_ptr<weld::CheckButton> m_xBtnCase;
137 std::unique_ptr<weld::CheckButton> m_xBtnSort;
138 std::unique_ptr<weld::Label> m_xFlSort;
139 std::unique_ptr<weld::RadioButton> m_xBtnAscending;
140 std::unique_ptr<weld::RadioButton> m_xBtnDescending;
141 std::unique_ptr<weld::CheckButton> m_xBtnFormats;
142 std::unique_ptr<weld::CheckButton> m_xBtnUserDef;
143 std::unique_ptr<weld::ComboBox> m_xLbUserDef;
144};
145
146/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~ScTpSubTotalGroup1() override
Definition: tpsubt.cxx:609
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:394
ScTpSubTotalGroup1(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:412
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:431
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:425
ScTpSubTotalGroup2(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:416
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:400
virtual ~ScTpSubTotalGroup2() override
Definition: tpsubt.cxx:613
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:432
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:426
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:427
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:433
virtual ~ScTpSubTotalGroup3() override
Definition: tpsubt.cxx:617
ScTpSubTotalGroup3(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:420
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:406
DECL_LINK(CheckHdl, const weld::TreeView::iter_col &, void)
sal_uInt16 nFieldCount
Definition: tpsubt.hxx:65
std::unique_ptr< weld::TreeView > mxLbFunctions
Definition: tpsubt.hxx:69
const OUString aStrColumn
Definition: tpsubt.hxx:57
sal_uInt16 GetFieldSelPos(SCCOL nField)
Definition: tpsubt.cxx:283
bool DoReset(sal_uInt16 nGroupNo, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:111
std::unique_ptr< weld::CheckButton > mxLbSelectAllColumns
Definition: tpsubt.hxx:70
DECL_LINK(SelectTreeListBoxHdl, weld::TreeView &, void)
ScDocument * pDoc
Definition: tpsubt.hxx:60
DECL_LINK(SelectListBoxHdl, weld::ComboBox &, void)
void FillListBoxes()
Definition: tpsubt.cxx:245
static sal_uInt16 FuncToLbPos(ScSubTotalFunc eFunc)
Definition: tpsubt.cxx:322
bool DoFillItemSet(sal_uInt16 nGroupNo, SfxItemSet &rArgSet)
Definition: tpsubt.cxx:171
DECL_LINK(CheckBoxHdl, weld::Toggleable &, void)
const ScSubTotalParam & rSubTotalData
Definition: tpsubt.hxx:63
const OUString aStrNone
Definition: tpsubt.hxx:56
std::vector< SCCOL > mnFieldArr
Definition: tpsubt.hxx:64
ScViewData * pViewData
Definition: tpsubt.hxx:59
static ScSubTotalFunc LbPosToFunc(sal_uInt16 nPos)
Definition: tpsubt.cxx:300
std::unique_ptr< weld::TreeView > mxLbColumns
Definition: tpsubt.hxx:68
std::unique_ptr< weld::ComboBox > mxLbGroup
Definition: tpsubt.hxx:67
void SelectHdl(const weld::Widget *)
Definition: tpsubt.cxx:361
const TypedWhichId< ScSubTotalItem > nWhichSubTotals
Definition: tpsubt.hxx:62
ScTpSubTotalGroup(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet, const sal_uInt16 &nTabNumber)
Definition: tpsubt.cxx:41
virtual ~ScTpSubTotalGroup() override
Definition: tpsubt.cxx:71
std::unique_ptr< weld::CheckButton > m_xBtnSort
Definition: tpsubt.hxx:137
ScDocument * pDoc
Definition: tpsubt.hxx:131
ScTpSubTotalOptions(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:438
std::unique_ptr< weld::CheckButton > m_xBtnUserDef
Definition: tpsubt.hxx:142
const ScSubTotalParam & rSubTotalData
Definition: tpsubt.hxx:133
const TypedWhichId< ScSubTotalItem > nWhichSubTotals
Definition: tpsubt.hxx:132
std::unique_ptr< weld::Label > m_xFlSort
Definition: tpsubt.hxx:138
std::unique_ptr< weld::CheckButton > m_xBtnPagebreak
Definition: tpsubt.hxx:135
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:487
std::unique_ptr< weld::CheckButton > m_xBtnCase
Definition: tpsubt.hxx:136
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:481
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:512
std::unique_ptr< weld::RadioButton > m_xBtnDescending
Definition: tpsubt.hxx:140
std::unique_ptr< weld::CheckButton > m_xBtnFormats
Definition: tpsubt.hxx:141
std::unique_ptr< weld::ComboBox > m_xLbUserDef
Definition: tpsubt.hxx:143
virtual ~ScTpSubTotalOptions() override
Definition: tpsubt.cxx:462
ScViewData * pViewData
Definition: tpsubt.hxx:130
DECL_LINK(CheckHdl, weld::Toggleable &, void)
void FillUserSortListBox()
Definition: tpsubt.cxx:538
std::unique_ptr< weld::RadioButton > m_xBtnAscending
Definition: tpsubt.hxx:139
std::pair< const TreeIter &, int > iter_col
ScSubTotalFunc
Definition: global.hxx:860
sal_uInt16 nPos
sal_Int16 SCCOL
Definition: types.hxx:21