F:/KPlato/koffice/libs/kformula/cmstyle.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Ulrich Kuettler <ulrich.kuettler@gmx.de>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef CMSTYLE_H
00021 #define CMSTYLE_H
00022 
00023 #include "fontstyle.h"
00024 
00025 KFORMULA_NAMESPACE_BEGIN
00026 
00027 
00028 class CMAlphaTable : public AlphaTable {
00029 public:
00030 
00031     CMAlphaTable();
00032 
00033     virtual AlphaTableEntry entry( short pos, CharFamily family, CharStyle style ) const;
00034 
00035 private:
00036 
00037 };
00038 
00039 
00040 class CMStyle : public FontStyle {
00041 public:
00042 
00047     virtual bool init( ContextStyle* context, bool install = true );
00048 
00050     virtual const AlphaTable* alphaTable() const;
00051 
00052     virtual Artwork* createArtwork( SymbolType type = EmptyBracket ) const;
00053 
00054     static QStringList missingFonts( bool install = true );
00055 
00056     static bool m_installed;
00057 
00058 private:
00059 
00060     static QStringList missingFontsInternal();
00061     static void installFonts();
00062 
00063     CMAlphaTable m_alphaTable;
00064 };
00065 
00066 
00067 class CMArtwork : public Artwork {
00068 public:
00069     CMArtwork( SymbolType t );
00070 
00071     virtual void calcSizes( const ContextStyle& style,
00072                             ContextStyle::TextStyle tstyle,
00073                             luPt parentSize );
00074     virtual void calcSizes( const ContextStyle& style,
00075                             ContextStyle::TextStyle tstyle );
00076 
00077     virtual void draw( QPainter& painter, const LuPixelRect& r,
00078                        const ContextStyle& style,
00079                        ContextStyle::TextStyle tstyle,
00080                        luPt parentSize, const LuPixelPoint& origin );
00081     virtual void draw( QPainter& painter, const LuPixelRect& r,
00082                        const ContextStyle& style,
00083                        ContextStyle::TextStyle tstyle,
00084                        const LuPixelPoint& parentOrigin );
00085 
00086     virtual bool isNormalChar() const;
00087 
00088     virtual double slant() const;
00089 
00090 private:
00091 
00092     bool calcCMDelimiterSize( const ContextStyle& context, uchar c,
00093                               luPt fontSize, luPt parentSize );
00094     void calcLargest( const ContextStyle& context, uchar c, luPt fontSize );
00095     void drawCMDelimiter( QPainter& painter, const ContextStyle& style,
00096                           luPixel x, luPixel y, luPt height );
00097 
00098     short cmChar;
00099 };
00100 
00101 KFORMULA_NAMESPACE_END
00102 
00103 #endif

Généré le Wed Nov 22 23:41:00 2006 pour KPlato par  doxygen 1.5.1-p1