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>
31 #include <boost/scoped_ptr.hpp>
34 struct MisspellRanges
;
37 class ScEditEngineDefaulter
;
43 // ---------------------------------------------------------------------------
47 class ScInputStatusItem
: public SfxPoolItem
53 EditTextObject
* pEditData
;
54 const std::vector
<editeng::MisspellRanges
>* mpMisspellRanges
;
59 ScInputStatusItem( sal_uInt16 nWhich
,
60 const ScAddress
& rCurPos
,
61 const ScAddress
& rStartPos
,
62 const ScAddress
& rEndPos
,
63 const OUString
& rString
,
64 const EditTextObject
* pData
);
65 ScInputStatusItem( const ScInputStatusItem
& rItem
);
68 virtual OUString
GetValueText() const;
70 virtual int operator==( const SfxPoolItem
& ) const;
71 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
73 const ScAddress
& GetPos() const { return aCursorPos
; }
74 const ScAddress
& GetStartPos() const { return aStartPos
; }
75 const ScAddress
& GetEndPos() const { return aEndPos
; }
76 SCTAB
GetTab() const { return aCursorPos
.Tab(); }
77 SCCOL
GetCol() const { return aCursorPos
.Col(); }
78 SCROW
GetRow() const { return aCursorPos
.Row(); }
79 SCCOL
GetStartCol() const { return aStartPos
.Col(); }
80 SCROW
GetStartRow() const { return aStartPos
.Row(); }
81 SCCOL
GetEndCol() const { return aEndPos
.Col(); }
82 SCROW
GetEndRow() const { return aEndPos
.Row(); }
84 const OUString
& GetString() const { return aString
; }
85 const EditTextObject
* GetEditData() const { return pEditData
; }
87 void SetMisspellRanges( const std::vector
<editeng::MisspellRanges
>* pRanges
);
88 const std::vector
<editeng::MisspellRanges
>* GetMisspellRanges() const;
92 #define SC_TAB_INSERTED 1
93 #define SC_TAB_DELETED 2
94 #define SC_TAB_MOVED 3
95 #define SC_TAB_COPIED 4
96 #define SC_TAB_HIDDEN 5
97 #define SC_TABS_INSERTED 6
98 #define SC_TABS_DELETED 7
100 class ScTablesHint
: public SfxHint
108 ScTablesHint(sal_uInt16 nNewId
, SCTAB nTable1
, SCTAB nTable2
=0);
111 sal_uInt16
GetId() const { return nId
; }
112 SCTAB
GetTab1() const { return nTab1
; }
113 SCTAB
GetTab2() const { return nTab2
; }
116 class ScEditViewHint
: public SfxHint
118 ScEditEngineDefaulter
* pEditEngine
;
119 ScAddress aCursorPos
;
123 ScEditViewHint( ScEditEngineDefaulter
* pEngine
, const ScAddress
& rCurPos
);
126 SCCOL
GetCol() const { return aCursorPos
.Col(); }
127 SCROW
GetRow() const { return aCursorPos
.Row(); }
128 SCTAB
GetTab() const { return aCursorPos
.Tab(); }
129 ScEditEngineDefaulter
* GetEngine() const { return pEditEngine
; }
132 ScEditViewHint(); // disabled
135 class ScIndexHint
: public SfxHint
142 ScIndexHint(sal_uInt16 nNewId
, sal_uInt16 nIdx
);
145 sal_uInt16
GetId() const { return nId
; }
146 sal_uInt16
GetIndex() const { return nIndex
; }
149 //----------------------------------------------------------------------------
150 // Parameter item for the sort dialog:
152 class SC_DLLPUBLIC ScSortItem
: public SfxPoolItem
156 ScSortItem( sal_uInt16 nWhich
,
157 ScViewData
* ptrViewData
,
158 const ScSortParam
* pSortData
);
159 ScSortItem( sal_uInt16 nWhich
,
160 const ScSortParam
* pSortData
);
161 ScSortItem( const ScSortItem
& rItem
);
164 virtual OUString
GetValueText() const;
165 virtual int operator==( const SfxPoolItem
& ) const;
166 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
167 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberUd
) const;
169 ScViewData
* GetViewData () const { return pViewData
; }
170 const ScSortParam
& GetSortData () const { return theSortData
; }
173 ScViewData
* pViewData
;
174 ScSortParam theSortData
;
177 //----------------------------------------------------------------------------
179 class SC_DLLPUBLIC ScQueryItem
: public SfxPoolItem
183 ScQueryItem( sal_uInt16 nWhich
,
184 ScViewData
* ptrViewData
,
185 const ScQueryParam
* pQueryData
);
186 ScQueryItem( sal_uInt16 nWhich
,
187 const ScQueryParam
* pQueryData
);
188 ScQueryItem( const ScQueryItem
& rItem
);
191 virtual OUString
GetValueText() const;
192 virtual int operator==( const SfxPoolItem
& ) const;
193 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
195 ScViewData
* GetViewData () const { return pViewData
; }
196 const ScQueryParam
& GetQueryData() const;
198 bool GetAdvancedQuerySource(ScRange
& rSource
) const;
199 void SetAdvancedQuerySource(const ScRange
* pSource
);
202 boost::scoped_ptr
<ScQueryParam
> mpQueryData
;
203 ScViewData
* pViewData
;
208 //----------------------------------------------------------------------------
210 class SC_DLLPUBLIC ScSubTotalItem
: public SfxPoolItem
214 ScSubTotalItem( sal_uInt16 nWhich
,
215 ScViewData
* ptrViewData
,
216 const ScSubTotalParam
* pSubTotalData
);
217 ScSubTotalItem( sal_uInt16 nWhich
,
218 const ScSubTotalParam
* pSubTotalData
);
219 ScSubTotalItem( const ScSubTotalItem
& rItem
);
222 virtual OUString
GetValueText() const;
223 virtual int operator==( const SfxPoolItem
& ) const;
224 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
225 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberUd
) const;
227 ScViewData
* GetViewData () const { return pViewData
; }
228 const ScSubTotalParam
& GetSubTotalData() const { return theSubTotalData
; }
231 ScViewData
* pViewData
;
232 ScSubTotalParam theSubTotalData
;
235 //----------------------------------------------------------------------------
237 class SC_DLLPUBLIC ScUserListItem
: public SfxPoolItem
241 ScUserListItem( sal_uInt16 nWhich
);
242 ScUserListItem( const ScUserListItem
& rItem
);
245 virtual OUString
GetValueText() const;
246 virtual int operator==( const SfxPoolItem
& ) const;
247 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
249 void SetUserList ( const ScUserList
& rUserList
);
250 ScUserList
* GetUserList () const { return pUserList
; }
253 ScUserList
* pUserList
;
256 //----------------------------------------------------------------------------
258 class ScConsolidateItem
: public SfxPoolItem
262 ScConsolidateItem( sal_uInt16 nWhich
,
263 const ScConsolidateParam
* pParam
);
264 ScConsolidateItem( const ScConsolidateItem
& rItem
);
265 ~ScConsolidateItem();
267 virtual OUString
GetValueText() const;
268 virtual int operator==( const SfxPoolItem
& ) const;
269 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
271 const ScConsolidateParam
& GetData() const { return theConsData
; }
274 ScConsolidateParam theConsData
;
277 //----------------------------------------------------------------------------
279 class ScPivotItem
: public SfxPoolItem
283 ScPivotItem( sal_uInt16 nWhich
, const ScDPSaveData
* pData
,
284 const ScRange
* pRange
, sal_Bool bNew
);
285 ScPivotItem( const ScPivotItem
& rItem
);
288 virtual OUString
GetValueText() const;
289 virtual int operator==( const SfxPoolItem
& ) const;
290 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
292 const ScDPSaveData
& GetData() const { return *pSaveData
; }
293 const ScRange
& GetDestRange() const { return aDestRange
; }
294 sal_Bool
IsNewSheet() const { return bNewSheet
; }
297 ScDPSaveData
* pSaveData
;
302 //----------------------------------------------------------------------------
304 class ScSolveItem
: public SfxPoolItem
308 ScSolveItem( sal_uInt16 nWhich
,
309 const ScSolveParam
* pParam
);
310 ScSolveItem( const ScSolveItem
& rItem
);
313 virtual OUString
GetValueText() const;
314 virtual int operator==( const SfxPoolItem
& ) const;
315 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
317 const ScSolveParam
& GetData() const { return theSolveData
; }
320 ScSolveParam theSolveData
;
323 //----------------------------------------------------------------------------
325 class ScTabOpItem
: public SfxPoolItem
329 ScTabOpItem( sal_uInt16 nWhich
,
330 const ScTabOpParam
* pParam
);
331 ScTabOpItem( const ScTabOpItem
& rItem
);
334 virtual OUString
GetValueText() const;
335 virtual int operator==( const SfxPoolItem
& ) const;
336 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
338 const ScTabOpParam
& GetData() const { return theTabOpData
; }
341 ScTabOpParam theTabOpData
;
346 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */