summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_web_legacy.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/elm_web_legacy.h')
-rw-r--r--src/lib/elementary/elm_web_legacy.h81
1 files changed, 80 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_web_legacy.h b/src/lib/elementary/elm_web_legacy.h
index ff4cf09905..29588eded5 100644
--- a/src/lib/elementary/elm_web_legacy.h
+++ b/src/lib/elementary/elm_web_legacy.h
@@ -1,3 +1,17 @@
+/** Types of zoom available.
+ *
+ * @ingroup Elm_Web
+ */
+typedef enum
+{
+ ELM_WEB_ZOOM_MODE_MANUAL = 0, /**< Zoom controlled normally by
+ * elm_web_zoom_set */
+ ELM_WEB_ZOOM_MODE_AUTO_FIT, /**< Zoom until content fits in web object */
+ ELM_WEB_ZOOM_MODE_AUTO_FILL, /**< Zoom until content fills web object */
+ ELM_WEB_ZOOM_MODE_LAST /**< Sentinel value to indicate last enum field during
+ * iteration */
+} Elm_Web_Zoom_Mode;
+
/**
* Add a new web object to the parent.
*
@@ -47,4 +61,69 @@ EINA_DEPRECATED EAPI Eina_Bool elm_web_uri_set(Evas_Object *obj, const c
*/
EINA_DEPRECATED EAPI const char *elm_web_uri_get(const Evas_Object *obj);
-#include "elm_web.eo.legacy.h" \ No newline at end of file
+
+/**
+ * @brief Sets the zoom mode to use.
+ *
+ * The modes can be any of those defined in .Elm_Web_Zoom_Mode, except
+ * .ELM_WEB_ZOOM_MODE_LAST. The default is .ELM_WEB_ZOOM_MODE_MANUAL.
+ *
+ * .ELM_WEB_ZOOM_MODE_MANUAL means the zoom level will be controlled with the
+ * @ref elm_web_zoom_set function.
+ *
+ * .ELM_WEB_ZOOM_MODE_AUTO_FIT will calculate the needed zoom level to make
+ * sure the entirety of the web object's contents are shown.
+ *
+ * .ELM_WEB_ZOOM_MODE_AUTO_FILL will calculate the needed zoom level to fit the
+ * contents in the web object's size, without leaving any space unused.
+ *
+ * @param[in] obj The object.
+ * @param[in] mode The mode to set.
+ *
+ * @ingroup Elm_Web
+ */
+EAPI void elm_web_zoom_mode_set(Evas_Object *obj, Elm_Web_Zoom_Mode mode);
+
+/**
+ * @brief Get the currently set zoom mode.
+ *
+ * @param[in] obj The object.
+ *
+ * @return The mode to set.
+ *
+ * @ingroup Elm_Web
+ */
+EAPI Elm_Web_Zoom_Mode elm_web_zoom_mode_get(const Evas_Object *obj);
+
+/**
+ * @brief Sets the zoom level of the web object.
+ *
+ * Zoom level matches the Webkit API, so 1.0 means normal zoom, with higher
+ * values meaning zoom in and lower meaning zoom out. This function will only
+ * affect the zoom level if the mode set with @ref elm_web_zoom_mode_set is
+ * .ELM_WEB_ZOOM_MODE_MANUAL.
+ *
+ * @param[in] obj The object.
+ * @param[in] zoom The zoom level to set.
+ *
+ * @ingroup Elm_Web
+ */
+EAPI void elm_web_zoom_set(Evas_Object *obj, double zoom);
+
+/**
+ * @brief Get the current zoom level set on the web object
+ *
+ * Note that this is the zoom level set on the web object and not that of the
+ * underlying Webkit one. In the .ELM_WEB_ZOOM_MODE_MANUAL mode, the two zoom
+ * levels should match, but for the other two modes the Webkit zoom is
+ * calculated internally to match the chosen mode without changing the zoom
+ * level set for the web object.
+ *
+ * @param[in] obj The object.
+ *
+ * @return The zoom level to set.
+ *
+ * @ingroup Elm_Web
+ */
+EAPI double elm_web_zoom_get(const Evas_Object *obj);
+#include "elm_web.eo.legacy.h"