Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

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