1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef SC_UIITEMS_HXX 25 #define SC_UIITEMS_HXX 26 27 #include "scdllapi.h" 28 #include "conditio.hxx" 29 #include "sortparam.hxx" 30 #include "queryparam.hxx" 31 #include "paramisc.hxx" 32 #include <svl/poolitem.hxx> 33 34 class ScEditEngineDefaulter; 35 class EditTextObject; 36 class ScViewData; 37 class ScDPSaveData; 38 39 // --------------------------------------------------------------------------- 40 41 // Items 42 43 class ScInputStatusItem : public SfxPoolItem 44 { 45 ScAddress aCursorPos; 46 ScAddress aStartPos; 47 ScAddress aEndPos; 48 String aString; 49 EditTextObject* pEditData; 50 51 public: 52 TYPEINFO(); 53 //UNUSED2008-05 ScInputStatusItem( sal_uInt16 nWhich, 54 //UNUSED2008-05 SCTAB nTab, 55 //UNUSED2008-05 SCCOL nCol, SCROW nRow, 56 //UNUSED2008-05 SCCOL nStartCol, SCROW nStartRow, 57 //UNUSED2008-05 SCCOL nEndCol, SCROW nSEndRow, 58 //UNUSED2008-05 const String& rString, 59 //UNUSED2008-05 const EditTextObject* pData ); 60 61 ScInputStatusItem( sal_uInt16 nWhich, 62 const ScAddress& rCurPos, 63 const ScAddress& rStartPos, 64 const ScAddress& rEndPos, 65 const String& rString, 66 const EditTextObject* pData ); 67 ScInputStatusItem( const ScInputStatusItem& rItem ); 68 ~ScInputStatusItem(); 69 70 virtual String GetValueText() const; 71 72 virtual int operator==( const SfxPoolItem& ) const; 73 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 74 GetPos() const75 const ScAddress& GetPos() const { return aCursorPos; } GetStartPos() const76 const ScAddress& GetStartPos() const { return aStartPos; } GetEndPos() const77 const ScAddress& GetEndPos() const { return aEndPos; } GetTab() const78 SCTAB GetTab() const { return aCursorPos.Tab(); } GetCol() const79 SCCOL GetCol() const { return aCursorPos.Col(); } GetRow() const80 SCROW GetRow() const { return aCursorPos.Row(); } GetStartCol() const81 SCCOL GetStartCol() const { return aStartPos.Col(); } GetStartRow() const82 SCROW GetStartRow() const { return aStartPos.Row(); } GetEndCol() const83 SCCOL GetEndCol() const { return aEndPos.Col(); } GetEndRow() const84 SCROW GetEndRow() const { return aEndPos.Row(); } 85 GetString() const86 const String& GetString() const { return aString; } GetEditData() const87 const EditTextObject* GetEditData() const { return pEditData; } 88 }; 89 90 91 #define SC_TAB_INSERTED 1 92 #define SC_TAB_DELETED 2 93 #define SC_TAB_MOVED 3 94 #define SC_TAB_COPIED 4 95 #define SC_TAB_HIDDEN 5 96 97 class ScTablesHint : public SfxHint 98 { 99 sal_uInt16 nId; 100 SCTAB nTab1; 101 SCTAB nTab2; 102 103 public: 104 TYPEINFO(); 105 ScTablesHint(sal_uInt16 nNewId, SCTAB nTable1, SCTAB nTable2=0); 106 ~ScTablesHint(); 107 GetId() const108 sal_uInt16 GetId() const { return nId; } GetTab1() const109 SCTAB GetTab1() const { return nTab1; } GetTab2() const110 SCTAB GetTab2() const { return nTab2; } 111 }; 112 113 class ScEditViewHint : public SfxHint 114 { 115 ScEditEngineDefaulter* pEditEngine; 116 ScAddress aCursorPos; 117 118 public: 119 TYPEINFO(); 120 ScEditViewHint( ScEditEngineDefaulter* pEngine, const ScAddress& rCurPos ); 121 ~ScEditViewHint(); 122 GetCol() const123 SCCOL GetCol() const { return aCursorPos.Col(); } GetRow() const124 SCROW GetRow() const { return aCursorPos.Row(); } GetTab() const125 SCTAB GetTab() const { return aCursorPos.Tab(); } GetEngine() const126 ScEditEngineDefaulter* GetEngine() const { return pEditEngine; } 127 128 private: 129 ScEditViewHint(); // disabled 130 }; 131 132 class ScIndexHint : public SfxHint 133 { 134 sal_uInt16 nId; 135 sal_uInt16 nIndex; 136 137 public: 138 TYPEINFO(); 139 ScIndexHint(sal_uInt16 nNewId, sal_uInt16 nIdx); 140 ~ScIndexHint(); 141 GetId() const142 sal_uInt16 GetId() const { return nId; } GetIndex() const143 sal_uInt16 GetIndex() const { return nIndex; } 144 }; 145 146 //---------------------------------------------------------------------------- 147 // Parameter-Item fuer den Sortierdialog: 148 149 class SC_DLLPUBLIC ScSortItem : public SfxPoolItem 150 { 151 public: 152 TYPEINFO(); 153 ScSortItem( sal_uInt16 nWhich, 154 ScViewData* ptrViewData, 155 const ScSortParam* pSortData ); 156 ScSortItem( sal_uInt16 nWhich, 157 const ScSortParam* pSortData ); 158 ScSortItem( const ScSortItem& rItem ); 159 ~ScSortItem(); 160 161 virtual String GetValueText() const; 162 virtual int operator==( const SfxPoolItem& ) const; 163 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 164 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const; 165 GetViewData() const166 ScViewData* GetViewData () const { return pViewData; } GetSortData() const167 const ScSortParam& GetSortData () const { return theSortData; } 168 169 private: 170 ScViewData* pViewData; 171 ScSortParam theSortData; 172 }; 173 174 //---------------------------------------------------------------------------- 175 // Parameter-Item fuer den Filterdialog: 176 177 class SC_DLLPUBLIC ScQueryItem : public SfxPoolItem 178 { 179 public: 180 TYPEINFO(); 181 ScQueryItem( sal_uInt16 nWhich, 182 ScViewData* ptrViewData, 183 const ScQueryParam* pQueryData ); 184 ScQueryItem( sal_uInt16 nWhich, 185 const ScQueryParam* pQueryData ); 186 ScQueryItem( const ScQueryItem& rItem ); 187 ~ScQueryItem(); 188 189 virtual String GetValueText() const; 190 virtual int operator==( const SfxPoolItem& ) const; 191 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 192 GetViewData() const193 ScViewData* GetViewData () const { return pViewData; } GetQueryData() const194 const ScQueryParam& GetQueryData() const { return theQueryData; } 195 196 sal_Bool GetAdvancedQuerySource(ScRange& rSource) const; 197 void SetAdvancedQuerySource(const ScRange* pSource); 198 199 private: 200 ScViewData* pViewData; 201 ScQueryParam theQueryData; 202 sal_Bool bIsAdvanced; 203 ScRange aAdvSource; 204 }; 205 206 //---------------------------------------------------------------------------- 207 // Parameter-Item fuer den Zwischenergebnisdialog: 208 209 class SC_DLLPUBLIC ScSubTotalItem : public SfxPoolItem 210 { 211 public: 212 TYPEINFO(); 213 ScSubTotalItem( sal_uInt16 nWhich, 214 ScViewData* ptrViewData, 215 const ScSubTotalParam* pSubTotalData ); 216 ScSubTotalItem( sal_uInt16 nWhich, 217 const ScSubTotalParam* pSubTotalData ); 218 ScSubTotalItem( const ScSubTotalItem& rItem ); 219 ~ScSubTotalItem(); 220 221 virtual String GetValueText() const; 222 virtual int operator==( const SfxPoolItem& ) const; 223 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 224 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const; 225 GetViewData() const226 ScViewData* GetViewData () const { return pViewData; } GetSubTotalData() const227 const ScSubTotalParam& GetSubTotalData() const { return theSubTotalData; } 228 229 private: 230 ScViewData* pViewData; 231 ScSubTotalParam theSubTotalData; 232 }; 233 234 //---------------------------------------------------------------------------- 235 // Parameter-Item fuer die Benutzerlisten-TabPage: 236 237 class SC_DLLPUBLIC ScUserListItem : public SfxPoolItem 238 { 239 public: 240 TYPEINFO(); 241 ScUserListItem( sal_uInt16 nWhich ); 242 ScUserListItem( const ScUserListItem& rItem ); 243 ~ScUserListItem(); 244 245 virtual String GetValueText() const; 246 virtual int operator==( const SfxPoolItem& ) const; 247 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 248 249 void SetUserList ( const ScUserList& rUserList ); GetUserList() const250 ScUserList* GetUserList () const { return pUserList; } 251 252 private: 253 ScUserList* pUserList; 254 }; 255 256 //---------------------------------------------------------------------------- 257 // Parameter-Item fuer die Konsolidieren-Dialog 258 259 class ScConsolidateItem : public SfxPoolItem 260 { 261 public: 262 TYPEINFO(); 263 ScConsolidateItem( sal_uInt16 nWhich, 264 const ScConsolidateParam* pParam ); 265 ScConsolidateItem( const ScConsolidateItem& rItem ); 266 ~ScConsolidateItem(); 267 268 virtual String GetValueText() const; 269 virtual int operator==( const SfxPoolItem& ) const; 270 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 271 GetData() const272 const ScConsolidateParam& GetData() const { return theConsData; } 273 274 private: 275 ScConsolidateParam theConsData; 276 }; 277 278 //---------------------------------------------------------------------------- 279 // Parameter-Item fuer den Pivot-Dialog 280 281 class ScPivotItem : public SfxPoolItem 282 { 283 public: 284 TYPEINFO(); 285 ScPivotItem( sal_uInt16 nWhich, const ScDPSaveData* pData, 286 const ScRange* pRange, sal_Bool bNew ); 287 ScPivotItem( const ScPivotItem& rItem ); 288 ~ScPivotItem(); 289 290 virtual String GetValueText() const; 291 virtual int operator==( const SfxPoolItem& ) const; 292 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 293 GetData() const294 const ScDPSaveData& GetData() const { return *pSaveData; } GetDestRange() const295 const ScRange& GetDestRange() const { return aDestRange; } IsNewSheet() const296 sal_Bool IsNewSheet() const { return bNewSheet; } 297 298 private: 299 ScDPSaveData* pSaveData; 300 ScRange aDestRange; 301 sal_Bool bNewSheet; 302 }; 303 304 //---------------------------------------------------------------------------- 305 // Parameter-Item fuer den Solver-Dialog 306 307 class ScSolveItem : public SfxPoolItem 308 { 309 public: 310 TYPEINFO(); 311 ScSolveItem( sal_uInt16 nWhich, 312 const ScSolveParam* pParam ); 313 ScSolveItem( const ScSolveItem& rItem ); 314 ~ScSolveItem(); 315 316 virtual String GetValueText() const; 317 virtual int operator==( const SfxPoolItem& ) const; 318 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 319 GetData() const320 const ScSolveParam& GetData() const { return theSolveData; } 321 322 private: 323 ScSolveParam theSolveData; 324 }; 325 326 //---------------------------------------------------------------------------- 327 // Parameter-Item fuer den Mehrfachoperationen-Dialog 328 329 class ScTabOpItem : public SfxPoolItem 330 { 331 public: 332 TYPEINFO(); 333 ScTabOpItem( sal_uInt16 nWhich, 334 const ScTabOpParam* pParam ); 335 ScTabOpItem( const ScTabOpItem& rItem ); 336 ~ScTabOpItem(); 337 338 virtual String GetValueText() const; 339 virtual int operator==( const SfxPoolItem& ) const; 340 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 341 GetData() const342 const ScTabOpParam& GetData() const { return theTabOpData; } 343 344 private: 345 ScTabOpParam theTabOpData; 346 }; 347 348 //---------------------------------------------------------------------------- 349 // Parameter-Item fuer den Dialog bedingte Formatierung 350 351 class ScCondFrmtItem : public SfxPoolItem 352 { 353 public: 354 TYPEINFO(); 355 ScCondFrmtItem( sal_uInt16 nWhich, 356 //! const ScConditionalFormat* pCondFrmt ); 357 const ScConditionalFormat& rCondFrmt ); 358 ScCondFrmtItem( const ScCondFrmtItem& rItem ); 359 ~ScCondFrmtItem(); 360 361 virtual String GetValueText() const; 362 virtual int operator==( const SfxPoolItem& ) const; 363 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 364 GetData() const365 const ScConditionalFormat& GetData() const { return theCondFrmtData; } 366 367 private: 368 ScConditionalFormat theCondFrmtData; 369 }; 370 371 372 373 #endif 374 375