1#include "Layout/HardIconParts.h"
2
3#include "Library/Layout/LayoutActionFunction.h"
4#include "Library/Layout/LayoutActor.h"
5#include "Library/Nerve/NerveSetupUtil.h"
6#include "Library/Nerve/NerveUtil.h"
7
8namespace {
9NERVE_IMPL(HardIconParts, Hide);
10NERVE_IMPL(HardIconParts, Appear);
11NERVE_IMPL(HardIconParts, Wait);
12NERVE_IMPL(HardIconParts, PageNext);
13NERVE_IMPL(HardIconParts, PageEnd);
14NERVE_IMPL(HardIconParts, End);
15
16NERVES_MAKE_NOSTRUCT(HardIconParts, Hide, Appear, Wait, PageNext, PageEnd, End);
17} // namespace
18
19HardIconParts::HardIconParts(const char* name) : al::LayoutActor(name) {
20 initNerve(&Hide, 0);
21}
22
23bool HardIconParts::isHide() const {
24 return al::isNerve(user: this, nerve: &Hide);
25}
26
27bool HardIconParts::isWait() const {
28 return al::isNerve(user: this, nerve: &Wait);
29}
30
31void HardIconParts::startHide() {
32 al::setNerve(user: this, nerve: &Hide);
33}
34
35void HardIconParts::startAppear() {
36 al::setNerve(user: this, nerve: &Appear);
37}
38
39void HardIconParts::startWait() {
40 al::setNerve(user: this, nerve: &Wait);
41}
42
43void HardIconParts::startEnd() {
44 al::setNerve(user: this, nerve: &End);
45}
46
47void HardIconParts::exeHide() {
48 if (al::isFirstStep(user: this))
49 al::startAction(layout: this, actionName: "Hide", paneName: nullptr);
50}
51
52void HardIconParts::exeAppear() {
53 if (al::isFirstStep(user: this))
54 al::startAction(layout: this, actionName: "Appear", paneName: nullptr);
55 al::setNerveAtActionEnd(layout: this, nerve: &Wait);
56}
57
58void HardIconParts::exeWait() {
59 if (al::isFirstStep(user: this))
60 al::startAction(layout: this, actionName: "Wait", paneName: nullptr);
61}
62
63void HardIconParts::exePageNext() {
64 if (al::isFirstStep(user: this))
65 al::startAction(layout: this, actionName: "PageNext", paneName: nullptr);
66 al::setNerveAtActionEnd(layout: this, nerve: &Hide);
67}
68
69void HardIconParts::exePageEnd() {
70 if (al::isFirstStep(user: this))
71 al::startAction(layout: this, actionName: "PageEnd", paneName: nullptr);
72 al::setNerveAtActionEnd(layout: this, nerve: &Hide);
73}
74
75void HardIconParts::exeEnd() {
76 if (al::isFirstStep(user: this))
77 al::startAction(layout: this, actionName: "End", paneName: nullptr);
78 al::setNerveAtActionEnd(layout: this, nerve: &Hide);
79}
80