sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svtools / imap.hxx
bloba87dd6cb57c9797d93f16671d0e595b29baf752d
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: imap.hxx,v $
10 * $Revision: 1.4 $
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 _IMAP_HXX
32 #define _IMAP_HXX
34 #ifndef INCLUDED_SVTDLLAPI_H
35 #include "bf_svtools/svtdllapi.h"
36 #endif
38 #ifndef _STRING_HXX //autogen
39 #include <tools/string.hxx>
40 #endif
41 #ifndef _STREAM_HXX //autogen
42 #include <tools/stream.hxx>
43 #endif
45 class Point;
46 class Rectangle;
47 class Size;
48 class Fraction;
50 namespace binfilter
53 class IMapObject;
55 /******************************************************************************
59 \******************************************************************************/
61 class ImageMap
63 List maList;
64 String aName;
66 protected:
68 // Binaer laden/speichern
69 void ImpWriteImageMap( SvStream& rOStm, const String& ) const ;
70 void ImpReadImageMap( SvStream& rIStm, USHORT nCount, const String& );
72 public:
74 TYPEINFO();
76 ImageMap() {};
77 ImageMap( const ImageMap& rImageMap );
79 // Der Dtor gibt den intern belegten
80 // Speicher wieder frei;
81 // alle IMapObjekte werden im Dtor zerstoert;
82 virtual ~ImageMap();
84 // Zuweisungsoperator
85 ImageMap& operator=( const ImageMap& rImageMap );
87 // Vergleichsoperator (es wird alles auf Gleichheit geprueft)
88 BOOL operator==( const ImageMap& rImageMap );
89 BOOL operator!=( const ImageMap& rImageMap );
91 // In die Map wird ein neues IMap-Obkekt ans Ende eingefuegt
92 void InsertIMapObject( const IMapObject& rIMapObject );
94 // Zugriff auf einzelne IMapObjekte; die Objekte
95 // duerfen von aussen _nicht_ zerstoert werden
96 IMapObject* GetFirstIMapObject() { return (IMapObject*) maList.First(); }
97 IMapObject* GetNextIMapObject() { return (IMapObject*) maList.Next(); }
98 IMapObject* GetLastIMapObject() { return (IMapObject*) maList.Last(); }
99 IMapObject* GetPrevIMapObject() { return (IMapObject*) maList.Prev(); }
100 IMapObject* GetIMapObject( USHORT nPos ) const { return (IMapObject*) maList.GetObject( nPos ); }
102 // Gibt die Gesamtanzahl der IMap-Objekte zurueck
103 UINT16 GetIMapObjectCount() const { return (UINT16) maList.Count(); }
105 // Loescht alle internen Objekte
106 void ClearImageMap();
108 // liefert die aktuelle Versionsnummer
109 UINT16 GetVersion() const;
111 // liefert / setzt den Namen der ImageMap
112 const String& GetName() const { return aName; }
113 void SetName( const String& rName ) { aName = rName; }
115 // skaliert alle Objekte der ImageMap entpr. dem uebergebenen Faktor
116 void Scale( const Fraction& rFractX, const Fraction& rFracY );
118 // Im-/Export
119 void Write ( SvStream& rOStm, const String& rBaseURL ) const;
120 void Read( SvStream& rIStm, const String& rBaseURL );
123 class IMapCompat
125 SvStream* pRWStm;
126 ULONG nCompatPos;
127 ULONG nTotalSize;
128 USHORT nStmMode;
130 IMapCompat() {}
131 IMapCompat( const IMapCompat& ) {}
132 IMapCompat& operator=( const IMapCompat& ) { return *this; }
133 BOOL operator==( const IMapCompat& ) { return FALSE; }
135 public:
137 IMapCompat( SvStream& rStm, const USHORT nStreamMode );
138 ~IMapCompat();
143 #endif // _IMAP_HXX