update dev300-m57
[ooovba.git] / sc / source / ui / inc / uiitems.hxx
blob65814362fc6a7807b01ab62a05056ba81db8649a
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 "paramisc.hxx"
38 #include <svtools/poolitem.hxx>
40 class ScEditEngineDefaulter;
41 class EditTextObject;
42 class ScViewData;
43 class ScDPSaveData;
45 // ---------------------------------------------------------------------------
47 // Items
49 class ScInputStatusItem : public SfxPoolItem
51 ScAddress aCursorPos;
52 ScAddress aStartPos;
53 ScAddress aEndPos;
54 String aString;
55 EditTextObject* pEditData;
57 public:
58 TYPEINFO();
59 //UNUSED2008-05 ScInputStatusItem( USHORT nWhich,
60 //UNUSED2008-05 SCTAB nTab,
61 //UNUSED2008-05 SCCOL nCol, SCROW nRow,
62 //UNUSED2008-05 SCCOL nStartCol, SCROW nStartRow,
63 //UNUSED2008-05 SCCOL nEndCol, SCROW nSEndRow,
64 //UNUSED2008-05 const String& rString,
65 //UNUSED2008-05 const EditTextObject* pData );
67 ScInputStatusItem( USHORT nWhich,
68 const ScAddress& rCurPos,
69 const ScAddress& rStartPos,
70 const ScAddress& rEndPos,
71 const String& rString,
72 const EditTextObject* pData );
73 ScInputStatusItem( const ScInputStatusItem& rItem );
74 ~ScInputStatusItem();
76 virtual String GetValueText() const;
78 virtual int operator==( const SfxPoolItem& ) const;
79 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
81 const ScAddress& GetPos() const { return aCursorPos; }
82 const ScAddress& GetStartPos() const { return aStartPos; }
83 const ScAddress& GetEndPos() const { return aEndPos; }
84 SCTAB GetTab() const { return aCursorPos.Tab(); }
85 SCCOL GetCol() const { return aCursorPos.Col(); }
86 SCROW GetRow() const { return aCursorPos.Row(); }
87 SCCOL GetStartCol() const { return aStartPos.Col(); }
88 SCROW GetStartRow() const { return aStartPos.Row(); }
89 SCCOL GetEndCol() const { return aEndPos.Col(); }
90 SCROW GetEndRow() const { return aEndPos.Row(); }
92 const String& GetString() const { return aString; }
93 const EditTextObject* GetEditData() const { return pEditData; }
97 #define SC_TAB_INSERTED 1
98 #define SC_TAB_DELETED 2
99 #define SC_TAB_MOVED 3
100 #define SC_TAB_COPIED 4
101 #define SC_TAB_HIDDEN 5
103 class ScTablesHint : public SfxHint
105 USHORT nId;
106 SCTAB nTab1;
107 SCTAB nTab2;
109 public:
110 TYPEINFO();
111 ScTablesHint(USHORT nNewId, SCTAB nTable1, SCTAB nTable2=0);
112 ~ScTablesHint();
114 USHORT GetId() const { return nId; }
115 SCTAB GetTab1() const { return nTab1; }
116 SCTAB GetTab2() const { return nTab2; }
119 class ScEditViewHint : public SfxHint
121 ScEditEngineDefaulter* pEditEngine;
122 ScAddress aCursorPos;
124 public:
125 TYPEINFO();
126 ScEditViewHint( ScEditEngineDefaulter* pEngine, const ScAddress& rCurPos );
127 ~ScEditViewHint();
129 SCCOL GetCol() const { return aCursorPos.Col(); }
130 SCROW GetRow() const { return aCursorPos.Row(); }
131 SCTAB GetTab() const { return aCursorPos.Tab(); }
132 ScEditEngineDefaulter* GetEngine() const { return pEditEngine; }
134 private:
135 ScEditViewHint(); // disabled
138 class ScIndexHint : public SfxHint
140 USHORT nId;
141 USHORT nIndex;
143 public:
144 TYPEINFO();
145 ScIndexHint(USHORT nNewId, USHORT nIdx);
146 ~ScIndexHint();
148 USHORT GetId() const { return nId; }
149 USHORT GetIndex() const { return nIndex; }
152 //----------------------------------------------------------------------------
153 // Parameter-Item fuer den Sortierdialog:
155 class SC_DLLPUBLIC ScSortItem : public SfxPoolItem
157 public:
158 TYPEINFO();
159 ScSortItem( USHORT nWhich,
160 ScViewData* ptrViewData,
161 const ScSortParam* pSortData );
162 ScSortItem( USHORT nWhich,
163 const ScSortParam* pSortData );
164 ScSortItem( const ScSortItem& rItem );
165 ~ScSortItem();
167 virtual String GetValueText() const;
168 virtual int operator==( const SfxPoolItem& ) const;
169 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
170 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberUd ) const;
172 ScViewData* GetViewData () const { return pViewData; }
173 const ScSortParam& GetSortData () const { return theSortData; }
175 private:
176 ScViewData* pViewData;
177 ScSortParam theSortData;
180 //----------------------------------------------------------------------------
181 // Parameter-Item fuer den Filterdialog:
183 class SC_DLLPUBLIC ScQueryItem : public SfxPoolItem
185 public:
186 TYPEINFO();
187 ScQueryItem( USHORT nWhich,
188 ScViewData* ptrViewData,
189 const ScQueryParam* pQueryData );
190 ScQueryItem( USHORT nWhich,
191 const ScQueryParam* pQueryData );
192 ScQueryItem( const ScQueryItem& rItem );
193 ~ScQueryItem();
195 virtual String GetValueText() const;
196 virtual int operator==( const SfxPoolItem& ) const;
197 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
199 ScViewData* GetViewData () const { return pViewData; }
200 const ScQueryParam& GetQueryData() const { return theQueryData; }
202 BOOL GetAdvancedQuerySource(ScRange& rSource) const;
203 void SetAdvancedQuerySource(const ScRange* pSource);
205 private:
206 ScViewData* pViewData;
207 ScQueryParam theQueryData;
208 BOOL bIsAdvanced;
209 ScRange aAdvSource;
212 //----------------------------------------------------------------------------
213 // Parameter-Item fuer den Zwischenergebnisdialog:
215 class SC_DLLPUBLIC ScSubTotalItem : public SfxPoolItem
217 public:
218 TYPEINFO();
219 ScSubTotalItem( USHORT nWhich,
220 ScViewData* ptrViewData,
221 const ScSubTotalParam* pSubTotalData );
222 ScSubTotalItem( USHORT nWhich,
223 const ScSubTotalParam* pSubTotalData );
224 ScSubTotalItem( const ScSubTotalItem& rItem );
225 ~ScSubTotalItem();
227 virtual String GetValueText() const;
228 virtual int operator==( const SfxPoolItem& ) const;
229 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
230 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberUd ) const;
232 ScViewData* GetViewData () const { return pViewData; }
233 const ScSubTotalParam& GetSubTotalData() const { return theSubTotalData; }
235 private:
236 ScViewData* pViewData;
237 ScSubTotalParam theSubTotalData;
240 //----------------------------------------------------------------------------
241 // Parameter-Item fuer die Benutzerlisten-TabPage:
243 class SC_DLLPUBLIC ScUserListItem : public SfxPoolItem
245 public:
246 TYPEINFO();
247 ScUserListItem( USHORT nWhich );
248 ScUserListItem( const ScUserListItem& rItem );
249 ~ScUserListItem();
251 virtual String GetValueText() const;
252 virtual int operator==( const SfxPoolItem& ) const;
253 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
255 void SetUserList ( const ScUserList& rUserList );
256 ScUserList* GetUserList () const { return pUserList; }
258 private:
259 ScUserList* pUserList;
262 //----------------------------------------------------------------------------
263 // Parameter-Item fuer die Konsolidieren-Dialog
265 class ScConsolidateItem : public SfxPoolItem
267 public:
268 TYPEINFO();
269 ScConsolidateItem( USHORT nWhich,
270 const ScConsolidateParam* pParam );
271 ScConsolidateItem( const ScConsolidateItem& rItem );
272 ~ScConsolidateItem();
274 virtual String GetValueText() const;
275 virtual int operator==( const SfxPoolItem& ) const;
276 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
278 const ScConsolidateParam& GetData() const { return theConsData; }
280 private:
281 ScConsolidateParam theConsData;
284 //----------------------------------------------------------------------------
285 // Parameter-Item fuer den Pivot-Dialog
287 class ScPivotItem : public SfxPoolItem
289 public:
290 TYPEINFO();
291 ScPivotItem( USHORT nWhich, const ScDPSaveData* pData,
292 const ScRange* pRange, BOOL bNew );
293 ScPivotItem( const ScPivotItem& rItem );
294 ~ScPivotItem();
296 virtual String GetValueText() const;
297 virtual int operator==( const SfxPoolItem& ) const;
298 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
300 const ScDPSaveData& GetData() const { return *pSaveData; }
301 const ScRange& GetDestRange() const { return aDestRange; }
302 BOOL IsNewSheet() const { return bNewSheet; }
304 private:
305 ScDPSaveData* pSaveData;
306 ScRange aDestRange;
307 BOOL bNewSheet;
310 //----------------------------------------------------------------------------
311 // Parameter-Item fuer den Solver-Dialog
313 class ScSolveItem : public SfxPoolItem
315 public:
316 TYPEINFO();
317 ScSolveItem( USHORT nWhich,
318 const ScSolveParam* pParam );
319 ScSolveItem( const ScSolveItem& rItem );
320 ~ScSolveItem();
322 virtual String GetValueText() const;
323 virtual int operator==( const SfxPoolItem& ) const;
324 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
326 const ScSolveParam& GetData() const { return theSolveData; }
328 private:
329 ScSolveParam theSolveData;
332 //----------------------------------------------------------------------------
333 // Parameter-Item fuer den Mehrfachoperationen-Dialog
335 class ScTabOpItem : public SfxPoolItem
337 public:
338 TYPEINFO();
339 ScTabOpItem( USHORT nWhich,
340 const ScTabOpParam* pParam );
341 ScTabOpItem( const ScTabOpItem& rItem );
342 ~ScTabOpItem();
344 virtual String GetValueText() const;
345 virtual int operator==( const SfxPoolItem& ) const;
346 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
348 const ScTabOpParam& GetData() const { return theTabOpData; }
350 private:
351 ScTabOpParam theTabOpData;
354 //----------------------------------------------------------------------------
355 // Parameter-Item fuer den Dialog bedingte Formatierung
357 class ScCondFrmtItem : public SfxPoolItem
359 public:
360 TYPEINFO();
361 ScCondFrmtItem( USHORT nWhich,
362 //! const ScConditionalFormat* pCondFrmt );
363 const ScConditionalFormat& rCondFrmt );
364 ScCondFrmtItem( const ScCondFrmtItem& rItem );
365 ~ScCondFrmtItem();
367 virtual String GetValueText() const;
368 virtual int operator==( const SfxPoolItem& ) const;
369 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
371 const ScConditionalFormat& GetData() const { return theCondFrmtData; }
373 private:
374 ScConditionalFormat theCondFrmtData;
379 #endif