LibreOffice Module sc (master)  1
uiitems.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_UIITEMS_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_UIITEMS_HXX
22 
23 #include <scdllapi.h>
24 #include <sortparam.hxx>
25 #include <subtotalparam.hxx>
26 #include <paramisc.hxx>
27 #include <svl/poolitem.hxx>
28 
29 #include <memory>
30 #include <vector>
31 
32 namespace editeng {
33  struct MisspellRanges;
34 }
35 
37 class EditTextObject;
38 class ScViewData;
39 class ScDPSaveData;
40 struct ScQueryParam;
41 
42 // Items
43 
45 {
49  OUString aString;
50  std::unique_ptr<EditTextObject> pEditData;
51  const std::vector<editeng::MisspellRanges>* mpMisspellRanges;
52 
53 public:
54 
55  ScInputStatusItem( sal_uInt16 nWhich,
56  const ScAddress& rCurPos,
57  const ScAddress& rStartPos,
58  const ScAddress& rEndPos,
59  const OUString& rString,
60  const EditTextObject* pData );
61  ScInputStatusItem( const ScInputStatusItem& rItem );
62  virtual ~ScInputStatusItem() override;
63 
64  virtual bool operator==( const SfxPoolItem& ) const override;
65  virtual ScInputStatusItem* Clone( SfxItemPool *pPool = nullptr ) const override;
66 
67  const ScAddress& GetPos() const { return aCursorPos; }
68 
69  const OUString& GetString() const { return aString; }
70  const EditTextObject* GetEditData() const { return pEditData.get(); }
71 
72  void SetMisspellRanges( const std::vector<editeng::MisspellRanges>* pRanges );
73  const std::vector<editeng::MisspellRanges>* GetMisspellRanges() const { return mpMisspellRanges;}
74 };
75 
76 #define SC_TAB_INSERTED 1
77 #define SC_TAB_DELETED 2
78 #define SC_TAB_MOVED 3
79 #define SC_TAB_COPIED 4
80 #define SC_TAB_HIDDEN 5
81 #define SC_TABS_INSERTED 6
82 #define SC_TABS_DELETED 7
83 
84 class ScTablesHint : public SfxHint
85 {
86  sal_uInt16 nId;
89 
90 public:
91  ScTablesHint(sal_uInt16 nNewId, SCTAB nTable1, SCTAB nTable2=0);
92  virtual ~ScTablesHint() override;
93 
94  sal_uInt16 GetTablesHintId() const { return nId; }
95  SCTAB GetTab1() const { return nTab1; }
96  SCTAB GetTab2() const { return nTab2; }
97 };
98 
99 class ScEditViewHint : public SfxHint
100 {
103 
104 public:
105  ScEditViewHint() = delete;
106  ScEditViewHint( ScEditEngineDefaulter* pEngine, const ScAddress& rCurPos );
107  virtual ~ScEditViewHint() override;
108 
109  SCCOL GetCol() const { return aCursorPos.Col(); }
110  SCROW GetRow() const { return aCursorPos.Row(); }
111  SCTAB GetTab() const { return aCursorPos.Tab(); }
113 };
114 
115 class ScIndexHint : public SfxHint
116 {
117  sal_uInt16 nIndex;
118 
119 public:
120  ScIndexHint(SfxHintId nNewId, sal_uInt16 nIdx);
121  virtual ~ScIndexHint() override;
122 
123  sal_uInt16 GetIndex() const { return nIndex; }
124 };
125 
126 // Parameter item for the sort dialog:
127 
129 {
130 public:
131  ScSortItem( sal_uInt16 nWhich,
132  ScViewData* ptrViewData,
133  const ScSortParam* pSortData );
134  ScSortItem( sal_uInt16 nWhich,
135  const ScSortParam* pSortData );
136 
137  virtual bool operator==( const SfxPoolItem& ) const override;
138  virtual ScSortItem* Clone( SfxItemPool *pPool = nullptr ) const override;
139  virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
140 
141  ScViewData* GetViewData () const { return pViewData; }
142  const ScSortParam& GetSortData () const { return theSortData; }
143 
144 private:
147 };
148 
150 {
151 public:
152  ScQueryItem( sal_uInt16 nWhich,
153  ScViewData* ptrViewData,
154  const ScQueryParam* pQueryData );
155  ScQueryItem( sal_uInt16 nWhich,
156  const ScQueryParam* pQueryData );
157  ScQueryItem( const ScQueryItem& rItem );
158  virtual ~ScQueryItem() override;
159 
160  virtual bool operator==( const SfxPoolItem& ) const override;
161  virtual ScQueryItem* Clone( SfxItemPool *pPool = nullptr ) const override;
162 
163  ScViewData* GetViewData () const { return pViewData; }
164  const ScQueryParam& GetQueryData() const;
165 
166  bool GetAdvancedQuerySource(ScRange& rSource) const;
167  void SetAdvancedQuerySource(const ScRange* pSource);
168 
169 private:
170  std::unique_ptr<ScQueryParam> mpQueryData;
174 };
175 
177 {
178 public:
179  ScSubTotalItem( sal_uInt16 nWhich,
180  ScViewData* ptrViewData,
181  const ScSubTotalParam* pSubTotalData );
182  ScSubTotalItem( sal_uInt16 nWhich,
183  const ScSubTotalParam* pSubTotalData );
184 
185  virtual bool operator==( const SfxPoolItem& ) const override;
186  virtual ScSubTotalItem* Clone( SfxItemPool *pPool = nullptr ) const override;
187  virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
188 
189  ScViewData* GetViewData () const { return pViewData; }
190  const ScSubTotalParam& GetSubTotalData() const { return theSubTotalData; }
191 
192 private:
195 };
196 
198 {
199 public:
200  ScUserListItem( sal_uInt16 nWhich );
201  ScUserListItem( const ScUserListItem& rItem );
202  virtual ~ScUserListItem() override;
203 
204  virtual bool operator==( const SfxPoolItem& ) const override;
205  virtual ScUserListItem* Clone( SfxItemPool *pPool = nullptr ) const override;
206 
207  void SetUserList ( const ScUserList& rUserList );
208  ScUserList* GetUserList () const { return pUserList.get(); }
209 
210 private:
211  std::unique_ptr<ScUserList> pUserList;
212 };
213 
215 {
216 public:
217  ScConsolidateItem( sal_uInt16 nWhich,
218  const ScConsolidateParam* pParam );
219 
220  virtual bool operator==( const SfxPoolItem& ) const override;
221  virtual ScConsolidateItem* Clone( SfxItemPool *pPool = nullptr ) const override;
222 
223  const ScConsolidateParam& GetData() const { return theConsData; }
224 
225 private:
227 };
228 
229 class ScPivotItem : public SfxPoolItem
230 {
231 public:
232  ScPivotItem( sal_uInt16 nWhich, const ScDPSaveData* pData,
233  const ScRange* pRange, bool bNew );
234  ScPivotItem( const ScPivotItem& rItem );
235  virtual ~ScPivotItem() override;
236 
237  virtual bool operator==( const SfxPoolItem& ) const override;
238  virtual ScPivotItem* Clone( SfxItemPool *pPool = nullptr ) const override;
239 
240  const ScDPSaveData& GetData() const { return *pSaveData; }
241  const ScRange& GetDestRange() const { return aDestRange; }
242  bool IsNewSheet() const { return bNewSheet; }
243 
244 private:
245  std::unique_ptr<ScDPSaveData> pSaveData;
247  bool bNewSheet;
248 };
249 
250 class ScSolveItem : public SfxPoolItem
251 {
252 public:
253  ScSolveItem( sal_uInt16 nWhich,
254  const ScSolveParam* pParam );
255 
256  virtual bool operator==( const SfxPoolItem& ) const override;
257  virtual ScSolveItem* Clone( SfxItemPool *pPool = nullptr ) const override;
258 
259  const ScSolveParam& GetData() const { return theSolveData; }
260 
261 private:
263 };
264 
265 class ScTabOpItem : public SfxPoolItem
266 {
267 public:
268  ScTabOpItem( sal_uInt16 nWhich,
269  const ScTabOpParam* pParam );
270 
271  virtual bool operator==( const SfxPoolItem& ) const override;
272  virtual ScTabOpItem* Clone( SfxItemPool *pPool = nullptr ) const override;
273 
274  const ScTabOpParam& GetData() const { return theTabOpData; }
275 
276 private:
278 };
279 
280 #endif
281 
282 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SCTAB GetTab2() const
Definition: uiitems.hxx:96
Collection of user-defined sort lists.
Definition: userlist.hxx:66
SfxHintId
const EditTextObject * GetEditData() const
Definition: uiitems.hxx:70
ScViewData * GetViewData() const
Definition: uiitems.hxx:141
ScSortParam theSortData
Definition: uiitems.hxx:146
SCROW Row() const
Definition: address.hxx:262
virtual bool operator==(const SfxPoolItem &) const =0
std::unique_ptr< ContentProperties > pData
virtual bool operator==(const SfxPoolItem &) const override
Definition: uiitems.cxx:339
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
std::unique_ptr< ScUserList > pUserList
Definition: uiitems.hxx:211
sal_uInt16 GetIndex() const
Definition: uiitems.hxx:123
ScSolveItem(sal_uInt16 nWhich, const ScSolveParam *pParam)
Data for the Solver dialog.
Definition: uiitems.cxx:401
ScSubTotalParam theSubTotalData
Definition: uiitems.hxx:194
ScTabOpParam theTabOpData
Definition: uiitems.hxx:277
ScViewData * GetViewData() const
Definition: uiitems.hxx:163
bool IsNewSheet() const
Definition: uiitems.hxx:242
ScRange aAdvSource
Definition: uiitems.hxx:172
ScViewData * pViewData
Definition: uiitems.hxx:193
SCTAB nTab2
Definition: uiitems.hxx:88
ScViewData * GetViewData() const
Definition: uiitems.hxx:189
ScUserList * GetUserList() const
Definition: uiitems.hxx:208
void SetMisspellRanges(const std::vector< editeng::MisspellRanges > *pRanges)
Definition: uiitems.cxx:76
ScInputStatusItem(sal_uInt16 nWhich, const ScAddress &rCurPos, const ScAddress &rStartPos, const ScAddress &rEndPos, const OUString &rString, const EditTextObject *pData)
Status update for entry field.
Definition: uiitems.cxx:32
ScPivotItem(sal_uInt16 nWhich, const ScDPSaveData *pData, const ScRange *pRange, bool bNew)
Data for the Pivot dialog.
Definition: uiitems.cxx:356
virtual bool operator==(const SfxPoolItem &) const override
Definition: uiitems.cxx:60
ScRange aDestRange
Definition: uiitems.hxx:246
const ScRange & GetDestRange() const
Definition: uiitems.hxx:241
virtual ScInputStatusItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: uiitems.cxx:71
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
std::unique_ptr< ScDPSaveData > pSaveData
Definition: uiitems.hxx:245
ScAddress aCursorPos
Definition: uiitems.hxx:102
SCTAB GetTab() const
Definition: uiitems.hxx:111
SCTAB Tab() const
Definition: address.hxx:271
virtual ScPivotItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: uiitems.cxx:393
ScViewData * pViewData
Definition: uiitems.hxx:145
virtual ScConsolidateItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: uiitems.cxx:348
ScEditEngineDefaulter * GetEngine() const
Definition: uiitems.hxx:112
SCCOL GetCol() const
Definition: uiitems.hxx:109
Parameter for data table aka multiple operations.
Definition: paramisc.hxx:46
ScEditEngineDefaulter * pEditEngine
Definition: uiitems.hxx:101
sal_Int16 SCCOL
Definition: types.hxx:22
ScAddress aCursorPos
Definition: uiitems.hxx:46
virtual ScTabOpItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: uiitems.cxx:441
virtual bool operator==(const SfxPoolItem &) const override
Definition: uiitems.cxx:408
sal_uInt16 nIndex
Definition: uiitems.hxx:117
const std::vector< editeng::MisspellRanges > * GetMisspellRanges() const
Definition: uiitems.hxx:73
virtual ScSolveItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: uiitems.cxx:417
const ScTabOpParam & GetData() const
Definition: uiitems.hxx:274
const ScConsolidateParam & GetData() const
Definition: uiitems.hxx:223
ScConsolidateItem(sal_uInt16 nWhich, const ScConsolidateParam *pParam)
Data for the Consolidate dialog.
Definition: uiitems.cxx:331
ScTablesHint(sal_uInt16 nNewId, SCTAB nTable1, SCTAB nTable2=0)
Adapt Views when inserting/deleting a table.
Definition: uiitems.cxx:86
std::unique_ptr< EditTextObject > pEditData
Definition: uiitems.hxx:50
const ScSortParam & GetSortData() const
Definition: uiitems.hxx:142
SCCOL Col() const
Definition: address.hxx:267
ScAddress aStartPos
Definition: uiitems.hxx:47
const std::vector< editeng::MisspellRanges > * mpMisspellRanges
Definition: uiitems.hxx:51
sal_Int32 SCROW
Definition: types.hxx:18
SCTAB nTab1
Definition: uiitems.hxx:87
sal_uInt16 GetTablesHintId() const
Definition: uiitems.hxx:94
ScAddress aEndPos
Definition: uiitems.hxx:48
SCROW GetRow() const
Definition: uiitems.hxx:110
sal_uInt16 nId
Definition: uiitems.hxx:86
unsigned char sal_uInt8
ScViewData * pViewData
Definition: uiitems.hxx:171
bool bIsAdvanced
Definition: uiitems.hxx:173
ScSolveParam theSolveData
Definition: uiitems.hxx:262
virtual ~ScInputStatusItem() override
Definition: uiitems.cxx:56
virtual bool operator==(const SfxPoolItem &) const override
Definition: uiitems.cxx:432
const ScSolveParam & GetData() const
Definition: uiitems.hxx:259
ScTabOpItem(sal_uInt16 nWhich, const ScTabOpParam *pParam)
Data for the TabOp dialog.
Definition: uiitems.cxx:425
const ScAddress & GetPos() const
Definition: uiitems.hxx:67
ScEditViewHint()=delete
const OUString & GetString() const
Definition: uiitems.hxx:69
virtual ~ScPivotItem() override
Definition: uiitems.cxx:378
ScIndexHint(SfxHintId nNewId, sal_uInt16 nIdx)
Definition: uiitems.cxx:97
ScConsolidateParam theConsData
Definition: uiitems.hxx:226
virtual ~ScTablesHint() override
Definition: uiitems.cxx:93
bool bNewSheet
Definition: uiitems.hxx:247
OUString aString
Definition: uiitems.hxx:49
virtual ~ScIndexHint() override
Definition: uiitems.cxx:103
virtual bool operator==(const SfxPoolItem &) const override
Definition: uiitems.cxx:382
std::unique_ptr< ScQueryParam > mpQueryData
Definition: uiitems.hxx:170
const ScDPSaveData & GetData() const
Definition: uiitems.hxx:240
#define SC_DLLPUBLIC
Definition: scdllapi.h:28
virtual ~ScEditViewHint() override
Definition: uiitems.cxx:116
sal_Int16 SCTAB
Definition: types.hxx:23
const ScSubTotalParam & GetSubTotalData() const
Definition: uiitems.hxx:190
SCTAB GetTab1() const
Definition: uiitems.hxx:95