summaryrefslogtreecommitdiffstats
path: root/kolf/kolf.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitc90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch)
tree6d8391395bce9eaea4ad78958617edb20c6a7573 /kolf/kolf.h
downloadtdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz
tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kolf/kolf.h')
-rw-r--r--kolf/kolf.h147
1 files changed, 147 insertions, 0 deletions
diff --git a/kolf/kolf.h b/kolf/kolf.h
new file mode 100644
index 00000000..8a2c6d78
--- /dev/null
+++ b/kolf/kolf.h
@@ -0,0 +1,147 @@
+#ifndef KOLF_H
+#define KOLF_H
+
+#include <kmainwindow.h>
+#include <kurl.h>
+
+#include <qmap.h>
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qwidget.h>
+#include <qvaluelist.h>
+#include <kdemacros.h>
+#include "game.h"
+
+class KolfGame;
+class KToggleAction;
+class KListAction;
+class KAction;
+class QGridLayout;
+class ScoreBoard;
+class QCloseEvent;
+class QEvent;
+class Player;
+class QWidget;
+class Editor;
+
+class KDE_EXPORT Kolf : public KMainWindow
+{
+ Q_OBJECT
+
+public:
+ Kolf();
+ ~Kolf();
+
+ void openURL(KURL url);
+
+public slots:
+ void closeGame();
+ void updateModified(bool);
+
+protected:
+ virtual bool queryClose();
+
+protected slots:
+ void startNewGame();
+ void loadGame();
+ void tutorial();
+ void newGame();
+ void save();
+ void saveAs();
+ void saveGame();
+ void saveGameAs();
+ void print();
+ void newPlayersTurn(Player *);
+ void gameOver();
+ void editingStarted();
+ void editingEnded();
+ void checkEditing();
+ void setHoleFocus() { game->setFocus(); }
+ void inPlayStart();
+ void inPlayEnd();
+ void maxStrokesReached(const QString &);
+ void updateHoleMenu(int);
+ void titleChanged(const QString &);
+ void newStatusText(const QString &);
+ void showInfoChanged(bool);
+ void useMouseChanged(bool);
+ void useAdvancedPuttingChanged(bool);
+ void showGuideLineChanged(bool);
+ void soundChanged(bool);
+ void initPlugins();
+ void showPlugins();
+ void showHighScores();
+ void enableAllMessages();
+ void createSpacer();
+
+ void emptySlot() {};
+
+ void setCurrentHole(int);
+
+private:
+ QWidget *dummy;
+ KolfGame *game;
+ Editor *editor;
+ KolfGame *spacer;
+ void initGUI();
+ QString filename;
+ PlayerList players;
+ PlayerList spacerPlayers;
+ QGridLayout *layout;
+ ScoreBoard *scoreboard;
+ KToggleAction *editingAction;
+ KAction *newHoleAction;
+ KAction *resetHoleAction;
+ KAction *undoShotAction;
+ //KAction *replayShotAction;
+ KAction *clearHoleAction;
+ KAction *tutorialAction;
+ KAction *newAction;
+ KAction *endAction;
+ KAction *printAction;
+ KAction *saveAction;
+ KAction *saveAsAction;
+ KAction *saveGameAction;
+ KAction *saveGameAsAction;
+ KAction *loadGameAction;
+ KAction *aboutAction;
+ KListAction *holeAction;
+ KAction *highScoreAction;
+ KAction *nextAction;
+ KAction *prevAction;
+ KAction *firstAction;
+ KAction *lastAction;
+ KAction *randAction;
+ KToggleAction *showInfoAction;
+ KToggleAction *useMouseAction;
+ KToggleAction *useAdvancedPuttingAction;
+ KToggleAction *showGuideLineAction;
+ KToggleAction *soundAction;
+ void setHoleMovementEnabled(bool);
+ void setHoleOtherEnabled(bool);
+ inline void setEditingEnabled(bool);
+ bool competition;
+
+ // contains everything
+ ObjectList *obj;
+ // contains subset of obj
+ ObjectList plugins;
+
+ QString loadedGame;
+
+ bool isTutorial;
+ bool courseModified;
+ QString title;
+ QString tempStatusBarText;
+};
+
+struct HighScore
+{
+ HighScore() {}
+ HighScore(const QString &name, int score) { this->name = name; this->score = score; }
+ QString name;
+ int score;
+};
+typedef QValueList<HighScore> HighScoreList;
+
+#endif