xref: /AOO41X/main/svtools/inc/svtools/imapcirc.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _GOODIES_IMAPCIRC_HXX
28 #define _GOODIES_IMAPCIRC_HXX
29 
30 #include "svtools/svtdllapi.h"
31 #include <tools/gen.hxx>
32 #include <svtools/imapobj.hxx>
33 
34 class Fraction;
35 
36 /******************************************************************************
37 |*
38 |*
39 |*
40 \******************************************************************************/
41 
42 class SVT_DLLPUBLIC IMapCircleObject : public IMapObject
43 {
44 	Point				aCenter;
45 	sal_uLong				nRadius;
46 
47 	void				ImpConstruct( const Point& rCenter, sal_uLong nRad, sal_Bool bPixel );
48 
49 protected:
50 
51 	// Binaer-Im-/Export
52 	virtual void		WriteIMapObject( SvStream& rOStm ) const;
53 	virtual void		ReadIMapObject(  SvStream& rIStm );
54 
55 public:
56 
57 						IMapCircleObject() {};
58 						IMapCircleObject( const Point& rCenter, sal_uLong nRad,
59 										  const String& rURL,
60 										  const String& rAltText,
61 										  const String& rDesc,
62 										  const String& rTarget,
63 										  const String& rName,
64 										  sal_Bool bActive = sal_True,
65 										  sal_Bool bPixelCoords = sal_True );
66 	virtual				~IMapCircleObject() {};
67 
68 	virtual sal_uInt16		GetType() const;
69 	virtual sal_Bool		IsHit( const Point& rPoint ) const;
70 
71 	Point				GetCenter( sal_Bool bPixelCoords = sal_True ) const;
72 	sal_uLong				GetRadius( sal_Bool bPixelCoords = sal_True ) const;
73 
74 	// liefert das BoundRect des Kreis-Objektes in 1/100mm
75 	virtual Rectangle	GetBoundRect() const;
76 
77 	void				Scale( const Fraction& rFractX, const Fraction& rFracY );
78 
79     using IMapObject::IsEqual;
80 	sal_Bool				IsEqual( const IMapCircleObject& rEqObj );
81 
82 	// Im-/Export
83     void                WriteCERN( SvStream& rOStm, const String& rBaseURL  ) const;
84     void                WriteNCSA( SvStream& rOStm, const String& rBaseURL  ) const;
85 };
86 
87 #endif
88