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 INCLUDED_SC_SOURCE_UI_INC_UIITEMS_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_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
;
45 class ScInputStatusItem
: public SfxPoolItem
51 EditTextObject
* pEditData
;
52 const std::vector
<editeng::MisspellRanges
>* mpMisspellRanges
;
57 ScInputStatusItem( sal_uInt16 nWhich
,
58 const ScAddress
& rCurPos
,
59 const ScAddress
& rStartPos
,
60 const ScAddress
& rEndPos
,
61 const OUString
& rString
,
62 const EditTextObject
* pData
);
63 ScInputStatusItem( const ScInputStatusItem
& rItem
);
64 virtual ~ScInputStatusItem();
66 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
67 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
69 const ScAddress
& GetPos() const { return aCursorPos
; }
70 const ScAddress
& GetStartPos() const { return aStartPos
; }
71 const ScAddress
& GetEndPos() const { return aEndPos
; }
72 SCTAB
GetTab() const { return aCursorPos
.Tab(); }
73 SCCOL
GetCol() const { return aCursorPos
.Col(); }
74 SCROW
GetRow() const { return aCursorPos
.Row(); }
75 SCCOL
GetStartCol() const { return aStartPos
.Col(); }
76 SCROW
GetStartRow() const { return aStartPos
.Row(); }
77 SCCOL
GetEndCol() const { return aEndPos
.Col(); }
78 SCROW
GetEndRow() const { return aEndPos
.Row(); }
80 const OUString
& GetString() const { return aString
; }
81 const EditTextObject
* GetEditData() const { return pEditData
; }
83 void SetMisspellRanges( const std::vector
<editeng::MisspellRanges
>* pRanges
);
84 const std::vector
<editeng::MisspellRanges
>* GetMisspellRanges() const { return mpMisspellRanges
;}
87 #define SC_TAB_INSERTED 1
88 #define SC_TAB_DELETED 2
89 #define SC_TAB_MOVED 3
90 #define SC_TAB_COPIED 4
91 #define SC_TAB_HIDDEN 5
92 #define SC_TABS_INSERTED 6
93 #define SC_TABS_DELETED 7
95 class ScTablesHint
: public SfxHint
102 ScTablesHint(sal_uInt16 nNewId
, SCTAB nTable1
, SCTAB nTable2
=0);
103 virtual ~ScTablesHint();
105 sal_uInt16
GetId() const { return nId
; }
106 SCTAB
GetTab1() const { return nTab1
; }
107 SCTAB
GetTab2() const { return nTab2
; }
110 class ScEditViewHint
: public SfxHint
112 ScEditEngineDefaulter
* pEditEngine
;
113 ScAddress aCursorPos
;
116 ScEditViewHint( ScEditEngineDefaulter
* pEngine
, const ScAddress
& rCurPos
);
117 virtual ~ScEditViewHint();
119 SCCOL
GetCol() const { return aCursorPos
.Col(); }
120 SCROW
GetRow() const { return aCursorPos
.Row(); }
121 SCTAB
GetTab() const { return aCursorPos
.Tab(); }
122 ScEditEngineDefaulter
* GetEngine() const { return pEditEngine
; }
125 ScEditViewHint(); // disabled
128 class ScIndexHint
: public SfxHint
134 ScIndexHint(sal_uInt16 nNewId
, sal_uInt16 nIdx
);
135 virtual ~ScIndexHint();
137 sal_uInt16
GetId() const { return nId
; }
138 sal_uInt16
GetIndex() const { return nIndex
; }
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
);
153 virtual ~ScSortItem();
155 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
156 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
157 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberUd
) const SAL_OVERRIDE
;
159 ScViewData
* GetViewData () const { return pViewData
; }
160 const ScSortParam
& GetSortData () const { return theSortData
; }
163 ScViewData
* pViewData
;
164 ScSortParam theSortData
;
167 class SC_DLLPUBLIC ScQueryItem
: public SfxPoolItem
171 ScQueryItem( sal_uInt16 nWhich
,
172 ScViewData
* ptrViewData
,
173 const ScQueryParam
* pQueryData
);
174 ScQueryItem( sal_uInt16 nWhich
,
175 const ScQueryParam
* pQueryData
);
176 ScQueryItem( const ScQueryItem
& rItem
);
177 virtual ~ScQueryItem();
179 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
180 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
182 ScViewData
* GetViewData () const { return pViewData
; }
183 const ScQueryParam
& GetQueryData() const;
185 bool GetAdvancedQuerySource(ScRange
& rSource
) const;
186 void SetAdvancedQuerySource(const ScRange
* pSource
);
189 boost::scoped_ptr
<ScQueryParam
> mpQueryData
;
190 ScViewData
* pViewData
;
195 class SC_DLLPUBLIC ScSubTotalItem
: public SfxPoolItem
199 ScSubTotalItem( sal_uInt16 nWhich
,
200 ScViewData
* ptrViewData
,
201 const ScSubTotalParam
* pSubTotalData
);
202 ScSubTotalItem( sal_uInt16 nWhich
,
203 const ScSubTotalParam
* pSubTotalData
);
204 ScSubTotalItem( const ScSubTotalItem
& rItem
);
205 virtual ~ScSubTotalItem();
207 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
208 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
209 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberUd
) const SAL_OVERRIDE
;
211 ScViewData
* GetViewData () const { return pViewData
; }
212 const ScSubTotalParam
& GetSubTotalData() const { return theSubTotalData
; }
215 ScViewData
* pViewData
;
216 ScSubTotalParam theSubTotalData
;
219 class SC_DLLPUBLIC ScUserListItem
: public SfxPoolItem
223 ScUserListItem( sal_uInt16 nWhich
);
224 ScUserListItem( const ScUserListItem
& rItem
);
225 virtual ~ScUserListItem();
227 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
228 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
230 void SetUserList ( const ScUserList
& rUserList
);
231 ScUserList
* GetUserList () const { return pUserList
; }
234 ScUserList
* pUserList
;
237 class ScConsolidateItem
: public SfxPoolItem
241 ScConsolidateItem( sal_uInt16 nWhich
,
242 const ScConsolidateParam
* pParam
);
243 ScConsolidateItem( const ScConsolidateItem
& rItem
);
244 virtual ~ScConsolidateItem();
246 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
247 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
249 const ScConsolidateParam
& GetData() const { return theConsData
; }
252 ScConsolidateParam theConsData
;
255 class ScPivotItem
: public SfxPoolItem
259 ScPivotItem( sal_uInt16 nWhich
, const ScDPSaveData
* pData
,
260 const ScRange
* pRange
, bool bNew
);
261 ScPivotItem( const ScPivotItem
& rItem
);
262 virtual ~ScPivotItem();
264 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
265 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
267 const ScDPSaveData
& GetData() const { return *pSaveData
; }
268 const ScRange
& GetDestRange() const { return aDestRange
; }
269 bool IsNewSheet() const { return bNewSheet
; }
272 ScDPSaveData
* pSaveData
;
277 class ScSolveItem
: public SfxPoolItem
281 ScSolveItem( sal_uInt16 nWhich
,
282 const ScSolveParam
* pParam
);
283 ScSolveItem( const ScSolveItem
& rItem
);
284 virtual ~ScSolveItem();
286 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
287 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
289 const ScSolveParam
& GetData() const { return theSolveData
; }
292 ScSolveParam theSolveData
;
295 class ScTabOpItem
: public SfxPoolItem
299 ScTabOpItem( sal_uInt16 nWhich
,
300 const ScTabOpParam
* pParam
);
301 ScTabOpItem( const ScTabOpItem
& rItem
);
302 virtual ~ScTabOpItem();
304 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
305 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
307 const ScTabOpParam
& GetData() const { return theTabOpData
; }
310 ScTabOpParam theTabOpData
;
315 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */