00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef QUEENSMAIN_H
00021 #define QUEENSMAIN_H
00022
00023
00024
00025 #include <qdialog.h>
00026 #include <qdatetime.h>
00027
00028 class QPushButton;
00029 class QSpinBox;
00030 class QListBox;
00031 class QLabel;
00032 class QString;
00033
00034 class SolutionContainer;
00035 class Queens;
00036 class Board;
00037 class UniqueWorker;
00038
00039 enum SortingAlgorithm{SortVector, SortList, SortHash, SortMNVector};
00040
00044 class QueensMain : public QDialog
00045 {
00046 Q_OBJECT
00047 private:
00048 Board *m_board;
00049 QPushButton *m_quit;
00050 QPushButton *m_start;
00051 QPushButton *m_stop;
00052 QPushButton *m_unique;
00053 QListBox *m_list;
00054 QSpinBox *m_sizeSelector;
00055 QLabel *m_status;
00056 QTime m_time;
00057
00058 SolutionContainer *m_solutions;
00059 Queens *m_queens;
00060 UniqueWorker *m_uworker;
00061 bool m_uniq;
00062 SortingAlgorithm m_sortalgo;
00063
00064 void contextMenuEvent(QContextMenuEvent *);
00065
00066 public:
00067 QueensMain(QWidget *parent = 0, const char *name = 0);
00068
00069 ~QueensMain();
00070 QString elapsed();
00071 void uniqueSolutions();
00072
00073 public slots:
00074 void start();
00075 void stop();
00076 void foundSolution();
00077 void finishedSearch();
00078 void showSolution();
00079 void uniquePush();
00080 void uniqueCallBack();
00081 void resize(int size);
00082
00083 void sortList();
00084 void sortVector();
00085 void sortHash();
00086 void sortMNVector();
00087 };
00088
00089 #endif