• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

libkdegames

  • sources
  • kde-4.14
  • kdegames
  • libkdegames
kstandardgameaction.h
Go to the documentation of this file.
1 /*
2  This file is part of the KDE games library
3  Copyright (C) 2001 Andreas Beckermann <b_mann@gmx.de>
4  Copyright (C) 2007 Simon Hürlimann <simon.huerlimann@huerlisi.ch>
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 shamelessy 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 class KAction;
28 class KToggleAction;
29 class QObject;
30 class KRecentFilesAction;
31 class KSelectAction;
32 
49 namespace KStandardGameAction
50 {
54  enum StandardGameAction {
55  // Game menu
56  New=1, Load, LoadRecent, Save, SaveAs, End, Pause, Highscores, Statistics,
57  Print, Quit,
58  // Move menu
59  Repeat, Undo, Redo, Roll, EndTurn,
60  // Settings menu
61  Carddecks,
62  ChooseGameType,
63  ConfigureHighscores,
64  ClearHighscores,
65  ClearStatistics,
66  Restart,
67  Hint,
68  Demo,
69  Solve,
70  ActionNone
71  };
72 
77  KDEGAMES_EXPORT KAction* create( StandardGameAction id, const QObject *recvr, const char *slot,
78  QObject* parent );
79 
80 
84  KDEGAMES_EXPORT const char* name( StandardGameAction id );
85 
89  KDEGAMES_EXPORT KAction *gameNew(const QObject *recvr, const char *slot,
90  QObject *parent );
91 
95  KDEGAMES_EXPORT KAction *load(const QObject *recvr, const char *slot,
96  QObject *parent );
97 
98  // FIXME why not to delete this and use just KStandardAction::openRecent???
99  // loadRecent seems to mimic its behaviour
104  KDEGAMES_EXPORT KRecentFilesAction *loadRecent(const QObject *recvr, const char *slot,
105  QObject *parent );
106 
110  KDEGAMES_EXPORT KAction *save(const QObject *recvr, const char *slot,
111  QObject *parent);
112 
116  KDEGAMES_EXPORT KAction *saveAs(const QObject *recvr, const char *slot,
117  QObject *parent );
118 
122  KDEGAMES_EXPORT KToggleAction *pause(const QObject *recvr, const char *slot,
123  QObject *parent );
124 
128  KDEGAMES_EXPORT KAction *highscores(const QObject *recvr, const char *slot,
129  QObject *parent );
130 
134  KDEGAMES_EXPORT KAction *clearHighscores(const QObject *recvr, const char *slot,
135  QObject *parent );
136 
140  KDEGAMES_EXPORT KAction *statistics(const QObject *recvr, const char *slot,
141  QObject *parent );
142 
146  KDEGAMES_EXPORT KAction *clearStatistics(const QObject *recvr, const char *slot,
147  QObject *parent );
148 
149 
154  KDEGAMES_EXPORT KAction *end(const QObject *recvr, const char *slot,
155  QObject *parent );
156 
161  KDEGAMES_EXPORT KAction *print(const QObject *recvr, const char *slot,
162  QObject *parent );
163 
167  KDEGAMES_EXPORT KAction *quit(const QObject *recvr, const char *slot,
168  QObject *parent );
169 
173  KDEGAMES_EXPORT KAction *repeat(const QObject *recvr, const char *slot,
174  QObject *parent );
175 
179  KDEGAMES_EXPORT KAction *undo(const QObject *recvr, const char *slot,
180  QObject *parent );
181 
185  KDEGAMES_EXPORT KAction *redo(const QObject *recvr, const char *slot,
186  QObject *parent );
187 
191  KDEGAMES_EXPORT KAction *roll(const QObject *recvr, const char *slot,
192  QObject *parent );
193 
198  KDEGAMES_EXPORT KAction *endTurn(const QObject *recvr, const char *slot,
199  QObject *parent );
200 
204  KDEGAMES_EXPORT KAction *carddecks(const QObject *recvr, const char *slot,
205  QObject *parent );
206 
210  KDEGAMES_EXPORT KAction *configureHighscores(const QObject *recvr, const char *slot,
211  QObject *parent );
212 
216  KDEGAMES_EXPORT KAction *hint(const QObject *recvr, const char *slot,
217  QObject *parent );
218 
222  KDEGAMES_EXPORT KToggleAction *demo(const QObject *recvr, const char *slot,
223  QObject *parent );
224 
228  KDEGAMES_EXPORT KAction *solve(const QObject *recvr, const char *slot,
229  QObject *parent );
230 
235  KDEGAMES_EXPORT KSelectAction *chooseGameType(const QObject *recvr, const char *slot,
236  QObject *parent );
237 
241  KDEGAMES_EXPORT KAction *restart(const QObject *recvr, const char *slot,
242  QObject *parent );
243 
244 }
245 
246 #endif
KStandardGameAction::restart
KDEGAMES_EXPORT KAction * restart(const QObject *recvr, const char *slot, QObject *parent)
Restart the game.
Definition: kstandardgameaction.cpp:225
KStandardGameAction::chooseGameType
KDEGAMES_EXPORT KSelectAction * chooseGameType(const QObject *recvr, const char *slot, QObject *parent)
Choose game type.
Definition: kstandardgameaction.cpp:222
KStandardGameAction::Roll
Definition: kstandardgameaction.h:59
KStandardGameAction::ClearHighscores
Definition: kstandardgameaction.h:64
KStandardGameAction::Restart
Definition: kstandardgameaction.h:66
KStandardGameAction::redo
KDEGAMES_EXPORT KAction * redo(const QObject *recvr, const char *slot, QObject *parent)
Redo the last move (which has been undone).
Definition: kstandardgameaction.cpp:196
KStandardGameAction::Redo
Definition: kstandardgameaction.h:59
libkdegames_export.h
KStandardGameAction::save
KDEGAMES_EXPORT KAction * save(const QObject *recvr, const char *slot, QObject *parent)
Save the current game.
Definition: kstandardgameaction.cpp:161
KStandardGameAction::End
Definition: kstandardgameaction.h:56
KStandardGameAction::Pause
Definition: kstandardgameaction.h:56
KStandardGameAction::Hint
Definition: kstandardgameaction.h:67
KStandardGameAction::carddecks
KDEGAMES_EXPORT KAction * carddecks(const QObject *recvr, const char *slot, QObject *parent)
Display configure carddecks dialog.
Definition: kstandardgameaction.cpp:207
KStandardGameAction::gameNew
KDEGAMES_EXPORT KAction * gameNew(const QObject *recvr, const char *slot, QObject *parent)
Start a new game.
Definition: kstandardgameaction.cpp:152
KStandardGameAction::Quit
Definition: kstandardgameaction.h:57
KStandardGameAction::pause
KDEGAMES_EXPORT KToggleAction * pause(const QObject *recvr, const char *slot, QObject *parent)
Pause the game.
Definition: kstandardgameaction.cpp:170
KStandardGameAction::Save
Definition: kstandardgameaction.h:56
KStandardGameAction::clearHighscores
KDEGAMES_EXPORT KAction * clearHighscores(const QObject *recvr, const char *slot, QObject *parent)
Clear highscores.
KStandardGameAction::SaveAs
Definition: kstandardgameaction.h:56
KStandardGameAction::Load
Definition: kstandardgameaction.h:56
KStandardGameAction::ChooseGameType
Definition: kstandardgameaction.h:62
KStandardGameAction::end
KDEGAMES_EXPORT KAction * end(const QObject *recvr, const char *slot, QObject *parent)
End the current game, but do not quit the program.
Definition: kstandardgameaction.cpp:167
KDEGAMES_EXPORT
#define KDEGAMES_EXPORT
Definition: libkdegames_export.h:32
KStandardGameAction::hint
KDEGAMES_EXPORT KAction * hint(const QObject *recvr, const char *slot, QObject *parent)
Give an advice/hint.
Definition: kstandardgameaction.cpp:213
QObject
KStandardGameAction::name
KDEGAMES_EXPORT const char * name(StandardGameAction id)
This will return the internal name of a given standard action.
Definition: kstandardgameaction.cpp:146
KStandardGameAction::ConfigureHighscores
Definition: kstandardgameaction.h:63
KStandardGameAction::Highscores
Definition: kstandardgameaction.h:56
KStandardGameAction::repeat
KDEGAMES_EXPORT KAction * repeat(const QObject *recvr, const char *slot, QObject *parent)
Repeat the last move.
Definition: kstandardgameaction.cpp:189
KStandardGameAction::ClearStatistics
Definition: kstandardgameaction.h:65
KStandardGameAction::StandardGameAction
StandardGameAction
The standard menubar and toolbar actions.
Definition: kstandardgameaction.h:54
KStandardGameAction::roll
KDEGAMES_EXPORT KAction * roll(const QObject *recvr, const char *slot, QObject *parent)
Roll die or dice.
Definition: kstandardgameaction.cpp:200
KStandardGameAction::Undo
Definition: kstandardgameaction.h:59
KStandardGameAction::configureHighscores
KDEGAMES_EXPORT KAction * configureHighscores(const QObject *recvr, const char *slot, QObject *parent)
Display configure highscores dialog.
Definition: kstandardgameaction.cpp:210
KStandardGameAction::EndTurn
Definition: kstandardgameaction.h:59
KStandardGameAction::Repeat
Definition: kstandardgameaction.h:59
KStandardGameAction::Solve
Definition: kstandardgameaction.h:69
KStandardGameAction::demo
KDEGAMES_EXPORT KToggleAction * demo(const QObject *recvr, const char *slot, QObject *parent)
Show a demo.
Definition: kstandardgameaction.cpp:216
KStandardGameAction::Demo
Definition: kstandardgameaction.h:68
KStandardGameAction::loadRecent
KDEGAMES_EXPORT KRecentFilesAction * loadRecent(const QObject *recvr, const char *slot, QObject *parent)
Load a recently loaded game.
Definition: kstandardgameaction.cpp:158
KStandardGameAction::quit
KDEGAMES_EXPORT KAction * quit(const QObject *recvr, const char *slot, QObject *parent)
Quit the game.
Definition: kstandardgameaction.cpp:185
KStandardGameAction::highscores
KDEGAMES_EXPORT KAction * highscores(const QObject *recvr, const char *slot, QObject *parent)
Show the highscores.
Definition: kstandardgameaction.cpp:173
KStandardGameAction::statistics
KDEGAMES_EXPORT KAction * statistics(const QObject *recvr, const char *slot, QObject *parent)
Show the statistics.
Definition: kstandardgameaction.cpp:176
KStandardGameAction::Carddecks
Definition: kstandardgameaction.h:61
KStandardGameAction::print
KDEGAMES_EXPORT KAction * print(const QObject *recvr, const char *slot, QObject *parent)
Print current game.
Definition: kstandardgameaction.cpp:182
KStandardGameAction::ActionNone
Definition: kstandardgameaction.h:70
KStandardGameAction::endTurn
KDEGAMES_EXPORT KAction * endTurn(const QObject *recvr, const char *slot, QObject *parent)
End the current turn (not the game).
Definition: kstandardgameaction.cpp:203
KStandardGameAction::Statistics
Definition: kstandardgameaction.h:56
KStandardGameAction::solve
KDEGAMES_EXPORT KAction * solve(const QObject *recvr, const char *slot, QObject *parent)
Solve the game.
Definition: kstandardgameaction.cpp:219
KStandardGameAction::LoadRecent
Definition: kstandardgameaction.h:56
KStandardGameAction::saveAs
KDEGAMES_EXPORT KAction * saveAs(const QObject *recvr, const char *slot, QObject *parent)
Save the current game under a different filename.
Definition: kstandardgameaction.cpp:164
KStandardGameAction::New
Definition: kstandardgameaction.h:56
KStandardGameAction::load
KDEGAMES_EXPORT KAction * load(const QObject *recvr, const char *slot, QObject *parent)
Load a previousely saved game.
Definition: kstandardgameaction.cpp:155
KStandardGameAction::clearStatistics
KDEGAMES_EXPORT KAction * clearStatistics(const QObject *recvr, const char *slot, QObject *parent)
Clear statistics.
Definition: kstandardgameaction.cpp:179
KStandardGameAction::undo
KDEGAMES_EXPORT KAction * undo(const QObject *recvr, const char *slot, QObject *parent)
Undo the last move.
Definition: kstandardgameaction.cpp:192
KStandardGameAction::Print
Definition: kstandardgameaction.h:57
KStandardGameAction::create
KDEGAMES_EXPORT KAction * create(StandardGameAction id, const QObject *recvr, const char *slot, QObject *parent)
Creates an action corresponding to the KStandardAction::StandardAction enum.
Definition: kstandardgameaction.cpp:92
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdegames

Skip menu "libkdegames"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal