1 #ifndef DALI_INTERNAL_PHYSICAL_KEYBOARD_H
2 #define DALI_INTERNAL_PHYSICAL_KEYBOARD_H
5 * Copyright (c) 2021 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 <dali/devel-api/adaptor-framework/physical-keyboard.h>
33 class PhysicalKeyboard : public BaseObject
37 * Creates a new instance of the PhysicalKeyboard.
39 static Dali::PhysicalKeyboard New();
42 * Gets the singleton instance of the Physical Keyboard.
44 static Dali::PhysicalKeyboard Get();
47 * @copydoc Dali::PhysicalKeyboard::IsAttached()
49 bool IsAttached() const;
52 * Should be called by the EventHandler when a key is received. If it's received from a physical
53 * keyboard then the parameter should be true.
54 * @param[in] fromPhysicalKeyboard true if received from a physical keyboard, false otherwise.
56 void KeyReceived(bool fromPhysicalKeyboard);
61 * @copydoc Dali::PhysicalKeyboard::StatusChangedSignal()
63 Dali::PhysicalKeyboard::PhysicalKeyboardSignalType& StatusChangedSignal()
65 return mStatusChangedSignal;
70 * A reference counted object may only be deleted by calling Unreference()
72 ~PhysicalKeyboard() override;
76 PhysicalKeyboard(const PhysicalKeyboard&);
77 PhysicalKeyboard& operator=(PhysicalKeyboard&);
85 Dali::PhysicalKeyboard::PhysicalKeyboardSignalType mStatusChangedSignal; ///< Status changed signal
86 bool mAttached; ///< true if the physical keyboard is attached, false otherwise
89 } // namespace Adaptor
91 } // namespace Internal
93 // Helpers for public-api forwarding methods
95 inline static Internal::Adaptor::PhysicalKeyboard& GetImplementation(PhysicalKeyboard& keyboard)
97 DALI_ASSERT_ALWAYS(keyboard && "PhysicalKeyboard handle is empty");
99 BaseObject& handle = keyboard.GetBaseObject();
101 return static_cast<Internal::Adaptor::PhysicalKeyboard&>(handle);
104 inline static const Internal::Adaptor::PhysicalKeyboard& GetImplementation(const PhysicalKeyboard& keyboard)
106 DALI_ASSERT_ALWAYS(keyboard && "PhysicalKeyboard handle is empty");
108 const BaseObject& handle = keyboard.GetBaseObject();
110 return static_cast<const Internal::Adaptor::PhysicalKeyboard&>(handle);
115 #endif // DALI_INTERNAL_PHYSICAL_KEYBOARD_H