LibreOffice Module sw (master) 1
fmturl.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_FMTURL_HXX
20#define INCLUDED_SW_INC_FMTURL_HXX
21
22#include <memory>
23#include <svl/poolitem.hxx>
24#include "swdllapi.h"
25#include "hintids.hxx"
26#include "format.hxx"
27
28class ImageMap;
29class IntlWrapper;
30
33{
35 OUString m_sURL;
36 OUString m_sName;
37 std::unique_ptr<ImageMap>
39
41
42public:
44
45 SwFormatURL( const SwFormatURL& );
46
47 virtual ~SwFormatURL() override;
48
50 virtual bool operator==( const SfxPoolItem& ) const override;
51 virtual SwFormatURL* Clone( SfxItemPool* pPool = nullptr ) const override;
52 virtual bool GetPresentation( SfxItemPresentation ePres,
53 MapUnit eCoreMetric,
54 MapUnit ePresMetric,
55 OUString &rText,
56 const IntlWrapper& rIntl ) const override;
57 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
58 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
59
60 void SetTargetFrameName( const OUString& rStr ) { m_sTargetFrameName = rStr; }
61 void SetURL(const OUString &rURL, bool bServerMap);
62 void SetMap( const ImageMap *pM );
63
64 const OUString& GetTargetFrameName()const { return m_sTargetFrameName; }
65 const OUString& GetURL() const { return m_sURL; }
66 bool IsServerMap() const { return m_bIsServerMap; }
67 const ImageMap *GetMap() const { return m_pMap.get(); }
68 ImageMap *GetMap() { return m_pMap.get(); }
69
70 const OUString& GetName() const { return m_sName; }
71 void SetName( const OUString& rNm ) { m_sName = rNm; }
72};
73
74inline const SwFormatURL &SwAttrSet::GetURL(bool bInP) const
75 { return Get( RES_URL,bInP); }
76
77inline const SwFormatURL &SwFormat::GetURL(bool bInP) const
78 { return m_aSet.GetURL(bInP); }
79
80#endif
81
82/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
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
const SwFormatURL & GetURL(bool=true) const
Definition: fmturl.hxx:74
SfxPoolItem subclass that wraps a URL.
Definition: fmturl.hxx:33
const ImageMap * GetMap() const
Definition: fmturl.hxx:67
std::unique_ptr< ImageMap > m_pMap
ClientSide images.
Definition: fmturl.hxx:38
OUString m_sTargetFrameName
Target frame for URL.
Definition: fmturl.hxx:34
const OUString & GetName() const
Definition: fmturl.hxx:70
void SetName(const OUString &rNm)
Definition: fmturl.hxx:71
ImageMap * GetMap()
Definition: fmturl.hxx:68
const OUString & GetTargetFrameName() const
Definition: fmturl.hxx:64
OUString m_sName
Name of the anchor.
Definition: fmturl.hxx:36
bool m_bIsServerMap
A ServerSideImageMap with the URL.
Definition: fmturl.hxx:40
const OUString & GetURL() const
Definition: fmturl.hxx:65
bool IsServerMap() const
Definition: fmturl.hxx:66
OUString m_sURL
Simple URL.
Definition: fmturl.hxx:35
void SetTargetFrameName(const OUString &rStr)
Definition: fmturl.hxx:60
SwAttrSet m_aSet
Definition: format.hxx:51
const SwFormatURL & GetURL(bool=true) const
Definition: fmturl.hxx:77
OUString m_sURL
OUString m_sName
constexpr TypedWhichId< SwFormatURL > RES_URL(117)
MapUnit
SfxItemPresentation
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
unsigned char sal_uInt8