2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-15 17:28:16 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2013-10-23 19:14:56 +02:00
|
|
|
#ifndef INCLUDED_SVTOOLS_IMAPOBJ_HXX
|
|
|
|
#define INCLUDED_SVTOOLS_IMAPOBJ_HXX
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2013-11-09 15:40:46 -06:00
|
|
|
#include <svtools/svtdllapi.h>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/macitem.hxx>
|
2011-06-20 21:39:11 +01:00
|
|
|
#include <rtl/strbuf.hxx>
|
2007-04-11 18:23:15 +00:00
|
|
|
|
|
|
|
class Point;
|
2017-03-30 20:27:55 +02:00
|
|
|
namespace tools { class Rectangle; }
|
2007-04-11 18:23:15 +00:00
|
|
|
class SvStream;
|
|
|
|
|
2018-01-12 20:14:18 +01:00
|
|
|
#define IMAP_OBJ_RECTANGLE (sal_uInt16(0x0001))
|
|
|
|
#define IMAP_OBJ_CIRCLE (sal_uInt16(0x0002))
|
|
|
|
#define IMAP_OBJ_POLYGON (sal_uInt16(0x0003))
|
|
|
|
#define IMAP_OBJ_VERSION (sal_uInt16(0x0005))
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2018-01-12 20:14:18 +01:00
|
|
|
#define IMAGE_MAP_VERSION (sal_uInt16(0x0001))
|
2007-04-11 18:23:15 +00:00
|
|
|
|
|
|
|
#define IMAPMAGIC "SDIMAP"
|
|
|
|
|
|
|
|
#define IMAP_MIRROR_HORZ 0x00000001L
|
|
|
|
#define IMAP_MIRROR_VERT 0x00000002L
|
|
|
|
|
|
|
|
#define IMAP_FORMAT_BIN 0x00000001L
|
|
|
|
#define IMAP_FORMAT_CERN 0x00000002L
|
|
|
|
#define IMAP_FORMAT_NCSA 0x00000004L
|
|
|
|
#define IMAP_FORMAT_DETECT 0xffffffffL
|
|
|
|
|
|
|
|
#define IMAP_ERR_OK 0x00000000L
|
|
|
|
#define IMAP_ERR_FORMAT 0x00000001L
|
|
|
|
|
|
|
|
class SVT_DLLPUBLIC IMapObject
|
|
|
|
{
|
|
|
|
friend class ImageMap;
|
|
|
|
|
2013-08-15 09:10:28 +02:00
|
|
|
OUString aURL;
|
|
|
|
OUString aAltText;
|
|
|
|
OUString aDesc;
|
|
|
|
OUString aTarget;
|
|
|
|
OUString aName;
|
2007-04-11 18:23:15 +00:00
|
|
|
SvxMacroTableDtor aEventList;
|
2014-03-20 16:07:35 +02:00
|
|
|
bool bActive;
|
2007-04-11 18:23:15 +00:00
|
|
|
|
|
|
|
protected:
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 nReadVersion;
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2014-01-14 22:18:53 +01:00
|
|
|
// binary import/export
|
2007-04-11 18:23:15 +00:00
|
|
|
virtual void WriteIMapObject( SvStream& rOStm ) const = 0;
|
|
|
|
virtual void ReadIMapObject( SvStream& rIStm ) = 0;
|
|
|
|
|
2014-01-14 22:18:53 +01:00
|
|
|
// helper methods
|
2015-04-07 16:18:28 +02:00
|
|
|
static void AppendCERNCoords(OStringBuffer& rBuf, const Point& rPoint100);
|
2017-08-07 17:16:26 +02:00
|
|
|
void AppendCERNURL(OStringBuffer& rBuf) const;
|
2015-04-07 16:18:28 +02:00
|
|
|
static void AppendNCSACoords(OStringBuffer& rBuf, const Point& rPoint100);
|
2017-08-07 17:16:26 +02:00
|
|
|
void AppendNCSAURL(OStringBuffer&rBuf) const;
|
2007-04-11 18:23:15 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
static rtl_TextEncoding nActualTextEncoding;
|
|
|
|
|
2009-10-30 17:36:02 +01:00
|
|
|
IMapObject();
|
2013-08-15 09:10:28 +02:00
|
|
|
IMapObject( const OUString& rURL,
|
|
|
|
const OUString& rAltText,
|
|
|
|
const OUString& rDesc,
|
|
|
|
const OUString& rTarget,
|
|
|
|
const OUString& rName,
|
2014-03-20 16:07:35 +02:00
|
|
|
bool bActive );
|
2007-04-11 18:23:15 +00:00
|
|
|
virtual ~IMapObject() {};
|
|
|
|
|
2015-01-21 12:15:26 +02:00
|
|
|
virtual sal_uInt16 GetType() const = 0;
|
|
|
|
virtual bool IsHit( const Point& rPoint ) const = 0;
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2017-08-07 17:16:26 +02:00
|
|
|
void Write ( SvStream& rOStm ) const;
|
|
|
|
void Read( SvStream& rIStm );
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2013-08-15 09:10:28 +02:00
|
|
|
const OUString& GetURL() const { return aURL; }
|
|
|
|
void SetURL( const OUString& rURL ) { aURL = rURL; }
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2013-08-15 09:10:28 +02:00
|
|
|
const OUString& GetAltText() const { return aAltText; }
|
|
|
|
void SetAltText( const OUString& rAltText) { aAltText = rAltText; }
|
2007-06-26 12:33:21 +00:00
|
|
|
|
2013-08-15 09:10:28 +02:00
|
|
|
const OUString& GetDesc() const { return aDesc; }
|
|
|
|
void SetDesc( const OUString& rDesc ) { aDesc = rDesc; }
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2013-08-15 09:10:28 +02:00
|
|
|
const OUString& GetTarget() const { return aTarget; }
|
|
|
|
void SetTarget( const OUString& rTarget ) { aTarget = rTarget; }
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2013-08-15 09:10:28 +02:00
|
|
|
const OUString& GetName() const { return aName; }
|
|
|
|
void SetName( const OUString& rName ) { aName = rName; }
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2014-03-20 16:07:35 +02:00
|
|
|
bool IsActive() const { return bActive; }
|
2016-09-04 12:03:36 +02:00
|
|
|
void SetActive( bool bSetActive ) { bActive = bSetActive; }
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2014-03-20 16:07:35 +02:00
|
|
|
bool IsEqual( const IMapObject& rEqObj );
|
2007-04-11 18:23:15 +00:00
|
|
|
|
|
|
|
// IMap-Events
|
2017-03-03 20:57:02 +01:00
|
|
|
const SvxMacroTableDtor& GetMacroTable() const { return aEventList;}
|
|
|
|
void SetMacroTable( const SvxMacroTableDtor& rTbl ) { aEventList = rTbl; }
|
2007-04-11 18:23:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|