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