merge the formfield patch from ooo-build
[ooovba.git] / vcl / unx / source / gdi / xlfd_smpl.hxx
blobed14fd7e3ec4d4cda039bb62782add420dfae656
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xlfd_smpl.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef XLFD_SIMPLE_HXX
31 #define XLFD_SIMPLE_HXX
33 #include <salunx.h>
34 #include <vcl/vclenum.hxx>
35 #include <tools/string.hxx>
37 class AttributeProvider;
39 // --------------------------------------------------------------------------
42 // broken down structure equivalent to a Xlfd string
45 // --------------------------------------------------------------------------
47 enum XlfdFonttype {
48 eTypeUnknown = TYPE_DONTKNOW,
49 eTypeBitmap = TYPE_RASTER,
50 eTypeScalableBitmap = TYPE_VECTOR,
51 eTypeScalable = TYPE_SCALABLE
54 class Xlfd {
56 public:
58 unsigned short mnFoundry;
59 unsigned short mnFamily;
60 unsigned short mnWeight;
61 unsigned short mnSlant;
62 unsigned short mnSetwidth;
63 unsigned short mnAddstyle;
64 unsigned short mnPixelSize;
65 unsigned short mnPointSize;
66 unsigned short mnResolutionX;
67 unsigned short mnResolutionY;
68 unsigned char mcSpacing;
69 unsigned short mnAverageWidth;
70 unsigned short mnCharset;
72 // all foundry, family, weight ... information referres
73 // to this factory
74 AttributeProvider *mpFactory;
76 Bool IsConformant( const char* pXlfdstring ) const;
78 public:
79 Xlfd();
80 Bool FromString( const char* pXlfdstring,
81 AttributeProvider *pFactory );
82 Bool SameFontoutline( const Xlfd *pComparedTo ) const ;
83 XlfdFonttype Fonttype() const ;
84 unsigned short GetEncoding() const ;
85 #if OSL_DEBUG_LEVEL > 1
86 const char* ToString( ByteString &rString ) const ;
87 void Dump() const;
88 #endif
91 extern "C" int
92 XlfdCompare( const void *vFrom, const void *vTo );
94 #endif /* XLFD_SIMPLE_HXX */