1//
2// KBlackBox
3//
4// A simple game inspired by an emacs module
5//
6/***************************************************************************
7 * Copyright (c) 2007, Nicolas Roffet *
8 * nicolas-kde@roffet.com *
9 * *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * GNU General Public License for more details. *
20 * *
21 * You should have received a copy of the GNU General Public License *
22 * along with this program; if not, write to the *
23 * Free Software Foundation, Inc., *
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA *
25 ***************************************************************************/
26
27#ifndef KBBITEMWITHPOSITION_H
28#define KBBITEMWITHPOSITION_H
29
30
31
32/**
33 * @brief Item with position
34 *
35 * Items with position can be managed by the class KBBGraphicsItemSet.
36 */
37class KBBItemWithPosition
38{
39 public:
40 virtual ~KBBItemWithPosition();
41 virtual int position() = 0;
42
43 /**
44 * @brief Destructor for dependent QGraphicsItem
45 * Some QGraphicsItem s needs to delete other dependent QGraphicsItemo s before being deleted. In this case, this methode should be reimplemented.
46 * If the object is not a QGraphicsItem, you probably don't need to reimplement it and can just reimplement the normal destructor in a child class.
47 *
48 * It's different from the normal destructor that only destroys this QGraphicsItem. By exiting KBlackBox, the QGraphicsScene is been destroyed and call in an arbitrary order the destructors of all QGraphicsItem.s. So the dependent items may be destroy before this one: That's why we cannot always destroy them in the normal destructor of this class.
49 */
50 virtual void cleanDelete();
51
52
53 virtual void highlight(bool);
54 virtual void highlightBoth(bool);
55
56 /**
57 * @brief Should the element changes if the game is paused?
58 * Do nothing.
59 * Reimplement this methode to do something if the game is paused.
60 */
61 virtual void setPause(bool state);
62};
63
64#endif // KBBITEMWITHPOSITION_H
65