[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / physical-keyboard.h
1 #ifndef DALI_PHYSICAL_KEYBOARD_H
2 #define DALI_PHYSICAL_KEYBOARD_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/base-handle.h>
23 #include <dali/public-api/signals/dali-signal.h>
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/dali-adaptor-common.h>
27
28 namespace Dali
29 {
30 namespace Internal DALI_INTERNAL
31 {
32 namespace Adaptor
33 {
34 class PhysicalKeyboard;
35 }
36 } // namespace DALI_INTERNAL
37
38 /**
39  * This is a handle to a physical keyboard connected to the device.
40  */
41 class DALI_ADAPTOR_API PhysicalKeyboard : public BaseHandle
42 {
43 public:
44   typedef Signal<void(PhysicalKeyboard)> PhysicalKeyboardSignalType;
45
46 public:
47   /**
48    * Create an uninitialized PhysicalKeyboard handle; this can be initialized with GetKeyboard()
49    * Calling member functions with an uninitialized Dali::Object is not allowed.
50    */
51   PhysicalKeyboard();
52
53   /**
54    * @brief Destructor
55    *
56    * This is non-virtual since derived Handle types must not contain data or virtual methods.
57    */
58   ~PhysicalKeyboard();
59
60   /**
61    * Gets a handle to the physical keyboard.
62    * @return A handle to the physical keyboard.
63    */
64   static PhysicalKeyboard Get();
65
66   /**
67    * Queries whether a physical keyboard is attached or not.
68    * @return true if a physical keyboard is attached, false otherwise.
69    */
70   bool IsAttached() const;
71
72   // Signals
73
74   /**
75    * Emitted when the status of the physical keyboard changes.
76    * A callback of the following type may be connected:
77    * @code
78    *   void YourCallbackName(PhysicalKeyboard keyboard);
79    * @endcode
80    * @pre The PhysicalKeyboard has been initialized.
81    * @return The status changed signal.
82    */
83   PhysicalKeyboardSignalType& StatusChangedSignal();
84
85   // Not intended for application developers
86
87   /**
88    * Creates a new handle from the implementation.
89    * @param[in] impl A pointer to the object.
90    */
91   explicit DALI_INTERNAL PhysicalKeyboard(Internal::Adaptor::PhysicalKeyboard* impl);
92 };
93
94 } // namespace Dali
95
96 #endif // DALI_PHYSICAL_KEYBOARD_H