summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_map_legacy.h
blob: 309b56076b6772c01478d587c14c91b98f9dea9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175

/**
 * @brief Set map's zoom behavior. It can be set to manual or automatic.
 *
 * Default value is #ELM_MAP_ZOOM_MODE_MANUAL.
 *
 * Values <b> don't </b> work as bitmask, only one can be chosen.
 *
 * Valid sizes are 2^zoom, consequently the map may be smaller than the
 * scroller view.
 *
 * See @ref elm_map_zoom_mode_set() See @ref elm_map_zoom_mode_get()
 *
 * @ingroup Elm_Map_Group
 */
typedef enum
{
  ELM_MAP_ZOOM_MODE_MANUAL = 0, /**< Zoom controlled manually by
                                 * elm_map_zoom_set(). It's set by default. */
  ELM_MAP_ZOOM_MODE_AUTO_FIT, /**< Zoom until map fits inside the scroll frame
                               * with no pixels outside this area. */
  ELM_MAP_ZOOM_MODE_AUTO_FILL, /**< Zoom until map fills scroll, ensuring no
                                * pixels are left unfilled. */
  ELM_MAP_ZOOM_MODE_LAST /**< Sentinel value to indicate last enum field during
                          * iteration */
} Elm_Map_Zoom_Mode;

/**
 * Add a new map widget to the given parent Elementary (container) object.
 *
 * @param parent The parent object.
 * @return a new map widget handle or @c NULL, on errors.
 *
 * This function inserts a new map widget on the canvas.
 *
 * @ingroup Elm_Map_Group
 */
EAPI Evas_Object          *elm_map_add(Evas_Object *parent);


/**
 * @brief Set the zoom level of the map.
 *
 * This sets the zoom level.
 *
 * It will respect limits defined by @ref elm_map_zoom_min_set and
 * @ref elm_map_zoom_max_set.
 *
 * By default these values are 0 (world map) and 18 (maximum zoom).
 *
 * This function should be used when zoom mode is set to
 * #ELM_MAP_ZOOM_MODE_MANUAL. This is the default mode, and can be set with
 * @ref elm_map_zoom_mode_set.
 *
 * @param[in] obj The object.
 * @param[in] zoom The zoom level.
 *
 * @ingroup Elm_Map_Group
 */
EAPI void elm_map_zoom_set(Evas_Object *obj, int zoom);

/**
 * @brief Get the zoom level of the map.
 *
 * This returns the current zoom level of the map object.
 *
 * Note that if you set the fill mode to other than #ELM_MAP_ZOOM_MODE_MANUAL
 * (which is the default), the zoom level may be changed at any time by the map
 * object itself to account for map size and map viewport size.
 *
 * @param[in] obj The object.
 *
 * @return The zoom level.
 *
 * @ingroup Elm_Map_Group
 */
EAPI int elm_map_zoom_get(const Evas_Object *obj);


/**
 * @brief Set the zoom mode used by the map object.
 *
 * This sets the zoom mode to manual or one of the automatic levels. Manual
 * (#ELM_MAP_ZOOM_MODE_MANUAL) means that zoom is set manually by
 * @ref elm_map_zoom_mode_set and will stay at that level until changed by code
 * or until zoom mode is changed. This is the default mode.
 *
 * The Automatic modes will allow the map object to automatically adjust zoom
 * mode based on properties. #ELM_MAP_ZOOM_MODE_AUTO_FIT will adjust zoom so
 * the map fits inside the scroll frame with no pixels outside this area.
 * #ELM_MAP_ZOOM_MODE_AUTO_FILL will be similar but ensure no pixels within the
 * frame are left unfilled. Do not forget that the valid sizes are 2^zoom,
 * consequently the map may be smaller than the scroller view.
 *
 * @param[in] obj The object.
 * @param[in] mode The zoom mode of the map, being it one of
 * #ELM_MAP_ZOOM_MODE_MANUAL (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT, or
 * #ELM_MAP_ZOOM_MODE_AUTO_FILL.
 *
 * @ingroup Elm_Map_Group
 */
EAPI void elm_map_zoom_mode_set(Evas_Object *obj, Elm_Map_Zoom_Mode mode);

/**
 * @brief Get the zoom mode used by the map object.
 *
 * This function returns the current zoom mode used by the ma object.
 *
 * @param[in] obj The object.
 *
 * @return The zoom mode of the map, being it one of #ELM_MAP_ZOOM_MODE_MANUAL
 * (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT, or #ELM_MAP_ZOOM_MODE_AUTO_FILL.
 *
 * @ingroup Elm_Map_Group
 */
EAPI Elm_Map_Zoom_Mode elm_map_zoom_mode_get(const Evas_Object *obj);

/**
 * @brief Enable or disable mouse wheel to be used to zoom in / out the map.
 *
 * Wheel is enabled by default.
 *
 * @param[in] obj The object.
 * @param[in] disabled Use @c true to disable mouse wheel or @c false to enable
 * it.
 *
 * @ingroup Elm_Map_Group
 */
EAPI void elm_map_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled);

/**
 * @brief Get a value whether mouse wheel is enabled or not.
 *
 * Mouse wheel can be used for the user to zoom in or zoom out the map.
 *
 * @param[in] obj The object.
 *
 * @return Use @c true to disable mouse wheel or @c false to enable it.
 *
 * @ingroup Elm_Map_Group
 */
EAPI Eina_Bool elm_map_wheel_disabled_get(const Evas_Object *obj);

/**
 * @brief Pause or unpause the map.
 *
 * This sets the paused state to on @c true or off @c false for map.
 *
 * The default is off.
 *
 * This will stop zooming using animation, changing zoom levels will change
 * instantly. This will stop any existing animations that are running.
 *
 * @param[in] obj The object.
 * @param[in] paused Use @c true to pause the map @c obj or @c false to unpause
 * it.
 *
 * @ingroup Elm_Map_Group
 */
EAPI void elm_map_paused_set(Evas_Object *obj, Eina_Bool paused);

/**
 * @brief Get a value whether map is paused or not.
 *
 * This gets the current paused state for the map object.
 *
 * @param[in] obj The object.
 *
 * @return Use @c true to pause the map @c obj or @c false to unpause it.
 *
 * @ingroup Elm_Map_Group
 */
EAPI Eina_Bool elm_map_paused_get(const Evas_Object *obj);

#include "elm_map_eo.legacy.h"