1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: txtrange.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _MyTXTRANGE_HXX
32 #define _MyTXTRANGE_HXX
35 #define _SVSTDARR_BOOLS
36 #define _SVSTDARR_LONGS
37 #include <svtools/svstdarr.hxx>
39 #include "svx/svxdllapi.h"
49 typedef SvLongs
* SvLongsPtr
;
51 /*************************************************************************
56 |* Ersterstellung 20.01.97
57 |* Letzte Aenderung AMA 20.01.97
59 *************************************************************************/
60 class SVX_DLLPUBLIC TextRanger
64 PolyPolygon
*mpPolyPolygon
; // Flaechenpolygon
65 PolyPolygon
*mpLinePolyPolygon
; // Linienpolygon
66 Rectangle
*pBound
; // Umfassendes Rechteck
67 USHORT nCacheSize
; // Cache-Size
68 USHORT nCacheIdx
; // Cache-Index
69 USHORT nRight
; // Abstand Kontur-Text
70 USHORT nLeft
; // Abstand Text-Kontur
71 USHORT nUpper
; // Abstand Kontur-Text
72 USHORT nLower
; // Abstand Text-Kontur
73 sal_uInt32 nPointCount
; // Anzahl der Polygonpunkte
74 BOOL bSimple
: 1; // Nur Aussenkante
75 BOOL bInner
: 1; // TRUE: Objekt beschriften (EditEngine);
76 // FALSE: Objekt umfliessen (StarWriter);
77 BOOL bVertical
:1; // for vertical writing mode
83 TextRanger( const TextRanger
& ); // not implemented
84 const Rectangle
& _GetBoundRect();
86 TextRanger( const basegfx::B2DPolyPolygon
& rPolyPolygon
, const basegfx::B2DPolyPolygon
* pLinePolyPolygon
,
87 USHORT nCacheSize
, USHORT nLeft
, USHORT nRight
,
88 BOOL bSimple
, BOOL bInner
, BOOL bVert
= sal_False
);
90 SvLongsPtr
GetTextRanges( const Range
& rRange
);
91 USHORT
GetRight() const { return nRight
; }
92 USHORT
GetLeft() const { return nLeft
; }
93 USHORT
GetUpper() const { return nUpper
; }
94 USHORT
GetLower() const { return nLower
; }
95 sal_uInt32
GetPointCount() const { return nPointCount
; }
96 BOOL
IsSimple() const { return bSimple
; }
97 BOOL
IsInner() const { return bInner
; }
98 BOOL
IsVertical() const { return bVertical
; }
99 BOOL
HasBorder() const { return nRight
|| nLeft
; }
100 const PolyPolygon
& GetPolyPolygon() const { return *mpPolyPolygon
; }
101 const PolyPolygon
* GetLinePolygon() const { return mpLinePolyPolygon
; }
102 const Rectangle
& GetBoundRect()
103 { return pBound
? static_cast< const Rectangle
& >(*pBound
) : _GetBoundRect(); }
104 void SetUpper( USHORT nNew
){ nUpper
= nNew
; }
105 void SetLower( USHORT nNew
){ nLower
= nNew
; }
106 void SetVertical( BOOL bNew
);
107 BOOL
IsFlag3() const { return bFlag3
; }
108 void SetFlag3( BOOL bNew
) { bFlag3
= bNew
; }
109 BOOL
IsFlag4() const { return bFlag4
; }
110 void SetFlag4( BOOL bNew
) { bFlag4
= bNew
; }
111 BOOL
IsFlag5() const { return bFlag5
; }
112 void SetFlag5( BOOL bNew
) { bFlag5
= bNew
; }
113 BOOL
IsFlag6() const { return bFlag6
; }
114 void SetFlag6( BOOL bNew
) { bFlag6
= bNew
; }
115 BOOL
IsFlag7() const { return bFlag7
; }
116 void SetFlag7( BOOL bNew
) { bFlag7
= bNew
; }
121 #endif // _TXTRANGE_HXX