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

/***************************************************************************
 *                                                                         *
 *   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.0"
#define QUIET_VERSION "CVS for kde3"

#include <kapplication.h>
#include <qwidget.h>
#include <frontend.h>
#include <qtimer.h>
#include <qbutton.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <stdlib.h>
#include <stdio.h>
#include <kmessagebox.h>
#include <krandomsequence.h>
#include <qptrlist.h>
#include <qpushbutton.h>
#include <kpopupmenu.h>
#include <kstandarddirs.h>
#include <klocale.h>
#include <kconfig.h>
#include <qevent.h>
#include <khelpmenu.h>

#include "kwritewords.h"
#include "scores.h"
#include "mwconfig.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;
	 	
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];
	 QString varrounds;
	 QString varnames;
	 QString varsolved;
	 QString vartotal;
	 QString varguesses;
    QString justtext;	
    void closeEvent(QCloseEvent *);
	 KHelpMenu *helpMenu;
    	
protected slots:
	 void write_scores();
	 void read_scores();
	 void first_run();
	 void check_update();
};

#endif

