#ifndef ASH_SYSTEM_FOCUS_MODE_FOCUS_MODE_UTIL_H_
#define ASH_SYSTEM_FOCUS_MODE_FOCUS_MODE_UTIL_H_
#include <string>
#include "ash/ash_export.h"
#include "base/time/time.h"
#include "google_apis/common/api_error_codes.h"
#include "ui/gfx/image/image_skia.h"
namespace ash {
class SystemTextfield;
namespace focus_mode_util {
enum class SoundState {
kNone,
kSelected,
kPaused,
kPlaying,
};
enum class SoundType {
kNone = 0,
kSoundscape = 1,
kYouTubeMusic = 2,
};
struct ASH_EXPORT SelectedPlaylist {
SelectedPlaylist();
SelectedPlaylist(const SelectedPlaylist& other);
SelectedPlaylist& operator=(const SelectedPlaylist& other);
~SelectedPlaylist();
bool empty() const { return id.empty(); }
std::string id;
std::string title;
gfx::ImageSkia thumbnail;
focus_mode_util::SoundType type = focus_mode_util::SoundType::kNone;
focus_mode_util::SoundState state = focus_mode_util::SoundState::kNone;
uint8_t list_position = 0;
};
inline constexpr char kFocusModeSoundsEnabled[] = "enabled";
inline constexpr char kFocusSoundsOnly[] = "focus-sounds";
inline constexpr char kFocusModeSoundsDisabled[] = "disabled";
constexpr std::string_view kTaskListIdKey = "taskListId";
constexpr std::string_view kTaskIdKey = "taskId";
constexpr std::string_view kSoundTypeKey = "SoundType";
constexpr std::string_view kPlaylistIdKey = "playlistId";
constexpr base::TimeDelta kMinimumDuration = base::Minutes(1);
constexpr base::TimeDelta kMaximumDuration = base::Minutes(300);
constexpr base::TimeDelta kInitialEndingMomentDuration = base::Seconds(9);
constexpr int kProgressIndicatorSteps = 120;
constexpr base::TimeDelta kExtendDuration = base::Minutes(10);
constexpr char kFocusModeEndingMomentNudgeId[] =
"focus_mode_ending_moment_nudge";
constexpr size_t kCongratulatoryTitleNum = 6;
ASH_EXPORT std::u16string GetDurationString(base::TimeDelta duration_to_format,
bool digital_format);
ASH_EXPORT std::u16string GetFormattedClockString(const base::Time end_time);
ASH_EXPORT std::u16string GetNotificationDescriptionForFocusSession(
const base::Time end_time);
ASH_EXPORT int GetTimerTextfieldInputInMinutes(
SystemTextfield* timer_textfield);
ASH_EXPORT std::u16string GetFormattedEndTimeString(const base::Time end_time);
ASH_EXPORT std::string GetSourceTitleForMediaControls(
const SelectedPlaylist& playlist);
ASH_EXPORT std::u16string GetCongratulatoryText(const size_t index);
ASH_EXPORT std::u16string GetCongratulatoryEmoji(const size_t index);
ASH_EXPORT std::u16string GetCongratulatoryTextAndEmoji(const size_t index);
ASH_EXPORT int GetNextProgressStep(double current_progress);
ASH_EXPORT void RecordHistogramForApiStatus(
const std::string& method,
const google_apis::ApiErrorCode error_code);
ASH_EXPORT void RecordHistogramForApiLatency(const std::string& method,
const base::TimeDelta latency);
ASH_EXPORT void RecordHistogramForApiResult(const std::string& method,
const bool successful);
ASH_EXPORT void RecordHistogramForApiRetryCount(const std::string& method,
const int retry_count);
}
}
#endif