F:/KPlato/koffice/libs/kotext/KoFontDiaPreview.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C)  2001,2002,2003 Montel Laurent <lmontel@mandrakesoft.com>
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 __kofontdiapreview_h__
00021 #define __kofontdiapreview_h__
00022 
00023 #include <q3frame.h>
00024 #include <QString>
00025 #include <QColor>
00026 #include <QFont>
00027 #include <QPainter>
00028 
00032 class KoFontDiaPreview : public Q3Frame
00033 {
00034     Q_OBJECT
00035 public:
00039     KoFontDiaPreview( QWidget* parent =0, const char* name = 0, Qt::WFlags fl = 0 );
00040     ~KoFontDiaPreview();
00041 
00042     void setText( const QString &text );
00043     void setFont( const QFont &font );
00044     void setFontColor( const QColor &textColor );
00045     void setBackgroundColor( const QColor &backgroundColor );
00046     void setShadow( double sdx, double sdy, QColor shadowColor );
00047     void setUnderlining( int underlining, int underliningStyle, const QColor underliningColor, bool wordByWord );
00048     void setWordByWord( bool wordByWord );
00049     void setStrikethrough( int strikethrough, int strikethroughStylestrikethrough, bool wordByWord );
00050     void setCapitalisation( int capitalisation );
00051     void setSubSuperscript( int subSuper, int offset, double relativeSize );
00052 
00053 
00054 private:
00055     void drawContents( QPainter* );
00056 
00057     QString m_text;
00058     QString displayText;
00059     QFont m_font;
00060     QFont displayFont;
00061     int m_fontSize;
00062     QColor m_textColor;
00063     QColor m_backgroundColor;
00064     double m_shadowDistanceX;
00065     double m_shadowDistanceY;
00066     QColor m_shadowColor;
00067     int m_underlining;
00068     int m_underliningStyle;
00069     QColor m_underliningColor;
00070     bool m_wordByWord;
00071     int m_strikethrough;
00072     int m_strikethroughStyle;
00073     int m_capitalisation;
00074     int m_subSuper;
00075     int m_offset;
00076     double m_relativeSize;
00077 
00078     QString formatCapitalisation( const QString &string );
00079     void drawUnderline( int x, int y, int width, int thickness, QColor & color, QPainter *p );
00080     void drawUnderlineWave( int x, int y, int width, int thickness, QColor & color, QPainter *p );
00081     void drawStrikethrough( int x, int y, int width, int thickness, QPainter *p );
00082 };
00083 
00084 #endif

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