X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=mainwindow.h;fp=mainwindow.h;h=fa5be543d2bd2032441504b589042f36c6761b58;hb=287af054a087505036ec2658fcafc0dac2464eee;hp=0000000000000000000000000000000000000000;hpb=38dba1fd735443036b9d1bc33cd5a9f1f3882530;p=vexed diff --git a/mainwindow.h b/mainwindow.h new file mode 100644 index 0000000..fa5be54 --- /dev/null +++ b/mainwindow.h @@ -0,0 +1,61 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#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 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