aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/conditions/ClickStateConditionEditor.h
blob: 786646201fcacd033dc9197b77a63a3ebdd039af (plain)
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
#pragma once
#include "../properties/SelectPropertyEditor.h"
#include "ConditionEditor.h"
#include "cru/common/ClonablePtr.h"
#include "cru/common/Event.h"
#include "cru/ui/style/Condition.h"

namespace cru::theme_builder::components::conditions {
class ClickStateConditionEditor : public ConditionEditor {
 public:
  ClickStateConditionEditor();
  ~ClickStateConditionEditor();

 public:
  ClonablePtr<ui::style::ClickStateCondition> GetValue() const;
  void SetValue(ui::style::ClickStateCondition* value,
                bool trigger_change = true);
  void SetValue(const ClonablePtr<ui::style::ClickStateCondition>& value,
                bool trigger_change = true) {
    SetValue(value.get(), trigger_change);
  }

  ClonablePtr<ui::style::Condition> GetCondition() override {
    return GetValue();
  }

  IEvent<std::nullptr_t>* ChangeEvent() { return &change_event_; }

 private:
  properties::SelectPropertyEditor click_state_select_;

  Event<std::nullptr_t> change_event_;
};
}  // namespace cru::theme_builder::components::conditions