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