summaryrefslogtreecommitdiffstats
path: root/kmines/dialogs.h
blob: 15321a4974c22a3fa0992f13035dc570b354aebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
 * Copyright (c) 1996-2003 Nicolas HADACEK (hadacek@kde.org)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef DIALOGS_H
#define DIALOGS_H

#include <tqpushbutton.h>

#include <kgamelcd.h>
#include <kexthighscore.h>

#include "defines.h"
#include "settings.h"

class KComboBox;
class KIntNumInput;

//-----------------------------------------------------------------------------
class Smiley : public TQPushButton, public KMines
{
 Q_OBJECT
 public:
    Smiley(TQWidget *parent, const char *name = 0)
        : TQPushButton(TQString::null, parent, name) {}

 public slots:
    void setMood(Mood);

 private:
    static const char **XPM_NAMES[NbMoods];
};

//-----------------------------------------------------------------------------
class DigitalClock : public KGameLCDClock
{
 Q_OBJECT
 public:
    DigitalClock(TQWidget *parent);

    void reset(bool customGame);

    bool cheating() const { return _cheating; }
    uint nbActions() const { return _nbActions; }
    KExtHighscore::Score score() const;

 public slots:
    void start();
    void setCheating();
    void addAction() { _nbActions++; }

 private slots:
    void timeoutClock();

 private:
    KExtHighscore::Score _first, _last;
    uint _nbActions;
    bool _cheating, _customGame;
};

//-----------------------------------------------------------------------------
class CustomConfig : public TQWidget, public KMines
{
 Q_OBJECT
 public:
    CustomConfig();

    static const uint maxWidth;
    static const uint minWidth;
    static const uint maxHeight;
    static const uint minHeight;

    void init() { updateNbMines(); }

 private slots:
    void typeChosen(int);
    void updateNbMines();

 private:
    bool _block;
    KIntNumInput *_width, *_height, *_mines;
    KComboBox    *_gameType;
};

//-----------------------------------------------------------------------------
class GameConfig : public TQWidget, public KMines
{
 Q_OBJECT
 public:
    GameConfig();

    static void saveLevel(Level::Type);

    void init() { _magicDialogEnabled = true; }

 private slots:
    void magicModified(bool);

 private:
    bool _magicDialogEnabled;

};

class AppearanceConfig : public TQWidget, public KMines
{
 Q_OBJECT
 public:
    AppearanceConfig();
};

#endif