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_FONT_HXX
30 : : #define _SV_FONT_HXX
31 : :
32 : : #include <vcl/dllapi.h>
33 : : #include <tools/gen.hxx>
34 : : #include <tools/string.hxx>
35 : : #include <i18npool/lang.h>
36 : : #include <tools/color.hxx>
37 : : #include <vcl/vclenum.hxx>
38 : : #include <vcl/fntstyle.hxx>
39 : :
40 : : class SvStream;
41 : : #define FontAlign TextAlign
42 : :
43 : : class Impl_Font;
44 : : class ImplFontAttributes;
45 : :
46 : : // --------
47 : : // - Font -
48 : : // --------
49 : :
50 : : class VCL_DLLPUBLIC Font
51 : : {
52 : : private:
53 : : Impl_Font* mpImplFont;
54 : : void MakeUnique();
55 : :
56 : : public:
57 : : Font();
58 : : Font( const Font& );
59 : : Font( const String& rFamilyName, const Size& );
60 : : Font( const String& rFamilyName, const String& rStyleName, const Size& );
61 : : Font( FontFamily eFamily, const Size& );
62 : : ~Font();
63 : :
64 : : void SetColor( const Color& );
65 : : const Color& GetColor() const;
66 : : void SetFillColor( const Color& );
67 : : const Color& GetFillColor() const;
68 : : void SetTransparent( sal_Bool bTransparent );
69 : : sal_Bool IsTransparent() const;
70 : : void SetAlign( FontAlign );
71 : : FontAlign GetAlign() const;
72 : :
73 : : void SetName( const rtl::OUString& rFamilyName );
74 : : const String& GetName() const;
75 : : void SetStyleName( const String& rStyleName );
76 : : const String& GetStyleName() const;
77 : : void SetSize( const Size& );
78 : : const Size& GetSize() const;
79 : : void SetHeight( long nHeight );
80 : : long GetHeight() const;
81 : : void SetWidth( long nWidth );
82 : : long GetWidth() const;
83 : :
84 : : void SetFamily( FontFamily );
85 : : FontFamily GetFamily() const;
86 : : void SetCharSet( rtl_TextEncoding );
87 : : rtl_TextEncoding GetCharSet() const;
88 : : void SetLanguage( LanguageType );
89 : : LanguageType GetLanguage() const;
90 : : void SetCJKContextLanguage( LanguageType );
91 : : LanguageType GetCJKContextLanguage() const;
92 : : void SetPitch( FontPitch ePitch );
93 : : FontPitch GetPitch() const;
94 : :
95 : : void SetOrientation( short nLineOrientation );
96 : : short GetOrientation() const;
97 : : void SetVertical( sal_Bool bVertical );
98 : : sal_Bool IsVertical() const;
99 : : void SetKerning( FontKerning nKerning );
100 : : FontKerning GetKerning() const;
101 : : sal_Bool IsKerning() const;
102 : :
103 : : void SetWeight( FontWeight );
104 : : FontWeight GetWeight() const;
105 : : void SetWidthType( FontWidth );
106 : : FontWidth GetWidthType() const;
107 : : void SetItalic( FontItalic );
108 : : FontItalic GetItalic() const;
109 : : void SetOutline( sal_Bool bOutline );
110 : : sal_Bool IsOutline() const;
111 : : void SetShadow( sal_Bool bShadow );
112 : : sal_Bool IsShadow() const;
113 : : void SetRelief( FontRelief );
114 : : FontRelief GetRelief() const;
115 : : void SetUnderline( FontUnderline );
116 : : FontUnderline GetUnderline() const;
117 : : void SetOverline( FontUnderline );
118 : : FontUnderline GetOverline() const;
119 : : void SetStrikeout( FontStrikeout );
120 : : FontStrikeout GetStrikeout() const;
121 : : void SetEmphasisMark( FontEmphasisMark );
122 : : FontEmphasisMark GetEmphasisMark() const;
123 : : void SetWordLineMode( sal_Bool bWordLine );
124 : : sal_Bool IsWordLineMode() const;
125 : :
126 : : void Merge( const Font& rFont );
127 : : void GetFontAttributes( ImplFontAttributes& rAttrs ) const;
128 : :
129 : : Font& operator=( const Font& );
130 : : sal_Bool operator==( const Font& ) const;
131 : 31924 : sal_Bool operator!=( const Font& rFont ) const
132 : 31924 : { return !(Font::operator==( rFont )); }
133 : : sal_Bool IsSameInstance( const Font& ) const;
134 : :
135 : : friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Font& );
136 : : friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Font& );
137 : :
138 : : static Font identifyFont( const void* pBuffer, sal_uInt32 nLen );
139 : : };
140 : :
141 : : #endif // _VCL_FONT_HXX
142 : :
143 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|