00001 /* 00002 Copyright (C) 2000,2001 Stefan Duffner 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License 00006 as published by the Free Software Foundation; either version 2 00007 of the License, or any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00019 #ifndef STATEPROPERTIESDLGIMPL_H 00020 #define STATEPROPERTIESDLGIMPL_H 00021 00022 #include <qvalidator.h> 00023 #include <qlineedit.h> 00024 #include <qtextedit.h> 00025 #include <qlabel.h> 00026 #include <qcolor.h> 00027 00028 #include "StatePropertiesDlg.h" 00029 #include "GState.h" 00030 00031 class MainWindow; 00032 00033 00038 class StatePropertiesDlgImpl : public StatePropertiesDlg 00039 { 00040 Q_OBJECT 00041 00042 public: 00043 StatePropertiesDlgImpl( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 00044 ~StatePropertiesDlgImpl(); 00045 00047 enum DialogMode { StateAdd, StateEdit }; 00048 00050 QString getName() {return le_name->text(); }; 00052 void setName(const QString& s) {le_name->setText(s); }; 00054 QString getDescription() {return te_description->text(); }; 00056 void setDescription(QString s) {te_description->setText(s); }; 00058 QString getCode() {return le_code->text(); }; 00060 void setCode(const QString& s) {le_code->setText(s); }; 00062 QString getRadius() {return le_radius->text(); }; 00064 void setRadius(const QString& r) {le_radius->setText(r); }; 00066 QString getLineWidth() {return le_linewidth->text(); }; 00068 void setLineWidth(const QString& l) {le_linewidth->setText(l); }; 00070 void setMainWindow(MainWindow* m) { main = m; }; 00072 void setMode(int m) { mode = m; }; 00074 void setState(GState* s) { state=s; }; 00076 void setColor(QColor c) { color=c; lb_colorpreview->setBackgroundColor(c); }; 00078 QColor getColor() { return color; }; 00079 00081 void setCodeMaxLength(int l) { le_code->setMaxLength(l); }; 00082 00084 void selectFirst() { le_name->selectAll(); le_name->setFocus(); }; 00085 00086 private: 00088 int mode; 00090 GState* state; 00092 QIntValidator* valRadius; 00094 QIntValidator* valLineWidth; 00096 MainWindow* main; 00098 QColor color; 00099 00100 public slots: 00101 void chooseFGColor(); 00102 void validate(); 00103 }; 00104 00105 #endif // STATEPROPERTIESDLGIMPL_H