1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
23 #include "svtools/svtdllapi.h"
24 #include <tools/string.hxx>
25 #include <tools/stream.hxx>
34 typedef ::std::vector
< IMapObject
* > IMapObjectList_impl
;
36 class SVT_DLLPUBLIC ImageMap
40 IMapObjectList_impl maList
;
45 // Binaer laden/speichern
46 void ImpWriteImageMap( SvStream
& rOStm
, const String
& ) const ;
47 void ImpReadImageMap( SvStream
& rIStm
, size_t nCount
, const String
& );
50 void ImpWriteCERN( SvStream
& rOStm
, const String
& rBaseURL
) const;
51 void ImpWriteNCSA( SvStream
& rOStm
, const String
& rBaseURL
) const;
52 sal_uLong
ImpReadCERN( SvStream
& rOStm
, const String
& rBaseURL
);
53 sal_uLong
ImpReadNCSA( SvStream
& rOStm
, const String
& rBaseURL
);
55 void ImpReadCERNLine( const OString
& rLine
, const String
& rBaseURL
);
56 Point
ImpReadCERNCoords( const char** ppStr
);
57 long ImpReadCERNRadius( const char** ppStr
);
58 String
ImpReadCERNURL( const char** ppStr
, const String
& rBaseURL
);
60 void ImpReadNCSALine( const OString
& rLine
, const String
& rBaseURL
);
61 String
ImpReadNCSAURL( const char** ppStr
, const String
& rBaseURL
);
62 Point
ImpReadNCSACoords( const char** ppStr
);
64 sal_uLong
ImpDetectFormat( SvStream
& rIStm
);
71 ImageMap( const String
& rName
);
72 ImageMap( const ImageMap
& rImageMap
);
74 // Der Dtor gibt den intern belegten
75 // Speicher wieder frei;
76 // alle IMapObjekte werden im Dtor zerstoert;
80 ImageMap
& operator=( const ImageMap
& rImageMap
);
82 // Vergleichsoperator (es wird alles auf Gleichheit geprueft)
83 sal_Bool
operator==( const ImageMap
& rImageMap
);
84 sal_Bool
operator!=( const ImageMap
& rImageMap
);
86 // In die Map wird ein neues IMap-Obkekt ans Ende eingefuegt
87 void InsertIMapObject( const IMapObject
& rIMapObject
);
89 // Zugriff auf einzelne IMapObjekte; die Objekte
90 // duerfen von aussen _nicht_ zerstoert werden
91 IMapObject
* GetIMapObject( size_t nPos
) const
93 return ( nPos
< maList
.size() ) ? maList
[ nPos
] : NULL
;
96 // Gibt das Objekt zurueck, das zuerst getroffen wurde oder NULL;
97 // Groessen- und Positionsangaben sind in 1/100mm;
98 // rTotalSize ist die Originalgroesse des Bildes;
99 // rDisplaySize die aktuelle Darstellungsgroesse;
100 // rRelPoint bezieht sich auf die Darstellungsgroesse
101 // und die linke oebere Ecke des Bildes
102 IMapObject
* GetHitIMapObject( const Size
& rOriginalSize
,
103 const Size
& rDisplaySize
,
104 const Point
& rRelHitPoint
,
105 sal_uLong nFlags
= 0 );
107 // Gibt die Gesamtanzahl der IMap-Objekte zurueck
108 size_t GetIMapObjectCount() const { return maList
.size(); }
110 // Loescht alle internen Objekte
111 void ClearImageMap();
113 // liefert die aktuelle Versionsnummer
114 sal_uInt16
GetVersion() const;
116 // liefert / setzt den Namen der ImageMap
117 const String
& GetName() const { return aName
; }
118 void SetName( const String
& rName
) { aName
= rName
; }
120 // skaliert alle Objekte der ImageMap entpr. dem uebergebenen Faktor
121 void Scale( const Fraction
& rFractX
, const Fraction
& rFracY
);
124 void Write ( SvStream
& rOStm
, const String
& rBaseURL
) const;
125 void Read( SvStream
& rIStm
, const String
& rBaseURL
);
127 void Write( SvStream
& rOStm
, sal_uLong nFormat
, const String
& rBaseURL
) const;
128 sal_uLong
Read( SvStream
& rIStm
, sal_uLong nFormat
, const String
& rBaseURL
);
134 sal_uLong nCompatPos
;
135 sal_uLong nTotalSize
;
139 IMapCompat( const IMapCompat
& ) {}
140 IMapCompat
& operator=( const IMapCompat
& ) { return *this; }
141 sal_Bool
operator==( const IMapCompat
& ) { return sal_False
; }
145 IMapCompat( SvStream
& rStm
, const sal_uInt16 nStreamMode
);
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */