[Tizen] Add DALi Autofill implementation
[platform/core/uifw/dali-adaptor.git] / dali / internal / input / common / key-grab.cpp
1 /*
2  * Copyright (c) 2018 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/public-api/adaptor-framework/key-grab.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/window-system/common/window-impl.h>
23
24 namespace Dali
25 {
26
27 namespace KeyGrab
28 {
29
30 bool GrabKeyTopmost( Window window, Dali::KEY daliKey )
31 {
32   Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation( window );
33   return windowImpl.GrabKey( daliKey, TOPMOST );
34 }
35
36 bool UngrabKeyTopmost( Window window, Dali::KEY daliKey )
37 {
38   Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation( window );
39   return windowImpl.UngrabKey( daliKey );
40 }
41
42 bool GrabKey( Window window, Dali::KEY daliKey, KeyGrabMode grabMode )
43 {
44   Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation( window );
45   return windowImpl.GrabKey( daliKey, grabMode );
46 }
47
48
49 bool UngrabKey( Window window, Dali::KEY daliKey )
50 {
51   Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation( window );
52   return windowImpl.UngrabKey( daliKey );
53 }
54
55
56 bool GrabKeyList( Window window, const Dali::Vector<Dali::KEY>& daliKeyVector, const Dali::Vector<KeyGrabMode>& grabModeVector, Dali::Vector<bool>& returnVector)
57 {
58   Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation( window );
59   return windowImpl.GrabKeyList( daliKeyVector, grabModeVector, returnVector );
60 }
61
62 bool UngrabKeyList( Window window, const Dali::Vector<Dali::KEY>& daliKeyVector, Dali::Vector<bool>& returnVector)
63 {
64   Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation( window );
65   return windowImpl.UngrabKeyList( daliKeyVector, returnVector );
66 }
67
68 } // namespace KeyGrab
69
70 } // namespace Dali
71