6205051500f1446df5c8f1a38e46e5257f3deb02
[platform/core/uifw/dali-adaptor.git] / adaptors / tizen / public-api / adaptor-framework / common / physical-keyboard.h
1 #ifndef __DALI_PHYSICAL_KEYBOARD_H__
2 #define __DALI_PHYSICAL_KEYBOARD_H__
3
4 /*
5  * Copyright (c) 2014 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-v2.h>
24
25 namespace Dali DALI_IMPORT_API
26 {
27
28 namespace Internal DALI_INTERNAL
29 {
30 namespace Adaptor
31 {
32 class PhysicalKeyboard;
33 }
34 }
35
36 /**
37  * This is a handle to a physical keyboard connected to the device.
38  */
39 class PhysicalKeyboard : public BaseHandle
40 {
41 public:
42
43   typedef SignalV2< void (PhysicalKeyboard) > Signal;
44
45 public:
46
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    * Virtual destructor.
55    */
56   virtual ~PhysicalKeyboard();
57
58   /**
59    * Gets a handle to the physical keyboard.
60    * @return A handle to the physical keyboard.
61    */
62   static PhysicalKeyboard Get();
63
64   /**
65    * Queries whether a physical keyboard is attached or not.
66    * @return true if a physical keyboard is attached, false otherwise.
67    */
68   bool IsAttached() const;
69
70   // Signals
71
72   /**
73    * Emitted when the status of the physical keyboard changes.
74    * A callback of the following type may be connected:
75    * @code
76    *   void YourCallbackName(PhysicalKeyboard keyboard);
77    * @endcode
78    * @pre The PhysicalKeyboard has been initialized.
79    * @return The status changed signal.
80    */
81   Signal& StatusChangedSignal();
82
83   // Not intended for application developers
84
85   /**
86    * Creates a new handle from the implementation.
87    * @param[in] impl A pointer to the object.
88    */
89   explicit DALI_INTERNAL PhysicalKeyboard( Internal::Adaptor::PhysicalKeyboard* impl );
90 };
91
92 } // namespace Dali
93
94 #endif // __DALI_PHYSICAL_KEYBOARD_H__