42#define SCALEPOINT(aPT,aFracX,aFracY) (aPT).setX(tools::Long((aPT).X()*aFracX)); \
43 (aPT).setY(tools::Long((aPT).Y()*aFracY));
56 OUString _aTarget, OUString _aName,
bool bURLActive )
58, aAltText(
std::move( _aAltText ))
59, aDesc(
std::move( _aDesc ))
60, aTarget(
std::move( _aTarget ))
62, bActive( bURLActive )
70 const rtl_TextEncoding eEncoding = osl_getThreadTextEncoding();
83 IMapCompat aCompat( rOStm, StreamMode::WRITE );
99 rtl_TextEncoding nTextEncoding;
112 IMapCompat aCompat( rIStm, StreamMode::READ );
138 const OUString& rURL,
139 const OUString& rAltText,
140 const OUString& rDesc,
141 const OUString& rTarget,
142 const OUString& rName,
144 bool bPixelCoords ) :
240 const OUString& rURL,
241 const OUString& rAltText,
242 const OUString& rDesc,
243 const OUString& rTarget,
244 const OUString& rName,
246 bool bPixelCoords ) :
256 MapMode aMap100( MapUnit::Map100thMM );
324 return static_cast<sal_Int32
>( std::hypot( aPoint.
X(), aPoint.
Y() ) ) <=
nRadius;
341 sal_Int32 nNewRadius;
377 const OUString& rURL,
378 const OUString& rAltText,
379 const OUString& rDesc,
380 const OUString& rTarget,
381 const OUString& rName,
383 bool bPixelCoords ) :
483 for ( sal_uInt16
i = 0;
i <
nCount;
i++ )
518 const sal_uInt16 nEqCount = rEqPoly.
GetSize();
522 bool bDifferent =
false;
524 for ( sal_uInt16
i = 0;
i <
nCount;
i++ )
526 if (
aPoly[
i ] != rEqPoly[
i ] )
624 if (
this != &rImageMap)
673 bool bDifferent = (
aName != rImageMap.
aName );
675 for (
size_t i = 0; (
i <
nCount ) && !bDifferent;
i++ )
729 return !( *
this == rImageMap );
741 switch( rIMapObject.
GetType() )
762 maList.emplace_back( std::move(pNewObject) );
772 const Size& rDisplaySize,
773 const Point& rRelHitPoint,
776 Point aRelPoint( rTotalSize.
Width() * rRelHitPoint.
X() / rDisplaySize.
Width(),
777 rTotalSize.
Height() * rRelHitPoint.
Y() / rDisplaySize.
Height() );
783 aRelPoint.
setX( rTotalSize.
Width() - aRelPoint.
X() );
786 aRelPoint.
setY( rTotalSize.
Height() - aRelPoint.
Y() );
792 if (
i->IsHit( aRelPoint ) ) {
798 return( pObj ? ( pObj->
IsActive() ? pObj :
nullptr ) :
nullptr );
843 pObj->Write( rOStm );
856 const size_t nMinRecordSize = 12;
857 const size_t nMaxRecords = rIStm.
remainingSize() / nMinRecordSize;
861 SAL_WARN(
"svtools.misc",
"Parsing error: " << nMaxRecords <<
" max possible entries, but " <<
862 nCount <<
" claimed, truncating");
880 maList.emplace_back( pObj );
888 maList.emplace_back( pObj );
896 maList.emplace_back( pObj );
916 OUString aImageName(
GetName() );
919 const rtl_TextEncoding eEncoding = osl_getThreadTextEncoding();
921 rOStm.
SetEndian( SvStreamEndian::LITTLE );
931 pCompat =
new IMapCompat( rOStm, StreamMode::WRITE );
954 rIStm.
SetEndian( SvStreamEndian::LITTLE );
957 if ( !memcmp( cMagic,
IMAPMAGIC,
sizeof( cMagic ) ) )
973 pCompat =
new IMapCompat( rIStm, StreamMode::READ );
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
sal_Int32 GetDenominator() const
bool IsEqual(const IMapCircleObject &rEqObj) const
virtual IMapObjectType GetType() const override
sal_Int32 GetRadius(bool bPixelCoords=true) const
virtual bool IsHit(const Point &rPoint) const override
virtual void ReadIMapObject(SvStream &rIStm) override
virtual void WriteIMapObject(SvStream &rOStm) const override
void Scale(const Fraction &rFractX, const Fraction &rFracY)
void ImpConstruct(const Point &rCenter, sal_Int32 nRad, bool bPixel)
Point GetCenter(bool bPixelCoords=true) const
virtual void WriteIMapObject(SvStream &rOStm) const =0
bool IsEqual(const IMapObject &rEqObj) const
virtual IMapObjectType GetType() const =0
void Read(SvStream &rIStm)
virtual void ReadIMapObject(SvStream &rIStm)=0
void Write(SvStream &rOStm) const
SvxMacroTableDtor aEventList
bool IsEqual(const IMapPolygonObject &rEqObj)
tools::Rectangle aEllipse
VCL_DLLPRIVATE void ImpConstruct(const tools::Polygon &rPoly, bool bPixel)
void Scale(const Fraction &rFractX, const Fraction &rFracY)
tools::Polygon GetPolygon(bool bPixelCoords=true) const
virtual void ReadIMapObject(SvStream &rIStm) override
void SetExtraEllipse(const tools::Rectangle &rEllipse)
virtual void WriteIMapObject(SvStream &rOStm) const override
virtual bool IsHit(const Point &rPoint) const override
virtual IMapObjectType GetType() const override
tools::Rectangle GetRectangle(bool bPixelCoords=true) const
virtual bool IsHit(const Point &rPoint) const override
VCL_DLLPRIVATE void ImpConstruct(const tools::Rectangle &rRect, bool bPixel)
virtual void ReadIMapObject(SvStream &rIStm) override
bool IsEqual(const IMapRectangleObject &rEqObj) const
virtual void WriteIMapObject(SvStream &rOStm) const override
virtual IMapObjectType GetType() const override
void Scale(const Fraction &rFractX, const Fraction &rFracY)
void Scale(const Fraction &rFractX, const Fraction &rFracY)
void Write(SvStream &rOStm) const
const OUString & GetName() const
void ImpWriteImageMap(SvStream &rOStm) const
std::vector< std::unique_ptr< IMapObject > > maList
void InsertIMapObject(const IMapObject &rIMapObject)
void Read(SvStream &rIStm)
IMapObject * GetIMapObject(size_t nPos) const
IMapObject * GetHitIMapObject(const Size &rOriginalSize, const Size &rDisplaySize, const Point &rRelHitPoint, sal_uLong nFlags=0) const
bool operator==(const ImageMap &rImageMap)
ImageMap & operator=(const ImageMap &rImageMap)
size_t GetIMapObjectCount() const
bool operator!=(const ImageMap &rImageMap)
void ImpReadImageMap(SvStream &rIStm, size_t nCount)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
SvStream & ReadCharAsBool(bool &rBool)
void SetEndian(SvStreamEndian SvStreamEndian)
SvStream & WriteBool(bool b)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & WriteOString(std::string_view rStr)
SvStream & WriteUInt32(sal_uInt32 nUInt32)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
SvStreamEndian GetEndian() const
void SetError(ErrCode nErrorCode)
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 SeekRel(sal_Int64 nPos)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
sal_uInt64 remainingSize()
SvStream & Write(SvStream &) const
#define SVSTREAM_GENERALERROR
#define SCALEPOINT(aPT, aFracX, aFracY)
#define IMAGE_MAP_VERSION
#define SAL_WARN(area, stream)
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
OString read_uInt16_lenPrefixed_uInt8s_ToOString(SvStream &rStrm)
OUString read_uInt16_lenPrefixed_uInt8s_ToOUString(SvStream &rStrm, rtl_TextEncoding eEnc)
TOOLS_DLLPUBLIC std::size_t write_uInt16_lenPrefixed_uInt8s_FromOString(SvStream &rStrm, std::string_view rStr)
std::size_t write_uInt16_lenPrefixed_uInt8s_FromOUString(SvStream &rStrm, std::u16string_view rStr, rtl_TextEncoding eEnc)