1 #ifndef ZONEVIEWWIDGET_H
2 #define ZONEVIEWWIDGET_H
3 
4 #include <QCheckBox>
5 #include <QGraphicsProxyWidget>
6 #include <QGraphicsWidget>
7 
8 class QLabel;
9 class QPushButton;
10 class CardZone;
11 class ZoneViewZone;
12 class Player;
13 class CardDatabase;
14 class QScrollBar;
15 class QCheckBox;
16 class GameScene;
17 class ServerInfo_Card;
18 class QGraphicsSceneMouseEvent;
19 class QGraphicsSceneWheelEvent;
20 class QStyleOption;
21 
22 class ScrollableGraphicsProxyWidget : public QGraphicsProxyWidget
23 {
24     Q_OBJECT
25 public slots:
recieveWheelEvent(QGraphicsSceneWheelEvent * event)26     void recieveWheelEvent(QGraphicsSceneWheelEvent *event)
27     {
28         wheelEvent(event);
29     }
30 };
31 
32 class ZoneViewWidget : public QGraphicsWidget
33 {
34     Q_OBJECT
35 private:
36     ZoneViewZone *zone;
37     QGraphicsWidget *zoneContainer;
38 
39     QPushButton *closeButton;
40     QScrollBar *scrollBar;
41     ScrollableGraphicsProxyWidget *scrollBarProxy;
42     QCheckBox sortByNameCheckBox;
43     QCheckBox sortByTypeCheckBox;
44     QCheckBox shuffleCheckBox;
45     QCheckBox pileViewCheckBox;
46 
47     bool canBeShuffled;
48     int extraHeight;
49     Player *player;
50 signals:
51     void closePressed(ZoneViewWidget *zv);
52 private slots:
53     void processSortByType(int value);
54     void processSortByName(int value);
55     void processSetPileView(int value);
56     void resizeToZoneContents();
57     void handleScrollBarChange(int value);
58     void zoneDeleted();
59     void moveEvent(QGraphicsSceneMoveEvent * /* event */);
60 
61 public:
62     ZoneViewWidget(Player *_player,
63                    CardZone *_origZone,
64                    int numberCards = 0,
65                    bool _revealZone = false,
66                    bool _writeableRevealZone = false,
67                    const QList<const ServerInfo_Card *> &cardList = QList<const ServerInfo_Card *>());
getZone()68     ZoneViewZone *getZone() const
69     {
70         return zone;
71     }
getPlayer()72     Player *getPlayer() const
73     {
74         return player;
75     }
76     void retranslateUi();
77 
78 protected:
79     void closeEvent(QCloseEvent *event);
80     void initStyleOption(QStyleOption *option) const;
81 };
82 
83 #endif
84