File indexing completed on 2024-04-28 05:38:03

0001 /*************************************************************************
0002  *     Copyright (C) 2011 by Joseph Boudou                               *
0003  *      Copyright (C) 2014 by Renaud Guezennec                            *
0004  *                                                                       *
0005  *     https://rolisteam.org/                                         *
0006  *                                                                       *
0007  *   Rolisteam is free software; you can redistribute it and/or modify   *
0008  *   it under the terms of the GNU General Public License as published   *
0009  *   by the Free Software Foundation; either version 2 of the License,   *
0010  *   or (at your option) any later version.                              *
0011  *                                                                       *
0012  *   This program is distributed in the hope that it will be useful,     *
0013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of      *
0014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
0015  *   GNU General Public License for more details.                        *
0016  *                                                                       *
0017  *   You should have received a copy of the GNU General Public License   *
0018  *   along with this program; if not, write to the                       *
0019  *   Free Software Foundation, Inc.,                                     *
0020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           *
0021  *************************************************************************/
0022 #ifndef PLAYERS_LIST_WIDGET_H
0023 #define PLAYERS_LIST_WIDGET_H
0024 
0025 #include <QAbstractProxyModel>
0026 #include <QDockWidget>
0027 
0028 #include "rwidgets_global.h"
0029 #include <QItemSelectionModel>
0030 #include <QPointer>
0031 #include <QPushButton>
0032 #include <QSet>
0033 #include <QTreeView>
0034 #include <memory>
0035 
0036 class UserListView;
0037 class PersonDialog;
0038 class Person;
0039 class PlayerOnMapModel;
0040 class PlayerController;
0041 
0042 namespace Ui
0043 {
0044 class PlayersPanel;
0045 }
0046 
0047 /**
0048  * @brief The PlayersListWidget class is the QDockWidget which display the PlayersListView. It is part of the MVC
0049  * pattern as the Controler.
0050  *
0051  */
0052 class RWIDGET_EXPORT PlayersPanel : public QDockWidget
0053 {
0054     Q_OBJECT
0055 public:
0056     PlayersPanel(PlayerController* ctrl, QWidget* parent= nullptr);
0057     ~PlayersPanel();
0058 
0059 private:
0060     void setConnection();
0061 
0062 private slots:
0063     void selectAnotherPerson(const QModelIndex& current, const QModelIndex& previous);
0064 signals:
0065     void runDiceForCharacter(const QString& dice, const QString& uuid);
0066 
0067 private:
0068     Ui::PlayersPanel* m_ui;
0069     QPointer<PlayerController> m_ctrl;
0070     QPointer<QItemSelectionModel> m_selectionModel;
0071 };
0072 
0073 #endif