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 _FMTINFMT_HXX 24 #define _FMTINFMT_HXX 25 26 #include <tools/string.hxx> 27 #include <svl/poolitem.hxx> 28 #include "swdllapi.h" 29 30 class SvxMacro; 31 class SvxMacroTableDtor; 32 class SwTxtINetFmt; 33 class IntlWrapper; 34 35 // ATT_INETFMT ********************************************* 36 37 class SW_DLLPUBLIC SwFmtINetFmt: public SfxPoolItem 38 { 39 friend class SwTxtINetFmt; 40 41 String msURL; // die URL 42 String msTargetFrame; // in diesen Frame soll die URL 43 String msINetFmtName; 44 String msVisitedFmtName; 45 String msHyperlinkName; // Name des Links 46 SvxMacroTableDtor* mpMacroTbl; 47 SwTxtINetFmt* mpTxtAttr; // mein TextAttribut 48 sal_uInt16 mnINetFmtId; 49 sal_uInt16 mnVisitedFmtId; 50 public: 51 SwFmtINetFmt( const String& rURL, const String& rTarget ); 52 SwFmtINetFmt( const SwFmtINetFmt& rAttr ); 53 SwFmtINetFmt(); // for TypeInfo 54 virtual ~SwFmtINetFmt(); 55 56 TYPEINFO(); 57 58 // "pure virtual Methoden" vom SfxPoolItem 59 virtual int operator==( const SfxPoolItem& ) const; 60 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; 61 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, 62 SfxMapUnit eCoreMetric, 63 SfxMapUnit ePresMetric, 64 String &rText, 65 const IntlWrapper* pIntl = 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 GetTxtINetFmt() const73 const SwTxtINetFmt* GetTxtINetFmt() const 74 { 75 return mpTxtAttr; 76 } GetTxtINetFmt()77 SwTxtINetFmt* GetTxtINetFmt() 78 { 79 return mpTxtAttr; 80 } 81 GetValue() const82 const String& GetValue() const 83 { 84 return msURL; 85 } 86 GetName() const87 const String& GetName() const 88 { 89 return msHyperlinkName; 90 } SetName(const String & rNm)91 void SetName( const String& rNm ) 92 { 93 msHyperlinkName = rNm; 94 } 95 GetTargetFrame() const96 const String& GetTargetFrame() const 97 { 98 return msTargetFrame; 99 } 100 SetINetFmtAndId(const String & rNm,const sal_uInt16 nId)101 void SetINetFmtAndId( 102 const String& rNm, 103 const sal_uInt16 nId ) 104 { 105 msINetFmtName = rNm; 106 mnINetFmtId = nId; 107 } 108 GetINetFmt() const109 const String& GetINetFmt() const 110 { 111 return msINetFmtName; 112 } 113 GetINetFmtId() const114 sal_uInt16 GetINetFmtId() const 115 { 116 return mnINetFmtId; 117 } 118 SetVisitedFmtAndId(const String & rNm,const sal_uInt16 nId)119 void SetVisitedFmtAndId( 120 const String& rNm, 121 const sal_uInt16 nId ) 122 { 123 msVisitedFmtName = rNm; 124 mnVisitedFmtId = nId; 125 } 126 GetVisitedFmt() const127 const String& GetVisitedFmt() const 128 { 129 return msVisitedFmtName; 130 } 131 GetVisitedFmtId() const132 sal_uInt16 GetVisitedFmtId() const 133 { 134 return mnVisitedFmtId; 135 } 136 137 // setze eine neue oder loesche die akt. MakroTabelle 138 void SetMacroTbl( const SvxMacroTableDtor* pTbl = 0 ); GetMacroTbl() const139 const SvxMacroTableDtor* GetMacroTbl() const 140 { 141 return mpMacroTbl; 142 } 143 144 // setze / erfrage ein Makro 145 void SetMacro( 146 sal_uInt16 nEvent, 147 const SvxMacro& rMacro ); 148 const SvxMacro* GetMacro( sal_uInt16 nEvent ) const; 149 }; 150 151 152 #endif 153 154