~ubuntu-branches/ubuntu/saucy/libkdegames/saucy-updates

« back to all changes in this revision

Viewing changes to libkdegamesprivate/kgame/dialogs/kgamedebugdialog.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell, Rohan Garg, Philip Muškovac, Jonathan Riddell
  • Date: 2013-06-21 01:42:38 UTC
  • mfrom: (1.2.3)
  • Revision ID: package-import@ubuntu.com-20130621014238-mk0kx5llg3m15ua6
Tags: 4:4.10.80-0ubuntu1
[ Rohan Garg ]
* New upstream release

[ Philip Muškovac ]
* Add Qml imports to libkdegames6.install 
* Add new symbols to libkdegames6.symbols

[ Jonathan Riddell ]
* New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
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)
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
 
 
21
 
#ifndef __KGAMEDEBUGDIALOG_H__
22
 
#define __KGAMEDEBUGDIALOG_H__
23
 
 
24
 
#include <kpagedialog.h>
25
 
#include "../../libkdegamesprivate_export.h"
26
 
 
27
 
class QListWidgetItem;
28
 
 
29
 
class KGame;
30
 
class KPlayer;
31
 
 
32
 
class KGameDebugDialogPrivate;
33
 
 
34
 
/**
35
 
 * \class KGameDebugDialog kgamedebugdialog.h <KGameDebugDialog>
36
 
 */
37
 
class KDEGAMESPRIVATE_EXPORT KGameDebugDialog : public KPageDialog
38
 
{
39
 
        Q_OBJECT
40
 
public:
41
 
        KGameDebugDialog(KGame* g, QWidget* parent, bool modal = false);
42
 
        ~KGameDebugDialog();
43
 
 
44
 
        /**
45
 
         * Automatically connects the KGame object to all error dependant slots. 
46
 
         * Create a KGameErrorDialog object, call this function and forget
47
 
         * everything.
48
 
         * @param g The KGame which will emit the erorrs (or not ;-) )
49
 
         **/
50
 
        void setKGame(const KGame* g);
51
 
 
52
 
public Q_SLOTS:
53
 
        /**
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.
57
 
         *
58
 
         * Note that @ref setKGame also unsets an already existing @ref KGame
59
 
         * object if exising.
60
 
         **/
61
 
        void slotUnsetKGame();
62
 
 
63
 
        /**
64
 
         * Update the data of the @ref KGame object
65
 
         **/
66
 
        void slotUpdateGameData();
67
 
 
68
 
        /**
69
 
         * Update the properties of the currently selected player
70
 
         **/
71
 
        void slotUpdatePlayerData();
72
 
 
73
 
        /**
74
 
         * Updates the list of players and calls @ref clearPlayerData. Note that
75
 
         * after this call NO player is selected anymore.
76
 
         **/
77
 
        void slotUpdatePlayerList();
78
 
 
79
 
        void slotClearMessages();
80
 
 
81
 
Q_SIGNALS:
82
 
        /**
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
87
 
         * KGame::sendMessage
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!
94
 
         **/
95
 
        void signalRequestIdName(int messageid, bool userid, QString& name);
96
 
 
97
 
protected:
98
 
        void clearPages();
99
 
 
100
 
        /**
101
 
         * Clear the data of the player view. Note that the player list is NOT
102
 
         * cleared.
103
 
         **/
104
 
        void clearPlayerData();
105
 
 
106
 
        /**
107
 
         * Clear the data view of the @ref KGame object
108
 
         **/
109
 
        void clearGameData();
110
 
 
111
 
        /**
112
 
         * Add a new player to the player list
113
 
         **/
114
 
        void addPlayer(KPlayer* p);
115
 
 
116
 
        /**
117
 
         * Remove a player from the list
118
 
         **/
119
 
        void removePlayer(QListWidgetItem* item);
120
 
 
121
 
        /**
122
 
         * @return Whether messages with this msgid shall be displayed or not
123
 
         **/
124
 
        bool showId(int msgid);
125
 
 
126
 
protected Q_SLOTS:
127
 
        /**
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
131
 
         **/
132
 
        void slotUpdatePlayerData(QListWidgetItem* item);
133
 
 
134
 
        void slotShowId();
135
 
        void slotHideId();
136
 
 
137
 
        /**
138
 
         * A message has been received - see @ref KGame::signalMessageUpdate
139
 
         **/
140
 
        void slotMessageUpdate(int msgid, quint32 receiver, quint32 sender);
141
 
 
142
 
private:
143
 
        void initGamePage();
144
 
        void initPlayerPage();
145
 
        void initMessagePage();
146
 
 
147
 
private:
148
 
        KGameDebugDialogPrivate* const d;
149
 
};
150
 
 
151
 
 
152
 
#endif