2
This file is part of the KDE games library
3
Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)
4
Copyright (C) 2001 Martin Heni (kde at heni-online.de)
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.
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.
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.
21
#ifndef __KGAMEDEBUGDIALOG_H__
22
#define __KGAMEDEBUGDIALOG_H__
24
#include <kpagedialog.h>
25
#include "../../libkdegamesprivate_export.h"
27
class QListWidgetItem;
32
class KGameDebugDialogPrivate;
35
* \class KGameDebugDialog kgamedebugdialog.h <KGameDebugDialog>
37
class KDEGAMESPRIVATE_EXPORT KGameDebugDialog : public KPageDialog
41
KGameDebugDialog(KGame* g, QWidget* parent, bool modal = false);
45
* Automatically connects the KGame object to all error dependant slots.
46
* Create a KGameErrorDialog object, call this function and forget
48
* @param g The KGame which will emit the erorrs (or not ;-) )
50
void setKGame(const KGame* g);
54
* Unsets a @ref KGame which has been set using @ref setKGame before.
55
* This is called automatically when the @ref KGame object is destroyed
56
* and you normally don't have to call this yourself.
58
* Note that @ref setKGame also unsets an already existing @ref KGame
61
void slotUnsetKGame();
64
* Update the data of the @ref KGame object
66
void slotUpdateGameData();
69
* Update the properties of the currently selected player
71
void slotUpdatePlayerData();
74
* Updates the list of players and calls @ref clearPlayerData. Note that
75
* after this call NO player is selected anymore.
77
void slotUpdatePlayerList();
79
void slotClearMessages();
83
* This signal is emitted when the "debug messages" page couldn't find
84
* the name of a message id. This is usually the case for user-defined
85
* messages. KGameDebugDialog asks you to give the msgid a name.
86
* @param messageid The ID of the message. As given to @ref
88
* @param userid User defined msgIds are internally increased by
89
* KGameMessage::IdUser. You don't have to care about this but if
90
* this signal is emitted with userid=false (shouldn't happen) then the
91
* name of an internal message as defined in
92
* KGameMessage::GameMessageIds couldn't be found.
93
* @param name The name of the msgid. You have to fill this!
95
void signalRequestIdName(int messageid, bool userid, QString& name);
101
* Clear the data of the player view. Note that the player list is NOT
104
void clearPlayerData();
107
* Clear the data view of the @ref KGame object
109
void clearGameData();
112
* Add a new player to the player list
114
void addPlayer(KPlayer* p);
117
* Remove a player from the list
119
void removePlayer(QListWidgetItem* item);
122
* @return Whether messages with this msgid shall be displayed or not
124
bool showId(int msgid);
128
* Update the data of the player specified in item
129
* @param item The @ref QListWidgetItem of the player to be updated. Note
130
* that the text of this item MUST be the ID of the player
132
void slotUpdatePlayerData(QListWidgetItem* item);
138
* A message has been received - see @ref KGame::signalMessageUpdate
140
void slotMessageUpdate(int msgid, quint32 receiver, quint32 sender);
144
void initPlayerPage();
145
void initMessagePage();
148
KGameDebugDialogPrivate* const d;