1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SW_INC_FMTINFMT_HXX
20 #define INCLUDED_SW_INC_FMTINFMT_HXX
22 #include <svl/poolitem.hxx>
28 class SvxMacroTableDtor
;
29 class SwTextINetFormat
;
31 enum class SvMacroItemId
: sal_uInt16
;
35 class SW_DLLPUBLIC SwFormatINetFormat final
37 , public sw::BroadcasterMixin
39 friend class SwTextINetFormat
;
41 OUString msURL
; ///< URL.
42 OUString msTargetFrame
; ///< Target frame for URL.
43 OUString msINetFormatName
;
44 OUString msVisitedFormatName
;
45 OUString msHyperlinkName
; ///< Name of the link.
46 std::unique_ptr
<SvxMacroTableDtor
> mpMacroTable
;
47 SwTextINetFormat
* mpTextAttr
; ///< My TextAttribute.
48 sal_uInt16 mnINetFormatId
;
49 sal_uInt16 mnVisitedFormatId
;
51 SwFormatINetFormat( const OUString
& rURL
, const OUString
& rTarget
);
52 SwFormatINetFormat( const SwFormatINetFormat
& rAttr
);
53 SwFormatINetFormat(); ///< For TypeInfo.
54 virtual ~SwFormatINetFormat() override
;
56 static SfxPoolItem
* CreateDefault();
58 /// "Pure virtual methods" of SfxPoolItem.
59 virtual bool operator==( const SfxPoolItem
& ) const override
;
60 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= nullptr ) const override
;
61 virtual bool GetPresentation( SfxItemPresentation ePres
,
65 const IntlWrapper
& rIntl
) const override
;
67 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
68 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
70 const SwTextINetFormat
* GetTextINetFormat() const
75 const OUString
& GetValue() const
80 const OUString
& GetName() const
82 return msHyperlinkName
;
84 void SetName( const OUString
& rNm
)
86 msHyperlinkName
= rNm
;
89 const OUString
& GetTargetFrame() const
94 void SetINetFormatAndId(
96 const sal_uInt16 nId
)
98 msINetFormatName
= rNm
;
102 const OUString
& GetINetFormat() const
104 return msINetFormatName
;
107 sal_uInt16
GetINetFormatId() const
109 return mnINetFormatId
;
112 void SetVisitedFormatAndId(
114 const sal_uInt16 nId
)
116 msVisitedFormatName
= rNm
;
117 mnVisitedFormatId
= nId
;
120 const OUString
& GetVisitedFormat() const
122 return msVisitedFormatName
;
125 sal_uInt16
GetVisitedFormatId() const
127 return mnVisitedFormatId
;
130 /// Set a new MacroTable or clear the current one.
131 void SetMacroTable( const SvxMacroTableDtor
* pTable
);
132 const SvxMacroTableDtor
* GetMacroTable() const
134 return mpMacroTable
.get();
137 /// Macro getter and setter.
138 void SetMacro( SvMacroItemId nEvent
, const SvxMacro
& rMacro
);
139 const SvxMacro
* GetMacro( SvMacroItemId nEvent
) const;
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */