Back to index

scribus-ng  1.3.4.dfsg+svn20071115
charselect.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 #ifndef CHARSELECT_H
00008 #define CHARSELECT_H
00009 
00010 #include <qdialog.h>
00011 #include "scribusapi.h"
00012 #include "chartable.h"
00013 #include "scrpalettebase.h"
00014 
00015 class QLabel;
00016 class QPushbutton;
00017 class QComboBox;
00018 class QGroupBox;
00019 class QCheckBox;
00020 
00021 class FontCombo;
00022 class PageItem;
00023 class UnicodeChooseButton;
00024 
00025 
00027 class SCRIBUS_API CharSelect : public ScrPaletteBase
00028 {
00029        Q_OBJECT
00030 
00031 public:
00032        CharSelect(QWidget* parent);
00033        ~CharSelect();
00034 
00035        void show();
00036        void setDoc(ScribusDoc* doc);
00037        void setEnabled(bool state, PageItem* item=0);
00038 
00039        const QString & fontInUse() const { return m_fontInUse; };
00040        void setFontInUse(const QString f) { m_fontInUse = f; };
00041 
00042        void setCharacterClass(int c) { m_characterClass = c; };
00043 
00044        const PageItem* item() const {return m_Item;};
00045        void setItem(PageItem* newItem) {m_Item=newItem;}
00046        const QString & getCharacters();
00047        void scanFont();
00048        void setupRangeCombo();
00049        void generatePreview(int charClass);
00050 
00051        CharTable* userTable() { return m_userTable; };
00052 
00053 private:
00054        ScribusDoc* m_doc;
00056        QString m_fontInUse;
00058 //     QString m_characters;
00060        int m_characterClass;
00062        CharTable* m_charTable;
00064        CharTable* m_userTable;
00065        UnicodeChooseButton* unicodeButton;
00066 
00067        QValueList<CharClassDef> allClasses;
00068        CharClassDef characters;
00069        CharClassDef charactersFull;
00070        CharClassDef charactersLatin1;
00071        CharClassDef charactersLatin1Supplement;
00072        CharClassDef charactersLatinExtendedA;
00073        CharClassDef charactersLatinExtendedB;
00074        CharClassDef charactersGeneralPunctuation;
00075        CharClassDef charactersSuperSubscripts;
00076        CharClassDef charactersCurrencySymbols;
00077        CharClassDef charactersLetterlikeSymbols;
00078        CharClassDef charactersNumberForms;
00079        CharClassDef charactersArrows;
00080        CharClassDef charactersMathematicalOperators;
00081        CharClassDef charactersBoxDrawing;
00082        CharClassDef charactersBlockElements;
00083        CharClassDef charactersGeometricShapes;
00084        CharClassDef charactersMiscellaneousSymbols;
00085        CharClassDef charactersDingbats;
00086        CharClassDef charactersSmallFormVariants;
00087        CharClassDef charactersAlphabeticPresentationForms;
00088        CharClassDef charactersSpecial;
00089        CharClassDef charactersGreek;
00090        CharClassDef charactersGreekExtended;
00091        CharClassDef charactersCyrillic;
00092        CharClassDef charactersCyrillicSupplement;
00093        CharClassDef charactersArabic;
00094        CharClassDef charactersArabicPresentationFormsA;
00095        CharClassDef charactersArabicPresentationFormsB;
00096        CharClassDef charactersHebrew;
00097        QMap<int,int> usedCharClasses;
00098        QString chToIns;
00099 
00100 public slots:
00101        void newChar(uint i);
00102        void userNewChar(uint i);
00103        void delChar();
00104        void newFont(int font);
00105        void newCharClass(int c);
00106        void delEdit();
00107        void insChar();
00108 
00109 signals:
00112        void insertSpecialChar();
00113        void insertUserSpecialChar(QChar);
00114 
00115 protected:
00116        bool eventFilter(QObject *obj, QEvent *ev);
00117 
00118        QString paletteFileMask;
00119 
00120        PageItem *m_Item;
00121 
00122        // GUI
00123        QGroupBox* m_bigPalette;
00124        QGroupBox* m_quickPalette;
00125 
00126        QLabel* insText;
00127        QLabel* sample;
00128        QLabel* fontLabel;
00129        QLabel* rangeLabel;
00130 
00131        FontCombo* fontSelector;
00132        QComboBox* rangeSelector;
00133        QPushButton* insertButton;
00134        QPushButton* deleteButton;
00135        QCheckBox* hideCheck;
00136 
00137        QPushButton *uniLoadButton;
00138        QPushButton *uniSaveButton;
00139        QPushButton *uniClearButton;
00140 
00141        void saveUserContent(QString f);
00142        void loadUserContent(QString f);
00143 
00144        protected slots:
00145               void hideCheck_clicked();
00146               void slot_insertSpecialChar();
00147               void slot_insertUserSpecialChar(QChar);
00148               void uniLoadButton_clicked();
00149               void uniSaveButton_clicked();
00150               void uniClearButton_clicked();
00151 };
00152 
00153 #endif