home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / tabruler.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-06-14  |  3.8 KB  |  166 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. #ifndef TABRULER_H
  8. #define TABRULER_H
  9.  
  10. #include <QVariant>
  11. #include <QWidget>
  12. #include <QHBoxLayout>
  13. #include <QPaintEvent>
  14. #include <QGridLayout>
  15. #include <QLabel>
  16. #include <QMouseEvent>
  17. #include <QEvent>
  18. #include <QVBoxLayout>
  19.  
  20. #include "scribusapi.h"
  21. #include "sctextstruct.h"
  22.  
  23. class QComboBox;
  24. class QPushButton;
  25. class ScrSpinBox;
  26. class QToolButton;
  27.  
  28. class SCRIBUS_API RulerT : public QWidget
  29. {
  30.     Q_OBJECT
  31.  
  32. public:
  33.     RulerT(QWidget* parent, int ein, QList<ParagraphStyle::TabRecord> Tabs, bool ind, double wid);
  34.     ~RulerT() {};
  35.     void setTabs(QList<ParagraphStyle::TabRecord> Tabs, int dEin);
  36.     void updateTabList();
  37.     bool mousePressed;
  38.     QList<ParagraphStyle::TabRecord> tabValues;
  39.     bool haveInd;
  40.     int unitIndex;
  41.     int offset;
  42.     int actTab;
  43.     double leftIndent;
  44.     double firstLine;
  45.     double Width;
  46.     int rulerCode;
  47.     int mouseX;
  48.     int offsetIncrement;
  49.  
  50. public slots:
  51.     void resetOffsetInc();
  52.     void decreaseOffset();
  53.     void increaseOffset();
  54.     void changeTab(int t);
  55.     void changeTabChar(QChar t);
  56.     void moveTab(double t);
  57.     void moveFirstLine(double t);
  58.     void moveLeftIndent(double t);
  59.  
  60. signals:
  61.     void tabMoved(double);
  62.     void typeChanged(int);
  63.     void fillCharChanged(QChar);
  64.     void leftIndentMoved(double);
  65.     void firstLineMoved(double);
  66.     void noTabs();
  67.     void newTab();
  68.     void mouseReleased();
  69.     void tabSelected();
  70.  
  71. protected:
  72.     virtual void paintEvent(QPaintEvent *);
  73.     virtual void mousePressEvent(QMouseEvent *m);
  74.     virtual void mouseReleaseEvent(QMouseEvent *);
  75.     virtual void mouseMoveEvent(QMouseEvent *m);
  76.     virtual void leaveEvent(QEvent*);
  77.     
  78. private:
  79.     double iter, iter2;
  80. };
  81.  
  82. class SCRIBUS_API Tabruler : public QWidget
  83. {
  84.     Q_OBJECT
  85.  
  86. public:
  87.     Tabruler( QWidget* parent,
  88.               bool haveFirst = true,
  89.               int dEin = 1,
  90.               QList<ParagraphStyle::TabRecord> Tabs = QList<ParagraphStyle::TabRecord>(),
  91.               double wid = -1);
  92.     ~Tabruler() {};
  93.  
  94.     virtual void setTabs(QList<ParagraphStyle::TabRecord> Tabs, int dEin);
  95.  
  96.     QList<ParagraphStyle::TabRecord> getTabVals();
  97.     bool haveF;
  98.     double getFirstLine();
  99.     double getLeftIndent();
  100.     double getRightIndent();
  101.  
  102. public slots:
  103.     void resetOFfL();
  104.     void resetOFfR();
  105.     void clearAll();
  106.     void tabAdded();
  107.     void lastTabRemoved();
  108.     void setTabType(int t);
  109.     void setType();
  110.     void setTabData(double t);
  111.     void setTab();
  112.     void setFirstLineData(double t);
  113.     void setFirstLine();
  114.     void setLeftIndentData(double t);
  115.     void setLeftIndent();
  116.     void setRightIndentData(double t);
  117.     void setRightIndent();
  118.     void setTabFillChar(QChar t);
  119.     void setFillChar();
  120.     void setCustomFillChar(const QString &txt);
  121.  
  122. signals:
  123.     /*! This signal is emited when is something changed in the tab ruler dialog/widget.
  124.     4/11/2005 pv */
  125.     void tabrulerChanged();
  126.  
  127.     /** emitted when tabs are changed */
  128.     void tabsChanged();
  129.     /** emitted when left indent is changed */
  130.     void leftIndentChanged(double);
  131.     /** emitted when right indent is changed */
  132.     void rightIndentChanged(double);
  133.     /** emitted when first line is changed */
  134.     void firstLineChanged(double);
  135.     void mouseReleased();
  136.  
  137. protected:
  138.     QVBoxLayout* tabrulerLayout;
  139.     QHBoxLayout* layout2;
  140.     QHBoxLayout* layout1;
  141.     QHBoxLayout* indentLayout;
  142.     QVBoxLayout* layout3;
  143.     QHBoxLayout *layout4;
  144.     QComboBox* TypeCombo;
  145.     QComboBox* tabFillCombo;
  146.     QLabel* tabFillComboT;
  147.     RulerT* ruler;
  148.     QToolButton* rulerScrollL;
  149.     QToolButton* rulerScrollR;
  150.     QLabel* positionLabel;
  151.     QLabel* firstLineLabel;
  152.     QLabel* leftIndentLabel;
  153.     QLabel* rightIndentLabel;
  154.     ScrSpinBox* tabData;
  155.     ScrSpinBox* firstLineData;
  156.     ScrSpinBox* leftIndentData;
  157.     ScrSpinBox* rightIndentData;
  158.     QPushButton* clearButton;
  159.  
  160.     double docUnitRatio;
  161. protected slots:
  162.     void slotMouseReleased();
  163. };
  164.  
  165. #endif // TABRULER_H
  166.