#include <Aurum.h>
#include <string>
#include <memory>
-#include <system_info.h>
#include "mmi-manager-dbg.h"
#include "TouchModule.h"
-#define TIZEN_PROFILE_TV (get_tizen_profile() == _PROFILE_TV)
-#define TIZEN_PROFILE_COMMON (get_tizen_profile() == _PROFILE_COMMON)
-
-typedef enum {
- _PROFILE_UNKNOWN = 0,
- _PROFILE_MOBILE = 0x1,
- _PROFILE_WEARABLE = 0x2,
- _PROFILE_TV = 0x4,
- _PROFILE_IVI = 0x8,
- _PROFILE_COMMON = 0x10,
-} tizen_profile_e;
-
-static tizen_profile_e get_tizen_profile()
-{
- tizen_profile_e profile;
- char *profileName = NULL;
-
- system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
- switch (*profileName) {
- case 't':
- case 'T':
- profile = _PROFILE_TV;
- break;
- case 'm':
- case 'M':
- profile = _PROFILE_MOBILE;
- break;
- default:
- profile = _PROFILE_COMMON;
- }
-
- free(profileName);
- return profile;
-}
-
TouchModule::TouchModule()
{
Aurum::AccessibleWatcher::getInstance();
LOGD("click object = %s", objectId.c_str());
found->getAccessibleNode()->print(1,1);
- if (TIZEN_PROFILE_TV) {
- found->setFocus();
- std::string input_text("Return");
- ret = device->pressKeyCode(input_text, Aurum::KeyRequestType::PRESS);
- LOGD("press ret = %d", ret);
+ found->setFocus();
+ std::string input_text("Return");
+ ret = device->pressKeyCode(input_text, Aurum::KeyRequestType::PRESS);
+ LOGD("press ret = %d", ret);
+
+ ret = device->pressKeyCode(input_text, Aurum::KeyRequestType::RELEASE);
+ LOGD("release ret = %d", ret);
+ LOGD("clicked keyname result = %d", ret);
- ret = device->pressKeyCode(input_text, Aurum::KeyRequestType::RELEASE);
- LOGD("release ret = %d", ret);
- LOGD("clicked keyname result = %d", ret);
- } else {
- found->click();
- ret = true;
- }
return ret;
}
free(ev);
}
+static tizen_profile_e __get_tizen_profile()
+{
+ tizen_profile_e profile;
+ char *profileName = NULL;
+
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+ switch (*profileName) {
+ case 't':
+ case 'T':
+ profile = _PROFILE_TV;
+ break;
+ case 'm':
+ case 'M':
+ profile = _PROFILE_MOBILE;
+ break;
+ default:
+ profile = _PROFILE_COMMON;
+ }
+
+ free(profileName);
+ return profile;
+}
+
EXPORT_API void output_modality_initialize()
{
LOGD("initialize output modality");
int ret = 0;
if (MMI_VOICE_TOUCH_MODE_TOOLTIP == mode) {
- LOGD("voice touch by tooltip");
- std::string objID = std::string(modality.object_id, strlen(modality.object_id));
- ret = g_touch_module->ClickByObjectId(objID);
+ if (TIZEN_PROFILE_TV) {
+ LOGD("voice touch by tooltip in TV");
+ std::string objID = std::string(modality.object_id, strlen(modality.object_id));
+ ret = g_touch_module->ClickByObjectId(objID);
+ }
+ else {
+ LOGD("voice touch by tooltip in others");
+ ret = g_touch_module->ClickByCoordinate(modality.coord_x, modality.coord_y);
+ }
} else if (MMI_VOICE_TOUCH_MODE_GRID == mode) {
LOGD("voice touch by grid");
ret = g_touch_module->ClickByCoordinate(modality.coord_x, modality.coord_y);
#include "mmi-common.h"
#include <tizen.h>
+#include <system_info.h>
+
+typedef enum {
+ _PROFILE_UNKNOWN = 0,
+ _PROFILE_MOBILE = 0x1,
+ _PROFILE_WEARABLE = 0x2,
+ _PROFILE_TV = 0x4,
+ _PROFILE_IVI = 0x8,
+ _PROFILE_COMMON = 0x10,
+} tizen_profile_e;
#ifdef __cplusplus
extern "C" {
#endif
+static tizen_profile_e __get_tizen_profile();
+
+#define TIZEN_PROFILE_TV (__get_tizen_profile() == _PROFILE_TV)
+#define TIZEN_PROFILE_COMMON (__get_tizen_profile() == _PROFILE_COMMON)
+
/**
* @brief Initialize MMI Output Modality Manager
*/