~greg-hellings/bibletime/debian

« back to all changes in this revision

Viewing changes to src/frontend/settingsdialogs/cfontchooser.h

  • Committer: Jonathan Marsden
  • Date: 2011-12-23 20:32:12 UTC
  • Revision ID: jmarsden@fastmail.fm-20111223203212-1g3e35rlhbys07iu
New upstream version 2.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*********
2
 
*
3
 
* This file is part of BibleTime's source code, http://www.bibletime.info/.
4
 
*
5
 
* Copyright 1999-2011 by the BibleTime developers.
6
 
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
7
 
*
8
 
**********/
9
 
 
10
 
#ifndef CFONTCHOOSER_H
11
 
#define CFONTCHOOSER_H
12
 
 
13
 
#include <QFrame>
14
 
 
15
 
#include <QWidget>
16
 
 
17
 
 
18
 
class CListWidget;
19
 
class QListWidget;
20
 
class QListWidgetItem;
21
 
class QString;
22
 
class QVBoxLayout;
23
 
class QWebView;
24
 
 
25
 
class CFontChooser : public QFrame {
26
 
        Q_OBJECT
27
 
 
28
 
    public:
29
 
        CFontChooser(QWidget *parent = 0);
30
 
        ~CFontChooser();
31
 
        void setFont(const QFont& font);
32
 
        void setSampleText(const QString& text);
33
 
        QSize sizeHint() const;
34
 
 
35
 
    private:
36
 
        void createFontAreaLayout();
37
 
        void createLayout();
38
 
        void createTextAreaLayout();
39
 
        void connectListWidgets();
40
 
        QString formatAsHtml(const QString& text);
41
 
        void loadFonts();
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);
47
 
 
48
 
        QFrame* m_fontWidget;
49
 
        QWebView* m_webView;
50
 
        CListWidget* m_fontListWidget;
51
 
        CListWidget* m_styleListWidget;
52
 
        CListWidget* m_sizeListWidget;
53
 
        QString m_htmlText;
54
 
        QFont m_font;
55
 
        QVBoxLayout* m_vBoxLayout;
56
 
        QString m_choosenStyle;
57
 
 
58
 
    private slots:
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);
63
 
 
64
 
    signals:
65
 
        void fontSelected(const QFont&);
66
 
};
67
 
 
68
 
#endif