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