bump product version to 4.1.6.2
[LibreOffice.git] / sc / source / ui / inc / uiitems.hxx
blobb539fd936d0a2c711b8e50d5a1d9a49d21824f17
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 <boost/scoped_ptr.hpp>
32 class ScEditEngineDefaulter;
33 class EditTextObject;
34 class ScViewData;
35 class ScDPSaveData;
36 struct ScQueryParam;
38 // ---------------------------------------------------------------------------
40 // Items
42 class ScInputStatusItem : public SfxPoolItem
44 ScAddress aCursorPos;
45 ScAddress aStartPos;
46 ScAddress aEndPos;
47 String aString;
48 EditTextObject* pEditData;
50 public:
51 TYPEINFO();
53 ScInputStatusItem( sal_uInt16 nWhich,
54 const ScAddress& rCurPos,
55 const ScAddress& rStartPos,
56 const ScAddress& rEndPos,
57 const String& rString,
58 const EditTextObject* pData );
59 ScInputStatusItem( const ScInputStatusItem& rItem );
60 ~ScInputStatusItem();
62 virtual String GetValueText() const;
64 virtual int operator==( const SfxPoolItem& ) const;
65 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
67 const ScAddress& GetPos() const { return aCursorPos; }
68 const ScAddress& GetStartPos() const { return aStartPos; }
69 const ScAddress& GetEndPos() const { return aEndPos; }
70 SCTAB GetTab() const { return aCursorPos.Tab(); }
71 SCCOL GetCol() const { return aCursorPos.Col(); }
72 SCROW GetRow() const { return aCursorPos.Row(); }
73 SCCOL GetStartCol() const { return aStartPos.Col(); }
74 SCROW GetStartRow() const { return aStartPos.Row(); }
75 SCCOL GetEndCol() const { return aEndPos.Col(); }
76 SCROW GetEndRow() const { return aEndPos.Row(); }
78 const String& GetString() const { return aString; }
79 const EditTextObject* GetEditData() const { return pEditData; }
83 #define SC_TAB_INSERTED 1
84 #define SC_TAB_DELETED 2
85 #define SC_TAB_MOVED 3
86 #define SC_TAB_COPIED 4
87 #define SC_TAB_HIDDEN 5
88 #define SC_TABS_INSERTED 6
89 #define SC_TABS_DELETED 7
91 class ScTablesHint : public SfxHint
93 sal_uInt16 nId;
94 SCTAB nTab1;
95 SCTAB nTab2;
97 public:
98 TYPEINFO();
99 ScTablesHint(sal_uInt16 nNewId, SCTAB nTable1, SCTAB nTable2=0);
100 ~ScTablesHint();
102 sal_uInt16 GetId() const { return nId; }
103 SCTAB GetTab1() const { return nTab1; }
104 SCTAB GetTab2() const { return nTab2; }
107 class ScEditViewHint : public SfxHint
109 ScEditEngineDefaulter* pEditEngine;
110 ScAddress aCursorPos;
112 public:
113 TYPEINFO();
114 ScEditViewHint( ScEditEngineDefaulter* pEngine, const ScAddress& rCurPos );
115 ~ScEditViewHint();
117 SCCOL GetCol() const { return aCursorPos.Col(); }
118 SCROW GetRow() const { return aCursorPos.Row(); }
119 SCTAB GetTab() const { return aCursorPos.Tab(); }
120 ScEditEngineDefaulter* GetEngine() const { return pEditEngine; }
122 private:
123 ScEditViewHint(); // disabled
126 class ScIndexHint : public SfxHint
128 sal_uInt16 nId;
129 sal_uInt16 nIndex;
131 public:
132 TYPEINFO();
133 ScIndexHint(sal_uInt16 nNewId, sal_uInt16 nIdx);
134 ~ScIndexHint();
136 sal_uInt16 GetId() const { return nId; }
137 sal_uInt16 GetIndex() const { return nIndex; }
140 //----------------------------------------------------------------------------
141 // Parameter item for the sort dialog:
143 class SC_DLLPUBLIC ScSortItem : public SfxPoolItem
145 public:
146 TYPEINFO();
147 ScSortItem( sal_uInt16 nWhich,
148 ScViewData* ptrViewData,
149 const ScSortParam* pSortData );
150 ScSortItem( sal_uInt16 nWhich,
151 const ScSortParam* pSortData );
152 ScSortItem( const ScSortItem& rItem );
153 ~ScSortItem();
155 virtual String GetValueText() const;
156 virtual int operator==( const SfxPoolItem& ) const;
157 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
158 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const;
160 ScViewData* GetViewData () const { return pViewData; }
161 const ScSortParam& GetSortData () const { return theSortData; }
163 private:
164 ScViewData* pViewData;
165 ScSortParam theSortData;
168 //----------------------------------------------------------------------------
170 class SC_DLLPUBLIC ScQueryItem : public SfxPoolItem
172 public:
173 TYPEINFO();
174 ScQueryItem( sal_uInt16 nWhich,
175 ScViewData* ptrViewData,
176 const ScQueryParam* pQueryData );
177 ScQueryItem( sal_uInt16 nWhich,
178 const ScQueryParam* pQueryData );
179 ScQueryItem( const ScQueryItem& rItem );
180 ~ScQueryItem();
182 virtual String GetValueText() const;
183 virtual int operator==( const SfxPoolItem& ) const;
184 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
186 ScViewData* GetViewData () const { return pViewData; }
187 const ScQueryParam& GetQueryData() const;
189 bool GetAdvancedQuerySource(ScRange& rSource) const;
190 void SetAdvancedQuerySource(const ScRange* pSource);
192 private:
193 boost::scoped_ptr<ScQueryParam> mpQueryData;
194 ScViewData* pViewData;
195 ScRange aAdvSource;
196 bool bIsAdvanced;
199 //----------------------------------------------------------------------------
201 class SC_DLLPUBLIC ScSubTotalItem : public SfxPoolItem
203 public:
204 TYPEINFO();
205 ScSubTotalItem( sal_uInt16 nWhich,
206 ScViewData* ptrViewData,
207 const ScSubTotalParam* pSubTotalData );
208 ScSubTotalItem( sal_uInt16 nWhich,
209 const ScSubTotalParam* pSubTotalData );
210 ScSubTotalItem( const ScSubTotalItem& rItem );
211 ~ScSubTotalItem();
213 virtual String GetValueText() const;
214 virtual int operator==( const SfxPoolItem& ) const;
215 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
216 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const;
218 ScViewData* GetViewData () const { return pViewData; }
219 const ScSubTotalParam& GetSubTotalData() const { return theSubTotalData; }
221 private:
222 ScViewData* pViewData;
223 ScSubTotalParam theSubTotalData;
226 //----------------------------------------------------------------------------
228 class SC_DLLPUBLIC ScUserListItem : public SfxPoolItem
230 public:
231 TYPEINFO();
232 ScUserListItem( sal_uInt16 nWhich );
233 ScUserListItem( const ScUserListItem& rItem );
234 ~ScUserListItem();
236 virtual String GetValueText() const;
237 virtual int operator==( const SfxPoolItem& ) const;
238 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
240 void SetUserList ( const ScUserList& rUserList );
241 ScUserList* GetUserList () const { return pUserList; }
243 private:
244 ScUserList* pUserList;
247 //----------------------------------------------------------------------------
249 class ScConsolidateItem : public SfxPoolItem
251 public:
252 TYPEINFO();
253 ScConsolidateItem( sal_uInt16 nWhich,
254 const ScConsolidateParam* pParam );
255 ScConsolidateItem( const ScConsolidateItem& rItem );
256 ~ScConsolidateItem();
258 virtual String GetValueText() const;
259 virtual int operator==( const SfxPoolItem& ) const;
260 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
262 const ScConsolidateParam& GetData() const { return theConsData; }
264 private:
265 ScConsolidateParam theConsData;
268 //----------------------------------------------------------------------------
270 class ScPivotItem : public SfxPoolItem
272 public:
273 TYPEINFO();
274 ScPivotItem( sal_uInt16 nWhich, const ScDPSaveData* pData,
275 const ScRange* pRange, sal_Bool bNew );
276 ScPivotItem( const ScPivotItem& rItem );
277 ~ScPivotItem();
279 virtual String GetValueText() const;
280 virtual int operator==( const SfxPoolItem& ) const;
281 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
283 const ScDPSaveData& GetData() const { return *pSaveData; }
284 const ScRange& GetDestRange() const { return aDestRange; }
285 sal_Bool IsNewSheet() const { return bNewSheet; }
287 private:
288 ScDPSaveData* pSaveData;
289 ScRange aDestRange;
290 sal_Bool bNewSheet;
293 //----------------------------------------------------------------------------
295 class ScSolveItem : public SfxPoolItem
297 public:
298 TYPEINFO();
299 ScSolveItem( sal_uInt16 nWhich,
300 const ScSolveParam* pParam );
301 ScSolveItem( const ScSolveItem& rItem );
302 ~ScSolveItem();
304 virtual String GetValueText() const;
305 virtual int operator==( const SfxPoolItem& ) const;
306 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
308 const ScSolveParam& GetData() const { return theSolveData; }
310 private:
311 ScSolveParam theSolveData;
314 //----------------------------------------------------------------------------
316 class ScTabOpItem : public SfxPoolItem
318 public:
319 TYPEINFO();
320 ScTabOpItem( sal_uInt16 nWhich,
321 const ScTabOpParam* pParam );
322 ScTabOpItem( const ScTabOpItem& rItem );
323 ~ScTabOpItem();
325 virtual String GetValueText() const;
326 virtual int operator==( const SfxPoolItem& ) const;
327 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
329 const ScTabOpParam& GetData() const { return theTabOpData; }
331 private:
332 ScTabOpParam theTabOpData;
335 #endif
337 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */