Files
yaze/src/app/editor/system/project_manager.h
scawful d45f7819e1 refactor(app): reorganize application structure and update includes
- Moved core components such as `Controller` and `Window` from `src/app/core/` to `src/app/` and `src/app/platform/`, respectively, to improve modularity and clarity.
- Updated include paths across the codebase to reflect the new locations of these components.
- Introduced a new foundational core library in `src/core/` for project management and ROM patching logic, enhancing the separation of concerns.
- Adjusted CMake configurations to ensure proper compilation of the new core library and updated dependencies in various modules.

Benefits:
- Streamlines the application structure, making it easier to navigate and maintain.
- Enhances code organization by clearly delineating core functionalities from application-specific logic.
- Improves overall architecture by promoting a clearer separation of concerns between different components.
2025-10-15 20:10:04 -04:00

71 lines
2.2 KiB
C++

#ifndef YAZE_APP_EDITOR_SYSTEM_PROJECT_MANAGER_H_
#define YAZE_APP_EDITOR_SYSTEM_PROJECT_MANAGER_H_
#include <string>
#include "absl/status/status.h"
#include "core/project.h"
namespace yaze {
namespace editor {
class ToastManager;
/**
* @class ProjectManager
* @brief Handles all project file operations
*
* Extracted from EditorManager to provide focused project management:
* - Project creation and templates
* - Project loading and saving
* - Project import/export
* - Project validation and repair
*/
class ProjectManager {
public:
explicit ProjectManager(ToastManager* toast_manager);
~ProjectManager() = default;
// Project file operations
absl::Status CreateNewProject(const std::string& template_name = "");
absl::Status OpenProject(const std::string& filename = "");
absl::Status SaveProject();
absl::Status SaveProjectAs(const std::string& filename = "");
// Project import/export
absl::Status ImportProject(const std::string& project_path);
absl::Status ExportProject(const std::string& export_path);
// Project maintenance
absl::Status RepairCurrentProject();
absl::Status ValidateProject();
// Project information
project::YazeProject& GetCurrentProject() { return current_project_; }
const project::YazeProject& GetCurrentProject() const { return current_project_; }
bool HasActiveProject() const { return !current_project_.filepath.empty(); }
std::string GetProjectName() const;
std::string GetProjectPath() const;
// Project templates
std::vector<std::string> GetAvailableTemplates() const;
absl::Status CreateFromTemplate(const std::string& template_name,
const std::string& project_name);
private:
project::YazeProject current_project_;
ToastManager* toast_manager_ = nullptr;
// Helper methods
absl::Status LoadProjectFromFile(const std::string& filename);
absl::Status SaveProjectToFile(const std::string& filename);
std::string GenerateProjectFilename(const std::string& project_name) const;
bool IsValidProjectFile(const std::string& filename) const;
absl::Status InitializeProjectStructure(const std::string& project_path);
};
} // namespace editor
} // namespace yaze
#endif // YAZE_APP_EDITOR_SYSTEM_PROJECT_MANAGER_H_