File indexing completed on 2024-05-12 04:02:40

0001 /*
0002     SPDX-FileCopyrightText: 2012 Mathias Kraus <k.hias@gmx.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef PLAYERSELECTORITEM_H
0008 #define PLAYERSELECTORITEM_H
0009 
0010 #include <QWidget>
0011 #include <QImage>
0012 #include <QPixmap>
0013 
0014 class PlayerSettings;
0015 class QCheckBox;
0016 class QLabel;
0017 class QLineEdit;
0018 class KKeySequenceWidget;
0019 
0020 class PlayerSelectorItem : public QWidget
0021 {
0022     Q_OBJECT
0023     
0024 private:
0025     QCheckBox* m_selectCheckBox;
0026     
0027     QLineEdit* m_playerName;
0028     QPixmap m_playerPreviewPixmap;
0029     QImage m_playerPreviewImageAlphaChannel;
0030     
0031     QLabel* m_playerPreviewPixmapLabel;
0032     QLabel* m_playerAuthor;
0033     
0034     KKeySequenceWidget* m_moveLeft;
0035     KKeySequenceWidget* m_moveUp;
0036     KKeySequenceWidget* m_moveRight;
0037     KKeySequenceWidget* m_moveDown;
0038     KKeySequenceWidget* m_dropBomb;
0039     
0040     QLabel* m_labelMoveLeft;
0041     QLabel* m_labelMoveUp;
0042     QLabel* m_labelMoveRight;
0043     QLabel* m_labelMoveDown;
0044     QLabel* m_labelDropBomb;
0045     
0046     QString m_playerId;
0047     //don't delete this, it's just a pointer to the real settings
0048     PlayerSettings* m_playerSettings;
0049     
0050 public:
0051     PlayerSelectorItem(const QString& playerId, PlayerSettings* playerSettings, QWidget* parent = nullptr);
0052     ~PlayerSelectorItem() override;
0053     
0054     void setPlayerPreviewPixmap(const QPixmap& pixmap);
0055     void setPlayerAuthor(const QString& name, const QString& mail);
0056 
0057 private Q_SLOTS:
0058     void selectionChanged(bool selectionState);
0059     void settingsChanged();
0060 
0061 };
0062 
0063 #endif //PLAYERSELECTORITEM_H
0064