00001 /* 00002 * Game Genie Encoder/Decoder 00003 * Copyright (C) 2004-2006,2008 emuWorks 00004 * http://games.technoplaza.net/ 00005 * 00006 * This file is part of Game Genie Encoder/Decoder. 00007 * 00008 * Game Genie Encoder/Decoder is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * Game Genie Encoder/Decoder is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with Game Genie Encoder/Decoder; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 // $Id: geniedialog.hh,v 1.7 2008/12/18 03:23:30 jdratlif Exp $ 00024 00025 #ifndef GGENCODER_GENIEDIALOG_HH_ 00026 #define GGENCODER_GENIEDIALOG_HH_ 00027 00028 #include <QDialog> 00029 #include <QRegExpValidator> 00030 00031 #include "ui_maindialog.h" 00032 00033 namespace ggencoder { 00034 /** 00035 * The main dialog for the application. 00036 */ 00037 class GenieDialog : public QDialog { 00038 Q_OBJECT 00039 00040 private: 00041 QRegExpValidator *hexValidator; 00042 QRegExpValidator *nesValidator; 00043 QRegExpValidator *snesValidator; 00044 QRegExpValidator *genesisValidator; 00045 QRegExpValidator *gbggValidator; 00046 Ui::MainDialog ui; 00047 int system; 00048 bool encoding, decoding; 00049 00050 /** 00051 * Decodes the game genie code into value, address, and compare 00052 * components. 00053 */ 00054 void decode(); 00055 00056 /** 00057 * Encodes the value, address, and compare into a game genie code. 00058 */ 00059 void encode(); 00060 00061 /** 00062 * Resets the controls. 00063 */ 00064 void reset(); 00065 00066 public: 00067 /** 00068 * Creates a new GenieDialog. 00069 */ 00070 GenieDialog(); 00071 00072 /** 00073 * Destructor for a GenieDialog. 00074 */ 00075 ~GenieDialog(); 00076 00077 private slots: 00078 /** 00079 * Called when the address box is edited. 00080 * 00081 * @param text The new text. 00082 */ 00083 void on_addressEdit_textEdited(const QString &text); 00084 00085 /** 00086 * Called when the compare box is edited. 00087 * 00088 * @param text The new text. 00089 */ 00090 void on_compareEdit_textEdited(const QString &text); 00091 00092 /** 00093 * Called when the game genie box is edited. 00094 * 00095 * @param text The new text. 00096 */ 00097 void on_gamegenieEdit_textEdited(const QString &text); 00098 00099 /** 00100 * Called when the Game Boy / Game Gear radio button is toggled. 00101 * 00102 * @param checked true if it was checked; false otherwise 00103 */ 00104 void on_gbggRadio_toggled(bool checked); 00105 00106 /** 00107 * Called when the Genesis radio button is toggled. 00108 * 00109 * @param checked true if it was checked; false otherwise 00110 */ 00111 void on_genesisRadio_toggled(bool checked); 00112 00113 /** 00114 * Called when the NES radio button is toggled. 00115 * 00116 * @param checked true if it was checked; false otherwise 00117 */ 00118 void on_nesRadio_toggled(bool checked); 00119 00120 /** 00121 * Called when the SNES radio button is toggled. 00122 * 00123 * @param checked true if it was checked; false otherwise 00124 */ 00125 void on_snesRadio_toggled(bool checked); 00126 00127 /** 00128 * Called when the value box is edited. 00129 * 00130 * @param text The new text. 00131 */ 00132 void on_valueEdit_textEdited(const QString &text); 00133 }; 00134 } 00135 00136 #endif 00137