Back to index

scribus-ng  1.3.4.dfsg+svn20071115
tffilter.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 TFFILTER_H
00008 #define TFFILTER_H
00009 
00010 #include <qwidget.h>
00011 #include <qcombobox.h>
00012 #include <qpushbutton.h>
00013 #include <qcheckbox.h>
00014 #include <qframe.h>
00015 #include <qlayout.h>
00016 #include <qlabel.h>
00017 #include <prefstable.h>
00018 #include <prefscontext.h>
00019 
00020 enum Action {
00021        REMOVE,
00022        REPLACE,
00023        APPLY
00024 };
00025 
00026 enum MatchStyle {
00027        ALL_PARAGRAPHS,
00028        STARTS_WITH,
00029        LESS_THAN,
00030        MORE_THAN
00031 };
00032 
00033 enum SecondaryAction {
00034        REMOVE_MATCH,
00035        DO_NOT_REMOVE_MATCH
00036 };
00037 
00038 class tfFilter : public QWidget
00039 {
00040        Q_OBJECT
00041 private:
00042        QCheckBox* enableCheck;
00043        QBoxLayout* alayout;
00044        QBoxLayout* blayout;
00045        QFrame* actionFrame;
00046        QComboBox* firstCombo;
00047        QLabel* firstLabel;
00048        QComboBox* secondCombo;
00049        QCheckBox* secondRegexpCheck;
00050        QLabel* secondLabel;
00051        QComboBox* thirdCombo;
00052 //     QCheckBox* thirdRegexpCheck;
00053        QLabel* thirdLabel;
00054        QComboBox* fourthCombo;
00055        QLabel* fourthLabel;
00056        QComboBox* fifthCombo;
00057        QCheckBox* fifthRegexpCheck;
00058        QLabel* fifthLabel;
00059        QComboBox* sixthCombo;
00060        QPushButton* removeButton;
00061        QPushButton* addButton;
00062        int currentAction;
00063        PrefsContext* prefs;
00064        PrefsTable* history;
00065        void createWidget();
00066        void getFirstCombo();
00067        void getSecondCombo();
00068        void getThirdCombo(int secondIndex);
00069        void getFourthCombo();
00070        void getFifthCombo();
00071        void getSixthCombo();
00072        void resetBRow();
00073        void getParagraphStyles();
00074 public:
00075        tfFilter(QWidget *parent, const char *name,
00076              int action, QString regExp, QString replace, QString pstyleName,
00077              int less, int more, int style, bool match, bool enabled, bool regexp);
00078        tfFilter(QWidget *parent = 0, const char *name = 0);
00079        ~tfFilter();
00080        void setRemovable(bool b);
00081        int getAction();
00082        QString regExp();
00083        QString replaceWith();
00084        QString getPStyleName();
00085        int getLessThan();
00086        int getMoreThan();
00087        int getStyle();
00088        bool removeMatch();
00089        bool isEnabled();
00090        bool isRegExp();
00091 signals:
00092        void removeClicked(tfFilter* tff);
00093        void addClicked(tfFilter* tff);
00094 private slots:
00095        void enableToggled(bool on);
00096        void addClick();
00097        void removeClick();
00098        void firstChanged(int index);
00099        void secondChanged(int index);
00100        void thirdChanged(int index);
00101        void fourthChanged(int index);
00102        void fifthChanged(int index);
00103        void sixthChanged(int index);
00104 };
00105 
00106 #endif // TFFILTER_H