1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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
35 #include "conditio.hxx"
36 #include "sortparam.hxx"
37 #include "queryparam.hxx"
38 #include "paramisc.hxx"
39 #include <svtools/poolitem.hxx>
41 class ScEditEngineDefaulter
;
46 // ---------------------------------------------------------------------------
50 class ScInputStatusItem
: public SfxPoolItem
56 EditTextObject
* pEditData
;
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
);
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
112 ScTablesHint(USHORT nNewId
, SCTAB nTable1
, SCTAB nTable2
=0);
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
;
127 ScEditViewHint( ScEditEngineDefaulter
* pEngine
, const ScAddress
& rCurPos
);
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
; }
136 ScEditViewHint(); // disabled
139 class ScIndexHint
: public SfxHint
146 ScIndexHint(USHORT nNewId
, USHORT nIdx
);
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
160 ScSortItem( USHORT nWhich
,
161 ScViewData
* ptrViewData
,
162 const ScSortParam
* pSortData
);
163 ScSortItem( USHORT nWhich
,
164 const ScSortParam
* pSortData
);
165 ScSortItem( const ScSortItem
& rItem
);
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
; }
177 ScViewData
* pViewData
;
178 ScSortParam theSortData
;
181 //----------------------------------------------------------------------------
182 // Parameter-Item fuer den Filterdialog:
184 class SC_DLLPUBLIC ScQueryItem
: public SfxPoolItem
188 ScQueryItem( USHORT nWhich
,
189 ScViewData
* ptrViewData
,
190 const ScQueryParam
* pQueryData
);
191 ScQueryItem( USHORT nWhich
,
192 const ScQueryParam
* pQueryData
);
193 ScQueryItem( const ScQueryItem
& rItem
);
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
);
207 ScViewData
* pViewData
;
208 ScQueryParam theQueryData
;
213 //----------------------------------------------------------------------------
214 // Parameter-Item fuer den Zwischenergebnisdialog:
216 class SC_DLLPUBLIC ScSubTotalItem
: public SfxPoolItem
220 ScSubTotalItem( USHORT nWhich
,
221 ScViewData
* ptrViewData
,
222 const ScSubTotalParam
* pSubTotalData
);
223 ScSubTotalItem( USHORT nWhich
,
224 const ScSubTotalParam
* pSubTotalData
);
225 ScSubTotalItem( const ScSubTotalItem
& rItem
);
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
; }
237 ScViewData
* pViewData
;
238 ScSubTotalParam theSubTotalData
;
241 //----------------------------------------------------------------------------
242 // Parameter-Item fuer die Benutzerlisten-TabPage:
244 class SC_DLLPUBLIC ScUserListItem
: public SfxPoolItem
248 ScUserListItem( USHORT nWhich
);
249 ScUserListItem( const ScUserListItem
& rItem
);
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
; }
260 ScUserList
* pUserList
;
263 //----------------------------------------------------------------------------
264 // Parameter-Item fuer die Konsolidieren-Dialog
266 class ScConsolidateItem
: public SfxPoolItem
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
; }
282 ScConsolidateParam theConsData
;
285 //----------------------------------------------------------------------------
286 // Parameter-Item fuer den Pivot-Dialog
288 class ScPivotItem
: public SfxPoolItem
292 ScPivotItem( USHORT nWhich
, const ScDPSaveData
* pData
,
293 const ScRange
* pRange
, BOOL bNew
);
294 ScPivotItem( const ScPivotItem
& rItem
);
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
; }
306 ScDPSaveData
* pSaveData
;
311 //----------------------------------------------------------------------------
312 // Parameter-Item fuer den Solver-Dialog
314 class ScSolveItem
: public SfxPoolItem
318 ScSolveItem( USHORT nWhich
,
319 const ScSolveParam
* pParam
);
320 ScSolveItem( const ScSolveItem
& rItem
);
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
; }
330 ScSolveParam theSolveData
;
333 //----------------------------------------------------------------------------
334 // Parameter-Item fuer den Mehrfachoperationen-Dialog
336 class ScTabOpItem
: public SfxPoolItem
340 ScTabOpItem( USHORT nWhich
,
341 const ScTabOpParam
* pParam
);
342 ScTabOpItem( const ScTabOpItem
& rItem
);
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
; }
352 ScTabOpParam theTabOpData
;
355 //----------------------------------------------------------------------------
356 // Parameter-Item fuer den Dialog bedingte Formatierung
358 class ScCondFrmtItem
: public SfxPoolItem
362 ScCondFrmtItem( USHORT nWhich
,
363 //! const ScConditionalFormat* pCondFrmt );
364 const ScConditionalFormat
& rCondFrmt
);
365 ScCondFrmtItem( const ScCondFrmtItem
& rItem
);
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
; }
375 ScConditionalFormat theCondFrmtData
;