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