File indexing completed on 2024-05-12 08:00:02
0001 /*************************************************************************** 0002 File : knightsview.h 0003 Project : Knights 0004 Description : Main view of Knights 0005 -------------------------------------------------------------------- 0006 SPDX-FileCopyrightText: 2016-2017 Alexander Semke (alexander.semke@web.de) 0007 SPDX-FileCopyrightText: 2009-2011 Miha Čančula (miha@noughmad.eu) 0008 0009 ***************************************************************************/ 0010 0011 /*************************************************************************** 0012 * * 0013 * SPDX-License-Identifier: GPL-2.0-or-later 0014 * * 0015 * This program is distributed in the hope that it will be useful, * 0016 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0018 * GNU General Public License for more details. * 0019 * * 0020 * You should have received a copy of the GNU General Public License * 0021 * along with this program; if not, write to the Free Software * 0022 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 0023 * Boston, MA 02110-1301 USA * 0024 * * 0025 ***************************************************************************/ 0026 #ifndef KNIGHTSVIEW_H 0027 #define KNIGHTSVIEW_H 0028 0029 #include "core/piece.h" 0030 #include <QWidget> 0031 0032 class KGameThemeProvider; 0033 0034 namespace Ui { 0035 class KnightsView; 0036 } 0037 0038 namespace Knights { 0039 0040 class Board; 0041 class Offer; 0042 class OfferWidget; 0043 0044 class KnightsView : public QWidget { 0045 Q_OBJECT 0046 public: 0047 explicit KnightsView(QWidget*); 0048 ~KnightsView() override; 0049 0050 void setupBoard(KGameThemeProvider*); 0051 void drawBoard(KGameThemeProvider*); 0052 0053 private: 0054 Ui::KnightsView* ui; 0055 Board* m_board; 0056 bool m_showAllOffers; 0057 QList<OfferWidget*> m_offerWidgets; 0058 0059 protected: 0060 void resizeEvent(QResizeEvent*) override; 0061 0062 public Q_SLOTS: 0063 void settingsChanged(); 0064 0065 private Q_SLOTS: 0066 void resizeScene(); 0067 void showAllOffersToggled(); 0068 0069 void showPopup(const Offer&); 0070 void popupHidden(int id); 0071 void updateOffers(); 0072 0073 Q_SIGNALS: 0074 void signalChangeStatusbar(const QString&); 0075 0076 void displayedPlayerChanged(Color); 0077 0078 }; 0079 } 0080 0081 #endif // KNIGHTSVIEW_H