#ifndef ASH_SYSTEM_FOCUS_MODE_SOUNDS_SOUND_SECTION_VIEW_H_
#define ASH_SYSTEM_FOCUS_MODE_SOUNDS_SOUND_SECTION_VIEW_H_
#include "ash/ash_export.h"
#include "ash/system/focus_mode/focus_mode_util.h"
#include "ash/system/focus_mode/sounds/focus_mode_sounds_controller.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/views/view.h"
namespace views {
class BoxLayoutView;
class FlexLayoutView;
}
namespace ash {
class PillButton;
class PlaylistView;
inline constexpr size_t kFocusModePlaylistViewsNum = 4;
class ASH_EXPORT SoundSectionView : public views::View {
METADATA_HEADER(SoundSectionView, views::View)
public:
explicit SoundSectionView(focus_mode_util::SoundType type);
SoundSectionView(const SoundSectionView&) = delete;
SoundSectionView& operator=(const SoundSectionView&) = delete;
~SoundSectionView() override;
void UpdateContents(
const std::vector<std::unique_ptr<FocusModeSoundsController::Playlist>>&
data);
void ShowAlternateView(bool show_alternate_view);
void SetAlternateView(std::unique_ptr<views::BoxLayoutView> alternate_view);
bool IsAlternateViewVisible() const;
void UpdateStateForSelectedPlaylist(
const focus_mode_util::SelectedPlaylist& selected_playlist);
void UpdateSelectedPlaylistForNewState(focus_mode_util::SoundState new_state);
private:
void CreatePlaylistViewsContainer(focus_mode_util::SoundType type);
const focus_mode_util::SoundType type_;
std::vector<PlaylistView*> playlist_view_list_;
raw_ptr<views::FlexLayoutView> playlist_views_container_ = nullptr;
raw_ptr<views::BoxLayoutView> alternate_view_ = nullptr;
raw_ptr<PillButton> learn_more_button_ = nullptr;
base::WeakPtrFactory<SoundSectionView> weak_factory_{this};
};
}
#endif