Fix svace/coverity issue (key events constructor)
[platform/core/uifw/dali-core.git] / dali / devel-api / events / key-event-devel.h
index 417dd48..cf88c9f 100644 (file)
-#ifndef DALI_KEY_EVENT_DEVEL_H
-#define DALI_KEY_EVENT_DEVEL_H
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL_INCLUDES
-#include <dali/public-api/events/key-event.h>
-#include <dali/devel-api/events/device.h>
-
-namespace Dali
-{
-
-namespace DevelKeyEvent
-{
-
-/**
- * @brief Get the device name the key event originated from
- *
- * @param[in] keyEvent The KeyEvent to retrieve the device name from
- * @return The device name
- */
-DALI_IMPORT_API std::string GetDeviceName( const KeyEvent& keyEvent );
-
-/**
- * @brief Get the device class the key event originated from
- *
- * The device class type is classification type of the input device of event received
- * @param[in] keyEvent The KeyEvent to retrieve the device class from
- * @return The type of the device class
- */
-DALI_IMPORT_API DevelDevice::Class::Type GetDeviceClass( const KeyEvent& keyEvent );
-
-/**
- * @brief Get the device subclass the key event originated from
- *
- * The device subclass type is subclassification type of the input device of event received.
- * @param[in] keyEvent The KeyEvent to retrieve the device subclass from
- * @return The type of the device subclass
- */
-DALI_IMPORT_API DevelDevice::Subclass::Type GetDeviceSubclass( const KeyEvent& keyEvent );
-
-} // namespace DevelKeyEvent
-
-} // namespace Dali
-
-#endif  //DALI_KEY_EVENT_DEVEL_H
+#ifndef DALI_KEY_EVENT_DEVEL_H\r
+#define DALI_KEY_EVENT_DEVEL_H\r
+\r
+/*\r
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/public-api/events/key-event.h>\r
+\r
+namespace Dali\r
+{\r
+namespace DevelKeyEvent\r
+{\r
+/**\r
+ * @brief Creates an initialized KeyEvent as default.\r
+ *\r
+ * @SINCE_2_2.45\r
+ * @return A handle to a newly allocated Dali resource\r
+ */\r
+DALI_CORE_API KeyEvent New();\r
+\r
+/**\r
+ * @brief Creates an initialized KeyEvent.\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in]  keyName         The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.\r
+ * @param[in]  logicalKey      The logical key symbol (eg. shift + 1 == "exclamation")\r
+ * @param[in]  keyString       The string of input characters or key pressed\r
+ * @param[in]  keyCode         The unique key code for the key pressed.\r
+ * @param[in]  keyModifier     The key modifier for special keys like shift and alt\r
+ * @param[in]  timeStamp       The time (in ms) that the key event occurred.\r
+ * @param[in]  keyState        The state of the key event.\r
+ * @param[in]  compose         The key compose\r
+ * @param[in]  deviceName      The name of device the key event originated from\r
+ * @param[in]  deviceClass     The class of device the key event originated from\r
+ * @param[in]  deviceSubclass  The subclass of device the key event originated from\r
+ * @return A handle to a newly allocated Dali resource\r
+ */\r
+DALI_CORE_API KeyEvent New(const std::string&           keyName,\r
+                           const std::string&           logicalKey,\r
+                           const std::string&           keyString,\r
+                           int                          keyCode,\r
+                           int                          keyModifier,\r
+                           unsigned long                timeStamp,\r
+                           const Dali::KeyEvent::State& keyState,\r
+                           const std::string&           compose,\r
+                           const std::string&           deviceName,\r
+                           const Device::Class::Type    deviceClass,\r
+                           const Device::Subclass::Type deviceSubclass);\r
+\r
+/**\r
+ * @brief Set the name given to the key pressed\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] keyName The name given to the key pressed.\r
+ */\r
+DALI_CORE_API void SetKeyName(KeyEvent keyEvent, const std::string& keyName);\r
+\r
+/**\r
+ * @brief Set the actual string of input characters that should be used for input editors.\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] keyString The actual string of input characters\r
+ */\r
+DALI_CORE_API void SetKeyString(KeyEvent keyEvent, const std::string& keyString);\r
+\r
+/**\r
+ * @brief Set the unique key code for the key pressed.\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] keyCode The unique key code for the key pressed\r
+ */\r
+DALI_CORE_API void SetKeyCode(KeyEvent keyEvent, int32_t keyCode);\r
+\r
+/**\r
+ * @brief Set the key modifier for special keys like Shift, Alt and Ctrl which modify the next key pressed.\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] keyModifier The key modifier\r
+ */\r
+DALI_CORE_API void SetKeyModifier(KeyEvent keyEvent, int32_t keyModifier);\r
+\r
+/**\r
+ * @brief Set the time (in ms) that the key event occurred.\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] time The time (in ms)\r
+ */\r
+DALI_CORE_API void SetTime(KeyEvent keyEvent, unsigned long time);\r
+\r
+/**\r
+ * @brief Set the state of the key event.\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] state The state of the key event\r
+ */\r
+DALI_CORE_API void SetState(KeyEvent keyEvent, const KeyEvent::State& state);\r
+\r
+/**\r
+ * @brief Set whether to repeat key event.\r
+ *\r
+ * @SINCE_2_2.44\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] repeat Whether the key event is a repeating key.\r
+ */\r
+DALI_CORE_API void SetRepeat(KeyEvent keyEvent, const bool repeat);\r
+\r
+} // namespace DevelKeyEvent\r
+\r
+} // namespace Dali\r
+\r
+#endif // DALI_KEY_EVENT_DEVEL_H\r