add more spacing
[personal-kdebase.git] / workspace / kcontrol / kfontinst / viewpart / FontPreview.h
bloba175b583a91d82ae15a3b513bccc95d9b8e61d9f
1 #ifndef __FONT_PREVIEW_H__
2 #define __FONT_PREVIEW_H__
4 /*
5 * KFontInst - KDE Font Installer
7 * Copyright 2003-2007 Craig Drummond <craig@kde.org>
9 * ----
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program 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 GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; see the file COPYING. If not, write to
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
27 #include <QtGui/QPixmap>
28 #include <QtCore/QSize>
29 #include <QtGui/QWidget>
30 #include <QtGui/QColor>
31 #include <QtGui/QPaintEvent>
32 #include <KDE/KUrl>
33 #include "KfiConstants.h"
34 #include "FcEngine.h"
36 class QWheelEvent;
38 namespace KFI
41 class CCharTip;
42 class CFcEngine;
44 class CFontPreview : public QWidget
46 Q_OBJECT
48 public:
50 CFontPreview(QWidget *parent);
51 virtual ~CFontPreview();
53 void paintEvent(QPaintEvent *);
54 void mouseMoveEvent(QMouseEvent *event);
55 void wheelEvent(QWheelEvent *e);
56 QSize sizeHint() const;
57 QSize minimumSizeHint() const;
59 void showFont(const KUrl &url, const QString &name=QString(),
60 unsigned long styleInfo=KFI_NO_STYLE_INFO, int face=0);
61 void showFont();
62 void showFace(int face);
63 void zoomIn();
64 void zoomOut();
66 CFcEngine * engine() { return itsEngine; }
68 public Q_SLOTS:
70 void setUnicodeRange(const QList<CFcEngine::TRange> &r);
72 Q_SIGNALS:
74 void status(bool);
75 void doZoomIn();
76 void doZoomOut();
78 private:
80 QPixmap itsPixmap;
81 KUrl itsCurrentUrl;
82 int itsCurrentFace,
83 itsLastWidth,
84 itsLastHeight,
85 itsStyleInfo;
86 QString itsFontName;
87 QList<CFcEngine::TRange> itsRange;
88 QList<CFcEngine::TChar> itsChars;
89 CFcEngine::TChar itsLastChar;
90 CCharTip *itsTip;
91 CFcEngine *itsEngine;
93 friend class CCharTip;
98 #endif