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 #include <sheetlimits.hxx>
25 
26 class ScViewData;
27 class ScDocument;
28 struct ScSubTotalParam;
29 
31 {
32 protected:
33  ScTpSubTotalGroup(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
34 
35 public:
36  virtual ~ScTpSubTotalGroup() override;
37 
38  bool DoReset ( sal_uInt16 nGroupNo,
39  const SfxItemSet& rArgSet );
40  bool DoFillItemSet ( sal_uInt16 nGroupNo,
41  SfxItemSet& rArgSet );
42 protected:
43  const OUString aStrNone;
44  const OUString aStrColumn;
45 
48 
49  const sal_uInt16 nWhichSubTotals;
51  std::vector<SCCOL> mnFieldArr;
52  sal_uInt16 nFieldCount;
53 
54  std::unique_ptr<weld::ComboBox> mxLbGroup;
55  std::unique_ptr<weld::TreeView> mxLbColumns;
56  std::unique_ptr<weld::TreeView> mxLbFunctions;
57  std::unique_ptr<weld::CheckButton> mxLbSelectAllColumns;
58 
59 private:
60  void Init ();
61  void FillListBoxes ();
62  static ScSubTotalFunc LbPosToFunc ( sal_uInt16 nPos );
63  static sal_uInt16 FuncToLbPos ( ScSubTotalFunc eFunc );
64  sal_uInt16 GetFieldSelPos ( SCCOL nField );
65 
66  // Handler ------------------------
67  DECL_LINK( SelectListBoxHdl, weld::ComboBox&, void );
68  DECL_LINK( SelectTreeListBoxHdl, weld::TreeView&, void );
69  DECL_LINK(CheckHdl, const weld::TreeView::iter_col&, void);
70  DECL_LINK(CheckBoxHdl, weld::Button&, void);
71  void SelectHdl(const weld::Widget*);
72 };
73 
75 {
76 public:
78  const SfxItemSet& rArgSet );
79  static std::unique_ptr<SfxTabPage> Create ( weld::Container* pPage, weld::DialogController* pController,
80  const SfxItemSet* rArgSet );
81  virtual ~ScTpSubTotalGroup1() override;
82 
83  virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
84  virtual void Reset ( const SfxItemSet* rArgSet ) override;
85 };
86 
88 {
89 public:
91  const SfxItemSet& rArgSet );
92  static std::unique_ptr<SfxTabPage> Create ( weld::Container* pPage, weld::DialogController* pController,
93  const SfxItemSet* rArgSet );
94  virtual ~ScTpSubTotalGroup2() override;
95 
96  virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
97  virtual void Reset ( const SfxItemSet* rArgSet ) override;
98 };
99 
101 {
102 public:
104  const SfxItemSet& rArgSet );
105  static std::unique_ptr<SfxTabPage> Create ( weld::Container* pPage, weld::DialogController* pController,
106  const SfxItemSet* rArgSet );
107  virtual ~ScTpSubTotalGroup3() override;
108 
109  virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
110  virtual void Reset ( const SfxItemSet* rArgSet ) override;
111 };
112 
113 class ScTpSubTotalOptions final : public SfxTabPage
114 {
115 public:
116  ScTpSubTotalOptions(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
117  static std::unique_ptr<SfxTabPage> Create ( weld::Container* pPage, weld::DialogController* pController,
118  const SfxItemSet* rArgSet );
119  virtual ~ScTpSubTotalOptions() override;
120 
121  virtual bool FillItemSet ( SfxItemSet* rArgSet ) override;
122  virtual void Reset ( const SfxItemSet* rArgSet ) override;
123 
124 private:
125  void Init ();
126  void FillUserSortListBox ();
127 
128  // Handler ------------------------
129  DECL_LINK(CheckHdl, weld::Button&, void);
130 
133  const sal_uInt16 nWhichSubTotals;
135 
136  std::unique_ptr<weld::CheckButton> m_xBtnPagebreak;
137  std::unique_ptr<weld::CheckButton> m_xBtnCase;
138  std::unique_ptr<weld::CheckButton> m_xBtnSort;
139  std::unique_ptr<weld::Label> m_xFlSort;
140  std::unique_ptr<weld::RadioButton> m_xBtnAscending;
141  std::unique_ptr<weld::RadioButton> m_xBtnDescending;
142  std::unique_ptr<weld::CheckButton> m_xBtnFormats;
143  std::unique_ptr<weld::CheckButton> m_xBtnUserDef;
144  std::unique_ptr<weld::ComboBox> m_xLbUserDef;
145 };
146 
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static sal_uInt16 FuncToLbPos(ScSubTotalFunc eFunc)
Definition: tpsubt.cxx:319
ScDocument * pDoc
Definition: tpsubt.hxx:132
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:397
DECL_LINK(SelectListBoxHdl, weld::ComboBox &, void)
virtual ~ScTpSubTotalGroup() override
Definition: tpsubt.cxx:67
std::unique_ptr< weld::CheckButton > m_xBtnPagebreak
Definition: tpsubt.hxx:136
std::vector< SCCOL > mnFieldArr
Definition: tpsubt.hxx:51
ScTpSubTotalGroup2(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:413
virtual ~ScTpSubTotalGroup1() override
Definition: tpsubt.cxx:608
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:485
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:422
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:429
ScTpSubTotalGroup(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:41
std::unique_ptr< weld::CheckButton > m_xBtnCase
Definition: tpsubt.hxx:137
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:403
std::pair< const TreeIter &, int > iter_col
void SelectHdl(const weld::Widget *)
Definition: tpsubt.cxx:358
virtual ~ScTpSubTotalGroup3() override
Definition: tpsubt.cxx:616
std::unique_ptr< weld::RadioButton > m_xBtnAscending
Definition: tpsubt.hxx:140
ScDocument * pDoc
Definition: tpsubt.hxx:47
bool DoFillItemSet(sal_uInt16 nGroupNo, SfxItemSet &rArgSet)
Definition: tpsubt.cxx:170
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:391
void FillUserSortListBox()
Definition: tpsubt.cxx:537
const OUString aStrColumn
Definition: tpsubt.hxx:44
std::unique_ptr< weld::CheckButton > m_xBtnFormats
Definition: tpsubt.hxx:142
sal_Int16 SCCOL
Definition: types.hxx:21
ScTpSubTotalGroup3(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:417
sal_uInt16 GetFieldSelPos(SCCOL nField)
Definition: tpsubt.cxx:280
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:479
std::unique_ptr< weld::CheckButton > m_xBtnUserDef
Definition: tpsubt.hxx:143
bool DoReset(sal_uInt16 nGroupNo, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:108
std::unique_ptr< weld::TreeView > mxLbColumns
Definition: tpsubt.hxx:55
sal_uInt16 nFieldCount
Definition: tpsubt.hxx:52
std::unique_ptr< weld::CheckButton > m_xBtnSort
Definition: tpsubt.hxx:138
ScViewData * pViewData
Definition: tpsubt.hxx:46
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:428
virtual ~ScTpSubTotalGroup2() override
Definition: tpsubt.cxx:612
static ScSubTotalFunc LbPosToFunc(sal_uInt16 nPos)
Definition: tpsubt.cxx:297
ScViewData * pViewData
Definition: tpsubt.hxx:131
std::unique_ptr< weld::RadioButton > m_xBtnDescending
Definition: tpsubt.hxx:141
std::unique_ptr< weld::CheckButton > mxLbSelectAllColumns
Definition: tpsubt.hxx:57
std::unique_ptr< weld::ComboBox > m_xLbUserDef
Definition: tpsubt.hxx:144
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:430
std::unique_ptr< weld::TreeView > mxLbFunctions
Definition: tpsubt.hxx:56
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:424
ScTpSubTotalGroup1(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:409
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:510
const sal_uInt16 nWhichSubTotals
Definition: tpsubt.hxx:133
const ScSubTotalParam & rSubTotalData
Definition: tpsubt.hxx:50
const sal_uInt16 nWhichSubTotals
Definition: tpsubt.hxx:49
ScTpSubTotalOptions(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:435
ScSubTotalFunc
Definition: global.hxx:844
virtual ~ScTpSubTotalOptions() override
Definition: tpsubt.cxx:459
const OUString aStrNone
Definition: tpsubt.hxx:43
const ScSubTotalParam & rSubTotalData
Definition: tpsubt.hxx:134
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:423
std::unique_ptr< weld::Label > m_xFlSort
Definition: tpsubt.hxx:139
void FillListBoxes()
Definition: tpsubt.cxx:245
std::unique_ptr< weld::ComboBox > mxLbGroup
Definition: tpsubt.hxx:54
DECL_LINK(CheckHdl, weld::Button &, void)