Back to index

scribus-ng  1.3.4.dfsg+svn20071115
fontcombo.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008                           fontcombo.h  -  description
00009                              -------------------
00010     begin                : Die Jun 17 2003
00011     copyright            : (C) 2003 by Franz Schmid
00012     email                : Franz.Schmid@altmuehlnet.de
00013  ***************************************************************************/
00014 
00015 /***************************************************************************
00016  *                                                                         *
00017  *   This program is free software; you can redistribute it and/or modify  *
00018  *   it under the terms of the GNU General Public License as published by  *
00019  *   the Free Software Foundation; either version 2 of the License, or     *
00020  *   (at your option) any later version.                                   *
00021  *                                                                         *
00022  ***************************************************************************/
00023 
00024 #ifndef FONTCOMBO_H
00025 #define FONTCOMBO_H
00026 
00027 #include <qcombobox.h>
00028 #include <qlabel.h>
00029 #include <qlistbox.h>
00030 #include <qlayout.h>
00031 #include <qwidget.h>
00032 
00033 #include "scribusapi.h"
00034 #include "scribusstructs.h"
00035 class QListBoxItem;
00036 class QFont;
00037 
00038 class ScribusDoc;
00039 class PrefsManager;
00040 
00045 class SCRIBUS_API FontListItem : public QListBoxItem
00046 {
00047 public:
00048     FontListItem(QComboBox* parent, QString f, QFont fo);
00049     virtual ~FontListItem() {};
00050 
00051     virtual const int width(const QListBox *);
00052     virtual const int height(const QListBox *);
00053 
00054 protected:
00055     virtual void paint(QPainter *p);
00056 
00057 private:
00058     QFont iFont;
00059     QString fontName;
00060 };
00061 
00062 class SCRIBUS_API FontCombo : public QComboBox  
00063 {
00064 public:
00065        FontCombo(QWidget* pa);
00066        ~FontCombo() {};
00067 
00068        void RebuildList(ScribusDoc *currentDoc, bool forAnnotation = false, bool forSubstitute = false);
00069 private:
00070        PrefsManager* prefsManager;
00071        QPixmap ttfFont;
00072        QPixmap otfFont;
00073        QPixmap psFont;
00074        QPixmap substFont;
00075 };
00076 
00077 class SCRIBUS_API FontComboH : public QWidget
00078 {
00079 
00080        Q_OBJECT
00081 
00082 public:
00083        FontComboH(QWidget* parent, bool labels=false);
00084        ~FontComboH() {};
00085        QString currentFont();
00086        void RebuildList(ScribusDoc *currentDoc, bool forAnnotation = false, bool forSubstitute = false);
00087 
00088 public slots:
00089        void setCurrentFont(QString f);
00090        void languageChange();
00091 
00092 signals:
00093        void fontSelected(QString);
00094 
00095 protected slots:
00096        void familySelected(int id);
00097        void styleSelected(int id);
00098 
00099 protected:
00100        QComboBox* fontFamily;
00101        QComboBox* fontStyle;
00102        QLabel *fontFaceLabel;
00103        QLabel *fontStyleLabel;
00104        PrefsManager* prefsManager;
00105        ScribusDoc *currDoc;
00106        QPixmap ttfFont;
00107        QPixmap otfFont;
00108        QPixmap psFont;
00109        QPixmap substFont;
00110        QGridLayout* fontComboLayout;
00111        bool showLabels;
00112 };
00113 
00114 #endif