KDEGames

kstandardgameaction.h
1 /*
2  This file is part of the KDE games library
3  Copyright (C) 2001 Andreas Beckermann <[email protected]>
4  Copyright (C) 2007 Simon Hürlimann <[email protected]>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 // this class was shamelessly stolen from kdelibs/kdeui/kstdction.[cpp|h] and
21 // after that just edited for our needs
22 #ifndef KSTANDARDGAMEACTION_H
23 #define KSTANDARDGAMEACTION_H
24 
25 #include <libkdegames_export.h>
26 
27 #include <QLoggingCategory>
28 
29 class QAction;
30 class KToggleAction;
31 class QObject;
32 class KRecentFilesAction;
33 class KSelectAction;
34 
35 Q_DECLARE_LOGGING_CATEGORY(GAMES_UI)
36 
37 
54 {
59  // Game menu
60  New=1, Load, LoadRecent, Save, SaveAs, End, Pause, Highscores, Statistics,
61  Print, Quit,
62  // Move menu
63  Repeat, Undo, Redo, Roll, EndTurn,
64  // Settings menu
65  Carddecks,
66  ChooseGameType,
67  ConfigureHighscores,
68  ClearHighscores,
69  ClearStatistics,
70  Restart,
71  Hint,
72  Demo,
73  Solve,
74  ActionNone
75  };
76 
81  KDEGAMES_EXPORT QAction* create( StandardGameAction id, const QObject *recvr, const char *slot,
82  QObject* parent );
83 
84 
88  KDEGAMES_EXPORT const char* name( StandardGameAction id );
89 
93  KDEGAMES_EXPORT QAction *gameNew(const QObject *recvr, const char *slot,
94  QObject *parent );
95 
99  KDEGAMES_EXPORT QAction *load(const QObject *recvr, const char *slot,
100  QObject *parent );
101 
102  // FIXME why not to delete this and use just KStandardAction::openRecent???
103  // loadRecent seems to mimic its behaviour
108  KDEGAMES_EXPORT KRecentFilesAction *loadRecent(const QObject *recvr, const char *slot,
109  QObject *parent );
110 
114  KDEGAMES_EXPORT QAction *save(const QObject *recvr, const char *slot,
115  QObject *parent);
116 
120  KDEGAMES_EXPORT QAction *saveAs(const QObject *recvr, const char *slot,
121  QObject *parent );
122 
126  KDEGAMES_EXPORT KToggleAction *pause(const QObject *recvr, const char *slot,
127  QObject *parent );
128 
132  KDEGAMES_EXPORT QAction *highscores(const QObject *recvr, const char *slot,
133  QObject *parent );
134 
138  KDEGAMES_EXPORT QAction *clearHighscores(const QObject *recvr, const char *slot,
139  QObject *parent );
140 
144  KDEGAMES_EXPORT QAction *statistics(const QObject *recvr, const char *slot,
145  QObject *parent );
146 
150  KDEGAMES_EXPORT QAction *clearStatistics(const QObject *recvr, const char *slot,
151  QObject *parent );
152 
153 
158  KDEGAMES_EXPORT QAction *end(const QObject *recvr, const char *slot,
159  QObject *parent );
160 
165  KDEGAMES_EXPORT QAction *print(const QObject *recvr, const char *slot,
166  QObject *parent );
167 
171  KDEGAMES_EXPORT QAction *quit(const QObject *recvr, const char *slot,
172  QObject *parent );
173 
177  KDEGAMES_EXPORT QAction *repeat(const QObject *recvr, const char *slot,
178  QObject *parent );
179 
183  KDEGAMES_EXPORT QAction *undo(const QObject *recvr, const char *slot,
184  QObject *parent );
185 
189  KDEGAMES_EXPORT QAction *redo(const QObject *recvr, const char *slot,
190  QObject *parent );
191 
195  KDEGAMES_EXPORT QAction *roll(const QObject *recvr, const char *slot,
196  QObject *parent );
197 
202  KDEGAMES_EXPORT QAction *endTurn(const QObject *recvr, const char *slot,
203  QObject *parent );
204 
208  KDEGAMES_EXPORT QAction *carddecks(const QObject *recvr, const char *slot,
209  QObject *parent );
210 
214  KDEGAMES_EXPORT QAction *configureHighscores(const QObject *recvr, const char *slot,
215  QObject *parent );
216 
220  KDEGAMES_EXPORT QAction *hint(const QObject *recvr, const char *slot,
221  QObject *parent );
222 
226  KDEGAMES_EXPORT KToggleAction *demo(const QObject *recvr, const char *slot,
227  QObject *parent );
228 
232  KDEGAMES_EXPORT QAction *solve(const QObject *recvr, const char *slot,
233  QObject *parent );
234 
239  KDEGAMES_EXPORT KSelectAction *chooseGameType(const QObject *recvr, const char *slot,
240  QObject *parent );
241 
245  KDEGAMES_EXPORT QAction *restart(const QObject *recvr, const char *slot,
246  QObject *parent );
247 
248 }
249 
250 #endif
KDEGAMES_EXPORT KSelectAction * chooseGameType(const QObject *recvr, const char *slot, QObject *parent)
Choose game type.
KDEGAMES_EXPORT QAction * carddecks(const QObject *recvr, const char *slot, QObject *parent)
Display configure carddecks dialog.
KDEGAMES_EXPORT QAction * endTurn(const QObject *recvr, const char *slot, QObject *parent)
End the current turn (not the game).
KDEGAMES_EXPORT QAction * highscores(const QObject *recvr, const char *slot, QObject *parent)
Show the highscores.
KDEGAMES_EXPORT QAction * repeat(const QObject *recvr, const char *slot, QObject *parent)
Repeat the last move.
KDEGAMES_EXPORT KToggleAction * pause(const QObject *recvr, const char *slot, QObject *parent)
Pause the game.
KDEGAMES_EXPORT QAction * clearStatistics(const QObject *recvr, const char *slot, QObject *parent)
Clear statistics.
KDEGAMES_EXPORT QAction * gameNew(const QObject *recvr, const char *slot, QObject *parent)
Start a new game.
Extension for KStandardAction in KDE Games.
KDEGAMES_EXPORT QAction * load(const QObject *recvr, const char *slot, QObject *parent)
Load a previously saved game.
KDEGAMES_EXPORT QAction * restart(const QObject *recvr, const char *slot, QObject *parent)
Restart the game.
KDEGAMES_EXPORT QAction * statistics(const QObject *recvr, const char *slot, QObject *parent)
Show the statistics.
KDEGAMES_EXPORT QAction * clearHighscores(const QObject *recvr, const char *slot, QObject *parent)
Clear highscores.
KDEGAMES_EXPORT QAction * roll(const QObject *recvr, const char *slot, QObject *parent)
Roll die or dice.
StandardGameAction
The standard menubar and toolbar actions.
KDEGAMES_EXPORT QAction * hint(const QObject *recvr, const char *slot, QObject *parent)
Give an advice/hint.
KDEGAMES_EXPORT KToggleAction * demo(const QObject *recvr, const char *slot, QObject *parent)
Show a demo.
KDEGAMES_EXPORT KRecentFilesAction * loadRecent(const QObject *recvr, const char *slot, QObject *parent)
Load a recently loaded game.
KDEGAMES_EXPORT QAction * solve(const QObject *recvr, const char *slot, QObject *parent)
Solve the game.
KDEGAMES_EXPORT QAction * configureHighscores(const QObject *recvr, const char *slot, QObject *parent)
Display configure highscores dialog.
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Sep 17 2020 22:37:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.