Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / vcl / inc / regionband.hxx
blob1fb5db93a41082e5705a832c0d7c0d06c95c29eb
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 .
19 #ifndef INCLUDED_VCL_INC_REGIONBAND_HXX
20 #define INCLUDED_VCL_INC_REGIONBAND_HXX
22 #include <vcl/region.hxx>
24 #include "regband.hxx"
26 #ifdef DBG_UTIL
27 const char* ImplDbgTestRegionBand(const void*);
28 #endif
30 class RegionBand
32 private:
33 friend const char* ImplDbgTestRegionBand(const void*);
35 ImplRegionBand* mpFirstBand; // root of the list with y-bands
36 ImplRegionBand* mpLastCheckedBand;
38 void implReset();
40 public:
41 RegionBand();
42 RegionBand(const RegionBand&);
43 RegionBand& operator=(const RegionBand&);
44 RegionBand(const tools::Rectangle&);
45 ~RegionBand();
47 bool operator==( const RegionBand& rRegionBand ) const;
49 void load(SvStream& rIStrm);
50 void save(SvStream& rIStrm) const;
52 bool isSingleRectangle() const;
53 ImplRegionBand* ImplGetFirstRegionBand() const { return mpFirstBand; }
54 void ImplAddMissingBands(const long nTop, const long nBottom);
55 void InsertBand(ImplRegionBand* pPreviousBand, ImplRegionBand* pBandToInsert);
56 void processPoints();
57 void CreateBandRange(long nYTop, long nYBottom);
58 void InsertLine(const Point& rStartPt, const Point& rEndPt, long nLineId);
59 void InsertPoint(const Point &rPoint, long nLineID, bool bEndPoint, LineType eLineType);
60 bool OptimizeBandList();
61 void Move(long nHorzMove, long nVertMove);
62 void Scale(double fScaleX, double fScaleY);
63 void InsertBands(long nTop, long nBottom);
64 static bool InsertSingleBand(ImplRegionBand* pBand, long nYBandPosition);
65 void Union(long nLeft, long nTop, long nRight, long nBottom);
66 void Intersect(long nLeft, long nTop, long nRight, long nBottom);
67 void Union(const RegionBand& rSource);
68 void Exclude(long nLeft, long nTop, long nRight, long nBottom);
69 void XOr(long nLeft, long nTop, long nRight, long nBottom);
70 void Intersect(const RegionBand& rSource);
71 bool Exclude(const RegionBand& rSource);
72 void XOr(const RegionBand& rSource);
73 tools::Rectangle GetBoundRect() const;
74 bool IsInside(const Point& rPoint) const;
75 sal_uInt32 getRectangleCount() const; // only users are Region::Intersect, Region::IsRectangle and PSWriter::ImplBmp
76 void GetRegionRectangles(RectangleVector& rTarget) const;
79 #endif // INCLUDED_VCL_INC_REGIONBAND_HXX
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */