1 /*	Copyright 2012 Theo Berkau <cwx@cyberwarriorx.com>
2 
3 	This file is part of Yabause.
4 
5 	Yabause is free software; you can redistribute it and/or modify
6 	it under the terms of the GNU General Public License as published by
7 	the Free Software Foundation; either version 2 of the License, or
8 	(at your option) any later version.
9 
10 	Yabause is distributed in the hope that it will be useful,
11 	but WITHOUT ANY WARRANTY; without even the implied warranty of
12 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 	GNU General Public License for more details.
14 
15 	You should have received a copy of the GNU General Public License
16 	along with Yabause; if not, write to the Free Software
17 	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18 */
19 #ifndef UICHEATSEARCH_H
20 #define UICHEATSEARCH_H
21 
22 #include "ui_UICheatSearch.h"
23 #include "../QtYabause.h"
24 
25 typedef struct
26 {
27    result_struct *results;
28    u32 numResults;
29    u32 startAddr;
30    u32 endAddr;
31 } cheatsearch_struct;
32 
33 class UICheatSearch : public QDialog, public Ui::UICheatSearch
34 {
35 	Q_OBJECT
36 
37 public:
38    UICheatSearch( QWidget* p, QList <cheatsearch_struct> *search, int searchType);
39    QList <cheatsearch_struct> *getSearchVariables(int *searchType);
40 protected:
41    QList <cheatsearch_struct> search;
42 
43    int searchType;
44 
45    void getSearchTypes();
46    void setSearchTypes();
47    void listResults();
48    void adjustSearchValueQValidator();
49 protected slots:
50    void on_twSearchResults_itemSelectionChanged();
51 	void on_leSearchValue_textChanged( const QString & text );
52    void on_pbRestart_clicked();
53    void on_pbSearch_clicked();
54    void on_pbAddCheat_clicked();
55    void on_rbUnsigned_toggled(bool checked);
56    void on_rbSigned_toggled(bool checked);
57    void on_rb8Bit_toggled(bool checked);
58    void on_rb16Bit_toggled(bool checked);
59    void on_rb32Bit_toggled(bool checked);
60 };
61 
62 #endif // UICHEATSEARCH_H
63