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 _SVTOOLS_CTYPEITM_HXX 24 #define _SVTOOLS_CTYPEITM_HXX 25 26 #include <svl/inettype.hxx> 27 #include <svl/custritm.hxx> 28 29 //========================================================================= 30 31 class CntContentTypeItem : public CntUnencodedStringItem 32 { 33 private: 34 INetContentType _eType; 35 XubString _aPresentation; 36 37 public: 38 TYPEINFO(); 39 40 CntContentTypeItem(); 41 CntContentTypeItem( sal_uInt16 nWhich, const XubString& rType ); 42 CntContentTypeItem( sal_uInt16 nWhich, const INetContentType eType ); 43 CntContentTypeItem( const CntContentTypeItem& rOrig ); 44 45 virtual SfxPoolItem* Create( SvStream& rStream, 46 sal_uInt16 nItemVersion ) const; 47 virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; 48 49 virtual int operator==( const SfxPoolItem& rOrig ) const; 50 51 virtual sal_uInt16 GetVersion(sal_uInt16) const; 52 53 virtual SfxPoolItem* Clone( SfxItemPool *pPool = NULL ) const; 54 55 void SetValue( const XubString& rNewVal ); 56 void SetPresentation( const XubString& rNewVal ); 57 58 using SfxPoolItem::Compare; 59 virtual int Compare( const SfxPoolItem &rWith, const IntlWrapper& rIntlWrapper ) const; 60 61 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 62 SfxMapUnit eCoreMetric, 63 SfxMapUnit ePresMetric, 64 XubString &rText, 65 const IntlWrapper* pIntlWrapper = 0 ) const; 66 67 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, 68 sal_uInt8 nMemberId = 0 ) const; 69 virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, 70 sal_uInt8 nMemberId = 0); 71 72 INetContentType GetEnumValue() const; 73 74 void SetValue( const INetContentType eType ); 75 }; 76 77 #endif /* !_SVTOOLS_CTYPEITM_HXX */ 78 79