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 .
22 #include <svl/macitem.hxx>
23 #include <rtl/strbuf.hxx>
28 enum class IMapObjectType
35 #define IMAP_OBJ_VERSION (sal_uInt16(0x0005))
36 #define IMAGE_MAP_VERSION (sal_uInt16(0x0001))
38 #define IMAPMAGIC "SDIMAP"
40 #define IMAP_MIRROR_HORZ 0x00000001L
41 #define IMAP_MIRROR_VERT 0x00000002L
51 #define IMAP_ERR_OK 0x00000000L
52 #define IMAP_ERR_FORMAT 0x00000001L
56 friend class ImageMap
;
63 SvxMacroTableDtor aEventList
;
67 sal_uInt16 nReadVersion
;
69 // binary import/export
70 virtual void WriteIMapObject( SvStream
& rOStm
) const = 0;
71 virtual void ReadIMapObject( SvStream
& rIStm
) = 0;
74 static void AppendCERNCoords(OStringBuffer
& rBuf
, const Point
& rPoint100
);
75 void AppendCERNURL(OStringBuffer
& rBuf
) const;
76 static void AppendNCSACoords(OStringBuffer
& rBuf
, const Point
& rPoint100
);
77 void AppendNCSAURL(OStringBuffer
&rBuf
) const;
82 IMapObject( OUString aURL
,
88 virtual ~IMapObject() {};
90 IMapObject(IMapObject
const &) = default;
91 IMapObject(IMapObject
&&) = default;
92 IMapObject
& operator =(IMapObject
const &) = default;
93 IMapObject
& operator =(IMapObject
&&) = default;
95 virtual IMapObjectType
GetType() const = 0;
96 virtual bool IsHit( const Point
& rPoint
) const = 0;
98 void Write ( SvStream
& rOStm
) const;
99 void Read( SvStream
& rIStm
);
101 const OUString
& GetURL() const { return aURL
; }
102 void SetURL( const OUString
& rURL
) { aURL
= rURL
; }
104 const OUString
& GetAltText() const { return aAltText
; }
105 void SetAltText( const OUString
& rAltText
) { aAltText
= rAltText
; }
107 const OUString
& GetDesc() const { return aDesc
; }
108 void SetDesc( const OUString
& rDesc
) { aDesc
= rDesc
; }
110 const OUString
& GetTarget() const { return aTarget
; }
111 void SetTarget( const OUString
& rTarget
) { aTarget
= rTarget
; }
113 const OUString
& GetName() const { return aName
; }
114 void SetName( const OUString
& rName
) { aName
= rName
; }
116 bool IsActive() const { return bActive
; }
117 void SetActive( bool bSetActive
) { bActive
= bSetActive
; }
119 bool IsEqual( const IMapObject
& rEqObj
) const;
122 const SvxMacroTableDtor
& GetMacroTable() const { return aEventList
;}
123 void SetMacroTable( const SvxMacroTableDtor
& rTbl
) { aEventList
= rTbl
; }
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */