Scribus
Open source desktop publishing at your fingertips
fontpreview.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef FONTPREVIEW_UI_H
8 #define FONTPREVIEW_UI_H
9 
10 #include "ui_fontpreview.h"
11 
12 class PrefsContext;
13 class SampleItem;
14 class ScribusDoc;
15 class FontListModel;
16 class QSortFilterProxyModel;
17 
18 
25 class FontPreview : public QDialog, Ui::FontPreview
26 {
27  Q_OBJECT
28 
29 public:
33  FontPreview(QString fontName = QString::null, QWidget* parent = 0, ScribusDoc* doc=0);
34  ~FontPreview();
35 
38  QString getCurrentFont();
39 
40 protected:
42  QPixmap ttfFont;
43  QPixmap otfFont;
44  QPixmap psFont;
45  QPixmap okIcon;
47  QString defaultStr;
51  uint xsize;
52  uint ysize;
53 
56 
59 
62  QSortFilterProxyModel * proxyModel;
63 
66  void paintSample();
67 
71  bool allowSample();
72 
74  void showEvent(QShowEvent * event);
75  void resizeEvent(QResizeEvent * event);
76 
77  ScribusDoc* m_Doc;
78 
79 protected slots:
82  virtual void languageChange();
83 
87  virtual void searchEdit_textChanged(const QString &s);
88 
90  void fontList_currentChanged(const QModelIndex &, const QModelIndex &);
91 
93  void displayButton_clicked();
94 
97 
99  void sizeSpin_valueChanged( int );
100 
101  void cancelButton_clicked();
102 
104  void setExtendedView(bool state);
105 };
106 
107 #endif // FONTPREVIEW_H
108 
Main window for "Font Preview" plugin. It's only gui. Constructs a FontPreview as a child of 'parent'...
Definition: fontpreview.h:25
void setExtendedView(bool state)
Show/hide "advanced" columns in the view.
Definition: fontpreview.cpp:207
FontListModel * fontModel
Store fonts in the Qt4 MVC model part.
Definition: fontpreview.h:58
bool allowSample()
Check if is there any item in list to prevent crashes. It allows not to paint the sample if there cou...
Definition: fontpreview.cpp:127
SampleItem * sampleItem
Sample text frame to render the preview.
Definition: fontpreview.h:55
PrefsContext * prefs
Configuration structure.
Definition: fontpreview.h:49
QSortFilterProxyModel * proxyModel
A model for searching in the font set. see searchEdit_textChanged() for more.
Definition: fontpreview.h:62
void resetDisplayButton_clicked()
Reset the sample phrase to the standard "blue quartz".
Definition: fontpreview.cpp:191
the Document Class
Definition: scribusdoc.h:90
void fontList_currentChanged(const QModelIndex &, const QModelIndex &)
Slot to handle row changes in the table view.
Definition: fontpreview.cpp:202
Model for font views. It contains quite all informations about fonts available to display in Qt4 view...
Definition: fontlistmodel.h:30
virtual void searchEdit_textChanged(const QString &s)
Called after each text change. It calls paintSample().
Definition: fontpreview.cpp:153
Definition: prefscontext.h:40
uint xsize
window size
Definition: fontpreview.h:51
void displayButton_clicked()
Setup the preview phrase instead of "blue quartz...".
Definition: fontpreview.cpp:180
void paintSample()
Create a pixmap sample with font preview. With GUI oprions.
Definition: fontpreview.cpp:135
QPixmap ttfFont
Pixmaps for each font type.
Definition: fontpreview.h:42
QString getCurrentFont()
Get the current selected font name.
Definition: fontpreview.cpp:172
virtual void languageChange()
Sets the strings of the subwidgets using the current language.
Definition: fontpreview.cpp:108
FontPreview(QString fontName=QString::null, QWidget *parent=0, ScribusDoc *doc=0)
Create Font Preview window,.
Definition: fontpreview.cpp:21
void showEvent(QShowEvent *event)
Paint sample on the dialog opening.
Definition: fontpreview.cpp:115
void sizeSpin_valueChanged(int)
Font size change.
Definition: fontpreview.cpp:197
QString defaultStr
Default "blue quartz" text.
Definition: fontpreview.h:47
Provides sample "text frame" as pixmap. You can create a pixmap with standard Scribus text frame here...
Definition: sampleitem.h:25