00001 #ifndef _DIALOGS_H_2527828932_ 00002 #define _DIALOGS_H_2527828932_ 00003 00004 #include <QDialog> 00005 class Editor; 00006 00007 class QSpinBox; 00008 class QComboBox; 00009 class QLineEdit; 00010 class QCheckBox; 00011 class QTextEdit; 00012 class QTableWidget; 00013 00014 00015 class GridRectDialog : public QDialog 00016 { 00017 Q_OBJECT 00018 public: 00019 GridRectDialog(QWidget* parent = 0); 00020 00021 void setLowerLeftX(int x); 00022 void setLowerLeftY(int y); 00023 void setUpperRightX(int x); 00024 void setUpperRightY(int y); 00025 void setBorder(int b); 00026 00027 int getLowerLeftX(); 00028 int getLowerLeftY(); 00029 int getUpperRightX(); 00030 int getUpperRightY(); 00031 int getBorder(); 00032 00033 protected: 00034 QSpinBox *spinLowerLeftX; 00035 QSpinBox *spinLowerLeftY; 00036 QSpinBox *spinUpperRightX; 00037 QSpinBox *spinUpperRightY; 00038 QSpinBox *spinBorder; 00039 }; 00040 00041 00042 00043 class StateStyleDialog: public QDialog{ 00044 Q_OBJECT 00045 public: 00046 StateStyleDialog(Editor *parent); 00047 00048 void setParams(); 00049 protected: 00050 Editor *editor; 00051 // adjusted 00052 QComboBox *comboLineStyle; 00053 QLineEdit *edtLineWidth; 00054 QLineEdit *edtLineColor; 00055 QLineEdit *edtLabelColor; 00056 QLineEdit *edtLabelScale; 00057 QComboBox *comboFillStatus; 00058 QLineEdit *edtFillColor; 00059 // preset 00060 QComboBox *comboDimLineStyle; 00061 QLineEdit *edtDimLineColor; 00062 QLineEdit *edtDimLineCoef; 00063 QLineEdit *edtDimLabelColor; 00064 QLineEdit *edtDimFillColor; 00065 // double 00066 QLineEdit *edtLineDblCoef; 00067 QLineEdit *edtLineDblSep; 00068 // apply 00069 QComboBox *comboApply; 00070 00071 protected slots: 00072 void myAccept(); // set params to editor 00073 }; 00074 00075 00076 00077 class TransitionStyleDialog: public QDialog{ 00078 Q_OBJECT 00079 public: 00080 TransitionStyleDialog(Editor *parent); 00081 00082 void setParams(); 00083 00084 Qt::PenStyle getLineStyle(); 00085 float getLineWidth(); 00086 QString getLineColor(); 00087 QString getLabelColor(); 00088 float getLabelScale(); 00089 bool getDblStatus(); 00090 00091 Qt::PenStyle getDimLineStyle(); 00092 QString getDimLineColor(); 00093 float getDimLineCoef(); 00094 QString getDimLabelColor(); 00095 00096 float getLineBorderCoef(); 00097 QString getLineBorderColor(); 00098 00099 float getLineDblCoef(); 00100 float getLineDblSep(); 00101 00102 protected: 00103 Editor *editor; 00104 // adjusted 00105 QComboBox *comboLineStyle; 00106 QLineEdit *edtLineWidth; 00107 QLineEdit *edtLineColor; 00108 QLineEdit *edtLabelColor; 00109 QLineEdit *edtLabelScale; 00110 QCheckBox *checkDblStatus; 00111 // preset 00112 QComboBox *comboDimLineStyle; 00113 QLineEdit *edtDimLineColor; 00114 QLineEdit *edtDimLineCoef; 00115 QLineEdit *edtDimLabelColor; 00116 // border 00117 QLineEdit *edtLineBorderCoef; 00118 QLineEdit *edtLineBorderColor; 00119 // double 00120 QLineEdit *edtLineDblCoef; 00121 QLineEdit *edtLineDblSep; 00122 // apply 00123 QComboBox *comboApply; 00124 00125 protected slots: 00126 void myAccept(); 00127 }; 00128 00129 00130 00131 class GraphGenerationDialog: public QDialog 00132 { 00133 Q_OBJECT 00134 public: 00135 GraphGenerationDialog(Editor *parent); 00136 00137 QString getString(); 00138 QPoint getStartPoint(); 00139 int getType(); 00140 int getDistance(); 00141 bool isExpandRequired(); 00142 00143 protected: 00144 Editor *editor; 00145 00146 QLineEdit *edtString; 00147 QComboBox *comboAlgorithm; 00148 QSpinBox *spinDistance; 00149 00150 QSpinBox *spinX; 00151 QSpinBox *spinY; 00152 00153 QCheckBox *checkExpandGrid; 00154 00155 protected slots: 00156 void myAccept(); 00157 void algorithmChanged(int i); 00158 }; 00159 00160 00161 00162 #include "iautomaton.h" 00163 00164 class LaTeXTableDialog: public QDialog 00165 { 00166 Q_OBJECT 00167 public: 00168 LaTeXTableDialog(Editor *parent, 00169 const QSharedPointer<ITransitionTable> &table); 00170 00171 QString text() const; 00172 00173 protected: 00174 void setViewText(); 00175 00176 QTextEdit *m_textEdit; 00177 QPushButton *m_switchButton; 00178 00179 QSharedPointer<ITransitionTable> m_pTable; 00180 00181 enum EViewType {eStringTable, eLaTeXTable}; 00182 EViewType m_viewType; 00183 00184 protected slots: 00185 void switchView(); 00186 void copyAll(); 00187 }; 00188 00189 00190 #include "ialgorithm.h" 00191 #include "itransition.h" 00192 class LoadAutomataDialog: public QDialog 00193 { 00194 Q_OBJECT 00195 public: 00196 LoadAutomataDialog(Editor *editor, const QString &dialogTitle, 00197 int count, const QStringList &drawAlgorithmList, 00198 bool useCurrent, IAlgorithm *algorithm); 00199 00200 QStringList getFileNames() const; 00201 bool useCurrentAutomaton() const; 00202 int getDrawAlgorithmIndex() const; 00203 00204 void setDrawAlgorithmIndex(int index); 00205 00206 bool alphabetIsSet() const; 00207 bool alphabetSymbolIsSet() const; 00208 bool epsilonSymbolIsSet() const; 00209 00210 ITransition::TCharSet getAlphabet() const; 00211 QString getAlphabetSymbol() const; 00212 QString getEpsilonSymbol() const; 00213 00214 private: 00215 QCheckBox* m_checkUseCurrent; 00216 QList<QLineEdit*> m_fileEdits; 00217 QList<QPushButton*> m_fileButtons; 00218 00219 QCheckBox *m_checkAlphabet; 00220 QCheckBox *m_checkAlphabetSymbol; 00221 QCheckBox *m_checkEpsilonSymbol; 00222 00223 QLineEdit *m_edtAlphabet; 00224 QLineEdit *m_edtAlphabetSymbol; 00225 QLineEdit *m_edtEpsilonSymbol; 00226 00227 int m_count; 00228 QString m_editorFileName; 00229 QString m_lastFileName; 00230 00231 QRegExp m_alphabetRegex; 00232 ITransition::TCharSet m_alphabet; 00233 QString m_alphabetSymbol; 00234 QString m_epsilonSymbol; 00235 00236 IAlgorithm *m_algorithm; 00237 00238 QComboBox *m_comboDrawList; 00239 00240 protected slots: 00241 void myAccept(); 00242 void checkChanged(int state); 00243 void buttonClicked(); 00244 00245 void checkAlphabetChanged(int); 00246 void checkAlphabetSymbChanged(int); 00247 void checkEpsilonSymbChanged(int); 00248 00249 void algorithmSettings(); 00250 }; 00251 00252 00253 00254 class ReportDialog : public QDialog 00255 { 00256 public: 00257 ReportDialog(const QString &reportText = "", QWidget *parent = 0); 00258 }; 00259 00260 #endif //_DIALOGS_H_2527828932_