Merge changes Icccc1ca3,Ia32ce8ab into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / focus-manager / keyboard-focus-manager.cpp
1 /*
2  * Copyright (c) 2015 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
20 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
21
22 // EXTERNAL INCLUDES
23 #include <cstring> // for strcmp
24
25 // INTERNAL INCLUDES
26
27 #include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
28
29 namespace Dali
30 {
31
32 namespace Toolkit
33 {
34
35 KeyboardFocusManager::KeyboardFocusManager()
36 {
37 }
38
39 KeyboardFocusManager::~KeyboardFocusManager()
40 {
41 }
42
43 KeyboardFocusManager KeyboardFocusManager::Get()
44 {
45   return Internal::KeyboardFocusManager::Get();
46 }
47
48 KeyboardFocusManager::KeyboardFocusManager(Internal::KeyboardFocusManager *impl)
49   : BaseHandle(impl)
50 {
51 }
52
53 bool KeyboardFocusManager::SetCurrentFocusActor(Actor actor)
54 {
55   return GetImpl(*this).SetCurrentFocusActor(actor);
56 }
57
58 Actor KeyboardFocusManager::GetCurrentFocusActor()
59 {
60   return GetImpl(*this).GetCurrentFocusActor();
61 }
62
63 bool KeyboardFocusManager::MoveFocus(Control::KeyboardFocus::Direction direction)
64 {
65   return GetImpl(*this).MoveFocus(direction);
66 }
67
68 void KeyboardFocusManager::ClearFocus()
69 {
70   GetImpl(*this).ClearFocus();
71 }
72
73 void KeyboardFocusManager::SetAsFocusGroup(Actor actor, bool isFocusGroup)
74 {
75   // deprecated method.
76   GetImpl(*this).SetAsFocusGroup(actor, isFocusGroup);
77 }
78
79 bool KeyboardFocusManager::IsFocusGroup(Actor actor) const
80 {
81   // deprecated method.
82   return GetImpl(*this).IsFocusGroup(actor);
83 }
84
85 Actor KeyboardFocusManager::GetFocusGroup(Actor actor)
86 {
87   return GetImpl(*this).GetFocusGroup(actor);
88 }
89
90 void KeyboardFocusManager::SetFocusGroupLoop(bool enabled)
91 {
92   GetImpl(*this).SetFocusGroupLoop(enabled);
93 }
94
95 bool KeyboardFocusManager::GetFocusGroupLoop() const
96 {
97   return GetImpl(*this).GetFocusGroupLoop();
98 }
99
100 void KeyboardFocusManager::SetFocusIndicatorActor(Actor indicator)
101 {
102   GetImpl(*this).SetFocusIndicatorActor(indicator);
103 }
104
105 Actor KeyboardFocusManager::GetFocusIndicatorActor()
106 {
107   return GetImpl(*this).GetFocusIndicatorActor();
108 }
109
110 KeyboardFocusManager::PreFocusChangeSignalType& KeyboardFocusManager::PreFocusChangeSignal()
111 {
112   return GetImpl(*this).PreFocusChangeSignal();
113 }
114
115 KeyboardFocusManager::FocusChangedSignalType& KeyboardFocusManager::FocusChangedSignal()
116 {
117   return GetImpl(*this).FocusChangedSignal();
118 }
119
120 KeyboardFocusManager::FocusGroupChangedSignalType& KeyboardFocusManager::FocusGroupChangedSignal()
121 {
122   return GetImpl(*this).FocusGroupChangedSignal();
123 }
124
125 KeyboardFocusManager::FocusedActorActivatedSignalType& KeyboardFocusManager::FocusedActorActivatedSignal()
126 {
127   return GetImpl(*this).FocusedActorActivatedSignal();
128 }
129
130 } // namespace Toolkit
131
132 } // namespace Dali