Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SV_HATCH_HXX
30 : : #define _SV_HATCH_HXX
31 : :
32 : : #include <tools/color.hxx>
33 : : #include <vcl/dllapi.h>
34 : :
35 : : #include <vcl/vclenum.hxx>
36 : :
37 : : // --------------
38 : : // - Impl_Hatch -
39 : : // --------------
40 : :
41 : : class SvStream;
42 : :
43 : : struct ImplHatch
44 : : {
45 : : sal_uLong mnRefCount;
46 : : Color maColor;
47 : : HatchStyle meStyle;
48 : : long mnDistance;
49 : : sal_uInt16 mnAngle;
50 : :
51 : : ImplHatch();
52 : : ImplHatch( const ImplHatch& rImplHatch );
53 : :
54 : : friend SvStream& operator>>( SvStream& rIStm, ImplHatch& rImplHatch );
55 : : friend SvStream& operator<<( SvStream& rOStm, const ImplHatch& rImplHatch );
56 : : };
57 : :
58 : : // ---------
59 : : // - Hatch -
60 : : // ---------
61 : :
62 : : class VCL_DLLPUBLIC Hatch
63 : : {
64 : : private:
65 : :
66 : : ImplHatch* mpImplHatch;
67 : : SAL_DLLPRIVATE void ImplMakeUnique();
68 : :
69 : : public:
70 : :
71 : : Hatch();
72 : : Hatch( const Hatch& rHatch );
73 : : Hatch( HatchStyle eStyle, const Color& rHatchColor, long nDistance, sal_uInt16 nAngle10 = 0 );
74 : : ~Hatch();
75 : :
76 : : Hatch& operator=( const Hatch& rHatch );
77 : : sal_Bool operator==( const Hatch& rHatch ) const;
78 : : sal_Bool operator!=( const Hatch& rHatch ) const { return !(Hatch::operator==( rHatch ) ); }
79 : : sal_Bool IsSameInstance( const Hatch& rHatch ) const { return( mpImplHatch == rHatch.mpImplHatch ); }
80 : :
81 : 1232 : HatchStyle GetStyle() const { return mpImplHatch->meStyle; }
82 : :
83 : : void SetColor( const Color& rColor );
84 : 616 : const Color& GetColor() const { return mpImplHatch->maColor; }
85 : :
86 : : void SetDistance( long nDistance );
87 : 1232 : long GetDistance() const { return mpImplHatch->mnDistance; }
88 : :
89 : : void SetAngle( sal_uInt16 nAngle10 );
90 : 616 : sal_uInt16 GetAngle() const { return mpImplHatch->mnAngle; }
91 : :
92 : : friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Hatch& rHatch );
93 : : friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Hatch& rHatch );
94 : : };
95 : :
96 : : #endif // _SV_HATCH_HXX
97 : :
98 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|