Formatting API
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / key-extension-plugin.h
1 #ifndef DALI_KEY_EXTENSION_PLUGIN_H
2 #define DALI_KEY_EXTENSION_PLUGIN_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 <cstdlib>
23
24 namespace Dali
25 {
26 /**
27  * @brief KeyExtensionPlugin is an abstract interface, used by dali-adaptor to access key extension plugin.
28  * A concrete implementation must be created for each platform and provided as dynamic library.
29  * @SINCE_1_2.41
30  */
31 class KeyExtensionPlugin
32 {
33 public:
34   struct KeyLookup
35   {
36     const char* keyName;      ///< XF86 key name
37     const int   daliKeyCode;  ///< Dali key code
38     const bool  deviceButton; ///< Whether the key is from a button on the device
39   };
40
41   /**
42    * @brief Constructor.
43    * @SINCE_1_2.41
44    */
45   KeyExtensionPlugin()
46   {
47   }
48
49   /**
50    * @brief Destructor.
51    * @SINCE_1_2.41
52    */
53   virtual ~KeyExtensionPlugin()
54   {
55   }
56
57   /**
58    * @brief Get extension key lookup table.
59    *
60    * @SINCE_1_2.41
61    * @return Pointer of extension Key lookup table.
62    */
63   virtual KeyLookup* GetKeyLookupTable() = 0;
64
65   /**
66    * @brief Get count of extension key lookup table.
67    *
68    * @SINCE_1_2.41
69    * @return count of extension Key lookup table.
70    */
71   virtual std::size_t GetKeyLookupTableCount() = 0;
72 };
73
74 } // namespace Dali
75
76 #endif