lok: calc - send other views our selection in their co-ordinates.
[LibreOffice.git] / include / vcl / lineinfo.hxx
blob09cc074075a22dd91308482439c8f6a46a29b840
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 INCLUDED_VCL_LINEINFO_HXX
21 #define INCLUDED_VCL_LINEINFO_HXX
23 #include <sal/types.h>
24 #include <vcl/dllapi.h>
25 #include <vcl/vclenum.hxx>
26 #include <basegfx/vector/b2enums.hxx>
27 #include <com/sun/star/drawing/LineCap.hpp>
28 #include <o3tl/cow_wrapper.hxx>
30 class SvStream;
31 namespace basegfx { class B2DPolyPolygon; }
33 struct ImplLineInfo
35 sal_Int32 mnWidth;
36 sal_Int32 mnDashLen;
37 sal_Int32 mnDotLen;
38 sal_Int32 mnDistance;
40 basegfx::B2DLineJoin meLineJoin;
41 css::drawing::LineCap meLineCap;
42 LineStyle meStyle;
44 sal_uInt16 mnDashCount;
45 sal_uInt16 mnDotCount;
47 ImplLineInfo();
49 bool operator==( const ImplLineInfo& ) const;
53 class VCL_DLLPUBLIC LineInfo
55 public:
56 LineInfo( LineStyle eLineStyle = LineStyle::Solid, sal_Int32 nWidth = 0 );
57 LineInfo( const LineInfo& rLineInfo );
58 LineInfo( LineInfo&& rLineInfo );
59 ~LineInfo();
61 LineInfo& operator=( const LineInfo& rLineInfo );
62 LineInfo& operator=( LineInfo&& rLineInfo );
63 bool operator==( const LineInfo& rLineInfo ) const;
64 bool operator!=( const LineInfo& rLineInfo ) const { return !(LineInfo::operator==( rLineInfo ) ); }
66 void SetStyle( LineStyle eStyle );
67 LineStyle GetStyle() const { return mpImplLineInfo->meStyle; }
69 void SetWidth( sal_Int32 nWidth );
70 sal_Int32 GetWidth() const { return mpImplLineInfo->mnWidth; }
72 void SetDashCount( sal_uInt16 nDashCount );
73 sal_uInt16 GetDashCount() const { return mpImplLineInfo->mnDashCount; }
75 void SetDashLen( sal_Int32 nDashLen );
76 sal_Int32 GetDashLen() const { return mpImplLineInfo->mnDashLen; }
78 void SetDotCount( sal_uInt16 nDotCount );
79 sal_uInt16 GetDotCount() const { return mpImplLineInfo->mnDotCount; }
81 void SetDotLen( sal_Int32 nDotLen );
82 sal_Int32 GetDotLen() const { return mpImplLineInfo->mnDotLen; }
84 void SetDistance( sal_Int32 nDistance );
85 sal_Int32 GetDistance() const { return mpImplLineInfo->mnDistance; }
87 void SetLineJoin(basegfx::B2DLineJoin eLineJoin);
88 basegfx::B2DLineJoin GetLineJoin() const { return mpImplLineInfo->meLineJoin; }
90 void SetLineCap(css::drawing::LineCap eLineCap);
91 css::drawing::LineCap GetLineCap() const { return mpImplLineInfo->meLineCap; }
93 bool IsDefault() const;
95 friend SvStream& ReadLineInfo( SvStream& rIStm, LineInfo& rLineInfo );
96 friend SvStream& WriteLineInfo( SvStream& rOStm, const LineInfo& rLineInfo );
98 // helper to get decomposed polygon data with the LineInfo applied. The source
99 // hairline polygon is given in io_rLinePolyPolygon. Both given polygons may
100 // contain results; e.g. when no fat line but DashDot is defined, the result will
101 // be in io_rLinePolyPolygon while o_rFillPolyPolygon will be empty. When fat line
102 // is defined, it will be vice-versa. If none is defined, io_rLinePolyPolygon will
103 // not be changed (but o_rFillPolyPolygon will be freed)
104 void applyToB2DPolyPolygon(
105 basegfx::B2DPolyPolygon& io_rLinePolyPolygon,
106 basegfx::B2DPolyPolygon& o_rFillPolyPolygon) const;
108 private:
109 o3tl::cow_wrapper< ImplLineInfo > mpImplLineInfo;
112 #endif // INCLUDED_VCL_LINEINFO_HXX
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */