forked from adlr/PDFSketch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
toolbox.h
39 lines (29 loc) · 765 Bytes
/
toolbox.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
// Copyright...
#ifndef PDFSKETCH_TOOLBOX_H__
#define PDFSKETCH_TOOLBOX_H__
#include "graphic.h"
namespace pdfsketch {
class ToolboxDelegate;
class Toolbox {
public:
enum Tool {
ARROW, TEXT, CIRCLE, RECTANGLE, SQUIGGLE, CHECKMARK
};
Toolbox() : current_(ARROW), delegate_(NULL) {}
void SetDelegate(ToolboxDelegate* delegate) {
delegate_ = delegate;
}
static std::string ToolAsString(Toolbox::Tool tool);
void SelectTool(const std::string& tool);
void SelectTool(Tool tool);
Tool CurrentTool() const { return current_; }
private:
Tool current_;
ToolboxDelegate* delegate_;
};
class ToolboxDelegate {
public:
virtual void ToolSelected(Toolbox::Tool tool) = 0;
};
} // namespace pdfsketch
#endif // PDFSKETCH_TOOLBOX_H__