/***************************************************************************
 *   Copyright (C) 2005-2006 by Anne-Marie Mahfouf   *
 *   annemarie.mahfouf@free.fr   *
 *                                                                         *
 *   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.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.             *
 ***************************************************************************/


#ifndef KALCUL_H_
#define KALCUL_H_

#include <kxmlguiwindow.h>

#include "kalculview.h"
#include "ui_prefs_baseui.h"
#include "ui_advancedui.h"
#include "ui_leveleditor_baseui.h"
#include "ui_exercisechooserui.h"

class QPrinter;
class KToggleAction;
class KAction;
class KUrl;

const int IDS_USER    = 100;

/**
 * This class serves as the main window for Kalcul.  It handles the
 * menus, toolbars, and status bars.
 *
 * @short Main window class
 * @author Anne-Marie Mahfouf <annemarie.mahfouf@free.fr>
 * @version 0.1
 */
class Kalcul : public KXmlGuiWindow
{
    Q_OBJECT
public:
    /**
     * Default Constructor
     */
    Kalcul();

    /**
     * Default Destructor
     */
    virtual ~Kalcul();

private slots:
    void optionsPreferences();

    void changeStatusbar(const QString& text, int);
    void changeCaption(const QString& text);

    void practiceAddition();
    void practiceSubtraction();
    void practiceMultiplication();
    void practiceDivision();

    void showExerciseDialog();
    void showLevelEditor();
    
    void settingsChanged();

private:
    void setupActions();

private:
    KalculView *m_view;

    QPrinter   *m_printer;

    // Settings.
    Ui::prefs_baseui ui_general;
    Ui::advancedui ui_advanced;
    // Dialogs
    Ui::leveleditor_baseui ui_leveleditor;
    Ui::exercisechooserui ui_exercisechooser;

protected:
    KAction *exerciseDialogAction;
    KAction *levelEditorAction;
};

#endif // KALCUL_H_

