~ubuntu-branches/ubuntu/trusty/bibletime/trusty

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Marsden
  • Date: 2009-11-18 17:30:00 UTC
  • mfrom: (1.3.4 upstream) (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20091118173000-endkhjz5qai88tvr
Tags: 2.4-1
* New upstream version 2.4
* debian/control: 
  - Replace incorrect bibletime-data Depends on lib4qt-gui
    with bibletime Depends on libqtgui4 (>= 4.4.0). (Closes: #556209).
  - Add Build-depends: on zlib1g-dev and libcurl4-gnutls-dev 
    (Closes: #556805).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// C++ Interface: CFontChooser
3
 
//
4
 
// Description: BibleTime font chooser
5
 
//
6
 
//
7
 
// Author: The BibleTime team <info@bibletime.info>, (C) 1999-2008
8
 
//
9
 
// Copyright: See COPYING file that comes with this distribution
10
 
//
11
 
//
 
1
/*********
 
2
*
 
3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
 
4
*
 
5
* Copyright 1999-2009 by the BibleTime developers.
 
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
 
7
*
 
8
**********/
12
9
 
13
10
#ifndef CFONTCHOOSER_H
14
11
#define CFONTCHOOSER_H
15
12
 
16
 
// These following two defines allow chosing between using KDE and 
17
 
// Qt only for rendering the preview text
18
 
 
 
13
#include <QFrame>
19
14
 
20
15
#include <QWidget>
21
 
#include <QFrame>
22
 
 
23
 
class QString;
24
 
class QFrame;
 
16
 
 
17
 
 
18
class CListWidget;
25
19
class QListWidget;
26
20
class QListWidgetItem;
 
21
class QString;
27
22
class QVBoxLayout;
28
23
class QWebView;
29
 
class CListWidget;
30
24
 
31
25
class CFontChooser : public QFrame {
32
 
        Q_OBJECT
33
 
 
34
 
public:
35
 
        CFontChooser(QWidget* parent = 0);
36
 
        ~CFontChooser();
37
 
        void setFont(const QFont& font); 
38
 
        void setSampleText(const QString& text);
39
 
        QSize sizeHint() const;
40
 
 
41
 
private:
42
 
        void createFontAreaLayout();
43
 
        void createLayout();
44
 
        void createTextAreaLayout();
45
 
        void connectListWidgets();
46
 
        QString formatAsHtml(const QString& text);
47
 
        void loadFonts();
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);
53
 
        
54
 
        QFrame* m_fontWidget;
55
 
        QWebView* m_webView;
56
 
        CListWidget* m_fontListWidget;
57
 
        CListWidget* m_styleListWidget;
58
 
        CListWidget* m_sizeListWidget;
59
 
        QString m_htmlText;
60
 
        QFont m_font;
61
 
        QVBoxLayout* m_vBoxLayout;
62
 
        QString m_choosenStyle;
63
 
 
64
 
private slots:
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);
69
 
 
70
 
signals:
71
 
        void fontSelected(const QFont&);
 
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&);
72
66
};
73
67
 
74
68
#endif