File indexing completed on 2025-03-23 06:53:54
0001 /******************************************************************* 0002 * 0003 * This file is part of the KDE project "Bovo" 0004 * 0005 * Bovo is free software; you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation; either version 2, or (at your option) 0008 * any later version. 0009 * 0010 * Bovo is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 * GNU General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU General Public License 0016 * along with Bovo; see the file COPYING. If not, write to 0017 * the Free Software Foundation, 51 Franklin Street, Fifth Floor, 0018 * Boston, MA 02110-1301, USA. 0019 * 0020 ********************************************************************/ 0021 0022 #ifndef BOVO_MARK_H 0023 #define BOVO_MARK_H 0024 0025 #include <QGraphicsSvgItem> 0026 0027 #include "common.h" 0028 0029 namespace bovo 0030 { 0031 class Move; 0032 } 0033 0034 using namespace bovo; 0035 0036 class QTimer; 0037 0038 namespace gui 0039 { 0040 0041 class Scene; 0042 0043 class Mark : public QGraphicsSvgItem 0044 { 0045 Q_OBJECT 0046 public: 0047 Mark(Scene *scene, const Move &move, bool animate = true, qreal fill = 0.75); 0048 ~Mark() override; 0049 void killAnimation(); 0050 void kill(); 0051 usi row() const; 0052 usi col() const; 0053 void setFill(qreal fill); 0054 QRectF boundingRect() const override; 0055 0056 public Q_SLOTS: 0057 void tick(); 0058 void killTick(); 0059 0060 Q_SIGNALS: 0061 void killed(Mark *thisMark); 0062 0063 protected: 0064 void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *widget = nullptr) override; 0065 0066 private: 0067 Scene *m_scene; 0068 int m_row; 0069 int m_col; 0070 qreal m_fill; 0071 int m_tick; 0072 bool m_animate; 0073 qreal m_opacity; 0074 QTimer *m_ticker; 0075 }; 0076 0077 } /* namespace gui */ 0078 0079 #endif // BOVO_MARH_H