File indexing completed on 2024-12-15 03:50:12
0001 /*************************************************************************** 0002 * Copyright 2008 Johannes Bergmeier <johannes.bergmeier@gmx.net> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify * 0005 * it under the terms of the GNU General Public License as published by * 0006 * the Free Software Foundation; either version 2 of the License, or * 0007 * (at your option) any later version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, * 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0012 * GNU General Public License for more details. * 0013 * * 0014 * You should have received a copy of the GNU General Public License * 0015 * along with this program; if not, write to the * 0016 * Free Software Foundation, Inc., * 0017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 0018 ***************************************************************************/ 0019 0020 #ifndef _KSUDOKU_GAMEACTIONS_H_ 0021 #define _KSUDOKU_GAMEACTIONS_H_ 0022 0023 #include <QList> 0024 #include <QObject> 0025 0026 class QAction; 0027 class KActionCollection; 0028 0029 namespace ksudoku { 0030 0031 class GameActions : public QObject { 0032 Q_OBJECT 0033 public: 0034 explicit GameActions(KActionCollection* collection, QObject *parent); 0035 void init(); 0036 void associateWidget(QWidget* widget); 0037 Q_SIGNALS: 0038 void selectValue(int value); 0039 void enterValue(int value = -1); 0040 void markValue(int value = -1); 0041 void move(int dx, int dy); 0042 private Q_SLOTS: 0043 void clearValue(); 0044 void moveUp(); 0045 void moveDown(); 0046 void moveLeft(); 0047 void moveRight(); 0048 private: 0049 KActionCollection* m_collection; 0050 QList<QAction *> m_actions; 0051 }; 0052 0053 } 0054 0055 #endif