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>
27 class SvxMacroTableDtor
;
28 class SwTextINetFormat
;
33 class SW_DLLPUBLIC SwFormatINetFormat
: public SfxPoolItem
35 friend class SwTextINetFormat
;
37 OUString msURL
; ///< URL.
38 OUString msTargetFrame
; ///< Target frame for URL.
39 OUString msINetFormatName
;
40 OUString msVisitedFormatName
;
41 OUString msHyperlinkName
; ///< Name of the link.
42 std::unique_ptr
<SvxMacroTableDtor
> mpMacroTable
;
43 SwTextINetFormat
* mpTextAttr
; ///< My TextAttribute.
44 sal_uInt16 mnINetFormatId
;
45 sal_uInt16 mnVisitedFormatId
;
47 SwFormatINetFormat( const OUString
& rURL
, const OUString
& rTarget
);
48 SwFormatINetFormat( const SwFormatINetFormat
& rAttr
);
49 SwFormatINetFormat(); ///< For TypeInfo.
50 virtual ~SwFormatINetFormat() override
;
52 static SfxPoolItem
* CreateDefault();
54 /// "Pure virtual methods" of SfxPoolItem.
55 virtual bool operator==( const SfxPoolItem
& ) const override
;
56 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= nullptr ) const override
;
57 virtual bool GetPresentation( SfxItemPresentation ePres
,
61 const IntlWrapper
* pIntl
= nullptr ) const override
;
63 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
64 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
66 const SwTextINetFormat
* GetTextINetFormat() const
71 const OUString
& GetValue() const
76 const OUString
& GetName() const
78 return msHyperlinkName
;
80 void SetName( const OUString
& rNm
)
82 msHyperlinkName
= rNm
;
85 const OUString
& GetTargetFrame() const
90 void SetINetFormatAndId(
92 const sal_uInt16 nId
)
94 msINetFormatName
= rNm
;
98 const OUString
& GetINetFormat() const
100 return msINetFormatName
;
103 sal_uInt16
GetINetFormatId() const
105 return mnINetFormatId
;
108 void SetVisitedFormatAndId(
110 const sal_uInt16 nId
)
112 msVisitedFormatName
= rNm
;
113 mnVisitedFormatId
= nId
;
116 const OUString
& GetVisitedFormat() const
118 return msVisitedFormatName
;
121 sal_uInt16
GetVisitedFormatId() const
123 return mnVisitedFormatId
;
126 /// Set a new MacroTable or clear the current one.
127 void SetMacroTable( const SvxMacroTableDtor
* pTable
);
128 const SvxMacroTableDtor
* GetMacroTable() const
130 return mpMacroTable
.get();
133 /// Macro getter and setter.
136 const SvxMacro
& rMacro
);
137 const SvxMacro
* GetMacro( sal_uInt16 nEvent
) const;
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */