]> Shamusworld >> Repos - architektonas/blob - src/widgets/blockwidget.h
Bugfixes related to removing Snapper class.
[architektonas] / src / widgets / blockwidget.h
1 #ifndef __BLOCKWIDGET_H__
2 #define __BLOCKWIDGET_H__
3
4 #include <QtGui>
5
6 class Block;
7 class BlockList;
8 class ActionHandler;
9
10 /**
11  * This is the Qt implementation of a widget which can view a
12  * block list.
13  */
14 class BlockWidget: public QWidget
15 {
16     Q_OBJECT
17
18         public:
19                 BlockWidget(ActionHandler * ah, QWidget * parent,
20                         const char * name = 0, Qt::WFlags f = 0);
21                 ~BlockWidget();
22
23                 void setBlockList(BlockList * blockList);
24                 BlockList * getBlockList();
25                 void update();
26                 void highlightBlock(Block * block);
27
28                 virtual void blockAdded(Block *);
29                 virtual void blockEdited(Block *);
30                 virtual void blockRemoved(Block *);
31                 virtual void blockToggled(Block *);
32
33         signals:
34                 void escape();
35
36         public slots:
37                 //void slotToggleView(QListBoxItem* item);
38 //              void slotActivated(const QString & blockName);
39                 void slotActivated(void);
40 //              void slotMouseButtonClicked(int button, Q3ListBoxItem * item, const QPoint & pos);
41                 void slotMouseButtonClicked(QListWidgetItem * item);
42
43         protected:
44                 void contextMenuEvent(QContextMenuEvent * e);
45                 virtual void keyPressEvent(QKeyEvent * e);
46
47         private:
48                 BlockList * blockList;
49 //              Q3ListBox * listBox;
50                 QListWidget * listBox;
51                 Block * lastBlock;
52                 QPixmap pxmVisible;
53                 QPixmap pxmHidden;
54                 QPixmap pxmAdd;
55                 QPixmap pxmRemove;
56                 QPixmap pxmAttributes;
57                 QPixmap pxmEdit;
58                 QPixmap pxmInsert;
59                 QPixmap pxmDefreezeAll;
60                 QPixmap pxmFreezeAll;
61                 ActionHandler * actionHandler;
62 };
63
64 #endif  // __BLOCKWIDGET_H__