~ubuntu-branches/ubuntu/utopic/hedgewars/utopic

1.2.14 by Gianfranco Costamagna
Import upstream version 0.9.19.2
1
/*
2
 * Hedgewars, a free turn based strategy game
3
 * Copyright (c) 2004-2013 Andrey Korotaev <unC0Rr@gmail.com>
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation; version 2 of the License
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
17
 */
18
19
#ifndef HATBUTTON_H
20
#define HATBUTTON_H
21
22
#include <QPushButton>
23
#include <QString>
24
#include <QModelIndex>
25
26
class HatModel;
27
28
class HatButton : public QPushButton
29
{
30
        Q_OBJECT
31
        Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex)
32
        Q_PROPERTY(QString currentHat READ currentHat WRITE setCurrentHat)
33
34
    public:
35
        HatButton(QWidget* parent);
36
        int currentIndex();
37
        QString currentHat() const;
1.2.16 by Gianfranco Costamagna
Import upstream version 0.9.20
38
        void setModel(HatModel * model);
1.2.14 by Gianfranco Costamagna
Import upstream version 0.9.19.2
39
40
    private:
41
        QModelIndex m_hat;
42
        HatModel * m_hatModel;
43
44
    signals:
45
        void currentIndexChanged(int);
46
        void currentHatChanged(const QString &);
47
48
    public slots:
49
        void setCurrentIndex(int index);
50
        void setCurrentHat(const QString & name);
51
52
    private slots:
53
        void showPrompt();
54
};
55
56
#endif // HATBUTTON_H