Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-physical-keyboard.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 #include "toolkit-physical-keyboard.h"
18
19 #include <dali/public-api/common/dali-common.h>
20 #include <dali/public-api/object/base-object.h>
21 #include <dali/public-api/signals/dali-signal-v2.h>
22
23 namespace Dali
24 {
25
26 /********************************************************************************
27  * Stub for Dali::Internal::Adaptor::PhysicalKeyboard
28  ********************************************************************************/
29 namespace Internal
30 {
31 namespace Adaptor
32 {
33 class PhysicalKeyboard : public BaseObject
34 {
35 public: // Creation & Destruction
36
37   PhysicalKeyboard();
38   ~PhysicalKeyboard();
39   static Dali::PhysicalKeyboard Get();
40
41 public:
42   bool IsAttached() const;
43
44 public: // Signals
45   Dali::PhysicalKeyboard::Signal& StatusChangedSignal();
46
47 private:
48   Dali::PhysicalKeyboard::Signal mStatusChangedSignal;
49   bool mIsAttached;
50   static Dali::PhysicalKeyboard mPhysicalKeyboard;
51 };
52
53 Dali::PhysicalKeyboard PhysicalKeyboard::mPhysicalKeyboard;
54
55 PhysicalKeyboard::PhysicalKeyboard()
56 : mIsAttached(true)
57 {
58 }
59
60 PhysicalKeyboard::~PhysicalKeyboard()
61 {
62 }
63
64 Dali::PhysicalKeyboard PhysicalKeyboard::Get()
65 {
66   if( ! mPhysicalKeyboard )
67   {
68     mPhysicalKeyboard = Dali::PhysicalKeyboard(new Internal::Adaptor::PhysicalKeyboard());
69   }
70   return mPhysicalKeyboard;
71 }
72
73 bool PhysicalKeyboard::IsAttached() const
74 {
75   return mIsAttached;
76 }
77
78 Dali::PhysicalKeyboard::Signal& PhysicalKeyboard::StatusChangedSignal()
79 {
80   return mStatusChangedSignal;
81 }
82
83 } // namespace Adaptor
84 } // namespace Internal
85
86
87 /********************************************************************************
88  * Stub for Dali::PhysicalKeyboard
89  ********************************************************************************/
90
91 PhysicalKeyboard::PhysicalKeyboard(){}
92 PhysicalKeyboard::~PhysicalKeyboard(){}
93
94 PhysicalKeyboard PhysicalKeyboard::Get()
95 {
96   // Get the physical keyboard handle
97   PhysicalKeyboard handle = Internal::Adaptor::PhysicalKeyboard::Get();
98   return handle;
99 }
100
101 bool PhysicalKeyboard::IsAttached() const
102 {
103   const BaseObject& object = GetBaseObject();
104   const Internal::Adaptor::PhysicalKeyboard& pyke = static_cast< const Internal::Adaptor::PhysicalKeyboard& >( object );
105   return pyke.IsAttached();
106 }
107
108 PhysicalKeyboard::Signal& PhysicalKeyboard::StatusChangedSignal()
109 {
110   BaseObject& object = GetBaseObject();
111   Internal::Adaptor::PhysicalKeyboard& pyke = static_cast< Internal::Adaptor::PhysicalKeyboard& >( object );
112   return pyke.StatusChangedSignal();
113 }
114
115 PhysicalKeyboard::PhysicalKeyboard( Internal::Adaptor::PhysicalKeyboard *impl )
116 : BaseHandle(impl)
117 {
118 }
119
120
121
122 } // namespace Dali