1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _GOODIES_IMAPPOLY_HXX 25 #define _GOODIES_IMAPPOLY_HXX 26 27 #include "svtools/svtdllapi.h" 28 #include <svtools/imapobj.hxx> 29 #include <tools/poly.hxx> 30 31 class Fraction; 32 33 /****************************************************************************** 34 |* 35 |* 36 |* 37 \******************************************************************************/ 38 39 class SVT_DLLPUBLIC IMapPolygonObject : public IMapObject 40 { 41 Polygon aPoly; 42 Rectangle aEllipse; 43 sal_Bool bEllipse; 44 45 SVT_DLLPRIVATE void ImpConstruct( const Polygon& rPoly, sal_Bool bPixel ); 46 47 protected: 48 49 // Binaer-Im-/Export 50 virtual void WriteIMapObject( SvStream& rOStm ) const; 51 virtual void ReadIMapObject( SvStream& rIStm ); 52 53 sal_Bool ReadPreProLine( SvStream& rIStm, String& rStr ); 54 55 public: IMapPolygonObject()56 IMapPolygonObject() {}; 57 IMapPolygonObject( const Polygon& rPoly, 58 const String& rURL, 59 const String& rAltText, 60 const String& rDesc, 61 const String& rTarget, 62 const String& rName, 63 sal_Bool bActive = sal_True, 64 sal_Bool bPixelCoords = sal_True ); ~IMapPolygonObject()65 virtual ~IMapPolygonObject() {}; 66 67 virtual sal_uInt16 GetType() const; 68 virtual sal_Bool IsHit( const Point& rPoint ) const; 69 70 Polygon GetPolygon( sal_Bool bPixelCoords = sal_True ) const; 71 72 // liefert das BoundRect des Polygon-Objektes in 1/100mm GetBoundRect() const73 virtual Rectangle GetBoundRect() const { return aPoly.GetBoundRect(); } 74 HasExtraEllipse() const75 sal_Bool HasExtraEllipse() const { return bEllipse; } GetExtraEllipse() const76 const Rectangle& GetExtraEllipse() const { return aEllipse; } 77 void SetExtraEllipse( const Rectangle& rEllipse ); 78 79 void Scale( const Fraction& rFractX, const Fraction& rFracY ); 80 81 using IMapObject::IsEqual; 82 sal_Bool IsEqual( const IMapPolygonObject& rEqObj ); 83 84 // Im-/Export 85 void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const; 86 void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const; 87 }; 88 89 #endif 90