1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
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
;
38 // ---------------------------------------------------------------------------
42 class ScInputStatusItem
: public SfxPoolItem
48 EditTextObject
* pEditData
;
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
);
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
99 ScTablesHint(sal_uInt16 nNewId
, SCTAB nTable1
, SCTAB nTable2
=0);
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
;
114 ScEditViewHint( ScEditEngineDefaulter
* pEngine
, const ScAddress
& rCurPos
);
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
; }
123 ScEditViewHint(); // disabled
126 class ScIndexHint
: public SfxHint
133 ScIndexHint(sal_uInt16 nNewId
, sal_uInt16 nIdx
);
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
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
);
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
; }
164 ScViewData
* pViewData
;
165 ScSortParam theSortData
;
168 //----------------------------------------------------------------------------
170 class SC_DLLPUBLIC ScQueryItem
: public SfxPoolItem
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
);
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
);
193 boost::scoped_ptr
<ScQueryParam
> mpQueryData
;
194 ScViewData
* pViewData
;
199 //----------------------------------------------------------------------------
201 class SC_DLLPUBLIC ScSubTotalItem
: public SfxPoolItem
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
);
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
; }
222 ScViewData
* pViewData
;
223 ScSubTotalParam theSubTotalData
;
226 //----------------------------------------------------------------------------
228 class SC_DLLPUBLIC ScUserListItem
: public SfxPoolItem
232 ScUserListItem( sal_uInt16 nWhich
);
233 ScUserListItem( const ScUserListItem
& rItem
);
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
; }
244 ScUserList
* pUserList
;
247 //----------------------------------------------------------------------------
249 class ScConsolidateItem
: public SfxPoolItem
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
; }
265 ScConsolidateParam theConsData
;
268 //----------------------------------------------------------------------------
270 class ScPivotItem
: public SfxPoolItem
274 ScPivotItem( sal_uInt16 nWhich
, const ScDPSaveData
* pData
,
275 const ScRange
* pRange
, sal_Bool bNew
);
276 ScPivotItem( const ScPivotItem
& rItem
);
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
; }
288 ScDPSaveData
* pSaveData
;
293 //----------------------------------------------------------------------------
295 class ScSolveItem
: public SfxPoolItem
299 ScSolveItem( sal_uInt16 nWhich
,
300 const ScSolveParam
* pParam
);
301 ScSolveItem( const ScSolveItem
& rItem
);
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
; }
311 ScSolveParam theSolveData
;
314 //----------------------------------------------------------------------------
316 class ScTabOpItem
: public SfxPoolItem
320 ScTabOpItem( sal_uInt16 nWhich
,
321 const ScTabOpParam
* pParam
);
322 ScTabOpItem( const ScTabOpItem
& rItem
);
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
; }
332 ScTabOpParam theTabOpData
;
337 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */