merge the formfield patch from ooo-build
[ooovba.git] / binfilter / inc / bf_sd / imapinfo.hxx
blobaf3e9987ee747054ab17a1e12d7838b1d337b62f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: imapinfo.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SD_IMAPINFO_HXX
32 #define _SD_IMAPINFO_HXX
34 #ifndef _SD_SDIOCMPT_HXX
35 #include "sdiocmpt.hxx"
36 #endif
37 #ifndef _SD_GLOB_HXX
38 #include "glob.hxx"
39 #endif
40 #ifndef _SVDOBJ_HXX //autogen
41 #include <bf_svx/svdobj.hxx>
42 #endif
43 #ifndef _IMAP_HXX //autogen
44 #include <bf_svtools/imap.hxx>
45 #endif
46 #include "bf_so3/staticbaseurl.hxx"
47 namespace binfilter {
50 /*************************************************************************
54 \************************************************************************/
56 class SdIMapInfo : public SdrObjUserData, public SfxListener
59 ImageMap aImageMap;
61 public:
62 SdIMapInfo() :
63 SdrObjUserData( SdUDInventor, SD_IMAPINFO_ID, 0 ) {};
65 SdIMapInfo( const ImageMap& rImageMap ) :
66 SdrObjUserData( SdUDInventor, SD_IMAPINFO_ID, 0 ),
67 aImageMap( rImageMap ) {};
69 SdIMapInfo( const SdIMapInfo& rIMapInfo ) :
70 SdrObjUserData( SdUDInventor, SD_IMAPINFO_ID, 0 ),
71 aImageMap( rIMapInfo.aImageMap ) {};
73 virtual ~SdIMapInfo() {};
75 virtual SdrObjUserData* Clone( SdrObject* pObj ) const { return new SdIMapInfo( *this ); }
77 virtual void WriteData( SvStream& rOStm );
78 virtual void ReadData( SvStream& rIStm );
80 void SetImageMap( const ImageMap& rIMap ) { aImageMap = rIMap; }
81 const ImageMap& GetImageMap() const { return aImageMap; }
85 /*************************************************************************
89 \************************************************************************/
91 inline void SdIMapInfo::WriteData( SvStream& rOStm )
93 SdrObjUserData::WriteData( rOStm );
95 SdIOCompat aIO( rOStm, STREAM_WRITE, 1 );
97 aImageMap.Write(
98 rOStm, ::binfilter::StaticBaseUrl::GetBaseURL(INetURLObject::NO_DECODE));
102 /*************************************************************************
106 \************************************************************************/
108 inline void SdIMapInfo::ReadData( SvStream& rIStm )
110 SdrObjUserData::ReadData( rIStm );
112 SdIOCompat aIO( rIStm, STREAM_READ );
114 aImageMap.Read(
115 rIStm, ::binfilter::StaticBaseUrl::GetBaseURL(INetURLObject::NO_DECODE));
119 } //namespace binfilter
120 #endif // _SD_IMAPINFO_HXX