2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-11-05 02:17:53 +01:00
|
|
|
#ifndef INCLUDED_SW_INC_FMTURL_HXX
|
|
|
|
#define INCLUDED_SW_INC_FMTURL_HXX
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2017-04-14 08:42:15 +10:00
|
|
|
#include <memory>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/poolitem.hxx>
|
2004-08-23 07:35:26 +00:00
|
|
|
#include "swdllapi.h"
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <hintids.hxx>
|
|
|
|
#include <format.hxx>
|
|
|
|
|
|
|
|
class ImageMap;
|
2001-05-13 02:33:31 +00:00
|
|
|
class IntlWrapper;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2017-04-08 05:34:28 +00:00
|
|
|
// URL, ServerMap and ClientMap
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
class SW_DLLPUBLIC SwFormatURL: public SfxPoolItem
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2013-08-18 01:03:43 +02:00
|
|
|
OUString sTargetFrameName; ///< Target frame for URL.
|
|
|
|
OUString sURL; ///< Simple URL.
|
|
|
|
OUString sName; ///< Name of the anchor.
|
2017-01-11 14:26:47 +02:00
|
|
|
std::unique_ptr<ImageMap>
|
|
|
|
pMap; ///< ClientSide images.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-02-19 12:30:34 +01:00
|
|
|
bool bIsServerMap; ///< A ServerSideImageMap with the URL.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-10-12 15:25:41 +02:00
|
|
|
SwFormatURL& operator=( const SwFormatURL& ) = delete;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
public:
|
2015-05-20 13:05:49 +02:00
|
|
|
SwFormatURL();
|
2004-08-23 07:35:26 +00:00
|
|
|
|
2017-03-02 09:44:44 +01:00
|
|
|
/// @@@ copy construction allowed, but assignment is not? @@@
|
2015-05-20 13:05:49 +02:00
|
|
|
SwFormatURL( const SwFormatURL& );
|
2004-08-23 07:35:26 +00:00
|
|
|
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SwFormatURL() override;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2012-09-11 15:16:03 +03:00
|
|
|
/// "Pure virtual methods" of SfxPoolItem.
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool operator==( const SfxPoolItem& ) const override;
|
2015-11-10 10:25:48 +01:00
|
|
|
virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
|
2014-07-24 11:31:39 +02:00
|
|
|
virtual bool GetPresentation( SfxItemPresentation ePres,
|
2016-08-19 09:31:35 +01:00
|
|
|
MapUnit eCoreMetric,
|
|
|
|
MapUnit ePresMetric,
|
|
|
|
OUString &rText,
|
|
|
|
const IntlWrapper* pIntl = nullptr ) const override;
|
2015-11-05 15:55:58 +02:00
|
|
|
virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
|
|
|
|
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2013-08-18 01:03:43 +02:00
|
|
|
void SetTargetFrameName( const OUString& rStr ) { sTargetFrameName = rStr; }
|
2013-01-20 11:07:21 +00:00
|
|
|
void SetURL(const OUString &rURL, bool bServerMap);
|
2012-09-11 15:16:03 +03:00
|
|
|
void SetMap( const ImageMap *pM ); ///< Pointer will be copied.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2016-04-13 15:33:00 +02:00
|
|
|
const OUString& GetTargetFrameName()const { return sTargetFrameName; }
|
|
|
|
const OUString& GetURL() const { return sURL; }
|
2014-02-19 12:30:34 +01:00
|
|
|
bool IsServerMap() const { return bIsServerMap; }
|
2017-01-11 14:26:47 +02:00
|
|
|
const ImageMap *GetMap() const { return pMap.get(); }
|
|
|
|
ImageMap *GetMap() { return pMap.get(); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2016-04-13 15:33:00 +02:00
|
|
|
const OUString& GetName() const { return sName; }
|
2013-08-18 01:03:43 +02:00
|
|
|
void SetName( const OUString& rNm ) { sName = rNm; }
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
inline const SwFormatURL &SwAttrSet::GetURL(bool bInP) const
|
|
|
|
{ return static_cast<const SwFormatURL&>(Get( RES_URL,bInP)); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
inline const SwFormatURL &SwFormat::GetURL(bool bInP) const
|
2015-04-30 20:24:30 +02:00
|
|
|
{ return m_aSet.GetURL(bInP); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-14 08:30:41 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|