Main Page | Class Hierarchy | Class List | File List

queensmain.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Torben Nielsen   *
00003  *   torben@t-hoerup.dk   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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

Generated on Sun Aug 14 15:33:57 2005 for queensgui.kdevelop by  doxygen 1.3.9.1