1 #ifndef __DALI_INTERNAL_PHYSICAL_KEYBOARD_H__
2 #define __DALI_INTERNAL_PHYSICAL_KEYBOARD_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/object/base-object.h>
25 #include <physical-keyboard.h>
36 class PhysicalKeyboard : public BaseObject
41 * Creates a new instance of the PhysicalKeyboard.
43 static Dali::PhysicalKeyboard New();
46 * Gets the singleton instance of the Physical Keyboard.
48 static Dali::PhysicalKeyboard Get();
51 * @copydoc Dali::PhysicalKeyboard::IsAttached()
53 bool IsAttached() const;
56 * Should be called by the EventHandler when a key is received. If it's received from a physical
57 * keyboard then the parameter should be true.
58 * @param[in] fromPhysicalKeyboard true if received from a physical keyboard, false otherwise.
60 void KeyReceived( bool fromPhysicalKeyboard );
65 * @copydoc Dali::PhysicalKeyboard::StatusChangedSignal()
67 Dali::PhysicalKeyboard::PhysicalKeyboardSignalType& StatusChangedSignal() { return mStatusChangedSignal; }
72 * A reference counted object may only be deleted by calling Unreference()
74 virtual ~PhysicalKeyboard();
79 PhysicalKeyboard( const PhysicalKeyboard& );
80 PhysicalKeyboard& operator=( PhysicalKeyboard& );
89 Dali::PhysicalKeyboard::PhysicalKeyboardSignalType mStatusChangedSignal; ///< Status changed signal
90 bool mAttached; ///< true if the physical keyboard is attached, false otherwise
93 } // namespace Adaptor
95 } // namespace Internal
97 // Helpers for public-api forwarding methods
99 inline static Internal::Adaptor::PhysicalKeyboard& GetImplementation( PhysicalKeyboard& keyboard )
101 DALI_ASSERT_ALWAYS( keyboard && "PhysicalKeyboard handle is empty" );
103 BaseObject& handle = keyboard.GetBaseObject();
105 return static_cast< Internal::Adaptor::PhysicalKeyboard& >( handle );
108 inline static const Internal::Adaptor::PhysicalKeyboard& GetImplementation( const PhysicalKeyboard& keyboard )
110 DALI_ASSERT_ALWAYS( keyboard && "PhysicalKeyboard handle is empty" );
112 const BaseObject& handle = keyboard.GetBaseObject();
114 return static_cast< const Internal::Adaptor::PhysicalKeyboard& >( handle );
119 #endif // __DALI_INTERNAL_PHYSICAL_KEYBOARD_H__