xref: /aoo4110/main/svtools/inc/svtools/imapcirc.hxx (revision b1cdbd2c)
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 #ifndef _GOODIES_IMAPCIRC_HXX
24 #define _GOODIES_IMAPCIRC_HXX
25 
26 #include "svtools/svtdllapi.h"
27 #include <tools/gen.hxx>
28 #include <svtools/imapobj.hxx>
29 
30 class Fraction;
31 
32 /******************************************************************************
33 |*
34 |*
35 |*
36 \******************************************************************************/
37 
38 class SVT_DLLPUBLIC IMapCircleObject : public IMapObject
39 {
40 	Point				aCenter;
41 	sal_uLong				nRadius;
42 
43 	void				ImpConstruct( const Point& rCenter, sal_uLong nRad, sal_Bool bPixel );
44 
45 protected:
46 
47 	// Binaer-Im-/Export
48 	virtual void		WriteIMapObject( SvStream& rOStm ) const;
49 	virtual void		ReadIMapObject(  SvStream& rIStm );
50 
51 public:
52 
IMapCircleObject()53 						IMapCircleObject() {};
54 						IMapCircleObject( const Point& rCenter, sal_uLong nRad,
55 										  const String& rURL,
56 										  const String& rAltText,
57 										  const String& rDesc,
58 										  const String& rTarget,
59 										  const String& rName,
60 										  sal_Bool bActive = sal_True,
61 										  sal_Bool bPixelCoords = sal_True );
~IMapCircleObject()62 	virtual				~IMapCircleObject() {};
63 
64 	virtual sal_uInt16		GetType() const;
65 	virtual sal_Bool		IsHit( const Point& rPoint ) const;
66 
67 	Point				GetCenter( sal_Bool bPixelCoords = sal_True ) const;
68 	sal_uLong				GetRadius( sal_Bool bPixelCoords = sal_True ) const;
69 
70 	// liefert das BoundRect des Kreis-Objektes in 1/100mm
71 	virtual Rectangle	GetBoundRect() const;
72 
73 	void				Scale( const Fraction& rFractX, const Fraction& rFracY );
74 
75     using IMapObject::IsEqual;
76 	sal_Bool				IsEqual( const IMapCircleObject& rEqObj );
77 
78 	// Im-/Export
79     void                WriteCERN( SvStream& rOStm, const String& rBaseURL  ) const;
80     void                WriteNCSA( SvStream& rOStm, const String& rBaseURL  ) const;
81 };
82 
83 #endif
84