mirror of
https://github.com/sebastiandine/Card-Collection-Manager-3.git
synced 2026-08-28 17:01:02 +00:00
55ace147bc
* initial development * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * ci/cd * ci/cd * ci/cd * ci/cd * ci/cd * ci/cd * ci/cd * pokemon * pokemon * pokemon * pokemon * pokemon * pokemon * improvements * improvements * ci/cd * ci/cd * improvements * improvements * improvements * improvements * improvements * improvements * improvements * improvements * improvements --------- Co-authored-by: sdine <sdine@sdine.com>
31 lines
1.0 KiB
C++
31 lines
1.0 KiB
C++
#pragma once
|
|
|
|
// ICardPreviewSource - resolves the preview image URL for a single card via
|
|
// the active game's external API. Implementations stay HTTP-bound, no UI deps.
|
|
//
|
|
// Modeled after per-game `getImage` helpers in
|
|
// `src/components/{magic,pokemon}/Selected*Panel.tsx`. The resulting URL is
|
|
// then fetched as raw image bytes by `CardPreviewService` and decoded by the
|
|
// UI layer (wxImage in our wx adapter).
|
|
|
|
#include "ccm/util/Result.hpp"
|
|
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
namespace ccm {
|
|
|
|
class ICardPreviewSource {
|
|
public:
|
|
virtual ~ICardPreviewSource() = default;
|
|
|
|
// Resolve the preview image URL for a single card. `setNo` is optional
|
|
// (empty string is fine); some game APIs (e.g. Pokemon TCG) can use it as
|
|
// a more precise lookup key, others (Magic/Scryfall) ignore it.
|
|
virtual Result<std::string> fetchImageUrl(std::string_view name,
|
|
std::string_view setId,
|
|
std::string_view setNo) = 0;
|
|
};
|
|
|
|
} // namespace ccm
|