Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

FontPreview Class Reference

Main window for "Font Preview" plugin. It's only gui. Constructs a FontPreview as a child of 'parent', with the name 'name' and widget flags set to 'f'. The dialog will by default be modeless, unless you set 'modal' to true to construct a modal dialog. More...

#include <fontpreview.h>

Collaboration diagram for FontPreview:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 FontPreview (QString fontName=QString::null, QWidget *parent=0, ScribusDoc *doc=0)
 Create Font Preview window,.
 ~FontPreview ()
QString getCurrentFont ()
 Get the current selected font name.

Protected Slots

virtual void languageChange ()
 Sets the strings of the subwidgets using the current language.
virtual void searchEdit_textChanged (const QString &s)
 Called after each text change. It calls paintSample().
virtual void searchButton_clicked ()
 The same as searchEdit_textChanged().
void fontList_currentChanged (const QModelIndex &, const QModelIndex &)
 Slot to handle row changes in the table view.
void displayButton_clicked ()
 Setup the preview phrase instead of "blue quartz...".
void resetDisplayButton_clicked ()
 Reset the sample phrase to the standard "blue quartz".
void sizeSpin_valueChanged (int)
 Font size change.
void cancelButton_clicked ()

Protected Member Functions

void paintSample ()
 Create a pixmap sample with font preview. With GUI oprions.
bool allowSample ()
 Check if is there any item in list to prevent crashes. It allows not to paint the sample if there could be memory leak.

Protected Attributes

QPixmap ttfFont
 Pixmaps for each font type.
QPixmap otfFont
QPixmap psFont
QPixmap okIcon
QString defaultStr
 Default "blue quartz" text.
PrefsContextprefs
 Configuration structure.
uint xsize
 window size
uint ysize
SampleItemsampleItem
 Sample text frame to render the preview.
FontListModelfontModel
 Store fonts in the Qt4 MVC model part.
QSortFilterProxyModel * proxyModel
 A model for searching in the font set. see searchButton_clicked() for more.
ScribusDocm_Doc


Detailed Description

Main window for "Font Preview" plugin. It's only gui. Constructs a FontPreview as a child of 'parent', with the name 'name' and widget flags set to 'f'. The dialog will by default be modeless, unless you set 'modal' to true to construct a modal dialog.

Definition at line 25 of file fontpreview.h.


Constructor & Destructor Documentation

FontPreview::FontPreview ( QString  fontName = QString::null,
QWidget *  parent = 0,
ScribusDoc doc = 0 
)

FontPreview::~FontPreview (  ) 

Definition at line 92 of file fontpreview.cpp.

References SampleItem::cleanupTemporary(), prefs, sampleItem, and PrefsContext::set().


Member Function Documentation

QString FontPreview::getCurrentFont (  ) 

Get the current selected font name.

Return values:
QString the font name.

Definition at line 160 of file fontpreview.cpp.

References fontModel, FontListModel::nameForIndex(), and proxyModel.

Referenced by paintSample(), and FontPreviewPlugin::run().

void FontPreview::paintSample (  )  [protected]

Create a pixmap sample with font preview. With GUI oprions.

Definition at line 118 of file fontpreview.cpp.

References allowSample(), getCurrentFont(), SampleItem::getSample(), sampleItem, SampleItem::setFont(), and SampleItem::setFontSize().

Referenced by displayButton_clicked(), fontList_currentChanged(), and sizeSpin_valueChanged().

bool FontPreview::allowSample (  )  [protected]

Check if is there any item in list to prevent crashes. It allows not to paint the sample if there could be memory leak.

Return values:
bool true if you can paint sample safely.

Definition at line 110 of file fontpreview.cpp.

References fontModel, and FontListModel::rowCount().

Referenced by paintSample().

void FontPreview::languageChange (  )  [protected, virtual, slot]

Sets the strings of the subwidgets using the current language.

Definition at line 102 of file fontpreview.cpp.

References tr().

Referenced by FontPreview().

void FontPreview::searchEdit_textChanged ( const QString &  s  )  [protected, virtual, slot]

Called after each text change. It calls paintSample().

Parameters:
s non-used string

Definition at line 136 of file fontpreview.cpp.

References searchButton_clicked().

Referenced by FontPreview().

void FontPreview::searchButton_clicked (  )  [protected, virtual, slot]

The same as searchEdit_textChanged().

Definition at line 141 of file fontpreview.cpp.

References proxyModel.

Referenced by FontPreview(), and searchEdit_textChanged().

void FontPreview::fontList_currentChanged ( const QModelIndex &  ,
const QModelIndex &   
) [protected, slot]

Slot to handle row changes in the table view.

Definition at line 190 of file fontpreview.cpp.

References paintSample().

Referenced by FontPreview().

void FontPreview::displayButton_clicked (  )  [protected, slot]

Setup the preview phrase instead of "blue quartz...".

Definition at line 168 of file fontpreview.cpp.

References paintSample(), sampleItem, and SampleItem::setText().

Referenced by FontPreview(), and resetDisplayButton_clicked().

void FontPreview::resetDisplayButton_clicked (  )  [protected, slot]

Reset the sample phrase to the standard "blue quartz".

Definition at line 179 of file fontpreview.cpp.

References defaultStr, and displayButton_clicked().

Referenced by FontPreview().

void FontPreview::sizeSpin_valueChanged ( int   )  [protected, slot]

Font size change.

Definition at line 185 of file fontpreview.cpp.

References paintSample().

Referenced by FontPreview().

void FontPreview::cancelButton_clicked (  )  [protected, slot]

Definition at line 174 of file fontpreview.cpp.

Referenced by FontPreview().


Member Data Documentation

QPixmap FontPreview::ttfFont [protected]

Pixmaps for each font type.

Definition at line 42 of file fontpreview.h.

QPixmap FontPreview::otfFont [protected]

Definition at line 43 of file fontpreview.h.

QPixmap FontPreview::psFont [protected]

Definition at line 44 of file fontpreview.h.

QPixmap FontPreview::okIcon [protected]

Definition at line 45 of file fontpreview.h.

QString FontPreview::defaultStr [protected]

Default "blue quartz" text.

Definition at line 47 of file fontpreview.h.

Referenced by FontPreview(), and resetDisplayButton_clicked().

Configuration structure.

Definition at line 49 of file fontpreview.h.

Referenced by FontPreview(), and ~FontPreview().

uint FontPreview::xsize [protected]

window size

Definition at line 51 of file fontpreview.h.

Referenced by FontPreview().

uint FontPreview::ysize [protected]

Definition at line 52 of file fontpreview.h.

Referenced by FontPreview().

Sample text frame to render the preview.

Definition at line 55 of file fontpreview.h.

Referenced by displayButton_clicked(), FontPreview(), paintSample(), and ~FontPreview().

Store fonts in the Qt4 MVC model part.

Definition at line 58 of file fontpreview.h.

Referenced by allowSample(), FontPreview(), and getCurrentFont().

QSortFilterProxyModel* FontPreview::proxyModel [protected]

A model for searching in the font set. see searchButton_clicked() for more.

Definition at line 62 of file fontpreview.h.

Referenced by FontPreview(), getCurrentFont(), and searchButton_clicked().

Definition at line 73 of file fontpreview.h.

Referenced by FontPreview().


The documentation for this class was generated from the following files:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.