forked from schulmar/Templar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistwidgethandler.h
46 lines (32 loc) · 876 Bytes
/
listwidgethandler.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
#ifndef LISTWIDGETHANDLER_H
#define LISTWIDGETHANDLER_H
#include "templateeventhandler.h"
#include <vector>
#include <QSharedPointer>
class QListWidget;
class QListWidgetItem;
namespace Templar {
namespace Detail {
class Command;
} // namespace Detail
class ListWidgetHandler : public TemplateEventHandler
{
public:
ListWidgetHandler(QListWidget *listW) :
listWidget(listW) {}
void handleEvent(const TraceEntry &entry);
void undoEvent();
void reset();
void forward(const std::vector<TraceEntry> & entryVec);
void rewind(unsigned int);
public:
void addItem(QListWidgetItem *item);
QListWidgetItem* takeItem();
private:
QListWidgetItem* makeItem(const TraceEntry& entry) const;
private:
QListWidget *listWidget;
std::vector<Detail::Command*> undoList;
};
} // namespace Templar
#endif // LISTWIDGETHANDLER_H