1#ifndef YAZE_APP_EDITOR_SYSTEM_SESSION_COORDINATOR_H_
2#define YAZE_APP_EDITOR_SYSTEM_SESSION_COORDINATOR_H_
9#include "absl/status/status.h"
14#include "imgui/imgui.h"
113 void RenameSession(
size_t index,
const std::string& new_name);
115 size_t session_index)
const;
139 size_t session_index = SIZE_MAX);
141 absl::Status
SaveSessionAs(
size_t session_index,
const std::string& filename);
143 const std::string& filepath);
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
The EditorManager controls the main editor window and manages the various editor classes.
Contains a complete set of editors for a single ROM instance.
Central registry for all editor cards with session awareness and dependency injection.
High-level orchestrator for multi-session UI.
void ShowSessionManager()
void NotifySessionCreated(size_t index, RomSession *session)
void SwitchToSession(size_t index)
void * GetActiveSession() const
char session_rename_buffer_[256]
void * GetSession(size_t index) const
void RemoveObserver(SessionObserver *observer)
size_t GetEmptySessionCount() const
std::string GenerateUniqueEditorTitle(const std::string &editor_name, size_t session_index) const
void CleanupClosedSessions()
zelda3::GameData * GetCurrentGameData() const
bool IsSessionSwitcherVisible() const
EditorSet * GetCurrentEditorSet() const
size_t GetActiveSessionIndex() const
void CloseCurrentSession()
EditorManager * editor_manager_
~SessionCoordinator()=default
void ToggleSessionManager()
void NotifySessionClosed(size_t index)
RomSession * GetActiveRomSession() const
void ShowAllPanelsInActiveSession()
void CloseSession(size_t index)
size_t GetActiveSessionCount() const
void NotifySessionRomLoaded(size_t index, RomSession *session)
void FocusPreviousSession()
void UpdateSessionCount()
void DrawSessionManager()
absl::StatusOr< RomSession * > CreateSessionFromRom(Rom &&rom, const std::string &filepath)
UserSettings * user_settings_
void DuplicateCurrentSession()
void HideSessionSwitcher()
void DrawSessionContextMenu(size_t index)
absl::Status SaveSessionAs(size_t session_index, const std::string &filename)
size_t active_session_index_
absl::Status SaveActiveSession(const std::string &filename="")
void ActivateSession(size_t index)
ImVec4 GetSessionColor(size_t index) const
absl::Status LoadRomIntoSession(const std::string &filename, size_t session_index=SIZE_MAX)
std::string GetSessionDisplayName(size_t index) const
void ShowSessionSwitcher()
void RenameSession(size_t index, const std::string &new_name)
bool IsSessionModified(size_t index) const
void SetEditorManager(EditorManager *manager)
size_t session_to_rename_
SessionCoordinator(PanelManager *panel_manager, ToastManager *toast_manager, UserSettings *user_settings)
size_t GetTotalSessionCount() const
void UpdateActiveSession()
bool HasDuplicateSession(const std::string &filepath) const
static constexpr size_t kMinSessions
void ToggleSessionSwitcher()
void ShowPanelsInCategory(const std::string &category)
ToastManager * toast_manager_
void HidePanelsInCategory(const std::string &category)
void HideAllPanelsInActiveSession()
bool IsSessionClosed(size_t index) const
std::string GetSessionIcon(size_t index) const
bool show_session_manager_
void DrawSessionRenameDialog()
void ShowSessionLimitWarning()
void DrawSessionSwitcher()
std::string GetActiveSessionDisplayName() const
bool show_session_switcher_
Rom * GetCurrentRom() const
void ShowSessionOperationResult(const std::string &operation, bool success)
bool IsValidSessionIndex(size_t index) const
bool IsSessionEmpty(size_t index) const
std::vector< SessionObserver * > observers_
bool HasMultipleSessions() const
void DrawSessionTab(size_t index, bool is_active)
void DrawSessionBadge(size_t index)
void RemoveSession(size_t index)
void SetActiveSessionIndex(size_t index)
bool IsSessionActive(size_t index) const
std::vector< std::unique_ptr< RomSession > > sessions_
void ValidateSessionIndex(size_t index) const
void DrawSessionIndicator()
void AddObserver(SessionObserver *observer)
void NotifySessionSwitched(size_t index, RomSession *session)
bool IsSessionManagerVisible() const
bool IsSessionLoaded(size_t index) const
size_t GetLoadedSessionCount() const
std::string GenerateUniqueSessionName(const std::string &base_name) const
PanelManager * panel_manager_
bool show_session_rename_dialog_
static constexpr size_t kMaxSessions
void HideSessionManager()
Observer interface for session state changes.
virtual void OnSessionSwitched(size_t new_index, RomSession *session)=0
Called when the active session changes.
virtual void OnSessionClosed(size_t index)=0
Called when a session is closed.
virtual void OnSessionCreated(size_t index, RomSession *session)=0
Called when a new session is created.
virtual void OnSessionRomLoaded(size_t index, RomSession *session)
Called when a ROM is loaded into a session.
virtual ~SessionObserver()=default
Manages user preferences and settings persistence.
Represents a single session, containing a ROM and its associated editors.