Files
XCEngine/new_editor/app/Platform/Win32/EditorWindowScreenshotController.h

48 lines
1.4 KiB
C
Raw Normal View History

#pragma once
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <cstdint>
#include <filesystem>
#include <string>
#include <string_view>
namespace XCEngine::UI::Editor::App {
class EditorWindowScreenshotController {
public:
void Initialize(const std::filesystem::path& captureRoot);
void Shutdown();
void RequestCapture(std::string reason);
2026-04-22 02:14:26 +08:00
bool TryBeginCapture(std::filesystem::path& outHistoryPath);
void CompleteCaptureSuccess(const std::filesystem::path& historyPath);
void CompleteCaptureFailure(std::string error);
bool HasPendingCapture() const;
const std::filesystem::path& GetLatestCapturePath() const;
const std::string& GetLastCaptureSummary() const;
const std::string& GetLastCaptureError() const;
private:
std::filesystem::path BuildHistoryCapturePath(std::string_view reason) const;
2026-04-22 02:14:26 +08:00
void ResetPendingRequest();
static std::string BuildTimestampString();
static std::string SanitizeReason(std::string_view reason);
std::filesystem::path m_captureRoot = {};
std::filesystem::path m_historyRoot = {};
std::filesystem::path m_latestCapturePath = {};
2026-04-22 02:14:26 +08:00
std::filesystem::path m_activeHistoryCapturePath = {};
std::string m_pendingReason = {};
std::string m_lastCaptureSummary = {};
std::string m_lastCaptureError = {};
std::uint64_t m_captureCount = 0;
bool m_capturePending = false;
};
} // namespace XCEngine::UI::Editor::App