File indexing completed on 2024-04-14 03:59:44

0001 /***************************************************************************
0002  *   Copyright (C) 2005 by Albert Astals Cid <aacid@kde.org>               *
0003  *                                                                         *
0004  *   This program is free software; you can redistribute it and/or modify  *
0005  *   it under the terms of the GNU General Public License as published by  *
0006  *   the Free Software Foundation; either version 2 of the License, or     *
0007  *   (at your option) any later version.                                   *
0008  ***************************************************************************/
0009 
0010 #ifndef LATERALWIDGET_H
0011 #define LATERALWIDGET_H
0012 
0013 #include <QWidget>
0014 
0015 class QLabel;
0016 class QPushButton;
0017 class QStackedWidget;
0018 
0019 class dicesWidget;
0020 
0021 class lateralWidget : public QWidget
0022 {
0023 Q_OBJECT
0024     public:
0025         explicit lateralWidget(QWidget *parent);
0026 
0027         void nextTurn();        
0028 
0029         void setEnabled(bool enabled);
0030         void endGame();
0031 
0032         int getDice(int dice) const;
0033         void selectDice(int dice, bool select);
0034         void highlightDice(int dice, bool highlight);
0035         int getRolls() const;
0036         
0037         int getOnes() const;
0038         int getTwos() const;
0039         int getThrees() const;
0040         int getFours() const;
0041         int getFives() const;
0042         int getSixs() const;
0043         int getThreeOfAKind() const;
0044         int getFourOfAKind() const;
0045         int getFullHouse() const;
0046         int getSStraight() const;
0047         int getLStraight() const;
0048         int getKiriki() const;
0049         int totalSum() const;
0050         
0051     Q_SIGNALS:
0052         void newGameClicked();
0053         void rolled();
0054 
0055     public Q_SLOTS:
0056         void roll();
0057         void newGame();
0058         void enableDemoMode();
0059         void disableDemoMode();
0060         void unhighlightAllDice();
0061     
0062     private:
0063         void updateRollLabel();
0064         
0065         QLabel *m_rolls;
0066         dicesWidget *m_dices;
0067         QStackedWidget *m_buttons;
0068         QPushButton *m_rollButton;
0069         QPushButton *m_newGameButton;
0070         bool m_demoMode;
0071 
0072         int m_roll;
0073 };
0074 
0075 #endif
0076