-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpuzzlemenuitems.h
85 lines (69 loc) · 1.68 KB
/
puzzlemenuitems.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
**
*/
#ifndef ABSTRACTPUZZLEMENUITEMS_H
#define ABSTRACTPUZZLEMENUITEMS_H
#include "abstractitem.h"
// File must include
#include <QPointF>
// Forward declaration
class QPixmap;
/**
* @brief An abstract class of items used in puzzle secondary menu.
*/
class AbstractPuzzleMenuItem : public AbstractRectItem
{
public:
/**
* @brief Type of the items.
*/
enum ItemType{ExchangeItem=0, UniteItem, LockItem};
virtual void paint(QPainter *painter, int width, int height, int frame)=0;
/**
* @brief A function returns the pixmap of an item.
*/
static const QPixmap& pixmap(ItemType type, int frame);
virtual double width();
virtual double height();
private:
// The position of the item
// (The position is relative one, NOT absolute one!)
QPointF position;
};
/**
* @brief A class of items used in puzzle secondary menu of exchange serial.
*/
class PuzzleMenuExchangeItem : public AbstractPuzzleMenuItem
{
public:
/**
* @brief Constructor.
*/
PuzzleMenuExchangeItem();
virtual void paint(QPainter *painter, int width, int height, int frame);
};
/**
* @brief A class of items used in puzzle secondary menu of unit serial.
*/
class PuzzleMenuUniteItem : public AbstractPuzzleMenuItem
{
public:
/**
* @brief Constructor.
*/
PuzzleMenuUniteItem();
virtual void paint(QPainter *painter, int width, int height, int frame);
};
/**
* @brief A class of items used in puzzle secondary menu of lock serial.
*/
class PuzzleMenuLockItem : public AbstractPuzzleMenuItem
{
public:
/**
* @brief Constructor.
*/
PuzzleMenuLockItem();
virtual void paint(QPainter *painter, int width, int height, int frame);
};
#endif // ABSTRACTPUZZLEMENUITEMS_H