xref: /trunk/main/sw/inc/fmturl.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _FMTURL_HXX
28 #define _FMTURL_HXX
29 
30 #include <svl/poolitem.hxx>
31 #include "swdllapi.h"
32 #include <hintids.hxx>
33 #include <format.hxx>
34 
35 class ImageMap;
36 class IntlWrapper;
37 
38 // URL, ServerMap und ClientMap
39 
40 class SW_DLLPUBLIC SwFmtURL: public SfxPoolItem
41 {
42     String    sTargetFrameName; // in diesen Frame soll die URL
43     String    sURL;             //Einfache URL
44     String    sName;            // Name des Anchors
45     ImageMap *pMap;             //ClientSide Images
46 
47     sal_Bool      bIsServerMap;     //mit der URL eine ServerSideImageMap
48 
49     SwFmtURL& operator=( const SwFmtURL& );
50 
51 public:
52     SwFmtURL();
53 
54     // @@@ copy construction allowed, but assigment is not? @@@
55     SwFmtURL( const SwFmtURL& );
56 
57     virtual ~SwFmtURL();
58 
59     // "pure virtual Methoden" vom SfxPoolItem
60     virtual int             operator==( const SfxPoolItem& ) const;
61     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const;
62     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
63                                     SfxMapUnit eCoreMetric,
64                                     SfxMapUnit ePresMetric,
65                                     String &rText,
66                                     const IntlWrapper*    pIntl = 0 ) const;
67     virtual sal_Bool             QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
68     virtual sal_Bool             PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
69 
70     void SetTargetFrameName( const String& rStr ) { sTargetFrameName = rStr; }
71     void SetURL( const String &rURL, sal_Bool bServerMap );
72     void SetMap( const ImageMap *pM );  //Pointer wird kopiert!
73 
74     const String   &GetTargetFrameName()const { return sTargetFrameName; }
75     const String   &GetURL()            const { return sURL; }
76           sal_Bool      IsServerMap()       const { return bIsServerMap; }
77     const ImageMap *GetMap()            const { return pMap; }
78           ImageMap *GetMap()                  { return pMap; }
79 
80     const String& GetName() const           { return sName; }
81     void SetName( const String& rNm )       { sName = rNm; }
82 };
83 
84 
85 inline const SwFmtURL &SwAttrSet::GetURL(sal_Bool bInP) const
86     { return (const SwFmtURL&)Get( RES_URL,bInP); }
87 
88 inline const SwFmtURL &SwFmt::GetURL(sal_Bool bInP) const
89     { return aSet.GetURL(bInP); }
90 
91 #endif
92 
93