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 "paramisc.hxx"
38 #include <svtools/poolitem.hxx>
40 class ScEditEngineDefaulter
;
45 // ---------------------------------------------------------------------------
49 class ScInputStatusItem
: public SfxPoolItem
55 EditTextObject
* pEditData
;
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
);
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
111 ScTablesHint(USHORT nNewId
, SCTAB nTable1
, SCTAB nTable2
=0);
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
;
126 ScEditViewHint( ScEditEngineDefaulter
* pEngine
, const ScAddress
& rCurPos
);
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
; }
135 ScEditViewHint(); // disabled
138 class ScIndexHint
: public SfxHint
145 ScIndexHint(USHORT nNewId
, USHORT nIdx
);
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
159 ScSortItem( USHORT nWhich
,
160 ScViewData
* ptrViewData
,
161 const ScSortParam
* pSortData
);
162 ScSortItem( USHORT nWhich
,
163 const ScSortParam
* pSortData
);
164 ScSortItem( const ScSortItem
& rItem
);
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
; }
176 ScViewData
* pViewData
;
177 ScSortParam theSortData
;
180 //----------------------------------------------------------------------------
181 // Parameter-Item fuer den Filterdialog:
183 class SC_DLLPUBLIC ScQueryItem
: public SfxPoolItem
187 ScQueryItem( USHORT nWhich
,
188 ScViewData
* ptrViewData
,
189 const ScQueryParam
* pQueryData
);
190 ScQueryItem( USHORT nWhich
,
191 const ScQueryParam
* pQueryData
);
192 ScQueryItem( const ScQueryItem
& rItem
);
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
);
206 ScViewData
* pViewData
;
207 ScQueryParam theQueryData
;
212 //----------------------------------------------------------------------------
213 // Parameter-Item fuer den Zwischenergebnisdialog:
215 class SC_DLLPUBLIC ScSubTotalItem
: public SfxPoolItem
219 ScSubTotalItem( USHORT nWhich
,
220 ScViewData
* ptrViewData
,
221 const ScSubTotalParam
* pSubTotalData
);
222 ScSubTotalItem( USHORT nWhich
,
223 const ScSubTotalParam
* pSubTotalData
);
224 ScSubTotalItem( const ScSubTotalItem
& rItem
);
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
; }
236 ScViewData
* pViewData
;
237 ScSubTotalParam theSubTotalData
;
240 //----------------------------------------------------------------------------
241 // Parameter-Item fuer die Benutzerlisten-TabPage:
243 class SC_DLLPUBLIC ScUserListItem
: public SfxPoolItem
247 ScUserListItem( USHORT nWhich
);
248 ScUserListItem( const ScUserListItem
& rItem
);
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
; }
259 ScUserList
* pUserList
;
262 //----------------------------------------------------------------------------
263 // Parameter-Item fuer die Konsolidieren-Dialog
265 class ScConsolidateItem
: public SfxPoolItem
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
; }
281 ScConsolidateParam theConsData
;
284 //----------------------------------------------------------------------------
285 // Parameter-Item fuer den Pivot-Dialog
287 class ScPivotItem
: public SfxPoolItem
291 ScPivotItem( USHORT nWhich
, const ScDPSaveData
* pData
,
292 const ScRange
* pRange
, BOOL bNew
);
293 ScPivotItem( const ScPivotItem
& rItem
);
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
; }
305 ScDPSaveData
* pSaveData
;
310 //----------------------------------------------------------------------------
311 // Parameter-Item fuer den Solver-Dialog
313 class ScSolveItem
: public SfxPoolItem
317 ScSolveItem( USHORT nWhich
,
318 const ScSolveParam
* pParam
);
319 ScSolveItem( const ScSolveItem
& rItem
);
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
; }
329 ScSolveParam theSolveData
;
332 //----------------------------------------------------------------------------
333 // Parameter-Item fuer den Mehrfachoperationen-Dialog
335 class ScTabOpItem
: public SfxPoolItem
339 ScTabOpItem( USHORT nWhich
,
340 const ScTabOpParam
* pParam
);
341 ScTabOpItem( const ScTabOpItem
& rItem
);
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
; }
351 ScTabOpParam theTabOpData
;
354 //----------------------------------------------------------------------------
355 // Parameter-Item fuer den Dialog bedingte Formatierung
357 class ScCondFrmtItem
: public SfxPoolItem
361 ScCondFrmtItem( USHORT nWhich
,
362 //! const ScConditionalFormat* pCondFrmt );
363 const ScConditionalFormat
& rCondFrmt
);
364 ScCondFrmtItem( const ScCondFrmtItem
& rItem
);
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
; }
374 ScConditionalFormat theCondFrmtData
;