merge the formfield patch from ooo-build
[ooovba.git] / sc / source / ui / inc / uiitems.hxx
blob4cd4e58db185dbac523b6b8ecb59212b959550e8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: uiitems.hxx,v $
10 * $Revision: 1.7.32.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_UIITEMS_HXX
32 #define SC_UIITEMS_HXX
34 #include "scdllapi.h"
35 #include "conditio.hxx"
36 #include "sortparam.hxx"
37 #include "queryparam.hxx"
38 #include "paramisc.hxx"
39 #include <svtools/poolitem.hxx>
41 class ScEditEngineDefaulter;
42 class EditTextObject;
43 class ScViewData;
44 class ScDPSaveData;
46 // ---------------------------------------------------------------------------
48 // Items
50 class ScInputStatusItem : public SfxPoolItem
52 ScAddress aCursorPos;
53 ScAddress aStartPos;
54 ScAddress aEndPos;
55 String aString;
56 EditTextObject* pEditData;
58 public:
59 TYPEINFO();
60 //UNUSED2008-05 ScInputStatusItem( USHORT nWhich,
61 //UNUSED2008-05 SCTAB nTab,
62 //UNUSED2008-05 SCCOL nCol, SCROW nRow,
63 //UNUSED2008-05 SCCOL nStartCol, SCROW nStartRow,
64 //UNUSED2008-05 SCCOL nEndCol, SCROW nSEndRow,
65 //UNUSED2008-05 const String& rString,
66 //UNUSED2008-05 const EditTextObject* pData );
68 ScInputStatusItem( USHORT nWhich,
69 const ScAddress& rCurPos,
70 const ScAddress& rStartPos,
71 const ScAddress& rEndPos,
72 const String& rString,
73 const EditTextObject* pData );
74 ScInputStatusItem( const ScInputStatusItem& rItem );
75 ~ScInputStatusItem();
77 virtual String GetValueText() const;
79 virtual int operator==( const SfxPoolItem& ) const;
80 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
82 const ScAddress& GetPos() const { return aCursorPos; }
83 const ScAddress& GetStartPos() const { return aStartPos; }
84 const ScAddress& GetEndPos() const { return aEndPos; }
85 SCTAB GetTab() const { return aCursorPos.Tab(); }
86 SCCOL GetCol() const { return aCursorPos.Col(); }
87 SCROW GetRow() const { return aCursorPos.Row(); }
88 SCCOL GetStartCol() const { return aStartPos.Col(); }
89 SCROW GetStartRow() const { return aStartPos.Row(); }
90 SCCOL GetEndCol() const { return aEndPos.Col(); }
91 SCROW GetEndRow() const { return aEndPos.Row(); }
93 const String& GetString() const { return aString; }
94 const EditTextObject* GetEditData() const { return pEditData; }
98 #define SC_TAB_INSERTED 1
99 #define SC_TAB_DELETED 2
100 #define SC_TAB_MOVED 3
101 #define SC_TAB_COPIED 4
102 #define SC_TAB_HIDDEN 5
104 class ScTablesHint : public SfxHint
106 USHORT nId;
107 SCTAB nTab1;
108 SCTAB nTab2;
110 public:
111 TYPEINFO();
112 ScTablesHint(USHORT nNewId, SCTAB nTable1, SCTAB nTable2=0);
113 ~ScTablesHint();
115 USHORT GetId() const { return nId; }
116 SCTAB GetTab1() const { return nTab1; }
117 SCTAB GetTab2() const { return nTab2; }
120 class ScEditViewHint : public SfxHint
122 ScEditEngineDefaulter* pEditEngine;
123 ScAddress aCursorPos;
125 public:
126 TYPEINFO();
127 ScEditViewHint( ScEditEngineDefaulter* pEngine, const ScAddress& rCurPos );
128 ~ScEditViewHint();
130 SCCOL GetCol() const { return aCursorPos.Col(); }
131 SCROW GetRow() const { return aCursorPos.Row(); }
132 SCTAB GetTab() const { return aCursorPos.Tab(); }
133 ScEditEngineDefaulter* GetEngine() const { return pEditEngine; }
135 private:
136 ScEditViewHint(); // disabled
139 class ScIndexHint : public SfxHint
141 USHORT nId;
142 USHORT nIndex;
144 public:
145 TYPEINFO();
146 ScIndexHint(USHORT nNewId, USHORT nIdx);
147 ~ScIndexHint();
149 USHORT GetId() const { return nId; }
150 USHORT GetIndex() const { return nIndex; }
153 //----------------------------------------------------------------------------
154 // Parameter-Item fuer den Sortierdialog:
156 class SC_DLLPUBLIC ScSortItem : public SfxPoolItem
158 public:
159 TYPEINFO();
160 ScSortItem( USHORT nWhich,
161 ScViewData* ptrViewData,
162 const ScSortParam* pSortData );
163 ScSortItem( USHORT nWhich,
164 const ScSortParam* pSortData );
165 ScSortItem( const ScSortItem& rItem );
166 ~ScSortItem();
168 virtual String GetValueText() const;
169 virtual int operator==( const SfxPoolItem& ) const;
170 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
171 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberUd ) const;
173 ScViewData* GetViewData () const { return pViewData; }
174 const ScSortParam& GetSortData () const { return theSortData; }
176 private:
177 ScViewData* pViewData;
178 ScSortParam theSortData;
181 //----------------------------------------------------------------------------
182 // Parameter-Item fuer den Filterdialog:
184 class SC_DLLPUBLIC ScQueryItem : public SfxPoolItem
186 public:
187 TYPEINFO();
188 ScQueryItem( USHORT nWhich,
189 ScViewData* ptrViewData,
190 const ScQueryParam* pQueryData );
191 ScQueryItem( USHORT nWhich,
192 const ScQueryParam* pQueryData );
193 ScQueryItem( const ScQueryItem& rItem );
194 ~ScQueryItem();
196 virtual String GetValueText() const;
197 virtual int operator==( const SfxPoolItem& ) const;
198 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
200 ScViewData* GetViewData () const { return pViewData; }
201 const ScQueryParam& GetQueryData() const { return theQueryData; }
203 BOOL GetAdvancedQuerySource(ScRange& rSource) const;
204 void SetAdvancedQuerySource(const ScRange* pSource);
206 private:
207 ScViewData* pViewData;
208 ScQueryParam theQueryData;
209 BOOL bIsAdvanced;
210 ScRange aAdvSource;
213 //----------------------------------------------------------------------------
214 // Parameter-Item fuer den Zwischenergebnisdialog:
216 class SC_DLLPUBLIC ScSubTotalItem : public SfxPoolItem
218 public:
219 TYPEINFO();
220 ScSubTotalItem( USHORT nWhich,
221 ScViewData* ptrViewData,
222 const ScSubTotalParam* pSubTotalData );
223 ScSubTotalItem( USHORT nWhich,
224 const ScSubTotalParam* pSubTotalData );
225 ScSubTotalItem( const ScSubTotalItem& rItem );
226 ~ScSubTotalItem();
228 virtual String GetValueText() const;
229 virtual int operator==( const SfxPoolItem& ) const;
230 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
231 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberUd ) const;
233 ScViewData* GetViewData () const { return pViewData; }
234 const ScSubTotalParam& GetSubTotalData() const { return theSubTotalData; }
236 private:
237 ScViewData* pViewData;
238 ScSubTotalParam theSubTotalData;
241 //----------------------------------------------------------------------------
242 // Parameter-Item fuer die Benutzerlisten-TabPage:
244 class SC_DLLPUBLIC ScUserListItem : public SfxPoolItem
246 public:
247 TYPEINFO();
248 ScUserListItem( USHORT nWhich );
249 ScUserListItem( const ScUserListItem& rItem );
250 ~ScUserListItem();
252 virtual String GetValueText() const;
253 virtual int operator==( const SfxPoolItem& ) const;
254 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
256 void SetUserList ( const ScUserList& rUserList );
257 ScUserList* GetUserList () const { return pUserList; }
259 private:
260 ScUserList* pUserList;
263 //----------------------------------------------------------------------------
264 // Parameter-Item fuer die Konsolidieren-Dialog
266 class ScConsolidateItem : public SfxPoolItem
268 public:
269 TYPEINFO();
270 ScConsolidateItem( USHORT nWhich,
271 const ScConsolidateParam* pParam );
272 ScConsolidateItem( const ScConsolidateItem& rItem );
273 ~ScConsolidateItem();
275 virtual String GetValueText() const;
276 virtual int operator==( const SfxPoolItem& ) const;
277 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
279 const ScConsolidateParam& GetData() const { return theConsData; }
281 private:
282 ScConsolidateParam theConsData;
285 //----------------------------------------------------------------------------
286 // Parameter-Item fuer den Pivot-Dialog
288 class ScPivotItem : public SfxPoolItem
290 public:
291 TYPEINFO();
292 ScPivotItem( USHORT nWhich, const ScDPSaveData* pData,
293 const ScRange* pRange, BOOL bNew );
294 ScPivotItem( const ScPivotItem& rItem );
295 ~ScPivotItem();
297 virtual String GetValueText() const;
298 virtual int operator==( const SfxPoolItem& ) const;
299 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
301 const ScDPSaveData& GetData() const { return *pSaveData; }
302 const ScRange& GetDestRange() const { return aDestRange; }
303 BOOL IsNewSheet() const { return bNewSheet; }
305 private:
306 ScDPSaveData* pSaveData;
307 ScRange aDestRange;
308 BOOL bNewSheet;
311 //----------------------------------------------------------------------------
312 // Parameter-Item fuer den Solver-Dialog
314 class ScSolveItem : public SfxPoolItem
316 public:
317 TYPEINFO();
318 ScSolveItem( USHORT nWhich,
319 const ScSolveParam* pParam );
320 ScSolveItem( const ScSolveItem& rItem );
321 ~ScSolveItem();
323 virtual String GetValueText() const;
324 virtual int operator==( const SfxPoolItem& ) const;
325 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
327 const ScSolveParam& GetData() const { return theSolveData; }
329 private:
330 ScSolveParam theSolveData;
333 //----------------------------------------------------------------------------
334 // Parameter-Item fuer den Mehrfachoperationen-Dialog
336 class ScTabOpItem : public SfxPoolItem
338 public:
339 TYPEINFO();
340 ScTabOpItem( USHORT nWhich,
341 const ScTabOpParam* pParam );
342 ScTabOpItem( const ScTabOpItem& rItem );
343 ~ScTabOpItem();
345 virtual String GetValueText() const;
346 virtual int operator==( const SfxPoolItem& ) const;
347 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
349 const ScTabOpParam& GetData() const { return theTabOpData; }
351 private:
352 ScTabOpParam theTabOpData;
355 //----------------------------------------------------------------------------
356 // Parameter-Item fuer den Dialog bedingte Formatierung
358 class ScCondFrmtItem : public SfxPoolItem
360 public:
361 TYPEINFO();
362 ScCondFrmtItem( USHORT nWhich,
363 //! const ScConditionalFormat* pCondFrmt );
364 const ScConditionalFormat& rCondFrmt );
365 ScCondFrmtItem( const ScCondFrmtItem& rItem );
366 ~ScCondFrmtItem();
368 virtual String GetValueText() const;
369 virtual int operator==( const SfxPoolItem& ) const;
370 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
372 const ScConditionalFormat& GetData() const { return theCondFrmtData; }
374 private:
375 ScConditionalFormat theCondFrmtData;
380 #endif