Remove obsolete and non functional SizeChanged signal from actor
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / public-api / focus-manager / focus-manager.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali-toolkit/public-api/focus-manager/focus-manager.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/adaptor-framework/singleton-service.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/internal/focus-manager/focus-manager-impl.h>
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 const char* const FocusManager::SIGNAL_FOCUS_CHANGED = "focus-changed";
34 const char* const FocusManager::SIGNAL_FOCUS_OVERSHOT = "focus-overshot";
35 const char* const FocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED = "focused-actor-activated";
36
37 FocusManager::FocusManager()
38 {
39 }
40
41 FocusManager::~FocusManager()
42 {
43 }
44
45 FocusManager FocusManager::Get()
46 {
47   FocusManager manager;
48
49   // Check whether the focus manager is already created
50   SingletonService singletonService( SingletonService::Get() );
51   if ( singletonService )
52   {
53     Dali::BaseHandle handle = singletonService.GetSingleton(typeid(FocusManager));
54     if(handle)
55     {
56       // If so, downcast the handle of singleton to focus manager
57       manager = FocusManager(dynamic_cast<Internal::FocusManager*>(handle.GetObjectPtr()));
58     }
59
60     if(!manager)
61     {
62       // If not, create the focus manager and register it as a singleton
63       manager = FocusManager(new Internal::FocusManager());
64       singletonService.Register(typeid(manager), manager);
65     }
66   }
67
68   return manager;
69 }
70
71 FocusManager::FocusManager(Internal::FocusManager *impl)
72   : BaseHandle(impl)
73 {
74 }
75
76 void FocusManager::SetAccessibilityAttribute(Actor actor, AccessibilityAttribute type, const std::string& text)
77 {
78   GetImpl(*this).SetAccessibilityAttribute(actor, type, text);
79 }
80
81 std::string FocusManager::GetAccessibilityAttribute(Actor actor, AccessibilityAttribute type) const
82 {
83   return GetImpl(*this).GetAccessibilityAttribute(actor, type);
84 }
85
86 void FocusManager::SetFocusOrder(Actor actor, const unsigned int order)
87 {
88   GetImpl(*this).SetFocusOrder(actor, order);
89 }
90
91 unsigned int FocusManager::GetFocusOrder(Actor actor) const
92 {
93   return GetImpl(*this).GetFocusOrder(actor);
94 }
95
96 unsigned int FocusManager::GenerateNewFocusOrder() const
97 {
98   return GetImpl(*this).GenerateNewFocusOrder();
99 }
100
101 Actor FocusManager::GetActorByFocusOrder(const unsigned int order)
102 {
103   return GetImpl(*this).GetActorByFocusOrder(order);
104 }
105
106 bool FocusManager::SetCurrentFocusActor(Actor actor)
107 {
108   return GetImpl(*this).SetCurrentFocusActor(actor);
109 }
110
111 Actor FocusManager::GetCurrentFocusActor()
112 {
113   return GetImpl(*this).GetCurrentFocusActor();
114 }
115
116 Actor FocusManager::GetCurrentFocusGroup()
117 {
118   return GetImpl(*this).GetCurrentFocusGroup();
119 }
120
121 unsigned int FocusManager::GetCurrentFocusOrder()
122 {
123   return GetImpl(*this).GetCurrentFocusOrder();
124 }
125
126 bool FocusManager::MoveFocusForward()
127 {
128   return GetImpl(*this).MoveFocusForward();
129 }
130
131 bool FocusManager::MoveFocusBackward()
132 {
133   return GetImpl(*this).MoveFocusBackward();
134 }
135
136 void FocusManager::ClearFocus()
137 {
138   GetImpl(*this).ClearFocus();
139 }
140
141 void FocusManager::Reset()
142 {
143   GetImpl(*this).Reset();
144 }
145
146 void FocusManager::SetFocusGroup(Actor actor, bool isFocusGroup)
147 {
148   GetImpl(*this).SetFocusGroup(actor, isFocusGroup);
149 }
150
151 bool FocusManager::IsFocusGroup(Actor actor) const
152 {
153   return GetImpl(*this).IsFocusGroup(actor);
154 }
155
156 void FocusManager::SetGroupMode(bool enabled)
157 {
158   GetImpl(*this).SetGroupMode(enabled);
159 }
160
161 bool FocusManager::GetGroupMode() const
162 {
163   return GetImpl(*this).GetGroupMode();
164 }
165
166 void FocusManager::SetWrapMode(bool wrapped)
167 {
168   GetImpl(*this).SetWrapMode(wrapped);
169 }
170
171 bool FocusManager::GetWrapMode() const
172 {
173   return GetImpl(*this).GetWrapMode();
174 }
175
176 void FocusManager::SetFocusIndicatorActor(Actor indicator)
177 {
178   GetImpl(*this).SetFocusIndicatorActor(indicator);
179 }
180
181 Actor FocusManager::GetFocusIndicatorActor()
182 {
183   return GetImpl(*this).GetFocusIndicatorActor();
184 }
185
186 Actor FocusManager::GetFocusGroup(Actor actor)
187 {
188   return GetImpl(*this).GetFocusGroup(actor);
189 }
190
191 FocusManager::FocusChangedSignalType& FocusManager::FocusChangedSignal()
192 {
193   return GetImpl(*this).FocusChangedSignal();
194 }
195
196 FocusManager::FocusOvershotSignalType& FocusManager::FocusOvershotSignal()
197 {
198   return GetImpl(*this).FocusOvershotSignal();
199 }
200
201 FocusManager::FocusedActorActivatedSignalType& FocusManager::FocusedActorActivatedSignal()
202 {
203   return GetImpl(*this).FocusedActorActivatedSignal();
204 }
205
206 } // namespace Toolkit
207
208 } // namespace Dali