int (*set_value)(void *data);
};
+enum progressbar_time_format {
+ PROG_TIME_FORMAT_FIT, /* eg) 7:17 - default */
+ PROG_TIME_FORMAT_FULL, /* eg) 00:07:17 */
+};
+
struct progressbar *progressbar_create(Evas_Object *base, const char *style);
void progressbar_destroy(struct progressbar *m);
const char *total, const char *progress, const char *separator);
void progressbar_set_ops(struct progressbar *m,
struct progressbar_ops *ops, void *data);
+void progressbar_set_time_format(struct progressbar *m,
+ enum progressbar_time_format fmt);
void progressbar_reset(struct progressbar *m, int position, int duration);
void progressbar_show(struct progressbar *m);
char *part_total;
char *part_progress;
char *str_separator;
+
+ enum progressbar_time_format fmt;
};
static void _update_progress_info(struct progressbar *m, int position)
{
char progress[32] = {0,};
- util_time_string(progress, sizeof(progress), position);
+ util_time_string(progress, sizeof(progress), position, m->fmt);
elm_object_part_text_set(m->base, m->part_progress, progress);
}
char str[32] = {0,};
char total[32] = {0,};
- util_time_string(str, sizeof(str), duration);
+ util_time_string(str, sizeof(str), duration, m->fmt);
snprintf(total, sizeof(total), "%s%s", m->str_separator, str);
elm_object_part_text_set(m->base, m->part_total, total);
_update_time_info(m, position, duration);
}
+void progressbar_set_time_format(struct progressbar *m,
+ enum progressbar_time_format fmt)
+{
+ if (!m) {
+ _ERR("invalid parameter");
+ return;
+ }
+
+ m->fmt = fmt;
+}
+
void progressbar_set_ops(struct progressbar *m,
struct progressbar_ops *ops, void *data)
{
return NULL;
}
+ if (style)
+ elm_object_style_set(obj, style);
+
elm_slider_indicator_show_set(obj, EINA_FALSE);
elm_slider_indicator_show_on_focus_set(obj, EINA_FALSE);
elm_slider_horizontal_set(obj, EINA_TRUE);
elm_slider_step_set(obj, SLIDER_DEFAULT);
- if (style)
- elm_object_style_set(obj, style);
-
/* FIXME: focus disabled */
elm_object_focus_allow_set(obj, EINA_FALSE);
m->base = base;
m->slider = obj;
+ m->fmt = PROG_TIME_FORMAT_FIT;
return m;
}