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