Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef _SV_HATCH_HXX
21 : #define _SV_HATCH_HXX
22 :
23 : #include <tools/color.hxx>
24 : #include <vcl/dllapi.h>
25 :
26 : #include <vcl/vclenum.hxx>
27 :
28 : // --------------
29 : // - Impl_Hatch -
30 : // --------------
31 :
32 : class SvStream;
33 :
34 : struct ImplHatch
35 : {
36 : sal_uLong mnRefCount;
37 : Color maColor;
38 : HatchStyle meStyle;
39 : long mnDistance;
40 : sal_uInt16 mnAngle;
41 :
42 : ImplHatch();
43 : ImplHatch( const ImplHatch& rImplHatch );
44 :
45 : friend SvStream& operator>>( SvStream& rIStm, ImplHatch& rImplHatch );
46 : friend SvStream& operator<<( SvStream& rOStm, const ImplHatch& rImplHatch );
47 : };
48 :
49 : // ---------
50 : // - Hatch -
51 : // ---------
52 :
53 : class VCL_DLLPUBLIC Hatch
54 : {
55 : private:
56 :
57 : ImplHatch* mpImplHatch;
58 : SAL_DLLPRIVATE void ImplMakeUnique();
59 :
60 : public:
61 :
62 : Hatch();
63 : Hatch( const Hatch& rHatch );
64 : Hatch( HatchStyle eStyle, const Color& rHatchColor, long nDistance, sal_uInt16 nAngle10 = 0 );
65 : ~Hatch();
66 :
67 : Hatch& operator=( const Hatch& rHatch );
68 : sal_Bool operator==( const Hatch& rHatch ) const;
69 : sal_Bool operator!=( const Hatch& rHatch ) const { return !(Hatch::operator==( rHatch ) ); }
70 : sal_Bool IsSameInstance( const Hatch& rHatch ) const { return( mpImplHatch == rHatch.mpImplHatch ); }
71 :
72 0 : HatchStyle GetStyle() const { return mpImplHatch->meStyle; }
73 :
74 : void SetColor( const Color& rColor );
75 0 : const Color& GetColor() const { return mpImplHatch->maColor; }
76 :
77 : void SetDistance( long nDistance );
78 0 : long GetDistance() const { return mpImplHatch->mnDistance; }
79 :
80 : void SetAngle( sal_uInt16 nAngle10 );
81 0 : sal_uInt16 GetAngle() const { return mpImplHatch->mnAngle; }
82 :
83 : friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Hatch& rHatch );
84 : friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Hatch& rHatch );
85 : };
86 :
87 : #endif // _SV_HATCH_HXX
88 :
89 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|