4 // A simple game inspired by an emacs module
6 /***************************************************************************
7 * Copyright (c) 1999-2000, Robert Cimrman *
8 * cimrman3@students.zcu.cz *
10 * Copyright (c) 2007, Nicolas Roffet *
11 * nicolas-kde@roffet.com *
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
19 * This program is distributed in the hope that it will be useful, *
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22 * GNU General Public License for more details. *
24 * You should have received a copy of the GNU General Public License *
25 * along with this program; if not, write to the *
26 * Free Software Foundation, Inc., *
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA *
28 ***************************************************************************/
30 #ifndef KBBGRAPHICSITEMONBOX_H
31 #define KBBGRAPHICSITEMONBOX_H
38 #include "kbbgraphicsitem.h"
39 #include "kbbitemwithposition.h"
40 class KBBScalableGraphicWidget
;
41 class KBBThemeManager
;
46 * @brief Item on the box on the scalable graphic widget
48 * The item is general and can be a ball or other markers.
50 class KBBGraphicsItemOnBox
: public KBBGraphicsItem
, public KBBItemWithPosition
54 * @brief Invalid box position
56 static const int NO_POSITION
= -1;
59 KBBGraphicsItemOnBox(KBBScalableGraphicWidget::itemType itemType
, KBBScalableGraphicWidget
* parent
, KBBThemeManager
* themeManager
, const int boxPosition
, const int columns
, const int rows
);
65 virtual void removeInteractionInfos();
67 KBBScalableGraphicWidget
* m_widget
;
73 int boxPosition(qreal x
, qreal y
);
75 void mousePressEvent (QGraphicsSceneMouseEvent
* event
);
76 void mouseReleaseEvent (QGraphicsSceneMouseEvent
* event
);
77 void setBoxPosition(int boxPosition
);
80 int m_boxOutsidePosition
;
85 KBBScalableGraphicWidget::itemType m_itemType
;
88 #endif // KBBGRAPHICSITEMONBOX_H