1*38d50f7bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*38d50f7bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*38d50f7bSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*38d50f7bSAndrew Rist * distributed with this work for additional information 6*38d50f7bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*38d50f7bSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*38d50f7bSAndrew Rist * "License"); you may not use this file except in compliance 9*38d50f7bSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*38d50f7bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*38d50f7bSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*38d50f7bSAndrew Rist * software distributed under the License is distributed on an 15*38d50f7bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*38d50f7bSAndrew Rist * KIND, either express or implied. See the License for the 17*38d50f7bSAndrew Rist * specific language governing permissions and limitations 18*38d50f7bSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*38d50f7bSAndrew Rist *************************************************************/ 21*38d50f7bSAndrew Rist 22*38d50f7bSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SC_SCATTR_HXX 25cdf0e10cSrcweir #define SC_SCATTR_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <svl/poolitem.hxx> 28cdf0e10cSrcweir #include <svl/intitem.hxx> 29cdf0e10cSrcweir #include <svl/eitem.hxx> 30cdf0e10cSrcweir #include "scdllapi.h" 31cdf0e10cSrcweir #include "global.hxx" 32cdf0e10cSrcweir #include "address.hxx" 33cdf0e10cSrcweir 34cdf0e10cSrcweir //------------------------------------------------------------------------ 35cdf0e10cSrcweir 36cdf0e10cSrcweir // Flags fuer durch Merge verdeckte Zellen 37cdf0e10cSrcweir // und Control fuer Auto-Filter 38cdf0e10cSrcweir #define SC_MF_HOR 0x0001 39cdf0e10cSrcweir #define SC_MF_VER 0x0002 40cdf0e10cSrcweir #define SC_MF_AUTO 0x0004 /// autofilter arrow 41cdf0e10cSrcweir #define SC_MF_BUTTON 0x0008 /// field button for datapilot 42cdf0e10cSrcweir #define SC_MF_SCENARIO 0x0010 43cdf0e10cSrcweir #define SC_MF_BUTTON_POPUP 0x0020 /// dp button with popup arrow 44cdf0e10cSrcweir #define SC_MF_HIDDEN_MEMBER 0x0040 /// dp field button with presence of hidden member 45cdf0e10cSrcweir #define SC_MF_DP_TABLE 0x0080 /// dp table output 46cdf0e10cSrcweir 47cdf0e10cSrcweir #define SC_MF_ALL 0x00FF 48cdf0e10cSrcweir 49cdf0e10cSrcweir 50cdf0e10cSrcweir class EditTextObject; 51cdf0e10cSrcweir class SvxBorderLine; 52cdf0e10cSrcweir 53cdf0e10cSrcweir sal_Bool SC_DLLPUBLIC ScHasPriority( const SvxBorderLine* pThis, const SvxBorderLine* pOther ); 54cdf0e10cSrcweir 55cdf0e10cSrcweir //------------------------------------------------------------------------ 56cdf0e10cSrcweir 57cdf0e10cSrcweir class SC_DLLPUBLIC ScMergeAttr: public SfxPoolItem 58cdf0e10cSrcweir { 59cdf0e10cSrcweir SCsCOL nColMerge; 60cdf0e10cSrcweir SCsROW nRowMerge; 61cdf0e10cSrcweir public: 62cdf0e10cSrcweir TYPEINFO(); 63cdf0e10cSrcweir ScMergeAttr(); 64cdf0e10cSrcweir ScMergeAttr( SCsCOL nCol, SCsROW nRow = 0); 65cdf0e10cSrcweir ScMergeAttr( const ScMergeAttr& ); 66cdf0e10cSrcweir ~ScMergeAttr(); 67cdf0e10cSrcweir 68cdf0e10cSrcweir virtual String GetValueText() const; 69cdf0e10cSrcweir 70cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 71cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 72cdf0e10cSrcweir virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const; 73cdf0e10cSrcweir 74cdf0e10cSrcweir SCsCOL GetColMerge() const {return nColMerge; } 75cdf0e10cSrcweir SCsROW GetRowMerge() const {return nRowMerge; } 76cdf0e10cSrcweir 77cdf0e10cSrcweir sal_Bool IsMerged() const { return nColMerge>1 || nRowMerge>1; } 78cdf0e10cSrcweir 79cdf0e10cSrcweir inline ScMergeAttr& operator=(const ScMergeAttr& rMerge) 80cdf0e10cSrcweir { 81cdf0e10cSrcweir nColMerge = rMerge.nColMerge; 82cdf0e10cSrcweir nRowMerge = rMerge.nRowMerge; 83cdf0e10cSrcweir return *this; 84cdf0e10cSrcweir } 85cdf0e10cSrcweir }; 86cdf0e10cSrcweir 87cdf0e10cSrcweir //------------------------------------------------------------------------ 88cdf0e10cSrcweir 89cdf0e10cSrcweir class SC_DLLPUBLIC ScMergeFlagAttr: public SfxInt16Item 90cdf0e10cSrcweir { 91cdf0e10cSrcweir public: 92cdf0e10cSrcweir ScMergeFlagAttr(); 93cdf0e10cSrcweir ScMergeFlagAttr(sal_Int16 nFlags); 94cdf0e10cSrcweir ~ScMergeFlagAttr(); 95cdf0e10cSrcweir 96cdf0e10cSrcweir sal_Bool IsHorOverlapped() const { return ( GetValue() & SC_MF_HOR ) != 0; } 97cdf0e10cSrcweir sal_Bool IsVerOverlapped() const { return ( GetValue() & SC_MF_VER ) != 0; } 98cdf0e10cSrcweir sal_Bool IsOverlapped() const { return ( GetValue() & ( SC_MF_HOR | SC_MF_VER ) ) != 0; } 99cdf0e10cSrcweir 100cdf0e10cSrcweir sal_Bool HasAutoFilter() const { return ( GetValue() & SC_MF_AUTO ) != 0; } 101cdf0e10cSrcweir sal_Bool HasButton() const { return ( GetValue() & SC_MF_BUTTON ) != 0; } 102cdf0e10cSrcweir bool HasDPTable() const { return ( GetValue() & SC_MF_DP_TABLE ) != 0; } 103cdf0e10cSrcweir 104cdf0e10cSrcweir sal_Bool IsScenario() const { return ( GetValue() & SC_MF_SCENARIO ) != 0; } 105cdf0e10cSrcweir }; 106cdf0e10cSrcweir 107cdf0e10cSrcweir //------------------------------------------------------------------------ 108cdf0e10cSrcweir class SC_DLLPUBLIC ScProtectionAttr: public SfxPoolItem 109cdf0e10cSrcweir { 110cdf0e10cSrcweir sal_Bool bProtection; // Zelle schuetzen 111cdf0e10cSrcweir sal_Bool bHideFormula; // Formel nicht Anzeigen 112cdf0e10cSrcweir sal_Bool bHideCell; // Zelle nicht Anzeigen 113cdf0e10cSrcweir sal_Bool bHidePrint; // Zelle nicht Ausdrucken 114cdf0e10cSrcweir public: 115cdf0e10cSrcweir TYPEINFO(); 116cdf0e10cSrcweir ScProtectionAttr(); 117cdf0e10cSrcweir ScProtectionAttr( sal_Bool bProtect, 118cdf0e10cSrcweir sal_Bool bHFormula = sal_False, 119cdf0e10cSrcweir sal_Bool bHCell = sal_False, 120cdf0e10cSrcweir sal_Bool bHPrint = sal_False); 121cdf0e10cSrcweir ScProtectionAttr( const ScProtectionAttr& ); 122cdf0e10cSrcweir ~ScProtectionAttr(); 123cdf0e10cSrcweir 124cdf0e10cSrcweir virtual String GetValueText() const; 125cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( 126cdf0e10cSrcweir SfxItemPresentation ePres, 127cdf0e10cSrcweir SfxMapUnit eCoreMetric, 128cdf0e10cSrcweir SfxMapUnit ePresMetric, 129cdf0e10cSrcweir String& rText, 130cdf0e10cSrcweir const IntlWrapper* pIntl = 0 ) const; 131cdf0e10cSrcweir 132cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 133cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 134cdf0e10cSrcweir virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const; 135cdf0e10cSrcweir 136cdf0e10cSrcweir virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 137cdf0e10cSrcweir virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 138cdf0e10cSrcweir 139cdf0e10cSrcweir sal_Bool GetProtection() const { return bProtection; } 140cdf0e10cSrcweir sal_Bool SetProtection( sal_Bool bProtect); 141cdf0e10cSrcweir sal_Bool GetHideFormula() const { return bHideFormula; } 142cdf0e10cSrcweir sal_Bool SetHideFormula( sal_Bool bHFormula); 143cdf0e10cSrcweir sal_Bool GetHideCell() const { return bHideCell; } 144cdf0e10cSrcweir sal_Bool SetHideCell( sal_Bool bHCell); 145cdf0e10cSrcweir sal_Bool GetHidePrint() const { return bHidePrint; } 146cdf0e10cSrcweir sal_Bool SetHidePrint( sal_Bool bHPrint); 147cdf0e10cSrcweir inline ScProtectionAttr& operator=(const ScProtectionAttr& rProtection) 148cdf0e10cSrcweir { 149cdf0e10cSrcweir bProtection = rProtection.bProtection; 150cdf0e10cSrcweir bHideFormula = rProtection.bHideFormula; 151cdf0e10cSrcweir bHideCell = rProtection.bHideCell; 152cdf0e10cSrcweir bHidePrint = rProtection.bHidePrint; 153cdf0e10cSrcweir return *this; 154cdf0e10cSrcweir } 155cdf0e10cSrcweir }; 156cdf0e10cSrcweir 157cdf0e10cSrcweir 158cdf0e10cSrcweir //---------------------------------------------------------------------------- 159cdf0e10cSrcweir // ScRangeItem: verwaltet einen Tabellenbereich 160cdf0e10cSrcweir 161cdf0e10cSrcweir #define SCR_INVALID 0x01 162cdf0e10cSrcweir #define SCR_ALLTABS 0x02 163cdf0e10cSrcweir #define SCR_TONEWTAB 0x04 164cdf0e10cSrcweir 165cdf0e10cSrcweir class ScRangeItem : public SfxPoolItem 166cdf0e10cSrcweir { 167cdf0e10cSrcweir public: 168cdf0e10cSrcweir TYPEINFO(); 169cdf0e10cSrcweir 170cdf0e10cSrcweir inline ScRangeItem( const sal_uInt16 nWhich ); 171cdf0e10cSrcweir inline ScRangeItem( const sal_uInt16 nWhich, 172cdf0e10cSrcweir const ScRange& rRange, 173cdf0e10cSrcweir const sal_uInt16 nNewFlags = 0 ); 174cdf0e10cSrcweir inline ScRangeItem( const ScRangeItem& rCpy ); 175cdf0e10cSrcweir 176cdf0e10cSrcweir inline ScRangeItem& operator=( const ScRangeItem &rCpy ); 177cdf0e10cSrcweir 178cdf0e10cSrcweir // "pure virtual Methoden" vom SfxPoolItem 179cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 180cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 181cdf0e10cSrcweir SfxMapUnit eCoreMetric, 182cdf0e10cSrcweir SfxMapUnit ePresMetric, 183cdf0e10cSrcweir String &rText, 184cdf0e10cSrcweir const IntlWrapper* pIntl = 0 ) const; 185cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 186cdf0e10cSrcweir 187cdf0e10cSrcweir const ScRange& GetRange() const { return aRange; } 188cdf0e10cSrcweir void SetRange( const ScRange& rNew ) { aRange = rNew; } 189cdf0e10cSrcweir 190cdf0e10cSrcweir sal_uInt16 GetFlags() const { return nFlags; } 191cdf0e10cSrcweir void SetFlags( sal_uInt16 nNew ) { nFlags = nNew; } 192cdf0e10cSrcweir 193cdf0e10cSrcweir private: 194cdf0e10cSrcweir ScRange aRange; 195cdf0e10cSrcweir sal_uInt16 nFlags; 196cdf0e10cSrcweir }; 197cdf0e10cSrcweir 198cdf0e10cSrcweir inline ScRangeItem::ScRangeItem( const sal_uInt16 nWhichP ) 199cdf0e10cSrcweir : SfxPoolItem( nWhichP ), nFlags( SCR_INVALID ) // == ungueltige Area 200cdf0e10cSrcweir { 201cdf0e10cSrcweir } 202cdf0e10cSrcweir 203cdf0e10cSrcweir inline ScRangeItem::ScRangeItem( const sal_uInt16 nWhichP, 204cdf0e10cSrcweir const ScRange& rRange, 205cdf0e10cSrcweir const sal_uInt16 nNew ) 206cdf0e10cSrcweir : SfxPoolItem( nWhichP ), aRange( rRange ), nFlags( nNew ) 207cdf0e10cSrcweir { 208cdf0e10cSrcweir } 209cdf0e10cSrcweir 210cdf0e10cSrcweir inline ScRangeItem::ScRangeItem( const ScRangeItem& rCpy ) 211cdf0e10cSrcweir : SfxPoolItem( rCpy.Which() ), aRange( rCpy.aRange ), nFlags( rCpy.nFlags ) 212cdf0e10cSrcweir {} 213cdf0e10cSrcweir 214cdf0e10cSrcweir inline ScRangeItem& ScRangeItem::operator=( const ScRangeItem &rCpy ) 215cdf0e10cSrcweir { 216cdf0e10cSrcweir aRange = rCpy.aRange; 217cdf0e10cSrcweir return *this; 218cdf0e10cSrcweir } 219cdf0e10cSrcweir 220cdf0e10cSrcweir //---------------------------------------------------------------------------- 221cdf0e10cSrcweir // ScTableListItem: verwaltet eine Liste von Tabellen 222cdf0e10cSrcweir //---------------------------------------------------------------------------- 223cdf0e10cSrcweir class ScTableListItem : public SfxPoolItem 224cdf0e10cSrcweir { 225cdf0e10cSrcweir public: 226cdf0e10cSrcweir TYPEINFO(); 227cdf0e10cSrcweir 228cdf0e10cSrcweir inline ScTableListItem( const sal_uInt16 nWhich ); 229cdf0e10cSrcweir ScTableListItem( const ScTableListItem& rCpy ); 230cdf0e10cSrcweir //UNUSED2008-05 ScTableListItem( const sal_uInt16 nWhich, const List& rList ); 231cdf0e10cSrcweir ~ScTableListItem(); 232cdf0e10cSrcweir 233cdf0e10cSrcweir ScTableListItem& operator=( const ScTableListItem &rCpy ); 234cdf0e10cSrcweir 235cdf0e10cSrcweir // "pure virtual Methoden" vom SfxPoolItem 236cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 237cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 238cdf0e10cSrcweir SfxMapUnit eCoreMetric, 239cdf0e10cSrcweir SfxMapUnit ePresMetric, 240cdf0e10cSrcweir String &rText, 241cdf0e10cSrcweir const IntlWrapper* pIntl = 0 ) const; 242cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 243cdf0e10cSrcweir 244cdf0e10cSrcweir //UNUSED2009-05 sal_Bool GetTableList( List& aList ) const; 245cdf0e10cSrcweir //UNUSED2009-05 void SetTableList( const List& aList ); 246cdf0e10cSrcweir 247cdf0e10cSrcweir public: 248cdf0e10cSrcweir sal_uInt16 nCount; 249cdf0e10cSrcweir SCTAB* pTabArr; 250cdf0e10cSrcweir }; 251cdf0e10cSrcweir 252cdf0e10cSrcweir inline ScTableListItem::ScTableListItem( const sal_uInt16 nWhichP ) 253cdf0e10cSrcweir : SfxPoolItem(nWhichP), nCount(0), pTabArr(NULL) 254cdf0e10cSrcweir {} 255cdf0e10cSrcweir 256cdf0e10cSrcweir //---------------------------------------------------------------------------- 257cdf0e10cSrcweir // Seitenformat-Item: Kopf-/Fusszeileninhalte 258cdf0e10cSrcweir 259cdf0e10cSrcweir #define SC_HF_LEFTAREA 1 260cdf0e10cSrcweir #define SC_HF_CENTERAREA 2 261cdf0e10cSrcweir #define SC_HF_RIGHTAREA 3 262cdf0e10cSrcweir 263cdf0e10cSrcweir class SC_DLLPUBLIC ScPageHFItem : public SfxPoolItem 264cdf0e10cSrcweir { 265cdf0e10cSrcweir EditTextObject* pLeftArea; 266cdf0e10cSrcweir EditTextObject* pCenterArea; 267cdf0e10cSrcweir EditTextObject* pRightArea; 268cdf0e10cSrcweir 269cdf0e10cSrcweir public: 270cdf0e10cSrcweir TYPEINFO(); 271cdf0e10cSrcweir ScPageHFItem( sal_uInt16 nWhich ); 272cdf0e10cSrcweir ScPageHFItem( const ScPageHFItem& rItem ); 273cdf0e10cSrcweir ~ScPageHFItem(); 274cdf0e10cSrcweir 275cdf0e10cSrcweir virtual String GetValueText() const; 276cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 277cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 278cdf0e10cSrcweir 279cdf0e10cSrcweir virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const; 280cdf0e10cSrcweir 281cdf0e10cSrcweir virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 282cdf0e10cSrcweir virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 283cdf0e10cSrcweir 284cdf0e10cSrcweir const EditTextObject* GetLeftArea() const { return pLeftArea; } 285cdf0e10cSrcweir const EditTextObject* GetCenterArea() const { return pCenterArea; } 286cdf0e10cSrcweir const EditTextObject* GetRightArea() const { return pRightArea; } 287cdf0e10cSrcweir 288cdf0e10cSrcweir void SetLeftArea( const EditTextObject& rNew ); 289cdf0e10cSrcweir void SetCenterArea( const EditTextObject& rNew ); 290cdf0e10cSrcweir void SetRightArea( const EditTextObject& rNew ); 291cdf0e10cSrcweir 292cdf0e10cSrcweir //Set mit Uebereignung der Pointer, nArea siehe defines oben 293cdf0e10cSrcweir void SetArea( EditTextObject *pNew, int nArea ); 294cdf0e10cSrcweir }; 295cdf0e10cSrcweir 296cdf0e10cSrcweir 297cdf0e10cSrcweir //---------------------------------------------------------------------------- 298cdf0e10cSrcweir // Seitenformat-Item: Kopf-/Fusszeileninhalte 299cdf0e10cSrcweir 300cdf0e10cSrcweir class SC_DLLPUBLIC ScViewObjectModeItem: public SfxEnumItem 301cdf0e10cSrcweir { 302cdf0e10cSrcweir public: 303cdf0e10cSrcweir TYPEINFO(); 304cdf0e10cSrcweir 305cdf0e10cSrcweir ScViewObjectModeItem( sal_uInt16 nWhich ); 306cdf0e10cSrcweir ScViewObjectModeItem( sal_uInt16 nWhich, ScVObjMode eMode ); 307cdf0e10cSrcweir ~ScViewObjectModeItem(); 308cdf0e10cSrcweir 309cdf0e10cSrcweir virtual sal_uInt16 GetValueCount() const; 310cdf0e10cSrcweir virtual String GetValueText( sal_uInt16 nVal ) const; 311cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 312cdf0e10cSrcweir virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; 313cdf0e10cSrcweir virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const; 314cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 315cdf0e10cSrcweir SfxMapUnit eCoreMetric, 316cdf0e10cSrcweir SfxMapUnit ePresMetric, 317cdf0e10cSrcweir String& rText, 318cdf0e10cSrcweir const IntlWrapper* pIntl = 0 ) const; 319cdf0e10cSrcweir }; 320cdf0e10cSrcweir 321cdf0e10cSrcweir //---------------------------------------------------------------------------- 322cdf0e10cSrcweir // 323cdf0e10cSrcweir 324cdf0e10cSrcweir class ScDoubleItem : public SfxPoolItem 325cdf0e10cSrcweir { 326cdf0e10cSrcweir public: 327cdf0e10cSrcweir TYPEINFO(); 328cdf0e10cSrcweir ScDoubleItem( sal_uInt16 nWhich, double nVal=0 ); 329cdf0e10cSrcweir ScDoubleItem( const ScDoubleItem& rItem ); 330cdf0e10cSrcweir ~ScDoubleItem(); 331cdf0e10cSrcweir 332cdf0e10cSrcweir virtual String GetValueText() const; 333cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 334cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 335cdf0e10cSrcweir 336cdf0e10cSrcweir virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const; 337cdf0e10cSrcweir 338cdf0e10cSrcweir double GetValue() const { return nValue; } 339cdf0e10cSrcweir 340cdf0e10cSrcweir void SetValue( const double nVal ) { nValue = nVal;} 341cdf0e10cSrcweir 342cdf0e10cSrcweir private: 343cdf0e10cSrcweir double nValue; 344cdf0e10cSrcweir }; 345cdf0e10cSrcweir 346cdf0e10cSrcweir 347cdf0e10cSrcweir // ============================================================================ 348cdf0e10cSrcweir 349cdf0e10cSrcweir /** Member ID for "page scale to width" value in QueryValue() and PutValue(). */ 350cdf0e10cSrcweir const sal_uInt8 SC_MID_PAGE_SCALETO_WIDTH = 1; 351cdf0e10cSrcweir /** Member ID for "page scale to height" value in QueryValue() and PutValue(). */ 352cdf0e10cSrcweir const sal_uInt8 SC_MID_PAGE_SCALETO_HEIGHT = 2; 353cdf0e10cSrcweir 354cdf0e10cSrcweir 355cdf0e10cSrcweir /** Contains the "scale to width/height" attribute in page styles. */ 356cdf0e10cSrcweir class SC_DLLPUBLIC ScPageScaleToItem : public SfxPoolItem 357cdf0e10cSrcweir { 358cdf0e10cSrcweir public: 359cdf0e10cSrcweir TYPEINFO(); 360cdf0e10cSrcweir 361cdf0e10cSrcweir /** Default c'tor sets the width and height to 0. */ 362cdf0e10cSrcweir explicit ScPageScaleToItem(); 363cdf0e10cSrcweir explicit ScPageScaleToItem( sal_uInt16 nWidth, sal_uInt16 nHeight ); 364cdf0e10cSrcweir 365cdf0e10cSrcweir virtual ~ScPageScaleToItem(); 366cdf0e10cSrcweir 367cdf0e10cSrcweir virtual ScPageScaleToItem* Clone( SfxItemPool* = 0 ) const; 368cdf0e10cSrcweir 369cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& rCmp ) const; 370cdf0e10cSrcweir 371cdf0e10cSrcweir inline sal_uInt16 GetWidth() const { return mnWidth; } 372cdf0e10cSrcweir inline sal_uInt16 GetHeight() const { return mnHeight; } 373cdf0e10cSrcweir inline bool IsValid() const { return mnWidth || mnHeight; } 374cdf0e10cSrcweir 375cdf0e10cSrcweir inline void SetWidth( sal_uInt16 nWidth ) { mnWidth = nWidth; } 376cdf0e10cSrcweir inline void SetHeight( sal_uInt16 nHeight ) { mnHeight = nHeight; } 377cdf0e10cSrcweir inline void Set( sal_uInt16 nWidth, sal_uInt16 nHeight ) 378cdf0e10cSrcweir { mnWidth = nWidth; mnHeight = nHeight; } 379cdf0e10cSrcweir inline void SetInvalid() { mnWidth = mnHeight = 0; } 380cdf0e10cSrcweir 381cdf0e10cSrcweir virtual SfxItemPresentation GetPresentation( 382cdf0e10cSrcweir SfxItemPresentation ePresentation, 383cdf0e10cSrcweir SfxMapUnit, SfxMapUnit, 384cdf0e10cSrcweir XubString& rText, 385cdf0e10cSrcweir const IntlWrapper* = 0 ) const; 386cdf0e10cSrcweir 387cdf0e10cSrcweir virtual sal_Bool QueryValue( ::com::sun::star::uno::Any& rAny, sal_uInt8 nMemberId = 0 ) const; 388cdf0e10cSrcweir virtual sal_Bool PutValue( const ::com::sun::star::uno::Any& rAny, sal_uInt8 nMemberId = 0 ); 389cdf0e10cSrcweir 390cdf0e10cSrcweir private: 391cdf0e10cSrcweir sal_uInt16 mnWidth; 392cdf0e10cSrcweir sal_uInt16 mnHeight; 393cdf0e10cSrcweir }; 394cdf0e10cSrcweir 395cdf0e10cSrcweir // ============================================================================ 396cdf0e10cSrcweir 397cdf0e10cSrcweir #endif 398cdf0e10cSrcweir 399