2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
17 #include "toolkit-physical-keyboard.h"
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>
33 * Stub for the PhysicalKeyboard
35 class PhysicalKeyboard : public BaseObject
37 public: // Creation & Destruction
40 PhysicalKeyboard(ToolkitPhysicalKeyboard *toolkitPhysicalKeyboard);
42 static Dali::PhysicalKeyboard Get();
46 bool IsAttached() const;
50 Dali::PhysicalKeyboard::Signal& StatusChangedSignal();
54 ToolkitPhysicalKeyboard* mToolkitPhysicalKeyboard;
55 Dali::PhysicalKeyboard::Signal mStatusChangedSignal;
62 PhysicalKeyboard* gPhysicalKeyboard = NULL;
65 PhysicalKeyboard::PhysicalKeyboard()
66 : mToolkitPhysicalKeyboard(NULL),
71 PhysicalKeyboard::PhysicalKeyboard(ToolkitPhysicalKeyboard *toolkitPhysicalKeyboard)
72 : mToolkitPhysicalKeyboard(toolkitPhysicalKeyboard),
77 PhysicalKeyboard::~PhysicalKeyboard()
81 Dali::PhysicalKeyboard PhysicalKeyboard::Get()
83 DALI_ASSERT_ALWAYS(gPhysicalKeyboard);
84 return Dali::PhysicalKeyboard(gPhysicalKeyboard);
87 bool PhysicalKeyboard::IsAttached() const
92 Dali::PhysicalKeyboard::Signal& PhysicalKeyboard::StatusChangedSignal()
94 return mStatusChangedSignal;
97 } // namespace Adaptor
99 } // namespace Internal
101 ////////////////////////////////////////////////////////////////////////////////////////////////////
103 ToolkitPhysicalKeyboard::ToolkitPhysicalKeyboard()
104 : mPhysicalKeyboardStub(new Internal::Adaptor::PhysicalKeyboard(this)),
105 mPhysicalKeyboard( mPhysicalKeyboardStub )
107 Dali::Internal::Adaptor::gPhysicalKeyboard = mPhysicalKeyboardStub;
110 ToolkitPhysicalKeyboard::~ToolkitPhysicalKeyboard()
114 PhysicalKeyboard ToolkitPhysicalKeyboard::GetPhysicalKeyboard()
116 return mPhysicalKeyboard;