Back to index

scribus-ng  1.3.4.dfsg+svn20071115
smtextstylewidgets.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 #ifndef SMTEXTSTYLEWIDGETS_H
00009 #define SMTEXTSTYLEWIDGETS_H
00010 
00011 #include "smpstylewbase.h"
00012 #include "smcstylewbase.h"
00013 #include "styles/styleset.h"
00014 
00015 class QGridLayout;
00016 class QPopupMenu;
00017 class QToolButton;
00018 class SMMSpinBox;
00019 class QLabel;
00020 class QTabWidget;
00021 class QString;
00022 class QComboBox;
00023 class SMAlignSelect;
00024 class SMSpinBox;
00025 class QVBoxLayout;
00026 class SMTabruler;
00027 class SMFontComboH;
00028 class StyleSelect;
00029 class QSpacerItem;
00030 class SMScComboBox;
00031 class SMShadeButton;
00032 class CharStyle;
00033 class ParagraphStyle;
00034 class SMCStylePage;
00035 class ColorList;
00036 class SMColorCombo;
00037 class SMStyleSelect;
00038 
00039 class SMPStyleWidget : public PStyleWBase
00040 {
00041        Q_OBJECT
00042 public:
00043        SMPStyleWidget();
00044        ~SMPStyleWidget();
00045 
00046        void show(ParagraphStyle *pstyle, QValueList<ParagraphStyle> &pstyles, QValueList<CharStyle> &cstyles, int unitIndex, const QString &defLang);
00047        void show(QValueList<ParagraphStyle*> &pstyles, QValueList<ParagraphStyle> &pstylesAll, QValueList<CharStyle> &cstyles, int unitIndex, const QString &defLang);
00048 
00049        void clearAll();
00050 
00051        void languageChange();
00052 
00053        void unitChange(double oldRatio, double newRatio, int unitIndex);
00054 
00055 private:
00056        QGridLayout *distancesBoxLayout;
00057        QGridLayout *dropCapsBoxLayout;
00058        QVBoxLayout *tabsBoxLayout;
00059 
00060        SMScComboBox *lineSpacingMode_;
00061 
00062        QLabel      *pixmapLabel0;
00063        QLabel      *pixmapLabel1;
00064        QLabel      *pixmapLabel2;
00065        QLabel      *pixmapLabel3;
00066        QLabel      *pixmapLabel4;
00067        QLabel      *capLabel1;
00068        QLabel      *capLabel2;
00069 
00070        SMMSpinBox  *lineSpacing_;
00071        SMMSpinBox  *spaceAbove_;
00072        SMMSpinBox  *spaceBelow_;
00073        SMSpinBox   *dropCapLines_;
00074        SMMSpinBox  *dropCapOffset_;
00075 
00076        SMAlignSelect *alignement_;
00077        SMTabruler    *tabList_;
00078        SMCStylePage  *cpage;
00079 
00080        bool hasParent_;
00081        bool parentDropCap_;
00082 
00083        void setupDistances();
00084        void setupDropCaps();
00085        void setupTabs();
00086        void setupCharStyle();
00087 
00088        void showLineSpacing(QValueList<ParagraphStyle*> &pstyles);
00089        void showSpaceAB(QValueList<ParagraphStyle*> &pstyles, int unitIndex);
00090        void showDropCap(QValueList<ParagraphStyle*> &pstyles, int unitIndex);
00091        void showAlignment(QValueList<ParagraphStyle*> &pstyles);
00092        void showTabs(QValueList<ParagraphStyle*> &pstyles, int unitIndex);
00093        void showCStyle(QValueList<ParagraphStyle*> &pstyles, QValueList<CharStyle> &cstyles, const QString &defLang, int unitIndex);
00094        void showParent(QValueList<ParagraphStyle*> &pstyles);
00095 
00096        friend class SMParagraphStyle;
00097 
00098 private slots:
00099        void slotLineSpacingModeChanged(int);
00100        void slotDropCap(bool isOn);
00101        void slotParentDropCap();
00102 
00103 signals:
00104        void useParentDropCap();
00105 };
00106 
00107 class SMCStylePage : public CStylePBase
00108 {
00109        Q_OBJECT
00110 public:
00111        SMCStylePage(QWidget *parent = 0);
00112        ~SMCStylePage();
00113 
00114        void show(CharStyle *cstyle, QValueList<CharStyle> &cstyles, const QString &defLang, int unitIndex);
00115        void show(QValueList<CharStyle*> &cstyles, QValueList<CharStyle> &cstylesAll, const QString &defLang, int unitIndex);
00116        void fillLangCombo(QMap<QString,QString> langMap);
00117        void fillColorCombo(ColorList &colors);
00118        void languageChange();
00119        void clearAll();
00120 
00121 private:
00122        QVBoxLayout *basicBoxLayout;
00123        QVBoxLayout *advBoxLayout;
00124        QVBoxLayout *colorBoxLayout;
00125        QHBoxLayout *layout8;
00126        QHBoxLayout *layout9a;
00127        QHBoxLayout *layout5;
00128        QHBoxLayout *layout6;
00129        QGridLayout *spinBoxLayout_;
00130        QGridLayout *spinBoxLayoutBasic_;
00131 
00132        SMFontComboH  *fontFace_;
00133        SMStyleSelect *effects_;
00134        SMColorCombo  *fillColor_;
00135        SMShadeButton *fillShade_;
00136        SMColorCombo  *strokeColor_;
00137        SMShadeButton *strokeShade_;
00138        SMScComboBox  *language_;
00139 
00140        SMMSpinBox  *fontSize_;
00141        SMMSpinBox  *fontHScale_;
00142        SMMSpinBox  *fontVScale_;
00143        SMMSpinBox  *tracking_;
00144        SMMSpinBox  *baselineOffset_;
00145 
00146        QLabel      *fontSizeLabel_;
00147        QLabel      *hscaleLabel_;
00148        QLabel      *vscaleLabel_;
00149        QLabel      *FillIcon;
00150        QLabel      *pixmapLabel3_20;
00151        QLabel      *StrokeIcon;
00152        QLabel      *pixmapLabel3_19;
00153        QLabel      *trackingLabel_;
00154        QLabel      *baselineOffsetLabel_;
00155        QLabel      *languageLabel_;
00156 
00157        QSpacerItem *spacer1;
00158        QSpacerItem *spacer2;
00159        QSpacerItem *spacer3;
00160        QSpacerItem *spacer4;
00161 
00162        QMap<QString, QString> langMap_;
00163 
00164        void showSizeAndPosition(const QValueList<CharStyle*> &cstyles);
00165        void showEffects(const QValueList<CharStyle*> &cstyles);
00166        void showColors(const QValueList<CharStyle*> &cstyles);
00167        void showLanguage(const QValueList<CharStyle*> &cstyles, const QString &defLang);
00168        void showParent(const QValueList<CharStyle*> &cstyles);
00169 
00170        friend class SMParagraphStyle;
00171        friend class SMCharacterStyle;
00172 
00173 private slots:
00174        void slotColorChange();
00175 };
00176 
00177 #endif
00178