elm_conform : Add elm_conformant_input_area_disabled_set/get APIs
authorWoochanlee <wc0917.lee@samsung.com>
Thu, 12 Mar 2020 07:33:03 +0000 (16:33 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 17 Mar 2020 21:41:44 +0000 (06:41 +0900)
Applications in certain environments do not want to resize the conformant due to the input area.
For example, in an app where a round image is set as the background above the contour,
the image may look broken when the conformation is resized.

@tizen_feature

Change-Id: I731abbc6eb4769ad965eaba37b6d2518fe760df6

src/lib/elementary/elm_conform.c
src/lib/elementary/elm_conform_legacy.h
src/lib/elementary/elm_widget_conform.h

index 549dd26..aa034fa 100644 (file)
@@ -1665,6 +1665,37 @@ elm_conformant_add(Evas_Object *parent)
    return elm_legacy_add(MY_CLASS, parent);
 }
 
+// TIZEN_ONLY(20200311): Add conformant resize disable API.
+EAPI void
+elm_conformant_input_area_resize_disabled_set(Evas_Object *obj, Eina_Bool disabled)
+{
+   ELM_CONFORMANT_DATA_GET_OR_RETURN(obj, sd);
+
+   if (sd->input_area_resize_disabled == disabled) return;
+
+   if (disabled)
+     {
+        elm_object_signal_emit(obj, "elm,state,virtualkeypad,disable", "");
+        elm_object_signal_emit(obj, "elm,state,clipboard,disable", "");
+     }
+   else
+     {
+        elm_object_signal_emit(obj, "elm,state,virtualkeypad,enable", "");
+        elm_object_signal_emit(obj, "elm,state,clipboard,enable", "");
+     }
+
+   sd->input_area_resize_disabled = disabled;
+}
+
+EAPI Eina_Bool
+elm_conformant_input_area_resize_disabled_get(Evas_Object *obj)
+{
+   ELM_CONFORMANT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+
+   return sd->input_area_resize_disabled;
+}
+//
+
 EOLIAN static Eo *
 _elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *sd)
 {
@@ -1705,6 +1736,10 @@ _elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *sd)
    sd->rot = elm_win_rotation_get(sd->win);
    evas_object_data_set(sd->win, "\377 elm,conformant", obj);
 
+   // TIZEN_ONLY(20200311): Add conformant resize disable API.
+   sd->input_area_resize_disabled = EINA_FALSE;
+   //
+
    efl_event_callback_add(sd->win, EFL_UI_WIN_EVENT_INDICATOR_PROP_CHANGED, _on_indicator_mode_changed, obj);
    efl_event_callback_add(sd->win, EFL_UI_WIN_EVENT_WIN_ROTATION_CHANGED, _on_rotation_changed, obj);
    // TIZEN_ONLY(20150707): implemented elm_win_conformant_set/get for wayland
index b237b2d..68c26fc 100644 (file)
  */
 EAPI Evas_Object                 *elm_conformant_add(Evas_Object *parent);
 
+// TIZEN_ONLY(20200311): Add conformant resize disable API.
+/**
+ * @brief Disables conformant input area resize.
+ *
+ * The conformant resizes when an input area such as a keypad is launched to rebuild the internal layout.
+ * This API prevent conformant resize when the input state changed.
+ *
+ * @param obj The elm_conformant object.
+ * @param disable true disable conformant resize, otherwise false.
+ *
+ * @ingroup Elm_Conformant
+ * @see elm_conformant_input_area_resize_disabled_get()
+ */
+EAPI void                         elm_conformant_input_area_resize_disabled_set(Evas_Object *obj, Eina_Bool disable);
+
+/**
+ * @brief Gets the conformant input area resize disabled or not.
+ *
+ * @param obj The elm_conformant object.
+ *
+ * @return true confomant resize disabled, otherwise false.
+ *
+ * @ingroup Elm_Conformant
+ * @see elm_conformant_input_area_resize_disabled_set()
+ */
+EAPI Eina_Bool                    elm_conformant_input_area_resize_disabled_get(Evas_Object *obj);
+//
+
 // TIZEN_ONLY(20160218): Improve launching performance.
 /**
  * @internal
index 86bcd8d..fd9fcc9 100644 (file)
@@ -66,6 +66,10 @@ struct _Elm_Conformant_Data
    Evas_Object                   *indicator;
    Ecore_Timer                   *indi_timer;
    //END
+
+   //TIZEN_ONLY(20200311): Add conformant resize disable API.
+   Eina_Bool                      input_area_resize_disabled : 1;
+   //END
 };
 
 /* Enum to identify conformant swallow parts */