2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include "toolkit-physical-keyboard.h"
20 #include <dali/public-api/common/dali-common.h>
21 #include <dali/public-api/object/base-object.h>
22 #include <dali/public-api/signals/dali-signal.h>
27 /********************************************************************************
28 * Stub for Dali::Internal::Adaptor::PhysicalKeyboard
29 ********************************************************************************/
34 class PhysicalKeyboard : public BaseObject
36 public: // Creation & Destruction
40 static Dali::PhysicalKeyboard Get();
43 bool IsAttached() const;
46 Dali::PhysicalKeyboard::PhysicalKeyboardSignalType& StatusChangedSignal();
49 Dali::PhysicalKeyboard::PhysicalKeyboardSignalType mStatusChangedSignal;
51 static Dali::PhysicalKeyboard mPhysicalKeyboard;
54 Dali::PhysicalKeyboard PhysicalKeyboard::mPhysicalKeyboard;
56 PhysicalKeyboard::PhysicalKeyboard()
61 PhysicalKeyboard::~PhysicalKeyboard()
65 Dali::PhysicalKeyboard PhysicalKeyboard::Get()
67 if( ! mPhysicalKeyboard )
69 mPhysicalKeyboard = Dali::PhysicalKeyboard(new Internal::Adaptor::PhysicalKeyboard());
71 return mPhysicalKeyboard;
74 bool PhysicalKeyboard::IsAttached() const
79 Dali::PhysicalKeyboard::PhysicalKeyboardSignalType& PhysicalKeyboard::StatusChangedSignal()
81 return mStatusChangedSignal;
84 } // namespace Adaptor
85 } // namespace Internal
88 /********************************************************************************
89 * Stub for Dali::PhysicalKeyboard
90 ********************************************************************************/
92 PhysicalKeyboard::PhysicalKeyboard(){}
93 PhysicalKeyboard::~PhysicalKeyboard(){}
95 PhysicalKeyboard PhysicalKeyboard::Get()
97 // Get the physical keyboard handle
98 PhysicalKeyboard handle = Internal::Adaptor::PhysicalKeyboard::Get();
102 bool PhysicalKeyboard::IsAttached() const
104 const BaseObject& object = GetBaseObject();
105 const Internal::Adaptor::PhysicalKeyboard& pyke = static_cast< const Internal::Adaptor::PhysicalKeyboard& >( object );
106 return pyke.IsAttached();
109 PhysicalKeyboard::PhysicalKeyboardSignalType& PhysicalKeyboard::StatusChangedSignal()
111 BaseObject& object = GetBaseObject();
112 Internal::Adaptor::PhysicalKeyboard& pyke = static_cast< Internal::Adaptor::PhysicalKeyboard& >( object );
113 return pyke.StatusChangedSignal();
116 PhysicalKeyboard::PhysicalKeyboard( Internal::Adaptor::PhysicalKeyboard *impl )