lok: Hide file linking in section
[LibreOffice.git] / sw / inc / fmtinfmt.hxx
blob731773f6f2b36f99b9502336755e8670cf1f4fc4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
23 #include "swdllapi.h"
24 #include <memory>
25 #include "calbck.hxx"
27 class SvxMacro;
28 class SvxMacroTableDtor;
29 class SwTextINetFormat;
30 class IntlWrapper;
31 enum class SvMacroItemId : sal_uInt16;
33 // ATT_INETFMT
35 class SW_DLLPUBLIC SwFormatINetFormat final
36 : public SfxPoolItem
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;
50 public:
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,
62 MapUnit eCoreMetric,
63 MapUnit ePresMetric,
64 OUString &rText,
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
72 return mpTextAttr;
75 const OUString& GetValue() const
77 return msURL;
80 const OUString& GetName() const
82 return msHyperlinkName;
84 void SetName( const OUString& rNm )
86 msHyperlinkName = rNm;
89 const OUString& GetTargetFrame() const
91 return msTargetFrame;
94 void SetINetFormatAndId(
95 const OUString& rNm,
96 const sal_uInt16 nId )
98 msINetFormatName = rNm;
99 mnINetFormatId = nId;
102 const OUString& GetINetFormat() const
104 return msINetFormatName;
107 sal_uInt16 GetINetFormatId() const
109 return mnINetFormatId;
112 void SetVisitedFormatAndId(
113 const OUString& rNm,
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;
142 #endif
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */