1 
2 /**
3  * @brief Set map's zoom behavior. It can be set to manual or automatic.
4  *
5  * Default value is #ELM_MAP_ZOOM_MODE_MANUAL.
6  *
7  * Values <b> don't </b> work as bitmask, only one can be chosen.
8  *
9  * Valid sizes are 2^zoom, consequently the map may be smaller than the
10  * scroller view.
11  *
12  * See @ref elm_map_zoom_mode_set() See @ref elm_map_zoom_mode_get()
13  *
14  * @ingroup Elm_Map_Group
15  */
16 typedef enum
17 {
18   ELM_MAP_ZOOM_MODE_MANUAL = 0, /**< Zoom controlled manually by
19                                  * elm_map_zoom_set(). It's set by default. */
20   ELM_MAP_ZOOM_MODE_AUTO_FIT, /**< Zoom until map fits inside the scroll frame
21                                * with no pixels outside this area. */
22   ELM_MAP_ZOOM_MODE_AUTO_FILL, /**< Zoom until map fills scroll, ensuring no
23                                 * pixels are left unfilled. */
24   ELM_MAP_ZOOM_MODE_LAST /**< Sentinel value to indicate last enum field during
25                           * iteration */
26 } Elm_Map_Zoom_Mode;
27 
28 /**
29  * Add a new map widget to the given parent Elementary (container) object.
30  *
31  * @param parent The parent object.
32  * @return a new map widget handle or @c NULL, on errors.
33  *
34  * This function inserts a new map widget on the canvas.
35  *
36  * @ingroup Elm_Map_Group
37  */
38 EAPI Evas_Object          *elm_map_add(Evas_Object *parent);
39 
40 
41 /**
42  * @brief Set the zoom level of the map.
43  *
44  * This sets the zoom level.
45  *
46  * It will respect limits defined by @ref elm_map_zoom_min_set and
47  * @ref elm_map_zoom_max_set.
48  *
49  * By default these values are 0 (world map) and 18 (maximum zoom).
50  *
51  * This function should be used when zoom mode is set to
52  * #ELM_MAP_ZOOM_MODE_MANUAL. This is the default mode, and can be set with
53  * @ref elm_map_zoom_mode_set.
54  *
55  * @param[in] obj The object.
56  * @param[in] zoom The zoom level.
57  *
58  * @ingroup Elm_Map_Group
59  */
60 EAPI void elm_map_zoom_set(Evas_Object *obj, int zoom);
61 
62 /**
63  * @brief Get the zoom level of the map.
64  *
65  * This returns the current zoom level of the map object.
66  *
67  * Note that if you set the fill mode to other than #ELM_MAP_ZOOM_MODE_MANUAL
68  * (which is the default), the zoom level may be changed at any time by the map
69  * object itself to account for map size and map viewport size.
70  *
71  * @param[in] obj The object.
72  *
73  * @return The zoom level.
74  *
75  * @ingroup Elm_Map_Group
76  */
77 EAPI int elm_map_zoom_get(const Evas_Object *obj);
78 
79 
80 /**
81  * @brief Set the zoom mode used by the map object.
82  *
83  * This sets the zoom mode to manual or one of the automatic levels. Manual
84  * (#ELM_MAP_ZOOM_MODE_MANUAL) means that zoom is set manually by
85  * @ref elm_map_zoom_mode_set and will stay at that level until changed by code
86  * or until zoom mode is changed. This is the default mode.
87  *
88  * The Automatic modes will allow the map object to automatically adjust zoom
89  * mode based on properties. #ELM_MAP_ZOOM_MODE_AUTO_FIT will adjust zoom so
90  * the map fits inside the scroll frame with no pixels outside this area.
91  * #ELM_MAP_ZOOM_MODE_AUTO_FILL will be similar but ensure no pixels within the
92  * frame are left unfilled. Do not forget that the valid sizes are 2^zoom,
93  * consequently the map may be smaller than the scroller view.
94  *
95  * @param[in] obj The object.
96  * @param[in] mode The zoom mode of the map, being it one of
97  * #ELM_MAP_ZOOM_MODE_MANUAL (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT, or
98  * #ELM_MAP_ZOOM_MODE_AUTO_FILL.
99  *
100  * @ingroup Elm_Map_Group
101  */
102 EAPI void elm_map_zoom_mode_set(Evas_Object *obj, Elm_Map_Zoom_Mode mode);
103 
104 /**
105  * @brief Get the zoom mode used by the map object.
106  *
107  * This function returns the current zoom mode used by the ma object.
108  *
109  * @param[in] obj The object.
110  *
111  * @return The zoom mode of the map, being it one of #ELM_MAP_ZOOM_MODE_MANUAL
112  * (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT, or #ELM_MAP_ZOOM_MODE_AUTO_FILL.
113  *
114  * @ingroup Elm_Map_Group
115  */
116 EAPI Elm_Map_Zoom_Mode elm_map_zoom_mode_get(const Evas_Object *obj);
117 
118 /**
119  * @brief Enable or disable mouse wheel to be used to zoom in / out the map.
120  *
121  * Wheel is enabled by default.
122  *
123  * @param[in] obj The object.
124  * @param[in] disabled Use @c true to disable mouse wheel or @c false to enable
125  * it.
126  *
127  * @ingroup Elm_Map_Group
128  */
129 EAPI void elm_map_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled);
130 
131 /**
132  * @brief Get a value whether mouse wheel is enabled or not.
133  *
134  * Mouse wheel can be used for the user to zoom in or zoom out the map.
135  *
136  * @param[in] obj The object.
137  *
138  * @return Use @c true to disable mouse wheel or @c false to enable it.
139  *
140  * @ingroup Elm_Map_Group
141  */
142 EAPI Eina_Bool elm_map_wheel_disabled_get(const Evas_Object *obj);
143 
144 /**
145  * @brief Pause or unpause the map.
146  *
147  * This sets the paused state to on @c true or off @c false for map.
148  *
149  * The default is off.
150  *
151  * This will stop zooming using animation, changing zoom levels will change
152  * instantly. This will stop any existing animations that are running.
153  *
154  * @param[in] obj The object.
155  * @param[in] paused Use @c true to pause the map @c obj or @c false to unpause
156  * it.
157  *
158  * @ingroup Elm_Map_Group
159  */
160 EAPI void elm_map_paused_set(Evas_Object *obj, Eina_Bool paused);
161 
162 /**
163  * @brief Get a value whether map is paused or not.
164  *
165  * This gets the current paused state for the map object.
166  *
167  * @param[in] obj The object.
168  *
169  * @return Use @c true to pause the map @c obj or @c false to unpause it.
170  *
171  * @ingroup Elm_Map_Group
172  */
173 EAPI Eina_Bool elm_map_paused_get(const Evas_Object *obj);
174 
175 #include "elm_map_eo.legacy.h"
176