Horizon
tool_set_nc.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 #include <forward_list>
4 
5 namespace horizon {
6 
7 class ToolSetNotConnected : public ToolBase {
8 public:
9  ToolSetNotConnected(IDocument *c, ToolID tid);
10  ToolResponse begin(const ToolArgs &args) override;
11  ToolResponse update(const ToolArgs &args) override;
12  bool can_begin() override;
13  bool is_specific() override
14  {
15  return false;
16  }
17  std::set<InToolActionID> get_actions() const override
18  {
19  using I = InToolActionID;
20  return {
21  I::LMB,
22  I::CANCEL,
23  I::RMB,
24  I::NC_MODE,
25  };
26  }
27 
28 private:
29  enum class Mode { SET, CLEAR, TOGGLE };
30  Mode mode = Mode::SET;
31  void update_tip();
32 };
33 } // namespace horizon
horizon::ToolSetNotConnected::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
horizon::ToolSetNotConnected::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
horizon::ToolSetNotConnected::can_begin
bool can_begin() override
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool.hpp:42
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: tool.hpp:23
horizon::ToolSetNotConnected::is_specific
bool is_specific() override
Definition: tool_set_nc.hpp:13