libaurum: apply smart pointer wider and extract impl out
[platform/core/uifw/aurum.git] / libaurum / src / UiSelector.cc
1 #include "UiSelector.h"
2 #include <string>
3
4 UiSelector::UiSelector()
5     : mChild{}
6 {
7 }
8 /*
9 UiSelector::UiSelector(const UiSelector &src)
10 {
11     // 복사 생성자
12 }
13
14 UiSelector& UiSelector::operator= (const UiSelector& src)
15 {
16     // = 오버라이드
17     if (this == &src) return *this; // 자기 대입 방지
18     return *this;
19 }
20 */
21 UiSelector *UiSelector::id(std::string text)
22 {
23     this->mId = std::make_unique<std::string>(text);
24     return this;
25 }
26
27 UiSelector *UiSelector::text(std::string text)
28 {
29     this->mText = std::make_unique<std::string>(text);
30     return this;
31 }
32
33 UiSelector *UiSelector::pkg(std::string text)
34 {
35     this->mPkg = std::make_unique<std::string>(text);
36     return this;
37 }
38
39 UiSelector *UiSelector::res(std::string text)
40 {
41     this->mRes = std::make_unique<std::string>(text);
42     return this;
43 }
44
45 UiSelector *UiSelector::type(std::string text)
46 {
47     this->mType = std::make_unique<std::string>(text);
48     return this;
49 }
50
51 UiSelector *UiSelector::style(std::string text)
52 {
53     this->mStyle = std::make_unique<std::string>(text);
54     return this;
55 }
56
57 UiSelector *UiSelector::depth(int depth)
58 {
59     this->mMinDepth = std::make_unique<int>(depth);
60     this->mMaxDepth = std::make_unique<int>(depth);
61     return this;
62 }
63
64 UiSelector *UiSelector::depth(int minDepth, int maxDepth)
65 {
66     this->mMinDepth = std::make_unique<int>(minDepth);
67     this->mMaxDepth = std::make_unique<int>(maxDepth);
68     return this;
69 }
70
71 UiSelector *UiSelector::minDepth(int depth)
72 {
73     this->mMinDepth = std::make_unique<int>(depth);
74     return this;
75 }
76
77 UiSelector *UiSelector::maxDepth(int depth)
78 {
79     this->mMaxDepth = std::make_unique<int>(depth);
80     return this;
81 }
82
83 UiSelector *UiSelector::isChecked(bool cond)
84 {
85     this->mIschecked = std::make_unique<bool>(cond);
86     return this;
87 }
88
89 UiSelector *UiSelector::isCheckable(bool cond)
90 {
91     this->mIscheckable = std::make_unique<bool>(cond);
92     return this;
93 }
94
95 UiSelector *UiSelector::isClickable(bool cond)
96 {
97     this->mIsclickable = std::make_unique<bool>(cond);
98     return this;
99 }
100
101 UiSelector *UiSelector::isEnabled(bool cond)
102 {
103     this->mIsenabled = std::make_unique<bool>(cond);
104     return this;
105 }
106
107 UiSelector *UiSelector::isFocused(bool cond)
108 {
109     this->mIsfocused = std::make_unique<bool>(cond);
110     return this;
111 }
112
113 UiSelector *UiSelector::isFocusable(bool cond)
114 {
115     this->mIsfocusable = std::make_unique<bool>(cond);
116     return this;
117 }
118
119 UiSelector *UiSelector::isScrollable(bool cond)
120 {
121     this->mIsscrollable = std::make_unique<bool>(cond);
122     return this;
123 }
124
125 UiSelector *UiSelector::isSelected(bool cond)
126 {
127     this->mIsselected = std::make_unique<bool>(cond);
128     return this;
129 }
130
131 UiSelector *UiSelector::isShowing(bool cond)
132 {
133     this->mIsshowing = std::make_unique<bool>(cond);
134     return this;
135 }
136
137 UiSelector *UiSelector::isActive(bool cond)
138 {
139     this->mIsactive = std::make_unique<bool>(cond);
140     return this;
141 }
142
143 UiSelector *UiSelector::hasChild(std::shared_ptr<UiSelector> child)
144 {
145     mChild.push_back(child);
146     return this;
147 }