/*************************************************************************** * Copyright (C) 2005 by Torben Nielsen * * torben@t-hoerup.dk * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef QUEENSMAIN_H #define QUEENSMAIN_H #include #include #include //Added by qt3to4: #include #include #include "guiupdate.h" class QPushButton; class QSpinBox; class Q3ListBox; class QLabel; class QString; class Solution; class SolutionContainer; class Queens; class Board; enum SortingAlgorithm{SortVector, SortList, SortHash, SortMNVector, SortMinimalVector}; enum StorageClass{ StorageInt, StorageMatrix }; /** @author Torben Nielsen */ class QueensMain : public QDialog, public GUIUpdate { Q_OBJECT private: Board *m_board; QPushButton *m_quit; QPushButton *m_start; QPushButton *m_stop; Q3ListBox *m_list; QSpinBox *m_sizeSelector; QLabel *m_status; QTime m_time; Solution* m_sol; SolutionContainer *m_solutions; Queens *m_queens; SortingAlgorithm m_sortalgo; StorageClass m_storage; QTime m_elapsed; int m_totalcount; void contextMenuEvent(QContextMenuEvent *); public: QueensMain(QWidget *parent = 0, const char *name = 0); ~QueensMain(); QString elapsed(); void uniqueSolutions(); public slots: void start(); void stop(); void foundSolution(); void finishedSearch(); void showSolution(); void resize(int size); void duplicateRemoved(); void sortList(); void sortVector(); void sortHash(); void sortMNVector(); void sortMinimalVector(); void storageInt(); void storageMatrix(); }; #endif