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 .
20 #ifndef INCLUDED_VCL_IMAPOBJ_HXX
21 #define INCLUDED_VCL_IMAPOBJ_HXX
23 #include <svl/macitem.hxx>
24 #include <rtl/strbuf.hxx>
29 enum class IMapObjectType
36 #define IMAP_OBJ_VERSION (sal_uInt16(0x0005))
37 #define IMAGE_MAP_VERSION (sal_uInt16(0x0001))
39 #define IMAPMAGIC "SDIMAP"
41 #define IMAP_MIRROR_HORZ 0x00000001L
42 #define IMAP_MIRROR_VERT 0x00000002L
52 #define IMAP_ERR_OK 0x00000000L
53 #define IMAP_ERR_FORMAT 0x00000001L
57 friend class ImageMap
;
64 SvxMacroTableDtor aEventList
;
68 sal_uInt16 nReadVersion
;
70 // binary import/export
71 virtual void WriteIMapObject( SvStream
& rOStm
) const = 0;
72 virtual void ReadIMapObject( SvStream
& rIStm
) = 0;
75 static void AppendCERNCoords(OStringBuffer
& rBuf
, const Point
& rPoint100
);
76 void AppendCERNURL(OStringBuffer
& rBuf
) const;
77 static void AppendNCSACoords(OStringBuffer
& rBuf
, const Point
& rPoint100
);
78 void AppendNCSAURL(OStringBuffer
&rBuf
) const;
83 IMapObject( const OUString
& rURL
,
84 const OUString
& rAltText
,
85 const OUString
& rDesc
,
86 const OUString
& rTarget
,
87 const OUString
& rName
,
89 virtual ~IMapObject() {};
91 IMapObject(IMapObject
const &) = default;
92 IMapObject(IMapObject
&&) = default;
93 IMapObject
& operator =(IMapObject
const &) = default;
94 IMapObject
& operator =(IMapObject
&&) = default;
96 virtual IMapObjectType
GetType() const = 0;
97 virtual bool IsHit( const Point
& rPoint
) const = 0;
99 void Write ( SvStream
& rOStm
) const;
100 void Read( SvStream
& rIStm
);
102 const OUString
& GetURL() const { return aURL
; }
103 void SetURL( const OUString
& rURL
) { aURL
= rURL
; }
105 const OUString
& GetAltText() const { return aAltText
; }
106 void SetAltText( const OUString
& rAltText
) { aAltText
= rAltText
; }
108 const OUString
& GetDesc() const { return aDesc
; }
109 void SetDesc( const OUString
& rDesc
) { aDesc
= rDesc
; }
111 const OUString
& GetTarget() const { return aTarget
; }
112 void SetTarget( const OUString
& rTarget
) { aTarget
= rTarget
; }
114 const OUString
& GetName() const { return aName
; }
115 void SetName( const OUString
& rName
) { aName
= rName
; }
117 bool IsActive() const { return bActive
; }
118 void SetActive( bool bSetActive
) { bActive
= bSetActive
; }
120 bool IsEqual( const IMapObject
& rEqObj
) const;
123 const SvxMacroTableDtor
& GetMacroTable() const { return aEventList
;}
124 void SetMacroTable( const SvxMacroTableDtor
& rTbl
) { aEventList
= rTbl
; }
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */