Back to index

scribus-ng  1.3.4.dfsg+svn20071115
smwidgets.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 SMWIDGETS_H
00009 #define SMWIDGETS_H
00010 
00011 #include "mspinbox.h"
00012 #include "sccombobox.h"
00013 #include "alignselect.h"
00014 #include "styleselect.h"
00015 #include "shadebutton.h"
00016 #include "colorcombo.h"
00017 #include "fontcombo.h"
00018 #include "tabruler.h"
00019 
00020 class SMSpinBox : public QSpinBox
00021 {
00022        Q_OBJECT
00023 public:
00024        SMSpinBox(QWidget *parent, const char *name);
00025        ~SMSpinBox() {};
00026 
00027        void setValue(int val);
00028        void setValue(int val, bool isParentVal);
00029 
00030        void clear();
00031 
00032        void setParentValue(int val);
00033 
00034        bool useParentValue();
00035 
00036 protected:
00037        void interpretText();
00038 
00039 private:
00040        bool   hasParent_;
00041        bool   useParentValue_;
00042        int    pValue_;
00043        void setFont(bool wantBold);
00044 
00045 private slots:
00046        void slotValueChanged();
00047 };
00048 
00049 class SMMSpinBox : public MSpinBox
00050 {
00051        Q_OBJECT
00052 public:
00053        SMMSpinBox(QWidget *pa, int s);
00054        SMMSpinBox(double minValue, double maxValue, QWidget *pa, int s);
00055        SMMSpinBox(QWidget *parent, const char * name = 0);
00056        ~SMMSpinBox() {};
00057 
00058        void setValue(double val);
00059        void setValue(double val, bool isParentVal);
00060 
00061        void clear();
00062 
00063        void setParentValue(double val);
00064 
00065        bool useParentValue();
00066 
00067 protected:
00068        void interpretText();
00069 
00070 private:
00071        bool   hasParent_;
00072        bool   useParentValue_;
00073        double pValue_;
00074        void setFont(bool wantBold);
00075 
00076 private slots:
00077        void slotValueChanged();
00078 };
00079 
00080 class SMScComboBox  : public ScComboBox
00081 {
00082        Q_OBJECT
00083 public:
00084        SMScComboBox(QWidget *parent, const char *name);
00085        SMScComboBox(bool rw, QWidget* parent, const char* name);
00086        ~SMScComboBox() {};
00087 
00088        void setCurrentItem(int i);
00089        void setCurrentItem(int i, bool isParentValue);
00090 
00091        void setParentItem(int i);
00092 
00093        bool useParentValue();
00094 
00095 private:
00096        bool   hasParent_;
00097        bool   useParentValue_;
00098        int    pItem_;
00099        void setFont(bool wantBold);
00100 
00101 private slots:
00102        void currentChanged();
00103 };
00104 
00105 class SMAlignSelect : public AlignSelect
00106 {
00107        Q_OBJECT
00108 public:
00109        SMAlignSelect(QWidget *parent);
00110        ~SMAlignSelect() {}
00111 
00112        void setStyle(int i);
00113        void setStyle(int i, bool isParentValue);
00114 
00115        void setParentItem(int i);
00116 
00117        bool useParentValue();
00118 
00119        QToolButton *parentButton;
00120 
00121 private:
00122        bool   hasParent_;
00123        bool   useParentStyle_;
00124        int    pStyle_;
00125        void setFont(bool wantBold);
00126 
00127 private slots:
00128        void styleChanged();
00129        void pbPressed();
00130 };
00131 
00132 class SMStyleSelect  : public StyleSelect
00133 {
00134        Q_OBJECT
00135 public:
00136        SMStyleSelect(QWidget *parent);
00137        ~SMStyleSelect() {}
00138 
00139        void setStyle(int i);
00140        void setStyle(int i, bool isParentValue);
00141 
00142        void setParentItem(int i);
00143 
00144        bool useParentValue();
00145 
00146        QToolButton *parentButton;
00147 
00148 private:
00149        bool   hasParent_;
00150        bool   useParentStyle_;
00151        int    pStyle_;
00152        void setFont(bool wantBold);
00153 
00154 private slots:
00155        void styleChanged();
00156        void pbPressed();
00157 };
00158 
00159 class SMShadeButton  : public ShadeButton
00160 {
00161        Q_OBJECT
00162 public:
00163        SMShadeButton(QWidget *parent);
00164        ~SMShadeButton() {};
00165 
00166        void setValue(int i);
00167        void setValue(int i, bool isParentValue);
00168 
00169        void setParentValue(int i);
00170 
00171        bool useParentValue();
00172 
00173 private:
00174        bool   hasParent_;
00175        bool   useParentValue_;
00176        int    pValue_;
00177        void setFont(bool wantBold);
00178 
00179 private slots:
00180        void currentChanged();
00181        void slotUseParent();
00182 };
00183 
00184 class SMColorCombo  : public ColorCombo
00185 {
00186        Q_OBJECT
00187 public:
00188        SMColorCombo(QWidget *parent, const char *name);
00189        SMColorCombo(bool rw, QWidget* parent, const char* name);
00190        ~SMColorCombo() {};
00191 
00192        void setCurrentItem(int i);
00193        void setCurrentItem(int i, bool isParentValue);
00194 
00195        void setCurrentText(const QString &s);
00196        void setCurrentText(const QString &s, bool isParentValue);
00197 
00198        void setParentItem(int i);
00199        void setParentText(const QString &s);
00200 
00201        bool useParentValue();
00202 
00203 private:
00204        bool   hasParent_;
00205        bool   useParentValue_;
00206        int    pItem_;
00207        QString pText_;
00208        void setFont(bool wantBold);
00209 
00210 private slots:
00211        void currentChanged();
00212 };
00213 
00214 class SMFontComboH  : public FontComboH
00215 {
00216        Q_OBJECT
00217 public:
00218        SMFontComboH(QWidget *parent);
00219        ~SMFontComboH() {};
00220        
00221        void setCurrentFont(const QString &s);
00222        void setCurrentFont(const QString &s, bool isParentValue);
00223 
00224        void setParentFont(const QString &s);
00225        
00226        bool useParentFont();
00227 
00228 private:
00229        bool   hasParent_;
00230        bool   useParentValue_;
00231        QString pFont_;
00232        QString usePFont_;
00233        void setFont(bool wantBold);
00234 
00235 private slots:
00236        void currentChanged();
00237        void checkStyle();
00238 };
00239 
00240 class SMTabruler : public Tabruler
00241 {
00242        Q_OBJECT
00243 public:
00244        SMTabruler(QWidget* parent,
00245                         bool haveFirst = true,
00246                         int dEin = 1,
00247                         QValueList<ParagraphStyle::TabRecord> Tabs = QValueList<ParagraphStyle::TabRecord>(),
00248                         double wid = -1);
00249        ~SMTabruler() {};
00250 
00251        void setTabs(QValueList<ParagraphStyle::TabRecord> Tabs, int dEin);
00252        void setTabs(QValueList<ParagraphStyle::TabRecord> Tabs, int dEin, bool isParentValue);
00253        void setParentTabs(QValueList<ParagraphStyle::TabRecord> Tabs);
00254 
00255        void setFirstLineValue(double t);
00256        void setFirstLineValue(double t, bool isParentValue);
00257        void setParentFirstLine(double t);
00258 
00259        void setLeftIndentValue(double t);
00260        void setLeftIndentValue(double t, bool isParentValue);
00261        void setParentLeftIndent(double t);
00262 
00263        void setRightIndentValue(double t);
00264        void setRightIndentValue(double t, bool isParentValue);
00265        void setParentRightIndent(double t);
00266 
00267        bool useParentTabs();
00268        bool useParentFirstLine();
00269        bool useParentLeftIndent();
00270        bool useParentRightIndent();
00271 
00272        SMMSpinBox *first_;
00273        SMMSpinBox *left_;
00274        SMMSpinBox *right_;
00275 
00276 private:
00277        QValueList<ParagraphStyle::TabRecord> pTabs_;
00278        int pDein_;
00279        QToolButton *parentButton_;
00280        bool hasParent_;
00281        bool tabsChanged_;
00282        bool useParentTabs_;
00283        bool isSetupRight_;
00284        bool isSetupLeft_;
00285        bool isSetupFirst_;
00286 
00287 private slots:
00288        void slotTabsChanged();
00289        void pbClicked();
00290        void firstDataChanged();
00291        void leftDataChanged();
00292        void rightDataChanged();
00293        void firstValueChanged();
00294        void leftValueChanged();
00295        void rightValueChanged();
00296 };
00297 
00298 #endif
00299