Initial commit
[vexed] / mainwindow.h
diff --git a/mainwindow.h b/mainwindow.h
new file mode 100644 (file)
index 0000000..fa5be54
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+#include "levelpack.h"
+
+namespace Ui {
+    class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+    // save the current game state, i.e. -- current level
+    void saveState();
+
+protected:
+    LevelPack *pack;
+    int levelNo;
+    QList<QString> packNames;
+
+    void changeEvent(QEvent *e);
+    // get or set hiscore for current level
+    int hiscore(int score=-1);
+
+public slots:
+    void reorient();
+
+    void openPreferences();
+    void loadPack(const QString& packName,int levelToLoad);
+    void loadLevel();
+    void solved(int moves);
+    void howToPlay();
+
+    void loadNextLevel()
+    {
+            if(levelNo<(pack->size()-1))
+            {
+                    levelNo++;
+                    loadLevel();
+            }
+    }
+    void loadPrevLevel()
+    {
+            if(levelNo>0)
+            {
+                    levelNo--;
+                    loadLevel();
+            }
+    }
+    void movesChanged(int moves);
+private:
+    Ui::MainWindow *ui;
+};
+
+#endif // MAINWINDOW_H