fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / editeng / txtrange.hxx
blob700db5760ad1d88603b9e1cda5b459fdef796685
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _MyTXTRANGE_HXX
21 #define _MyTXTRANGE_HXX
23 #include "editeng/editengdllapi.h"
24 #include "tools/solar.h"
25 #include "tools/gen.hxx"
27 #include <deque>
29 class PolyPolygon;
30 class Rectangle;
32 namespace basegfx {
33 class B2DPolyPolygon;
36 typedef std::deque<long>* LongDqPtr;
38 /*************************************************************************
40 |* class TextRanger
42 *************************************************************************/
43 class EDITENG_DLLPUBLIC TextRanger
45 //! The RangeCache class is used to cache the result of a single range calculation.
46 struct RangeCache
48 Range range; //!< Range for which we calculated results.
49 std::deque<long> results; //!< Calculated results for the range.
50 RangeCache(const Range& rng) : range(rng) {};
52 std::deque<RangeCache> mRangeCache; //!< Cached range calculations.
53 PolyPolygon *mpPolyPolygon; // Surface polygon
54 PolyPolygon *mpLinePolyPolygon; // Line polygon
55 Rectangle *pBound; // Comprehensive rectangle
56 sal_uInt16 nCacheSize; // Cache-Size
57 sal_uInt16 nRight; // Distance Contour-Text
58 sal_uInt16 nLeft; // Distance Text-Contour
59 sal_uInt16 nUpper; // Distance Contour-Text
60 sal_uInt16 nLower; // Distance Text-Contour
61 sal_uInt32 nPointCount; // Number of polygon points
62 sal_Bool bSimple : 1; // Just outside edge
63 sal_Bool bInner : 1; // TRUE: Objekt inline (EditEngine);
64 // FALSE: Objekt flow (StarWriter);
65 sal_Bool bVertical :1; // for vertical writing mode
66 sal_Bool bFlag3 :1;
67 sal_Bool bFlag4 :1;
68 sal_Bool bFlag5 :1;
69 sal_Bool bFlag6 :1;
70 sal_Bool bFlag7 :1;
71 TextRanger( const TextRanger& ); // not implemented
72 const Rectangle& _GetBoundRect();
73 public:
74 TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon,
75 const basegfx::B2DPolyPolygon* pLinePolyPolygon,
76 sal_uInt16 nCacheSize, sal_uInt16 nLeft, sal_uInt16 nRight,
77 sal_Bool bSimple, sal_Bool bInner, sal_Bool bVert = sal_False );
78 ~TextRanger();
79 LongDqPtr GetTextRanges( const Range& rRange );
80 sal_uInt16 GetRight() const { return nRight; }
81 sal_uInt16 GetLeft() const { return nLeft; }
82 sal_uInt16 GetUpper() const { return nUpper; }
83 sal_uInt16 GetLower() const { return nLower; }
84 sal_uInt32 GetPointCount() const { return nPointCount; }
85 sal_Bool IsSimple() const { return bSimple; }
86 sal_Bool IsInner() const { return bInner; }
87 sal_Bool IsVertical() const { return bVertical; }
88 sal_Bool HasBorder() const { return nRight || nLeft; }
89 const PolyPolygon& GetPolyPolygon() const { return *mpPolyPolygon; }
90 const PolyPolygon* GetLinePolygon() const { return mpLinePolyPolygon; }
91 const Rectangle& GetBoundRect()
92 { return pBound ? static_cast< const Rectangle& >(*pBound) : _GetBoundRect(); }
93 void SetUpper( sal_uInt16 nNew ){ nUpper = nNew; }
94 void SetLower( sal_uInt16 nNew ){ nLower = nNew; }
95 void SetVertical( sal_Bool bNew );
96 sal_Bool IsFlag3() const { return bFlag3; }
97 void SetFlag3( sal_Bool bNew ) { bFlag3 = bNew; }
98 sal_Bool IsFlag4() const { return bFlag4; }
99 void SetFlag4( sal_Bool bNew ) { bFlag4 = bNew; }
100 sal_Bool IsFlag5() const { return bFlag5; }
101 void SetFlag5( sal_Bool bNew ) { bFlag5 = bNew; }
102 sal_Bool IsFlag6() const { return bFlag6; }
103 void SetFlag6( sal_Bool bNew ) { bFlag6 = bNew; }
104 sal_Bool IsFlag7() const { return bFlag7; }
105 void SetFlag7( sal_Bool bNew ) { bFlag7 = bNew; }
110 #endif // _TXTRANGE_HXX
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */