#ifndef TRIVIAAPP_H
#define TRIVIAAPP_H

#include <QApplication>
#include <QVector>

class Question; // forward declaration

static const QString triviaFilename = "Trivia.xml";

class TriviaApp : public QObject
{
  Q_OBJECT

 protected:
  QVector<Question*> questions;
  QString username;
  QString userAnswer;
  int score;
  int questionsCounter;
  int correctCounter;

 public:
  TriviaApp();
  ~TriviaApp();
  int exec();
  static Question* createQuestion(const QString& type);


 protected:
  bool loadQuestions();
  void printQuestions() const;
  QString getNewQuestion();
  int getScore() const;
  bool isCorrect();
  Question *actQuestion;

signals:

public slots:
    void getAnswerLine( const QString &answer);
    void getName(const QString &name);
    void decideMode(int index);

    friend class Window;
};

#endif // TRIVIAAPP_H
