/***************************************************************************
                          mainwindow.h  -  description
                             -------------------
    begin                : Sun Oct 21 2001
    copyright            : (C) 2001 by Primoz Anzur (zer0Kode)
    email                : zerokode@gmx.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#define LOCAL_VERSION "2.2"
//CVS version changes ONLY with major overhaul OR submission of new features...

#include "frontend.h"
#include <stdlib.h>
#include <stdio.h>
#include <kmessagebox.h>
#include <kpopupmenu.h>
#include <khelpmenu.h>

#include "kwritewords.h"
#include "scores.h"
#include "mwconfig.h"
#include "minparser.h"
#include "kmwnewconfig.h"

/** MainWindow is the base class of the project */
class MainWindow : public FrontEnd
{
  Q_OBJECT
public:
	/** construtor */
	MainWindow(QWidget* parent=0, const char *name=0);
	/** destructor */
	~MainWindow();


	int guesses;
	int tGuesses; //t stands for total
	int messups;
	int solvedWords;
	void randomizer(int level);
	void confuse_words();
	void reloadStructure();
	QPushButton *btnInvisible;
	KPopupMenu *mainMenu;
	QString shareLoginName;
	KWriteWords showConfig;
	KWriteWords configInputData;
	HighScores showScores;
	QString themeName;
	Config *cfg;
	bool isThemeBtn;
	void loadPopupMenu();
	bool emitSolved;
	KmwConfigurator *newCfg;

public slots:
	virtual void slot_close();
	virtual void slot_messup();
	virtual void slot_try();
	virtual void slot_textAccel();
	virtual void slot_scores();
	virtual void slot_changeLevel();
	void slot_openBook();
	void showAppConfig();
	void winRefresh();
	void theEnd();
	void theReply();

protected:
    QString messedWord;
    QString cleanWord;
    QString guessedString;
	 QString setLocalDictionary;
    KRandomSequence random;
	 int lines;
	 QString kMessedDataDir;
	 QString kMessedPicturesDir;
	 KConfig *config;
	 QString readName[10];
	 int readSolved[10];
	 int readRounds[10];
	 int readTotal[10];
	 int readGuesses[10];
    void closeEvent(QCloseEvent *);
	 KHelpMenu *helpMenu;
	 MinParser *silly;
	 KRandomSequence randomRow;
	 QString c_word;
	 QString d_word;

protected slots:
	 void write_scores();
	 void read_scores();
	 void first_run();
	 void check_update();
	 void sillyMess();
};

#endif

