1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _FCHRFMT_HXX 28 #define _FCHRFMT_HXX 29 30 31 #include <svl/poolitem.hxx> 32 #include <calbck.hxx> 33 #include <format.hxx> 34 35 class SwCharFmt; 36 class SwTxtCharFmt; 37 class IntlWrapper; 38 39 // ATT_CHARFMT ********************************************* 40 41 42 class SW_DLLPUBLIC SwFmtCharFmt: public SfxPoolItem, public SwClient 43 { 44 friend class SwTxtCharFmt; 45 SwTxtCharFmt* pTxtAttr; // mein TextAttribut 46 47 public: 48 SwFmtCharFmt() : pTxtAttr(0) {} 49 50 // single argument ctors shall be explicit. 51 explicit SwFmtCharFmt( SwCharFmt *pFmt ); 52 virtual ~SwFmtCharFmt(); 53 54 // @@@ public copy ctor, but no copy assignment? 55 SwFmtCharFmt( const SwFmtCharFmt& rAttr ); 56 protected: 57 virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); 58 59 private: 60 // @@@ public copy ctor, but no copy assignment? 61 SwFmtCharFmt & operator= (const SwFmtCharFmt &); 62 public: 63 64 TYPEINFO(); 65 66 // "pure virtual Methoden" vom SfxPoolItem 67 virtual int operator==( const SfxPoolItem& ) const; 68 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; 69 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 70 SfxMapUnit eCoreMetric, 71 SfxMapUnit ePresMetric, 72 String &rText, 73 const IntlWrapper* pIntl = 0 ) const; 74 75 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 76 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 77 78 virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; 79 80 void SetCharFmt( SwFmt* pFmt ) { pFmt->Add(this); } 81 SwCharFmt* GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); } 82 }; 83 #endif 84 85