LibreOffice Module sw (master) 1
fmtinfmt.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_SW_INC_FMTINFMT_HXX
20#define INCLUDED_SW_INC_FMTINFMT_HXX
21
22#include <svl/poolitem.hxx>
23#include "swdllapi.h"
24#include <memory>
25#include "calbck.hxx"
26
27class SvxMacro;
30class IntlWrapper;
31enum class SvMacroItemId : sal_uInt16;
32
33// ATT_INETFMT
34
36 : public SfxPoolItem
38{
39 friend class SwTextINetFormat;
40
41 OUString msURL;
42 OUString msTargetFrame;
45 OUString msHyperlinkName;
46 std::unique_ptr<SvxMacroTableDtor> mpMacroTable;
48 sal_uInt16 mnINetFormatId;
50public:
51 SwFormatINetFormat( OUString aURL, OUString aTarget );
54 virtual ~SwFormatINetFormat() override;
55
56 static SfxPoolItem* CreateDefault();
57
59 virtual bool operator==( const SfxPoolItem& ) const override;
60 virtual SwFormatINetFormat* 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;
66
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;
69
71 {
72 return mpTextAttr;
73 }
74
75 const OUString& GetValue() const
76 {
77 return msURL;
78 }
79
80 const OUString& GetName() const
81 {
82 return msHyperlinkName;
83 }
84 void SetName( const OUString& rNm )
85 {
86 msHyperlinkName = rNm;
87 }
88
89 const OUString& GetTargetFrame() const
90 {
91 return msTargetFrame;
92 }
93
95 const OUString& rNm,
96 const sal_uInt16 nId )
97 {
98 msINetFormatName = rNm;
99 mnINetFormatId = nId;
100 }
101
102 const OUString& GetINetFormat() const
103 {
104 return msINetFormatName;
105 }
106
107 sal_uInt16 GetINetFormatId() const
108 {
109 return mnINetFormatId;
110 }
111
113 const OUString& rNm,
114 const sal_uInt16 nId )
115 {
116 msVisitedFormatName = rNm;
117 mnVisitedFormatId = nId;
118 }
119
120 const OUString& GetVisitedFormat() const
121 {
122 return msVisitedFormatName;
123 }
124
125 sal_uInt16 GetVisitedFormatId() const
126 {
127 return mnVisitedFormatId;
128 }
129
131 void SetMacroTable( const SvxMacroTableDtor* pTable );
133 {
134 return mpMacroTable.get();
135 }
136
138 void SetMacro( SvMacroItemId nEvent, const SvxMacro& rMacro );
139 const SvxMacro* GetMacro( SvMacroItemId nEvent ) const;
140};
141
142#endif
143
144/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
virtual bool operator==(const SfxPoolItem &) const=0
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
void SetVisitedFormatAndId(const OUString &rNm, const sal_uInt16 nId)
Definition: fmtinfmt.hxx:112
const OUString & GetValue() const
Definition: fmtinfmt.hxx:75
const SvxMacroTableDtor * GetMacroTable() const
Definition: fmtinfmt.hxx:132
sal_uInt16 GetINetFormatId() const
Definition: fmtinfmt.hxx:107
const OUString & GetName() const
Definition: fmtinfmt.hxx:80
sal_uInt16 mnINetFormatId
Definition: fmtinfmt.hxx:48
const OUString & GetINetFormat() const
Definition: fmtinfmt.hxx:102
std::unique_ptr< SvxMacroTableDtor > mpMacroTable
Definition: fmtinfmt.hxx:46
OUString msTargetFrame
Target frame for URL.
Definition: fmtinfmt.hxx:42
OUString msURL
URL.
Definition: fmtinfmt.hxx:41
OUString msINetFormatName
Definition: fmtinfmt.hxx:43
OUString msHyperlinkName
Name of the link.
Definition: fmtinfmt.hxx:45
SwTextINetFormat * mpTextAttr
My TextAttribute.
Definition: fmtinfmt.hxx:47
void SetINetFormatAndId(const OUString &rNm, const sal_uInt16 nId)
Definition: fmtinfmt.hxx:94
const OUString & GetVisitedFormat() const
Definition: fmtinfmt.hxx:120
OUString msVisitedFormatName
Definition: fmtinfmt.hxx:44
const SwTextINetFormat * GetTextINetFormat() const
Definition: fmtinfmt.hxx:70
sal_uInt16 mnVisitedFormatId
Definition: fmtinfmt.hxx:49
const OUString & GetTargetFrame() const
Definition: fmtinfmt.hxx:89
void SetName(const OUString &rNm)
Definition: fmtinfmt.hxx:84
sal_uInt16 GetVisitedFormatId() const
Definition: fmtinfmt.hxx:125
SwTextAttr subclass that tracks the location of the wrapped SwFormatURL.
Definition: txtinet.hxx:30
SvMacroItemId
MapUnit
sal_Int16 nId
SfxItemPresentation
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
unsigned char sal_uInt8