2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01: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_IMAPPOLY_HXX
|
|
|
|
#define INCLUDED_SVTOOLS_IMAPPOLY_HXX
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2013-11-09 15:40:46 -06:00
|
|
|
#include <svtools/svtdllapi.h>
|
2007-04-11 18:23:15 +00:00
|
|
|
#include <svtools/imapobj.hxx>
|
|
|
|
#include <tools/poly.hxx>
|
|
|
|
|
2014-10-23 17:41:47 +02:00
|
|
|
class Fraction;
|
2014-10-23 17:30:09 +02:00
|
|
|
|
2007-04-11 18:23:15 +00:00
|
|
|
class SVT_DLLPUBLIC IMapPolygonObject : public IMapObject
|
|
|
|
{
|
|
|
|
Polygon aPoly;
|
|
|
|
Rectangle aEllipse;
|
2014-03-20 16:07:35 +02:00
|
|
|
bool bEllipse;
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2014-03-20 16:07:35 +02:00
|
|
|
SVT_DLLPRIVATE void ImpConstruct( const Polygon& rPoly, bool bPixel );
|
2007-04-11 18:23:15 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
// Binaer-Im-/Export
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual void WriteIMapObject( SvStream& rOStm ) const SAL_OVERRIDE;
|
|
|
|
virtual void ReadIMapObject( SvStream& rIStm ) SAL_OVERRIDE;
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2014-03-20 16:07:35 +02:00
|
|
|
bool ReadPreProLine( SvStream& rIStm, OUString& rStr );
|
2007-04-11 18:23:15 +00:00
|
|
|
|
|
|
|
public:
|
2014-04-04 11:20:48 +01:00
|
|
|
IMapPolygonObject() : bEllipse(false) {}
|
2007-04-11 18:23:15 +00:00
|
|
|
IMapPolygonObject( const Polygon& rPoly,
|
2013-08-15 09:10:28 +02:00
|
|
|
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 = true,
|
|
|
|
bool bPixelCoords = true );
|
2014-04-04 11:20:48 +01:00
|
|
|
virtual ~IMapPolygonObject() {}
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual sal_uInt16 GetType() const SAL_OVERRIDE;
|
|
|
|
virtual bool IsHit( const Point& rPoint ) const SAL_OVERRIDE;
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2014-03-20 16:07:35 +02:00
|
|
|
Polygon GetPolygon( bool bPixelCoords = true ) const;
|
2007-04-11 18:23:15 +00:00
|
|
|
|
|
|
|
// liefert das BoundRect des Polygon-Objektes in 1/100mm
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual Rectangle GetBoundRect() const SAL_OVERRIDE { return aPoly.GetBoundRect(); }
|
2007-04-11 18:23:15 +00:00
|
|
|
|
2014-03-20 16:07:35 +02:00
|
|
|
bool HasExtraEllipse() const { return bEllipse; }
|
2007-04-11 18:23:15 +00:00
|
|
|
const Rectangle& GetExtraEllipse() const { return aEllipse; }
|
|
|
|
void SetExtraEllipse( const Rectangle& rEllipse );
|
|
|
|
|
2014-10-23 17:41:47 +02:00
|
|
|
void Scale( const Fraction& rFractX, const Fraction& rFracY );
|
2007-04-11 18:23:15 +00:00
|
|
|
|
|
|
|
using IMapObject::IsEqual;
|
2014-03-20 16:07:35 +02:00
|
|
|
bool IsEqual( const IMapPolygonObject& rEqObj );
|
2007-04-11 18:23:15 +00:00
|
|
|
|
|
|
|
// Im-/Export
|
2013-08-15 09:10:28 +02:00
|
|
|
void WriteCERN( SvStream& rOStm, const OUString& rBaseURL ) const;
|
|
|
|
void WriteNCSA( SvStream& rOStm, const OUString& rBaseURL ) const;
|
2007-04-11 18:23:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|