Line data Source code
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 <svl/poolitem.hxx>
23 : #include "swdllapi.h"
24 : #include <hintids.hxx>
25 : #include <format.hxx>
26 :
27 : class ImageMap;
28 : class IntlWrapper;
29 :
30 : // URL, ServerMap und ClientMap
31 :
32 : class SW_DLLPUBLIC SwFmtURL: public SfxPoolItem
33 : {
34 : OUString sTargetFrameName; ///< Target frame for URL.
35 : OUString sURL; ///< Simple URL.
36 : OUString sName; ///< Name of the anchor.
37 : ImageMap *pMap; ///< ClientSide images.
38 :
39 : bool bIsServerMap; ///< A ServerSideImageMap with the URL.
40 :
41 : SwFmtURL& operator=( const SwFmtURL& );
42 :
43 : public:
44 : SwFmtURL();
45 :
46 : /// @@@ copy construction allowed, but assigment is not? @@@
47 : SwFmtURL( const SwFmtURL& );
48 :
49 : virtual ~SwFmtURL();
50 :
51 : /// "Pure virtual methods" of SfxPoolItem.
52 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
53 : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE;
54 : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
55 : SfxMapUnit eCoreMetric,
56 : SfxMapUnit ePresMetric,
57 : OUString &rText,
58 : const IntlWrapper* pIntl = 0 ) const SAL_OVERRIDE;
59 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
60 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
61 :
62 0 : void SetTargetFrameName( const OUString& rStr ) { sTargetFrameName = rStr; }
63 : void SetURL(const OUString &rURL, bool bServerMap);
64 : void SetMap( const ImageMap *pM ); ///< Pointer will be copied.
65 :
66 0 : OUString GetTargetFrameName()const { return sTargetFrameName; }
67 0 : OUString GetURL() const { return sURL; }
68 0 : bool IsServerMap() const { return bIsServerMap; }
69 0 : const ImageMap *GetMap() const { return pMap; }
70 0 : ImageMap *GetMap() { return pMap; }
71 :
72 0 : OUString GetName() const { return sName; }
73 0 : void SetName( const OUString& rNm ) { sName = rNm; }
74 : };
75 :
76 0 : inline const SwFmtURL &SwAttrSet::GetURL(sal_Bool bInP) const
77 0 : { return (const SwFmtURL&)Get( RES_URL,bInP); }
78 :
79 0 : inline const SwFmtURL &SwFmt::GetURL(sal_Bool bInP) const
80 0 : { return aSet.GetURL(bInP); }
81 :
82 : #endif
83 :
84 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|