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