diff --git a/src/core/gcal-context.c b/src/core/gcal-context.c index 9e4fd5d8..f20821b4 100644 --- a/src/core/gcal-context.c +++ b/src/core/gcal-context.c @@ -509,6 +509,29 @@ gcal_context_get_time_format (GcalContext *self) return self->time_format; } +/** + * gcal_context_get_week_start_day: + * @self: a #GcalContext instance + * + * Retrieves the current value of "week-start-day" desktop setting. + * Note that this value is synced with the source setting through + * the appropriate portal and if you want to be notified of changes + * you should register a callback on #GcalContext:week-start-day property. + * + * When the desktop setting is set to 'G_DESKTOP_WEEKDAY_DEFAULT' + * we fall back to 'get_first_weekday_iso()' function from 'gcal-utils.h' + * to find the actual day of the week from current locale. + * + * Returns: the currently set #GDesktopWeekday value + */ +GDesktopWeekday +gcal_context_get_week_start_day (GcalContext *self) +{ + g_return_val_if_fail (GCAL_IS_CONTEXT (self), get_first_weekday ()); + + return self->week_start_day; +} + /** * gcal_context_get_timezone: * diff --git a/src/core/gcal-context.h b/src/core/gcal-context.h index c88d7e7e..c6c73d6a 100644 --- a/src/core/gcal-context.h +++ b/src/core/gcal-context.h @@ -24,6 +24,7 @@ #include "gcal-enums.h" #include "gcal-manager.h" #include "gcal-search-engine.h" +#include "gdesktop-enums.h" #include "weather/gcal-weather-service.h" #include @@ -45,6 +46,8 @@ GSettings* gcal_context_get_settings (GcalContext GcalTimeFormat gcal_context_get_time_format (GcalContext *self); +GDesktopWeekday gcal_context_get_week_start_day (GcalContext *self); + GTimeZone* gcal_context_get_timezone (GcalContext *self); GcalWeatherService* gcal_context_get_weather_service (GcalContext *self);