Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / uiitems.hxx
bloba74a08d4ddd50e8bc0fb05ef8d328c4b949d089a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef SC_UIITEMS_HXX
21 #define SC_UIITEMS_HXX
23 #include "scdllapi.h"
24 #include "conditio.hxx"
25 #include "sortparam.hxx"
26 #include "subtotalparam.hxx"
27 #include "paramisc.hxx"
28 #include <svl/poolitem.hxx>
30 #include <vector>
31 #include <boost/scoped_ptr.hpp>
33 namespace editeng {
34 struct MisspellRanges;
37 class ScEditEngineDefaulter;
38 class EditTextObject;
39 class ScViewData;
40 class ScDPSaveData;
41 struct ScQueryParam;
43 // ---------------------------------------------------------------------------
45 // Items
47 class ScInputStatusItem : public SfxPoolItem
49 ScAddress aCursorPos;
50 ScAddress aStartPos;
51 ScAddress aEndPos;
52 OUString aString;
53 EditTextObject* pEditData;
54 const std::vector<editeng::MisspellRanges>* mpMisspellRanges;
56 public:
57 TYPEINFO();
59 ScInputStatusItem( sal_uInt16 nWhich,
60 const ScAddress& rCurPos,
61 const ScAddress& rStartPos,
62 const ScAddress& rEndPos,
63 const OUString& rString,
64 const EditTextObject* pData );
65 ScInputStatusItem( const ScInputStatusItem& rItem );
66 ~ScInputStatusItem();
68 virtual OUString GetValueText() const;
70 virtual int operator==( const SfxPoolItem& ) const;
71 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
73 const ScAddress& GetPos() const { return aCursorPos; }
74 const ScAddress& GetStartPos() const { return aStartPos; }
75 const ScAddress& GetEndPos() const { return aEndPos; }
76 SCTAB GetTab() const { return aCursorPos.Tab(); }
77 SCCOL GetCol() const { return aCursorPos.Col(); }
78 SCROW GetRow() const { return aCursorPos.Row(); }
79 SCCOL GetStartCol() const { return aStartPos.Col(); }
80 SCROW GetStartRow() const { return aStartPos.Row(); }
81 SCCOL GetEndCol() const { return aEndPos.Col(); }
82 SCROW GetEndRow() const { return aEndPos.Row(); }
84 const OUString& GetString() const { return aString; }
85 const EditTextObject* GetEditData() const { return pEditData; }
87 void SetMisspellRanges( const std::vector<editeng::MisspellRanges>* pRanges );
88 const std::vector<editeng::MisspellRanges>* GetMisspellRanges() const;
92 #define SC_TAB_INSERTED 1
93 #define SC_TAB_DELETED 2
94 #define SC_TAB_MOVED 3
95 #define SC_TAB_COPIED 4
96 #define SC_TAB_HIDDEN 5
97 #define SC_TABS_INSERTED 6
98 #define SC_TABS_DELETED 7
100 class ScTablesHint : public SfxHint
102 sal_uInt16 nId;
103 SCTAB nTab1;
104 SCTAB nTab2;
106 public:
107 TYPEINFO();
108 ScTablesHint(sal_uInt16 nNewId, SCTAB nTable1, SCTAB nTable2=0);
109 ~ScTablesHint();
111 sal_uInt16 GetId() const { return nId; }
112 SCTAB GetTab1() const { return nTab1; }
113 SCTAB GetTab2() const { return nTab2; }
116 class ScEditViewHint : public SfxHint
118 ScEditEngineDefaulter* pEditEngine;
119 ScAddress aCursorPos;
121 public:
122 TYPEINFO();
123 ScEditViewHint( ScEditEngineDefaulter* pEngine, const ScAddress& rCurPos );
124 ~ScEditViewHint();
126 SCCOL GetCol() const { return aCursorPos.Col(); }
127 SCROW GetRow() const { return aCursorPos.Row(); }
128 SCTAB GetTab() const { return aCursorPos.Tab(); }
129 ScEditEngineDefaulter* GetEngine() const { return pEditEngine; }
131 private:
132 ScEditViewHint(); // disabled
135 class ScIndexHint : public SfxHint
137 sal_uInt16 nId;
138 sal_uInt16 nIndex;
140 public:
141 TYPEINFO();
142 ScIndexHint(sal_uInt16 nNewId, sal_uInt16 nIdx);
143 ~ScIndexHint();
145 sal_uInt16 GetId() const { return nId; }
146 sal_uInt16 GetIndex() const { return nIndex; }
149 //----------------------------------------------------------------------------
150 // Parameter item for the sort dialog:
152 class SC_DLLPUBLIC ScSortItem : public SfxPoolItem
154 public:
155 TYPEINFO();
156 ScSortItem( sal_uInt16 nWhich,
157 ScViewData* ptrViewData,
158 const ScSortParam* pSortData );
159 ScSortItem( sal_uInt16 nWhich,
160 const ScSortParam* pSortData );
161 ScSortItem( const ScSortItem& rItem );
162 ~ScSortItem();
164 virtual OUString GetValueText() const;
165 virtual int operator==( const SfxPoolItem& ) const;
166 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
167 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const;
169 ScViewData* GetViewData () const { return pViewData; }
170 const ScSortParam& GetSortData () const { return theSortData; }
172 private:
173 ScViewData* pViewData;
174 ScSortParam theSortData;
177 //----------------------------------------------------------------------------
179 class SC_DLLPUBLIC ScQueryItem : public SfxPoolItem
181 public:
182 TYPEINFO();
183 ScQueryItem( sal_uInt16 nWhich,
184 ScViewData* ptrViewData,
185 const ScQueryParam* pQueryData );
186 ScQueryItem( sal_uInt16 nWhich,
187 const ScQueryParam* pQueryData );
188 ScQueryItem( const ScQueryItem& rItem );
189 ~ScQueryItem();
191 virtual OUString GetValueText() const;
192 virtual int operator==( const SfxPoolItem& ) const;
193 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
195 ScViewData* GetViewData () const { return pViewData; }
196 const ScQueryParam& GetQueryData() const;
198 bool GetAdvancedQuerySource(ScRange& rSource) const;
199 void SetAdvancedQuerySource(const ScRange* pSource);
201 private:
202 boost::scoped_ptr<ScQueryParam> mpQueryData;
203 ScViewData* pViewData;
204 ScRange aAdvSource;
205 bool bIsAdvanced;
208 //----------------------------------------------------------------------------
210 class SC_DLLPUBLIC ScSubTotalItem : public SfxPoolItem
212 public:
213 TYPEINFO();
214 ScSubTotalItem( sal_uInt16 nWhich,
215 ScViewData* ptrViewData,
216 const ScSubTotalParam* pSubTotalData );
217 ScSubTotalItem( sal_uInt16 nWhich,
218 const ScSubTotalParam* pSubTotalData );
219 ScSubTotalItem( const ScSubTotalItem& rItem );
220 ~ScSubTotalItem();
222 virtual OUString GetValueText() const;
223 virtual int operator==( const SfxPoolItem& ) const;
224 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
225 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const;
227 ScViewData* GetViewData () const { return pViewData; }
228 const ScSubTotalParam& GetSubTotalData() const { return theSubTotalData; }
230 private:
231 ScViewData* pViewData;
232 ScSubTotalParam theSubTotalData;
235 //----------------------------------------------------------------------------
237 class SC_DLLPUBLIC ScUserListItem : public SfxPoolItem
239 public:
240 TYPEINFO();
241 ScUserListItem( sal_uInt16 nWhich );
242 ScUserListItem( const ScUserListItem& rItem );
243 ~ScUserListItem();
245 virtual OUString GetValueText() const;
246 virtual int operator==( const SfxPoolItem& ) const;
247 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
249 void SetUserList ( const ScUserList& rUserList );
250 ScUserList* GetUserList () const { return pUserList; }
252 private:
253 ScUserList* pUserList;
256 //----------------------------------------------------------------------------
258 class ScConsolidateItem : public SfxPoolItem
260 public:
261 TYPEINFO();
262 ScConsolidateItem( sal_uInt16 nWhich,
263 const ScConsolidateParam* pParam );
264 ScConsolidateItem( const ScConsolidateItem& rItem );
265 ~ScConsolidateItem();
267 virtual OUString GetValueText() const;
268 virtual int operator==( const SfxPoolItem& ) const;
269 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
271 const ScConsolidateParam& GetData() const { return theConsData; }
273 private:
274 ScConsolidateParam theConsData;
277 //----------------------------------------------------------------------------
279 class ScPivotItem : public SfxPoolItem
281 public:
282 TYPEINFO();
283 ScPivotItem( sal_uInt16 nWhich, const ScDPSaveData* pData,
284 const ScRange* pRange, sal_Bool bNew );
285 ScPivotItem( const ScPivotItem& rItem );
286 ~ScPivotItem();
288 virtual OUString GetValueText() const;
289 virtual int operator==( const SfxPoolItem& ) const;
290 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
292 const ScDPSaveData& GetData() const { return *pSaveData; }
293 const ScRange& GetDestRange() const { return aDestRange; }
294 sal_Bool IsNewSheet() const { return bNewSheet; }
296 private:
297 ScDPSaveData* pSaveData;
298 ScRange aDestRange;
299 sal_Bool bNewSheet;
302 //----------------------------------------------------------------------------
304 class ScSolveItem : public SfxPoolItem
306 public:
307 TYPEINFO();
308 ScSolveItem( sal_uInt16 nWhich,
309 const ScSolveParam* pParam );
310 ScSolveItem( const ScSolveItem& rItem );
311 ~ScSolveItem();
313 virtual OUString GetValueText() const;
314 virtual int operator==( const SfxPoolItem& ) const;
315 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
317 const ScSolveParam& GetData() const { return theSolveData; }
319 private:
320 ScSolveParam theSolveData;
323 //----------------------------------------------------------------------------
325 class ScTabOpItem : public SfxPoolItem
327 public:
328 TYPEINFO();
329 ScTabOpItem( sal_uInt16 nWhich,
330 const ScTabOpParam* pParam );
331 ScTabOpItem( const ScTabOpItem& rItem );
332 ~ScTabOpItem();
334 virtual OUString GetValueText() const;
335 virtual int operator==( const SfxPoolItem& ) const;
336 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
338 const ScTabOpParam& GetData() const { return theTabOpData; }
340 private:
341 ScTabOpParam theTabOpData;
344 #endif
346 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */