2 * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include "mmi-common.h"
22 #include "TouchModule.h"
23 #include "mmi-manager-dbg.h"
24 #include "mmi_output_modality.h"
26 static TouchModule *g_touch_module = nullptr;
28 EXPORT_API void output_modality_initialize()
30 LOGD("initialize output modality");
31 g_touch_module = new TouchModule();
34 EXPORT_API void output_modality_shutdown()
36 LOGD("shutdown output modality");
38 delete g_touch_module;
39 g_touch_module = NULL;
43 EXPORT_API int output_modality_voice_touch(mmi_output_modality_voice_touch modality)
45 mmi_voice_touch_mode mode = (mmi_voice_touch_mode)modality.mode;
48 if (MMI_VOICE_TOUCH_MODE_TOOLTIP == mode) {
49 LOGD("voice touch by tooltip");
50 std::string objID = std::string(modality.object_id, strlen(modality.object_id));
51 ret = g_touch_module->ClickByObjectId(objID);
52 } else if (MMI_VOICE_TOUCH_MODE_GRID == mode) {
53 LOGD("voice touch by grid");
54 ret = g_touch_module->ClickByCoordinate(modality.coord_x, modality.coord_y);
58 LOGD("voice touch done");