File indexing completed on 2024-04-21 04:02:09

0001 /******************************************************************************
0002 *   KBlocks, a falling blocks game by KDE                                     *
0003 *   SPDX-FileCopyrightText: 2010-2021 Mauricio Piacentini <mauricio@tabuleiro.com>      *
0004 *                           Zhongjie Cai <squall.leonhart.cai@gmail.com>      *
0005 *                           Julian Helfferich <julian.helfferich@mailbox.org> *
0006 *                                                                             *
0007 *   SPDX-License-Identifier: GPL-2.0-or-later
0008 ******************************************************************************/
0009 #ifndef KBLOCKSVIEW_H
0010 #define KBLOCKSVIEW_H
0011 
0012 #include <QGraphicsView>
0013 
0014 class SceneInterface;
0015 class KGameTheme;
0016 
0017 class KBlocksView : public QGraphicsView
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     explicit KBlocksView(SceneInterface *scene, QWidget *parent = nullptr);
0023     ~KBlocksView() override;
0024 
0025 Q_SIGNALS:
0026     void focusEvent(bool flag);
0027 
0028 public Q_SLOTS:
0029     void settingsChanged();
0030 
0031 public:
0032     void loadTheme(const KGameTheme *theme);
0033 
0034 protected:
0035     void focusInEvent(QFocusEvent *event) override;
0036     void focusOutEvent(QFocusEvent *event) override;
0037     void resizeEvent(QResizeEvent *event) override;
0038 };
0039 
0040 #endif
0041