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
31namespace editeng {
32 struct MisspellRanges;
33}
34
36class EditTextObject;
37class ScViewData;
38class ScDPSaveData;
39struct ScQueryParam;
40
41// Items
42
44{
48 OUString aString;
49 std::unique_ptr<EditTextObject> pEditData;
50 const std::vector<editeng::MisspellRanges>* mpMisspellRanges;
51
52public:
53
54 ScInputStatusItem( sal_uInt16 nWhich,
55 const ScAddress& rCurPos,
56 const ScAddress& rStartPos,
57 const ScAddress& rEndPos,
58 OUString aString,
59 const EditTextObject* pData );
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
83class ScTablesHint : public SfxHint
84{
85 sal_uInt16 nId;
88
89public:
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
98class ScEditViewHint : public SfxHint
99{
102
103public:
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
114class ScIndexHint : public SfxHint
115{
116 sal_uInt16 nIndex;
117
118public:
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{
129public:
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
143private:
146};
147
149{
150public:
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
168private:
169 std::unique_ptr<ScQueryParam> mpQueryData;
173};
174
176{
177public:
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
189private:
192};
193
195{
196public:
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
207private:
208 std::unique_ptr<ScUserList> pUserList;
209};
210
212{
213public:
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
222private:
224};
225
227{
228public:
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
241private:
242 std::unique_ptr<ScDPSaveData> pSaveData;
245};
246
248{
249public:
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
258private:
260};
261
263{
264public:
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
273private:
275};
276
277/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SCTAB Tab() const
Definition: address.hxx:283
SCROW Row() const
Definition: address.hxx:274
SCCOL Col() const
Definition: address.hxx:279
const ScConsolidateParam & GetData() const
Definition: uiitems.hxx:220
virtual bool operator==(const SfxPoolItem &) const override
Definition: uiitems.cxx:332
virtual ScConsolidateItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: uiitems.cxx:341
ScConsolidateItem(sal_uInt16 nWhich, const ScConsolidateParam *pParam)
Data for the Consolidate dialog.
Definition: uiitems.cxx:324
ScConsolidateParam theConsData
Definition: uiitems.hxx:223
ScEditViewHint()=delete
SCTAB GetTab() const
Definition: uiitems.hxx:110
ScEditEngineDefaulter * pEditEngine
Definition: uiitems.hxx:100
ScEditEngineDefaulter * GetEngine() const
Definition: uiitems.hxx:111
virtual ~ScEditViewHint() override
Definition: uiitems.cxx:117
SCROW GetRow() const
Definition: uiitems.hxx:109
SCCOL GetCol() const
Definition: uiitems.hxx:108
ScAddress aCursorPos
Definition: uiitems.hxx:101
ScIndexHint(SfxHintId nNewId, sal_uInt16 nIdx)
Definition: uiitems.cxx:98
virtual ~ScIndexHint() override
Definition: uiitems.cxx:104
sal_uInt16 GetIndex() const
Definition: uiitems.hxx:122
sal_uInt16 nIndex
Definition: uiitems.hxx:116
const EditTextObject * GetEditData() const
Definition: uiitems.hxx:69
const ScAddress & GetPos() const
Definition: uiitems.hxx:66
const std::vector< editeng::MisspellRanges > * GetMisspellRanges() const
Definition: uiitems.hxx:72
const std::vector< editeng::MisspellRanges > * mpMisspellRanges
Definition: uiitems.hxx:50
std::unique_ptr< EditTextObject > pEditData
Definition: uiitems.hxx:49
virtual ~ScInputStatusItem() override
Definition: uiitems.cxx:57
const OUString & GetString() const
Definition: uiitems.hxx:68
OUString aString
Definition: uiitems.hxx:48
ScAddress aCursorPos
Definition: uiitems.hxx:45
void SetMisspellRanges(const std::vector< editeng::MisspellRanges > *pRanges)
Definition: uiitems.cxx:77
virtual ScInputStatusItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: uiitems.cxx:72
ScAddress aStartPos
Definition: uiitems.hxx:46
ScInputStatusItem(sal_uInt16 nWhich, const ScAddress &rCurPos, const ScAddress &rStartPos, const ScAddress &rEndPos, OUString aString, const EditTextObject *pData)
Status update for entry field.
Definition: uiitems.cxx:33
ScAddress aEndPos
Definition: uiitems.hxx:47
virtual bool operator==(const SfxPoolItem &) const override
Definition: uiitems.cxx:61
virtual bool operator==(const SfxPoolItem &) const override
Definition: uiitems.cxx:375
virtual ~ScPivotItem() override
Definition: uiitems.cxx:371
ScPivotItem(sal_uInt16 nWhich, const ScDPSaveData *pData, const ScRange *pRange, bool bNew)
Data for the Pivot dialog.
Definition: uiitems.cxx:349
std::unique_ptr< ScDPSaveData > pSaveData
Definition: uiitems.hxx:242
ScRange aDestRange
Definition: uiitems.hxx:243
bool bNewSheet
Definition: uiitems.hxx:244
bool IsNewSheet() const
Definition: uiitems.hxx:239
const ScDPSaveData & GetData() const
Definition: uiitems.hxx:237
virtual ScPivotItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: uiitems.cxx:386
const ScRange & GetDestRange() const
Definition: uiitems.hxx:238
ScViewData * pViewData
Definition: uiitems.hxx:170
ScViewData * GetViewData() const
Definition: uiitems.hxx:162
ScRange aAdvSource
Definition: uiitems.hxx:171
bool bIsAdvanced
Definition: uiitems.hxx:172
std::unique_ptr< ScQueryParam > mpQueryData
Definition: uiitems.hxx:169
ScSolveParam theSolveData
Definition: uiitems.hxx:259
ScSolveItem(sal_uInt16 nWhich, const ScSolveParam *pParam)
Data for the Solver dialog.
Definition: uiitems.cxx:394
virtual bool operator==(const SfxPoolItem &) const override
Definition: uiitems.cxx:401
const ScSolveParam & GetData() const
Definition: uiitems.hxx:256
virtual ScSolveItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: uiitems.cxx:410
ScViewData * pViewData
Definition: uiitems.hxx:144
const ScSortParam & GetSortData() const
Definition: uiitems.hxx:141
ScSortParam theSortData
Definition: uiitems.hxx:145
ScViewData * GetViewData() const
Definition: uiitems.hxx:140
const ScSubTotalParam & GetSubTotalData() const
Definition: uiitems.hxx:187
ScViewData * GetViewData() const
Definition: uiitems.hxx:186
ScSubTotalParam theSubTotalData
Definition: uiitems.hxx:191
ScViewData * pViewData
Definition: uiitems.hxx:190
ScTabOpItem(sal_uInt16 nWhich, const ScTabOpParam *pParam)
Data for the TabOp dialog.
Definition: uiitems.cxx:418
virtual ScTabOpItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: uiitems.cxx:434
virtual bool operator==(const SfxPoolItem &) const override
Definition: uiitems.cxx:425
const ScTabOpParam & GetData() const
Definition: uiitems.hxx:271
ScTabOpParam theTabOpData
Definition: uiitems.hxx:274
sal_uInt16 GetTablesHintId() const
Definition: uiitems.hxx:93
SCTAB nTab2
Definition: uiitems.hxx:87
SCTAB GetTab2() const
Definition: uiitems.hxx:95
virtual ~ScTablesHint() override
Definition: uiitems.cxx:94
ScTablesHint(sal_uInt16 nNewId, SCTAB nTable1, SCTAB nTable2=0)
Adapt Views when inserting/deleting a table.
Definition: uiitems.cxx:87
SCTAB GetTab1() const
Definition: uiitems.hxx:94
SCTAB nTab1
Definition: uiitems.hxx:86
sal_uInt16 nId
Definition: uiitems.hxx:85
ScUserList * GetUserList() const
Definition: uiitems.hxx:205
std::unique_ptr< ScUserList > pUserList
Definition: uiitems.hxx:208
Collection of user-defined sort lists.
Definition: userlist.hxx:62
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool operator==(const SfxPoolItem &) const=0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
SfxHintId
std::unique_ptr< sal_Int32[]> pData
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
Parameter for data table aka multiple operations.
Definition: paramisc.hxx:46
unsigned char sal_uInt8
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17