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