2 This file is part of SloppyGUI.
4 SloppyGUI is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 SloppyGUI 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.
14 You should have received a copy of the GNU General Public License
15 along with SloppyGUI. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef PROMOTIONDLG_H
19 #define PROMOTIONDLG_H
23 #include "chessboard/chessboard.h"
29 * PromotionDialog provides an UI for chess piece promotion.
31 class PromotionDialog
: public QDialog
37 * Creates a new promotion dialog.
38 * @param parent Dialog's parent widget.
39 * @param f Dialog's window flags.
41 PromotionDialog(QWidget
* parent
= 0, Qt::WindowFlags f
= 0);
43 * Returns the user selected promotion type.
44 * The promotion type this method returns is always valid even if
45 * the user cancelled the dialog. By default the promotion type
47 * @return User selected promotion type. Always valid even if dialog
50 Chessboard::ChessPiece
promotionType() const;
53 void selectPromotionType(int type
);
56 Chessboard::ChessPiece m_promotionType
;
57 QRadioButton
* m_queenRadio
;
58 QRadioButton
* m_knightRadio
;
59 QRadioButton
* m_rookRadio
;
60 QRadioButton
* m_bishopRadio
;
61 QSignalMapper
* m_signalMapper
;
65 #endif // PROMOTIONDLG_H