UI Voice layout type removed, changed to view type 16/122216/2
authorRadek Kintop <r.kintop@samsung.com>
Thu, 30 Mar 2017 13:47:00 +0000 (15:47 +0200)
committerRadek Kintop <r.kintop@samsung.com>
Mon, 3 Apr 2017 09:03:27 +0000 (11:03 +0200)
Change-Id: I8385342a6a955e4e06165f7b4a57db78116a9c64
Signed-off-by: Radek Kintop <r.kintop@samsung.com>
CMakeLists.txt
include/define.h
include/grid/grid_sound.h [deleted file]
include/view/system/view_voice_control.h [moved from include/layout/voice.h with 73% similarity]
res/settings-theme.edc
res/settings.edc
src/grid/grid_sound.c [deleted file]
src/layout/layout_voice.c [deleted file]
src/view/system/view_voice_control.c [new file with mode: 0644]

index 9a6c7d8..00237ed 100755 (executable)
@@ -81,12 +81,10 @@ SET(SRCS
        src/data/system/data_wired.c
        src/data/system/data_wireless.c
        src/data/system/settings_voice_control.c
-       src/grid/grid_sound.c
        src/grid/grid_wireless.c
        src/layout/layout_network.c
        src/layout/layout_picture.c
        src/layout/layout_system.c
-       src/layout/layout_voice.c
        src/view/common/view_generic_popup.c
        src/view/picture/view_picture_slider_generic.c
        src/view/picture/view_picture_contrast.c
@@ -94,6 +92,7 @@ SET(SRCS
        src/view/picture/view_picture_color.c
        src/view/picture/view_picture_tint.c
        src/view/system/view_clock.c
+       src/view/system/view_voice_control.c
        src/view/system/view_language.c
        src/view/system/view_reset.c
        src/view/view_base.c
index f1592d7..2a98ef4 100644 (file)
@@ -37,7 +37,6 @@
 #define LAYOUT_ID_PICTURE "LAYOUT_ID_PICTURE"
 #define LAYOUT_ID_NETWORK "LAYOUT_ID_NETWORK"
 #define LAYOUT_ID_SYSTEM "LAYOUT_ID_SYSTEM"
-#define LAYOUT_ID_VOICE "LAYOUT_ID_VOICE"
 
 /* Group for EDC */
 #define GRP_VIEW_BASE "grp.view.base"
diff --git a/include/grid/grid_sound.h b/include/grid/grid_sound.h
deleted file mode 100644 (file)
index eaba8ec..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#ifndef __AIR_SETTINGS_GRID_SOUND_H__
-#define __AIR_SETTINGS_GRID_SOUND_H__
-
-#include <stdbool.h>
-
-/**
-* @brief Sound grid item's data.
-*/
-struct sound_item_s {
-       char *label;    /**< item's label */
-       int id;         /**< item's ID */
-       bool selected;  /**< item's selected state  */
-};
-
-/**
-* @brief Get the pointer to the grid_class object of sound grid.
-*
-* @return The pointer to sound grid_class object.
-*/
-struct grid_class *get_sound_grid_class(void);
-
-#endif /* __AIR_SETTINGS_GRID_SOUND_H__ */
similarity index 73%
rename from include/layout/voice.h
rename to include/view/system/view_voice_control.h
index ae0dec5..7391c33 100644 (file)
  * limitations under the License.
  */
 
-#ifndef __AIR_SETTINGS_LAYOUT_VOICE_H__
-#define __AIR_SETTINGS_LAYOUT_VOICE_H__
+#ifndef INCLUDE_VIEW_SYSTEM_VIEW_VOICE_CONTROL_H_
+#define INCLUDE_VIEW_SYSTEM_VIEW_VOICE_CONTROL_H_
 
-/* group */
-#define GRP_LAYOUT_VOICE "grp.layout.voice"
+#include "common/viewmgr.h"
 
-/* part */
-#define PART_VOICE "part.voice"
+view_class *view_voice_control_get_vclass(void);
 
-#endif
+
+#endif /* INCLUDE_VIEW_SYSTEM_VIEW_VOICE_CONTROL_H_ */
index 9ed05ad..5254e80 100644 (file)
@@ -18,7 +18,6 @@
 #include "../include/layout/network.h"
 #include "../include/layout/picture.h"
 #include "../include/layout/system.h"
-#include "../include/layout/voice.h"
 
 collections {
        base_scale: APP_BASE_SCALE;
index 375a6ca..347e8c5 100644 (file)
@@ -18,7 +18,6 @@
 #include "../include/layout/network.h"
 #include "../include/layout/picture.h"
 #include "../include/layout/system.h"
-#include "../include/layout/voice.h"
 
 /*
  * EDC DEBUG
diff --git a/src/grid/grid_sound.c b/src/grid/grid_sound.c
deleted file mode 100644 (file)
index ab73264..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#include "grid/grid_sound.h"
-
-#include <Elementary.h>
-
-#include "common/gridmgr.h"
-#include "app_debug.h"
-#include "define.h"
-
-#define SOUND_LIST_ITEM_X (222 + 16)
-#define SOUND_LIST_ITEM_Y (40 + 16)
-
-static char *_text_get_cb(void *data, Evas_Object *obj, const char *part);
-static Eina_Bool _state_get_cb(void *data, Evas_Object *obj, const char *part);
-
-static struct grid_class _gclass = {
-       .item_style = STYLE_GRID_DEFAULT,
-       .item_width = SOUND_LIST_ITEM_X,
-       .item_height = SOUND_LIST_ITEM_Y,
-       .text_get = _text_get_cb,
-       .state_get = _state_get_cb,
-       .del = NULL,
-};
-
-struct grid_class *get_sound_grid_class(void)
-{
-       return &_gclass;
-}
-
-static char *_text_get_cb(void *data, Evas_Object *obj, const char *part)
-{
-       struct sound_item_s *s_info = (struct sound_item_s *)data;
-
-       if (!s_info || !s_info->label) {
-               _ERR("Get data failed.");
-               return NULL;
-       }
-
-       return strdup(s_info->label);
-}
-
-static Eina_Bool _state_get_cb(void *data, Evas_Object *obj, const char *part)
-{
-       struct sound_item_s *s_info = (struct sound_item_s *)data;
-
-       if (!s_info) {
-               _ERR("Get data failed.");
-               return EINA_FALSE;
-       }
-
-       return s_info->selected;
-}
diff --git a/src/layout/layout_voice.c b/src/layout/layout_voice.c
deleted file mode 100644 (file)
index aba199c..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#include <Elementary.h>
-
-#include "app_debug.h"
-#include "common/inputmgr.h"
-#include "common/layoutmgr.h"
-#include "common/menumgr.h"
-#include "common/viewmgr.h"
-#include "common/utils.h"
-#include "define.h"
-#include "layout.h"
-#include "layout/voice.h"
-
-#define PADDING_X 26
-#define PADDING_Y 26
-
-struct _priv {
-       Evas_Object *base;
-       Evas_Object *ly;
-       Evas_Object *table;
-       layoutmgr *lmgr;
-       struct menumgr *menu;
-};
-
-enum {
-       MENU_VOICE_CONTROL,
-       MENU_VOICE_LANGUAGE,
-       MENU_TTS_SPEED,
-       MENU_TTS_LANGUAGE
-};
-
-static void _selected(void *data, int id);
-static char *_get_status(void *data, int id);
-
-static struct menumgr_info menu_info[] = {
-       {
-               .id = MENU_VOICE_CONTROL,
-               .title = "Voice control",
-               .style = STYLE_STATUS_BTN,
-               .disabled = EINA_TRUE,
-               .status = _get_status,
-               .selected = _selected,
-               .progress_value = NULL,
-               .progress_evas = NULL,
-               .update_cb = NULL,
-       },
-       {
-               .id = MENU_VOICE_LANGUAGE,
-               .title = "Voice language",
-               .style = STYLE_STATUS_BTN,
-               .disabled = EINA_TRUE,
-               .status = _get_status,
-               .selected = _selected,
-               .progress_value = NULL,
-               .progress_evas = NULL,
-               .update_cb = NULL,
-       },
-       {
-               .id = MENU_TTS_SPEED,
-               .title = "TTS speed",
-               .style = STYLE_STATUS_BTN,
-               .disabled = EINA_TRUE,
-               .status = _get_status,
-               .selected = _selected,
-               .progress_value = NULL,
-               .progress_evas = NULL,
-               .update_cb = NULL,
-       },
-       {
-               .id = MENU_TTS_LANGUAGE,
-               .title = "TTS language",
-               .style = STYLE_STATUS_BTN,
-               .disabled = EINA_TRUE,
-               .status = _get_status,
-               .selected = _selected,
-               .progress_value = NULL,
-               .progress_evas = NULL,
-               .update_cb = NULL,
-       },
-};
-
-static char *_get_status(void *data, int id)
-{
-       return NULL;
-}
-
-static void _selected(void *data, int id)
-{
-}
-
-static bool _add_layout_contents(struct _priv *priv)
-{
-       Evas_Object *table;
-       struct menumgr *menu;
-
-       table = utils_add_table(priv->ly, PADDING_X, PADDING_Y);
-       if (!table) {
-               _ERR("failed to add table");
-               return false;
-       }
-
-       priv->table = table;
-
-       elm_object_part_content_set(priv->ly, PART_VOICE, table);
-
-       menu = menumgr_create(table, NULL, menu_info, ARRAY_SIZE(menu_info), priv);
-       if (!menu) {
-               _ERR("failed to create menu manager");
-               evas_object_del(table);
-               return false;
-       }
-
-       priv->menu = menu;
-
-       return true;
-}
-
-static bool _create(layoutmgr *lmgr, void *data)
-{
-       struct _priv *priv;
-       Evas_Object *base, *ly;
-
-       if (!lmgr) {
-               _ERR("Invalid argument.");
-               return false;
-       }
-
-       base = layoutmgr_get_base(lmgr);
-       if (!base) {
-               _ERR("Get base layout failed.");
-               return false;
-       }
-
-       ly = utils_add_layout(base, GRP_LAYOUT_VOICE, EINA_FALSE);
-       if (!ly) {
-               _ERR("Add layout failed.");
-               return false;
-       }
-
-       priv = calloc(1, sizeof(*priv));
-       if (!priv) {
-               _ERR("Calloc failed.");
-               evas_object_del(ly);
-               return false;
-       }
-
-       priv->lmgr = lmgr;
-       priv->base = base;
-       priv->ly = ly;
-
-       if (!_add_layout_contents(priv)) {
-               _ERR("Add layout contents failed.");
-               evas_object_del(ly);
-               free(priv);
-               return false;
-       }
-
-       layoutmgr_set_layout_data(lmgr, LAYOUT_ID_VOICE, priv);
-
-       return true;
-}
-
-static void _show(void *layout_data)
-{
-       struct _priv *priv;
-
-       if (!layout_data) {
-               _ERR("Invalid argument.");
-               return;
-       }
-
-       priv = layout_data;
-
-       if (priv->ly) {
-               menumgr_update(priv->menu);
-
-               evas_object_show(priv->ly);
-               elm_object_part_content_set(priv->base, PART_CONTENT, priv->ly);
-       }
-}
-
-static void _hide(void *layout_data)
-{
-       struct _priv *priv;
-
-       if (!layout_data) {
-               _ERR("Invalid argument.");
-               return;
-       }
-
-       priv = layout_data;
-
-       if (priv->ly) {
-               evas_object_hide(priv->ly);
-               elm_object_part_content_unset(priv->base, PART_CONTENT);
-       }
-}
-
-static void _destroy(void *layout_data)
-{
-       struct _priv *priv;
-
-       if (!layout_data) {
-               _ERR("Invalid argument.");
-               return;
-       }
-
-       priv = layout_data;
-
-       menumgr_destroy(priv->menu);
-
-       evas_object_del(priv->ly);
-
-       free(priv);
-}
-
-static void _update(void *layout_data, int update_type, void *data)
-{
-       struct _priv *priv = (struct _priv *)layout_data;
-
-       if (!priv) {
-               _ERR("Invalid argument.");
-               return;
-       }
-
-       switch (update_type) {
-               case UPDATE_DISABLE:
-                       elm_object_disabled_set(priv->ly, EINA_TRUE);
-                       break;
-               case UPDATE_ENABLE:
-                       elm_object_disabled_set(priv->ly, EINA_FALSE);
-                       break;
-               case UPDATE_CONTENT:
-                       menumgr_update(priv->menu);
-                       break;
-               default:
-                       break;
-       }
-}
-
-static layout_class _lclass = {
-       .layout_id = LAYOUT_ID_VOICE,
-       .create = _create,
-       .show = _show,
-       .hide = _hide,
-       .destroy = _destroy,
-       .update = _update
-};
-
-/* TODO: needed in temporary disabled component
-layout_class *layout_voice_get_lclass(void)
-{
-       return &_lclass;
-}
-*/
diff --git a/src/view/system/view_voice_control.c b/src/view/system/view_voice_control.c
new file mode 100644 (file)
index 0000000..1c69527
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <Elementary.h>
+#include "app_debug.h"
+#include "define.h"
+#include "view/system/view_voice_control.h"
+
+typedef struct {
+       Evas_Object *base;
+} private_data;
+
+static Evas_Object *_create(Evas_Object *win, void *data);
+static void _show(void *data);
+static void _hide(void *data);
+static void _destroy(void *data);
+
+static view_class _vclass = {
+       .view_id = VIEW_VOICE_CONTROL,
+       .create = _create,
+       .show = _show,
+       .hide = _hide,
+       .destroy = _destroy
+};
+
+view_class *view_voice_control_get_vclass(void)
+{
+       return &_vclass;
+}
+
+static Evas_Object *_create(Evas_Object *win, void *data)
+{
+       private_data *priv = NULL;
+
+       priv = calloc(1, sizeof(private_data));
+       if (!priv) {
+               _ERR("Mem alloc error");
+               abort();
+               return NULL;
+       }
+
+       if (!viewmgr_set_view_data(VIEW_VOICE_CONTROL, priv)) {
+               _ERR("Set view data failed.");
+               evas_object_del(priv->base);
+               free(priv);
+               return NULL;
+       }
+
+       return priv->base;
+}
+
+static void _show(void *data)
+{
+       private_data *priv = data;
+       if (!priv) {
+               _ERR("!priv");
+               return;
+       }
+}
+
+static void _hide(void *data)
+{
+       private_data *priv = data;
+
+       if (!priv) {
+               _ERR("!priv");
+               return;
+       }
+
+}
+
+static void _destroy(void *data)
+{
+       private_data *priv = data;
+
+       if (!priv) {
+               _ERR("!priv");
+               return;
+       }
+}