2
// C++ Interface: CFontChooser
4
// Description: BibleTime font chooser
7
// Author: The BibleTime team <info@bibletime.info>, (C) 1999-2008
9
// Copyright: See COPYING file that comes with this distribution
3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
5
* Copyright 1999-2009 by the BibleTime developers.
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
13
10
#ifndef CFONTCHOOSER_H
14
11
#define CFONTCHOOSER_H
16
// These following two defines allow chosing between using KDE and
17
// Qt only for rendering the preview text
26
20
class QListWidgetItem;
31
25
class CFontChooser : public QFrame {
35
CFontChooser(QWidget* parent = 0);
37
void setFont(const QFont& font);
38
void setSampleText(const QString& text);
39
QSize sizeHint() const;
42
void createFontAreaLayout();
44
void createTextAreaLayout();
45
void connectListWidgets();
46
QString formatAsHtml(const QString& text);
48
void loadSizes(const QString& font, const QString& style);
49
void loadStyles(const QString& font);
50
void outputHtmlText();
51
void restoreListWidgetValue(QListWidget* listWidget, const QString& value);
52
QString saveListWidgetValue(QListWidget* listWidget);
56
CListWidget* m_fontListWidget;
57
CListWidget* m_styleListWidget;
58
CListWidget* m_sizeListWidget;
61
QVBoxLayout* m_vBoxLayout;
62
QString m_choosenStyle;
65
void fontChanged(QListWidgetItem* current, QListWidgetItem* previous);
66
void setFontStyle(const QString& styleString, QFont* font);
67
void sizeChanged(QListWidgetItem* current, QListWidgetItem* previous);
68
void styleChanged(QListWidgetItem* current, QListWidgetItem* previous);
71
void fontSelected(const QFont&);
29
CFontChooser(QWidget *parent = 0);
31
void setFont(const QFont& font);
32
void setSampleText(const QString& text);
33
QSize sizeHint() const;
36
void createFontAreaLayout();
38
void createTextAreaLayout();
39
void connectListWidgets();
40
QString formatAsHtml(const QString& text);
42
void loadSizes(const QString& font, const QString& style);
43
void loadStyles(const QString& font);
44
void outputHtmlText();
45
void restoreListWidgetValue(QListWidget* listWidget, const QString& value);
46
QString saveListWidgetValue(QListWidget* listWidget);
50
CListWidget* m_fontListWidget;
51
CListWidget* m_styleListWidget;
52
CListWidget* m_sizeListWidget;
55
QVBoxLayout* m_vBoxLayout;
56
QString m_choosenStyle;
59
void fontChanged(QListWidgetItem* current, QListWidgetItem* previous);
60
void setFontStyle(const QString& styleString, QFont* font);
61
void sizeChanged(QListWidgetItem* current, QListWidgetItem* previous);
62
void styleChanged(QListWidgetItem* current, QListWidgetItem* previous);
65
void fontSelected(const QFont&);