kstdgameaction.h
00001 /* 00002 This file is part of the TDE games library 00003 Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de) 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 // this class was shamelessy stolen from tdelibs/tdeui/kstdction.[cpp|h] and 00020 // after that just edited for our needs 00021 #ifndef KSTDGAMEACTION_H 00022 #define KSTDGAMEACTION_H 00023 00024 class TDEAction; 00025 class TDEToggleAction; 00026 class TQObject; 00027 class TDEActionCollection; 00028 class TDERecentFilesAction; 00029 class TDESelectAction; 00030 #include <kdemacros.h> 00031 00032 //----------------------------------------------------------------------------- 00047 // #### KDE4: transform in namespace 00048 class KDE_EXPORT KStdGameAction 00049 { 00050 public: 00054 enum StdGameAction { 00055 // Game menu 00056 New=1, Load, LoadRecent, Save, SaveAs, End, Pause, Highscores, 00057 Print, Quit, 00058 // Move menu 00059 Repeat, Undo, Redo, Roll, EndTurn, 00060 // Settings menu 00061 Carddecks, 00062 ChooseGameType, // @since 3.2 00063 ConfigureHighscores, // @since 3.2 00064 00065 Restart, // @since 3.2 00066 Hint, // @since 3.2 00067 Demo, // @since 3.2 00068 Solve, // @since 3.2 00069 ActionNone // @since 3.2 00070 }; 00071 00072 KStdGameAction(); 00073 ~KStdGameAction(); 00074 00080 static TDEAction* create( StdGameAction id, const char *name, 00081 const TQObject *recvr, const char *slot, 00082 TDEActionCollection* parent ); 00083 00087 static TDEAction* create( StdGameAction id, 00088 const TQObject *recvr, const char *slot, 00089 TDEActionCollection* parent ) 00090 { return create( id, 0, recvr, slot, parent ); } 00091 00092 00098 static TDEAction *action(StdGameAction act_enum, const TQObject *recvr = 0, 00099 const char *slot = 0, TDEActionCollection *parent = 0, 00100 const char *name = 0L ); 00101 00106 static const char* name( StdGameAction id ); 00107 00112 static const char* stdName(StdGameAction act_enum); 00113 00117 static TDEAction *gameNew(const TQObject *recvr = 0, const char *slot = 0, 00118 TDEActionCollection *parent = 0, const char *name = 0L ); 00119 00123 static TDEAction *load(const TQObject *recvr = 0, const char *slot = 0, 00124 TDEActionCollection *parent = 0, const char *name = 0L ); 00125 00129 static TDERecentFilesAction *loadRecent(const TQObject *recvr = 0, const char *slot = 0, 00130 TDEActionCollection *parent = 0, const char *name = 0L ); 00131 00135 static TDEAction *save(const TQObject *recvr = 0, const char *slot = 0, 00136 TDEActionCollection *parent = 0, const char *name = 0L ); 00137 00141 static TDEAction *saveAs(const TQObject *recvr = 0, const char *slot = 0, 00142 TDEActionCollection *parent = 0, const char *name = 0L ); 00143 00147 static TDEToggleAction *pause(const TQObject *recvr = 0, const char *slot = 0, 00148 TDEActionCollection *parent = 0, const char *name = 0L ); 00149 00153 static TDEAction *highscores(const TQObject *recvr = 0, const char *slot = 0, 00154 TDEActionCollection *parent = 0, const char *name = 0L ); 00155 00156 00161 static TDEAction *end(const TQObject *recvr = 0, const char *slot = 0, 00162 TDEActionCollection *parent = 0, const char *name = 0L ); 00163 00168 static TDEAction *print(const TQObject *recvr = 0, const char *slot = 0, 00169 TDEActionCollection *parent = 0, const char *name = 0L ); 00170 00174 static TDEAction *quit(const TQObject *recvr = 0, const char *slot = 0, 00175 TDEActionCollection *parent = 0, const char *name = 0L ); 00176 00177 00178 00182 static TDEAction *repeat(const TQObject *recvr = 0, const char *slot = 0, 00183 TDEActionCollection *parent = 0, const char *name = 0L ); 00184 00188 static TDEAction *undo(const TQObject *recvr = 0, const char *slot = 0, 00189 TDEActionCollection *parent = 0, const char *name = 0L ); 00190 00194 static TDEAction *redo(const TQObject *recvr = 0, const char *slot = 0, 00195 TDEActionCollection *parent = 0, const char *name = 0L ); 00196 00200 static TDEAction *roll(const TQObject *recvr = 0, const char *slot = 0, 00201 TDEActionCollection *parent = 0, const char *name = 0L ); 00202 00207 static TDEAction *endTurn(const TQObject *recvr = 0, const char *slot = 0, 00208 TDEActionCollection *parent = 0, const char *name = 0L ); 00209 00210 00214 static TDEAction *carddecks(const TQObject *recvr = 0, const char *slot = 0, 00215 TDEActionCollection *parent = 0, const char *name = 0L ); 00216 00221 static TDEAction *configureHighscores(const TQObject *recvr = 0, const char *slot = 0, 00222 TDEActionCollection *parent = 0, const char *name = 0L ); 00223 00228 static TDEAction *hint(const TQObject *recvr = 0, const char *slot = 0, 00229 TDEActionCollection *parent = 0, const char *name = 0L ); 00230 00235 static TDEToggleAction *demo(const TQObject *recvr = 0, const char *slot = 0, 00236 TDEActionCollection *parent = 0, const char *name = 0L ); 00237 00242 static TDEAction *solve(const TQObject *recvr = 0, const char *slot = 0, 00243 TDEActionCollection *parent = 0, const char *name = 0L ); 00244 00249 static TDESelectAction *chooseGameType(const TQObject *recvr = 0, const char *slot = 0, 00250 TDEActionCollection *parent = 0, const char *name = 0L ); 00251 00256 static TDEAction *restart(const TQObject *recvr = 0, const char *slot = 0, 00257 TDEActionCollection *parent = 0, const char *name = 0L ); 00258 00259 }; 00260 00261 #endif