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 #ifndef _FMTSRND_HXX 24 #define _FMTSRND_HXX 25 26 #include "swdllapi.h" 27 #include <hintids.hxx> 28 #include <format.hxx> 29 #include <svl/eitem.hxx> 30 31 // --> OD 2006-08-15 #i68520# - refactoring 32 // separate enumeration <SwSurround> in own header file 33 #include <fmtsrndenum.hxx> 34 // <-- 35 class IntlWrapper; 36 37 //SwFmtSurround, wie soll sich der --------------- 38 // Dokumentinhalt unter dem Rahmen verhalten --- 39 40 class SW_DLLPUBLIC SwFmtSurround: public SfxEnumItem 41 { 42 sal_Bool bAnchorOnly :1; 43 sal_Bool bContour :1; 44 sal_Bool bOutside :1; 45 public: 46 SwFmtSurround( SwSurround eNew = SURROUND_PARALLEL ); 47 SwFmtSurround( const SwFmtSurround & ); 48 inline SwFmtSurround &operator=( const SwFmtSurround &rCpy ); 49 50 // "pure virtual Methoden" vom SfxPoolItem 51 virtual int operator==( const SfxPoolItem& ) const; 52 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; 53 virtual sal_uInt16 GetValueCount() const; 54 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 55 SfxMapUnit eCoreMetric, 56 SfxMapUnit ePresMetric, 57 String &rText, 58 const IntlWrapper* pIntl = 0 ) const; 59 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 60 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 61 62 63 SwSurround GetSurround()const { return SwSurround( GetValue() ); } 64 sal_Bool IsAnchorOnly() const { return bAnchorOnly; } 65 sal_Bool IsContour() const { return bContour; } 66 sal_Bool IsOutside() const { return bOutside; } 67 void SetSurround ( SwSurround eNew ){ SfxEnumItem::SetValue( sal_uInt16( eNew ) ); } 68 void SetAnchorOnly( sal_Bool bNew ) { bAnchorOnly = bNew; } 69 void SetContour( sal_Bool bNew ) { bContour = bNew; } 70 void SetOutside( sal_Bool bNew ) { bOutside = bNew; } 71 }; 72 73 inline SwFmtSurround &SwFmtSurround::operator=( const SwFmtSurround &rCpy ) 74 { 75 bAnchorOnly = rCpy.IsAnchorOnly(); 76 bContour = rCpy.IsContour(); 77 bOutside = rCpy.IsOutside(); 78 SfxEnumItem::SetValue( rCpy.GetValue() ); 79 return *this; 80 } 81 82 inline const SwFmtSurround &SwAttrSet::GetSurround(sal_Bool bInP) const 83 { return (const SwFmtSurround&)Get( RES_SURROUND,bInP); } 84 85 inline const SwFmtSurround &SwFmt::GetSurround(sal_Bool bInP) const 86 { return aSet.GetSurround(bInP); } 87 88 #endif 89 90