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-v2.h>
34 * Stub for the PhysicalKeyboard
36 class PhysicalKeyboard : public BaseObject
38 public: // Creation & Destruction
41 PhysicalKeyboard(ToolkitPhysicalKeyboard *toolkitPhysicalKeyboard);
43 static Dali::PhysicalKeyboard Get();
47 bool IsAttached() const;
51 Dali::PhysicalKeyboard::Signal& StatusChangedSignal();
55 ToolkitPhysicalKeyboard* mToolkitPhysicalKeyboard;
56 Dali::PhysicalKeyboard::Signal mStatusChangedSignal;
63 PhysicalKeyboard* gPhysicalKeyboard = NULL;
66 PhysicalKeyboard::PhysicalKeyboard()
67 : mToolkitPhysicalKeyboard(NULL),
72 PhysicalKeyboard::PhysicalKeyboard(ToolkitPhysicalKeyboard *toolkitPhysicalKeyboard)
73 : mToolkitPhysicalKeyboard(toolkitPhysicalKeyboard),
78 PhysicalKeyboard::~PhysicalKeyboard()
82 Dali::PhysicalKeyboard PhysicalKeyboard::Get()
84 DALI_ASSERT_ALWAYS(gPhysicalKeyboard);
85 return Dali::PhysicalKeyboard(gPhysicalKeyboard);
88 bool PhysicalKeyboard::IsAttached() const
93 Dali::PhysicalKeyboard::Signal& PhysicalKeyboard::StatusChangedSignal()
95 return mStatusChangedSignal;
98 } // namespace Adaptor
100 } // namespace Internal
102 ////////////////////////////////////////////////////////////////////////////////////////////////////
104 ToolkitPhysicalKeyboard::ToolkitPhysicalKeyboard()
105 : mPhysicalKeyboardStub(new Internal::Adaptor::PhysicalKeyboard(this)),
106 mPhysicalKeyboard( mPhysicalKeyboardStub )
108 Dali::Internal::Adaptor::gPhysicalKeyboard = mPhysicalKeyboardStub;
111 ToolkitPhysicalKeyboard::~ToolkitPhysicalKeyboard()
115 PhysicalKeyboard ToolkitPhysicalKeyboard::GetPhysicalKeyboard()
117 return mPhysicalKeyboard;