Back to index

scribus-ng  1.3.4.dfsg+svn20071115
mpalette.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 MPALETTE_H
00008 #define MPALETTE_H
00009 
00010 #include <qbuttongroup.h>
00011 #include <qcheckbox.h>
00012 #include <qcombobox.h>
00013 #include <qframe.h>
00014 #include <qgroupbox.h>
00015 #include <qlabel.h>
00016 #include <qpushbutton.h>
00017 #include <qradiobutton.h>
00018 #include <qspinbox.h>
00019 #include <qtoolbutton.h>
00020 #include <qwidget.h>
00021 #include <qwidgetstack.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qimage.h>
00025 #include <qpixmap.h>
00026 #include <qlistbox.h>
00027 #include <qlineedit.h>
00028 #include <qtimer.h>
00029 #include <qtoolbox.h>
00030 #include <qpopupmenu.h>
00031 
00032 #include "scribusapi.h"
00033 #include "scrpalettebase.h"
00034 #include "mspinbox.h"
00035 #include "pageitem.h"
00036 #include "page.h"
00037 class ScribusDoc;
00038 #include "linkbutton.h"
00039 #include "linecombo.h"
00040 #include "spalette.h"
00041 #include "fontcombo.h"
00042 #include "colorcombo.h"
00043 class StyleSelect;
00044 #include "alignselect.h"
00045 #include "shadebutton.h"
00046 class Cpalette;
00047 class Autoforms;
00048 class ArrowChooser;
00049 class ScComboBox;
00050 class ScribusMainWindow;
00051 class UserActionSniffer;
00052 /*
00053 class SCRIBUS_API LabelButton : public QLabel
00054 {
00055        Q_OBJECT
00056 
00057 public:
00058        LabelButton(QWidget* parent, QString text1, QString text2);
00059        ~LabelButton() {};
00060        void setTexts(QString text1, QString text2);
00061        bool getState();
00062 
00063 private:
00064        bool state;
00065        QString TextA;
00066        QString TextB;
00067 
00068 signals:
00069        void clicked();
00070 
00071 protected:
00072        virtual void enterEvent(QEvent*);
00073        virtual void leaveEvent(QEvent*);
00074        virtual void mousePressEvent(QMouseEvent*);
00075        virtual void mouseReleaseEvent(QMouseEvent *);
00076 };
00077 */
00078 class SCRIBUS_API NameWidget : public QLineEdit
00079 {
00080        Q_OBJECT
00081 
00082 public:
00083        NameWidget(QWidget* parent);
00084        ~NameWidget() {};
00085 
00086 signals:
00087        void Leaved();
00088 
00089 protected:
00090        virtual void focusOutEvent(QFocusEvent *);
00091 };
00092 
00093 class SCRIBUS_API Mpalette : public ScrPaletteBase
00094 {
00095        Q_OBJECT
00096 
00097 public:
00098        Mpalette(QWidget* parent);
00099        ~Mpalette() {};
00100 
00101        virtual void closeEvent(QCloseEvent *closeEvent);
00102        void updateColorSpecialGradient();
00103        const VGradient getFillGradient();
00104        void updateColorList();
00105        void setGradientEditMode(bool);
00106        void updateCmsList();
00107        void setTextFlowMode(PageItem::TextFlowMode mode);
00108        void ShowCMS();
00113        void fillLangCombo(QMap<QString,QString> langMap);
00115        bool userActionOn(); // not yet implemented!!! This is needed badly.
00116                          // When user releases the mouse button or arrow key, changes must be checked
00117                          // and if in ScribusView a groupTransaction has been started it must be also
00118                          // commmited
00119 
00120        Cpalette *Cpal;
00121        Autoforms* SCustom;
00122        Autoforms* SCustom2;
00123        ParaStyleComboBox *paraStyleCombo;
00124        CharStyleComboBox *charStyleCombo;
00125        FontComboH* Fonts;
00126        ArrowChooser* startArrow;
00127        ArrowChooser* endArrow;
00128        QButtonGroup* RotationGroup;
00129        QButtonGroup* textFlowOptions;
00130        QButtonGroup* textFlowOptions2;
00131        
00132 public slots:
00133        void setMainWindow(ScribusMainWindow *mw);
00134        void languageChange();
00135        void setDoc(ScribusDoc *d);
00136        void unsetDoc();
00137        void unsetItem();
00138 //     void setCurrentItem(PageItem *);
00139        void setMultipleSelection(bool);
00140        void NewSel(int nr);
00141        void SetCurItem(PageItem *i);
00142        void unitChange();
00143        void setLevel(uint l);
00144        void setXY(double x, double y);
00145        void setBH(double x, double y);
00146        void setR(double r);
00147        void setRR(double r);
00148        void setCols(int r, double g);
00149        void setLspMode(int id);
00150        void setLsp(double r);
00151        void setSize(int s);
00152        void setFontFace(const QString&);
00153        void setExtra(int e);
00154        void setDvals(double left, double top, double bottom, double right);
00155        void ChangeScaling();
00156        void setLvalue(double scx, double scy, double x, double y);
00157        void setSvalue(double s);
00158        void setLIvalue(Qt::PenStyle p, Qt::PenCapStyle pc, Qt::PenJoinStyle pj);
00160        void updateStyle(const ParagraphStyle& newCurrent);
00161        void setStil(int s);
00162        void setAli(int e);
00163        void setParStyle(const QString& name);
00164        void setCharStyle(const QString& name);
00165        void setOpticalMargins(int);
00166        void setMinWordTracking();
00167        void setNormWordTracking();
00168        void setMinGlyphExtension();
00169        void setMaxGlyphExtension();
00170        void setShadowOffs(int x, int y);
00171        void setUnderline(int p, int w);
00172        void newUnderline();
00173        void setStrike(int p, int w);
00174        void newStrike();
00175        void setOutlineW(int x);
00176        void newOutlineW();
00177        void setTScale(int e);
00178        void NewTScale();
00179        void NewTScaleV();
00180        void NewTBase();
00181        void setTScaleV(int e);
00182        void setTBase(int e);
00183        void SetLineFormats(ScribusDoc *dd);
00184        void SetSTline(QListBoxItem *c);
00185        void NewTFont(QString);
00186        void newTxtFill();
00187        void newTxtStroke();
00188        void setActShade();
00189        void setActFarben(QString p, QString b, int shp, int shb);
00190        void ManageTabs();
00191        void setLocked(bool);
00192        void setSizeLocked(bool);
00193        void setPrintingEnabled(bool);
00194        void setFlippedH(bool);
00195        void setFlippedV(bool);
00196 
00197 private slots:
00198        void SelTab(int t);
00199        void NewX();
00200        void NewY();
00201        void NewW();
00202        void NewH();
00203        void NewR();
00204        void NewRR();
00205        void NewLsp();
00206        void HandleGapSwitch();
00207        void NewCols();
00208        void NewGap();
00209        void NewSize();
00210        void NewExtra();
00211        void handleFlipH();
00212        void handleFlipV();
00213        void ToggleKette();
00214        void HChange();
00215        void VChange();
00216        void ToggleKetteD();
00217        void HChangeD();
00218        void VChangeD();
00219        void NewLocalXY();
00220        void NewLocalSC();
00221        void NewLocalDpi();
00222        void EditEff();
00223        void EditPSD();
00224        void NewLS();
00225        void NewLSty();
00226        void NewLJoin();
00227        void NewLEnd();
00228        void NewAli(int a);
00229        void setTypeStyle(int s);
00230        void newShadowOffs();
00231        void NewLMode();
00232        void DoLower();
00233        void DoRaise();
00234        void DoFront();
00235        void DoBack();
00236        void NewRotMode(int m);
00237        void DoFlow(int id);
00238        void MakeIrre(int f, int c, double *vals);
00239        void EditSh();
00240        void EditSh2();
00241        void NewTDist();
00242        void NewSpGradient(double x1, double y1, double x2, double y2);
00243        void toggleGradientEdit();
00244        void DoRevert();
00245        void doClearCStyle();
00246        void doClearPStyle();
00247        void handleLock();
00248        void handleLockSize();
00249        void handlePrint();
00250        void handlePathType();
00251        void handlePathFlip();
00252        void handlePathLine();
00253        void handlePathDist();
00254        void handlePathOffs();
00255        void handleFillRule();
00256        void handleOverprint();
00257        void ChProf(const QString& prn);
00258        void ChIntent();
00259        void NewName();
00260        void NewLanguage();
00261        void HandleTLines();
00262        void setStartArrow(int id);
00263        void setEndArrow(int id);
00264        void setGroupTransparency(int trans);
00265        void setGroupBlending(int blend);
00266        void doGrouping();
00267 
00268 protected slots:
00269        //virtual void reject();
00270        void mspinboxStartUserAction();
00271        void mspinboxFinishUserAction();
00272        void updateSpinBoxConstants();
00273 
00274 signals:
00275        void DocChanged();
00276        void NewParStyle(int);
00277        void NewAlignment(int);
00278        void NewEffects(int);
00279        void ShapeEdit();
00280        void NewFont(const QString&);
00281        void UpdtGui(int);
00282 
00283 protected:
00284        ScribusMainWindow *m_ScMW;
00285        
00286        QVBoxLayout* MpalLayout;
00287        QVBoxLayout* pageLayout;
00288        QVBoxLayout* pageLayout_2;
00289        QVBoxLayout* pageLayout_2a;
00290        QVBoxLayout* pageLayout_2b;
00291        QVBoxLayout* pageLayout_2c;
00292        QVBoxLayout* pageLayout_3;
00293        QVBoxLayout* pageLayout_4;
00294        QVBoxLayout* pageLayout_5;
00295        QVBoxLayout* pageLayout_5a;
00296        QVBoxLayout* pageLayout_5b;
00297        QVBoxLayout* pageLayout_6;
00298        QVBoxLayout* OverPLayout;
00299        QVBoxLayout* TLineLayout;
00300        QHBoxLayout* layout60;
00301        QGridLayout* Layout44;
00302        QHBoxLayout* Layout13;
00303        QGridLayout* Layout12;
00304        QHBoxLayout* layout47;
00305        QVBoxLayout* layout46;
00306        QGridLayout* layout41;
00307        QHBoxLayout* Layout1;
00308        QGridLayout* layout43;
00309        QVBoxLayout* Layout24;
00310        QHBoxLayout* Layout18;
00311        QHBoxLayout* Layout13_2;
00312        QGridLayout* Layout12_2;
00313        QHBoxLayout* NameGroupLayout;
00314        QGridLayout* GeoGroupLayout;
00315        QGridLayout* LayerGroupLayout;
00316        QHBoxLayout* RotationGroupLayout;
00317        QHBoxLayout* ShapeGroupLayout;
00318        QGridLayout* DistanceLayout;
00319        QGridLayout* DistanceLayout2;
00320        QVBoxLayout* DistanceLayout3;
00321        QGridLayout* GroupBox3aLayout;
00322        QVBoxLayout* GroupBoxCMLayout;
00323        QVBoxLayout* textFlowOptionsLayout;
00324        QVBoxLayout* textFlowOptionsLayout2;
00325        QHBoxLayout* layout23;
00326        QHBoxLayout* layout24;
00327        QVBoxLayout* page_group_layout;
00328        QHBoxLayout* ShapeGroupLayout2;
00329        QGridLayout* Layout1t;
00330        QHBoxLayout* wordTrackingHLayout;
00331        QHBoxLayout* glyphExtensionHLayout;
00332        
00333        NameWidget* NameEdit;
00334        
00335        QWidget* page;
00336        QWidget* page_2;
00337        QWidget* page_2a;
00338        QWidget* page_2b;
00339        QWidget* page_2c;
00340        QWidget* page_3;
00341        QWidget* page_4;
00342        QWidget* page_5;
00343        QWidget* page_5a;
00344        QWidget* page_5b;
00345        QWidget* page_6;
00346        QWidget* page_group;
00347        
00348        QLabel* xposLabel;
00349        QLabel* widthLabel;
00350        QLabel* yposLabel;
00351        QLabel* heightLabel;
00352        QLabel* rotationLabel;
00353        QLabel* basepointLabel;
00354        QLabel* LevelTxt;
00355        QLabel* SRect;
00356        QLabel* SRect2;
00357        QLabel* rndcornersLabel;
00358        QLabel* startoffsetLabel;
00359        QLabel* distfromcurveLabel;
00360        QLabel* pathTextTypeLabel;
00361        QLabel* topLabel;
00362        QLabel* columnsLabel;
00363        QLabel* bottomLabel;
00364        QLabel* leftLabel;
00365        QLabel* rightLabel;
00366        QLabel* trackingLabel;
00367        QLabel* fontsizeLabel;
00368        QLabel* yscaleLabel;
00369        QLabel* xscaleLabel;
00370        QLabel* xposImgLabel;
00371        QLabel* yposImgLabel;
00372        QLabel* linewidthLabel;
00373        QLabel* endingsLabel;
00374        QLabel* linetypeLabel;
00375        QLabel* StrokeIcon;
00376        QLabel* ShadeTxt2;
00377        QLabel* ShadeTxt1;
00378        QLabel* FillIcon;
00379        QLabel* paraStyleLabel;
00380        QLabel* charStyleLabel;
00381        QLabel* langLabel;
00382        QLabel* LineModeT;
00383        QLabel* TextCms1;
00384        QLabel* TextCms2;
00385        QLabel* edgesLabel;
00386        QLabel* ChBaseTxt;
00387        QLabel* ScaleTxt;
00388        QLabel* ScaleTxtV;
00389        QLabel* imgDPIXLabel;
00390        QLabel* imgDPIYLabel;
00391        QLabel* startArrowText;
00392        QLabel* endArrowText;
00393        QLabel* TransTxt;
00394        QLabel* TransTxt2;
00395        QLabel* optMarginLabel;
00396        QLabel* wordTrackingLabel;
00397        QLabel* minWordTrackingLabel;
00398        QLabel* normWordTrackingLabel;
00399        QLabel* glyphExtensionLabel;
00400        QLabel* minGlyphExtensionLabel;
00401        QLabel* maxGlyphExtensionLabel;
00402 
00403 //     LabelButton* colgapLabel;
00404        ScComboBox* colgapLabel;
00405        StyleSelect* SeStyle;
00406        AlignSelect* GroupAlign;
00407 
00408        LinkButton* keepImageWHRatioButton;
00409        LinkButton* keepFrameWHRatioButton;
00410        LinkButton* keepImageDPIRatioButton;
00411        LineCombo* LStyle;
00412 
00413        ShadeButton *PM1;
00414        ShadeButton *PM2;
00415        PageItem *CurItem;
00416        bool HaveDoc;
00417        bool HaveItem;
00418        ScribusDoc *doc;
00419        double Umrech;
00420        bool LMode;
00421        double RoVal;
00422 
00423 
00424        QButtonGroup* ShapeGroup;
00425        QButtonGroup* ShapeGroup2;
00426        QButtonGroup* Distance3;
00427        QButtonGroup* OverP;
00428 
00429        QToolButton* TabsButton;
00430 
00431        QToolButton* Zup;
00432        QToolButton* ZDown;
00433        QToolButton* ZTop;
00434        QToolButton* ZBottom;
00435 
00436        QToolBox* TabStack;
00437        QWidgetStack* TabStack2;
00438        QWidgetStack* TabStack3;
00439 
00440 
00441        QGroupBox* NameGroup;
00442        QGroupBox* GeoGroup;
00443        QGroupBox* LayerGroup;
00444        QGroupBox* Distance;
00445        QGroupBox* Distance2;
00446        QGroupBox* GroupBoxCM;
00447        QGroupBox* TLines;
00448        QGroupBox* GroupBox3a;
00449        QGroupBox* TransGroup;
00450 
00451        QToolButton* textFlowDisabled;
00452        QToolButton* textFlowUsesFrameShape;
00453        QToolButton* textFlowUsesBoundingBox;
00454        QToolButton* textFlowUsesContourLine;
00455        QToolButton* textFlowUsesImageClipping;
00456        QToolButton* textFlowDisabled2;
00457        QToolButton* textFlowUsesFrameShape2;
00458        QToolButton* textFlowUsesBoundingBox2;
00459        QToolButton* textFlowUsesContourLine2;
00460        QToolButton* textFlowUsesImageClipping2;
00461        QCheckBox* Aspect;
00462        QCheckBox* flippedPathText;
00463        QCheckBox* showcurveCheckBox;
00464        QCheckBox* TopLine;
00465        QCheckBox* LeftLine;
00466        QCheckBox* RightLine;
00467        QCheckBox* BottomLine;
00468 
00469        ScComboBox* pathTextType;
00470        QComboBox* langCombo;
00471        QComboBox* InputP;
00472        QComboBox* MonitorI;
00473        QComboBox* LineMode;
00474        ColorCombo* TxStroke;
00475        QComboBox* LJoinStyle;
00476        QComboBox* LEndStyle;
00477        ColorCombo* TxFill;
00478        ScComboBox* blendMode;
00479        QComboBox *optMarginCombo;
00480 
00481        QListBox* StyledLine;
00482 
00483        MSpinBox* Width;
00484        MSpinBox* Xpos;
00485        MSpinBox* Ypos;
00486        MSpinBox* Height;
00487        MSpinBox* Rot;
00488        MSpinBox* RoundRect;
00489        MSpinBox* dGap;
00490        MSpinBox* DTop;
00491        MSpinBox* DBottom;
00492        MSpinBox* DLeft;
00493        MSpinBox* DRight;
00494        MSpinBox* Dist;
00495        MSpinBox* LineW;
00496        MSpinBox* Size;
00497        MSpinBox* LineSp;
00498        MSpinBox* Extra;
00499        MSpinBox* imageYOffsetSpinBox;
00500        MSpinBox* imageXOffsetSpinBox;
00501        MSpinBox* imageYScaleSpinBox;
00502        MSpinBox* imageXScaleSpinBox;
00503        MSpinBox* imgDpiX;
00504        MSpinBox* imgDpiY;
00505        MSpinBox* LSize;
00506        MSpinBox* ChScale;
00507        MSpinBox* ChScaleV;
00508        MSpinBox* ChBase;
00509        MSpinBox* minWordTrackingSpinBox;
00510        MSpinBox* normWordTrackingSpinBox;
00511        MSpinBox* minGlyphExtSpinBox;
00512        MSpinBox* maxGlyphExtSpinBox;
00513        QSpinBox* DCol;
00514        QSpinBox* TransSpin;
00515 
00516        QRadioButton* TopLeft;
00517        QRadioButton* TopRight;
00518        QRadioButton* Center;
00519        QRadioButton* BottomLeft;
00520        QRadioButton* BottomRight;
00521        QRadioButton* FreeScale;
00522        QRadioButton* FrameScale;
00523        QRadioButton* EvenOdd;
00524        QRadioButton* NonZero;
00525        QRadioButton* KnockOut;
00526        QRadioButton* Overprint;
00527 
00528        QFrame* Line1;
00529        QFrame* Line2;
00530        QFrame* Line4;
00531        QFrame* Line5;
00532        QFrame* Frame4;
00533 
00534        QPopupMenu* lineSpacingPop;
00535 
00536        QToolButton* linespacingButton;
00537        QToolButton* DoGroup;
00538        QToolButton* DoUnGroup;
00539        QToolButton* FlipH;
00540        QToolButton* FlipV;
00541        QToolButton* Locked;
00542        QToolButton* NoPrint;
00543        QToolButton* NoResize;
00544        QToolButton* Revert;
00545        QToolButton* charStyleClear;
00546        QToolButton* paraStyleClear;
00547        QToolButton* EditShape;
00548        QToolButton* EditShape2;
00549        QToolButton* EditEffects;
00550        QToolButton* EditPSDProps;
00551 
00552        
00553        bool _userActionOn;
00554        UserActionSniffer *userActionSniffer;
00555        void installSniffer(MSpinBox *spinBox);
00556        
00557        int idXYZItem;
00558        int idShapeItem;
00559        int idTextItem;
00560        int idImageItem;
00561        int idLineItem;
00562        int idColorsItem;
00563        int idGroupItem;
00564 };
00565 
00566 class SCRIBUS_API UserActionSniffer : public QObject
00567 {
00568        Q_OBJECT
00569 
00570 public:
00571        UserActionSniffer();
00572 protected:
00573        bool eventFilter( QObject *o, QEvent *e );
00574 signals:
00575        void actionStart();
00576        void actionEnd();
00577 };
00578 
00579 #endif