game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
core::StoreIntegrationController Class Reference

#include <store_integration_controller.h>

Classes

class  Impl
struct  UnifiedGameInfo
 Get games from all stores (unified view). More...

Public Types

using OnCloudSaveEvent = std::function<void(const CloudSaveEvent&)>
using OnDependencyEvent = std::function<void(const DependencyEvent&)>
using OnStoreSyncComplete = std::function<void(const StoreSyncEvent&)>
using ProgressCallback = std::function<void(int percent, const std::string& status)>

Public Member Functions

 StoreIntegrationController ()
 StoreIntegrationController (const StoreIntegrationController &)=delete
 StoreIntegrationController (StoreIntegrationController &&) noexcept
 ~StoreIntegrationController ()
void authenticateEpic (const std::function< void(bool success, const std::string &message)> &callback)
 Start Epic authentication flow.
void authenticateGOG (const std::function< void(bool success, const std::string &message)> &callback)
 Start GOG authentication flow.
void cancelOperation ()
 Cancel any ongoing operation.
std::vector< UnifiedGameInfo > checkAllUpdates () const
 Check for updates across all stores.
std::optional< std::string > createSaveSnapshot (const std::string &gameId, const std::string &description="")
 Create a save snapshot (backup).
bool deleteSaveSnapshot (const std::string &snapshotId)
 Delete a snapshot.
std::vector< SaveLocation > detectSaveLocations (const std::string &gameName, const std::string &prefixPath="") const
 Detect save locations for a game.
std::vector< WineDependency > getAllDependencies () const
 Get all available dependencies.
std::vector< UnifiedGameInfo > getAllStoreGames () const
std::vector< StoreStatus > getAllStoreStatus () const
 Get status of all available stores.
std::vector< WineDependency > getDependenciesByCategory (DependencyCategory category) const
 Get dependencies by category.
EpicAuthStatus getEpicAuthStatus () const
 Get Epic authentication status.
std::vector< EpicGameInfo > getEpicLibrary (bool forceRefresh=false)
 Get all Epic library games.
GOGAuthStatus getGOGAuthStatus () const
 Get GOG authentication status.
std::vector< GOGGameInfo > getGOGLibrary (bool forceRefresh=false)
 Get all GOG library games.
std::vector< EpicGameInfo > getInstalledEpicGames () const
 Get installed Epic games.
std::vector< GOGGameInfo > getInstalledGOGGames () const
 Get installed GOG games.
std::vector< std::string > getRecommendedDependencies () const
 Get recommended dependencies for gaming.
std::optional< SaveLocation > getSaveLocation (const std::string &gameId) const
 Get save location for a game.
std::vector< SaveLocation > getSaveLocations () const
 Get all registered save locations.
std::vector< SaveSnapshot > getSaveSnapshots (const std::string &gameId) const
 Get all snapshots for a game.
StoreStatus getStoreStatus (StoreType store) const
 Get status of a specific store.
int64_t getTotalBackupSize () const
 Get total backup size.
int importEpicGames ()
 Import Epic games to main library.
int importGOGGames ()
 Import GOG games to main library.
std::future< int > installDependencies (const std::string &prefixPath, const std::vector< std::string > &verbIds, const ProgressCallback &progressCallback=nullptr)
 Install multiple dependencies.
std::future< bool > installDependency (const std::string &prefixPath, const std::string &verbId, const ProgressCallback &progressCallback=nullptr)
 Install a dependency.
std::future< bool > installEpicGame (const std::string &appName, const std::string &installPath="", const ProgressCallback &progressCallback=nullptr)
 Install an Epic game.
std::future< bool > installForSteamGame (uint32_t steamAppId, const std::vector< std::string > &verbIds, const ProgressCallback &progressCallback=nullptr)
 Install dependencies for a Steam/Proton game.
std::future< bool > installGamingPreset (const std::string &prefixPath, const ProgressCallback &progressCallback=nullptr)
 Install gaming preset (vcrun, dxvk, fonts).
std::future< bool > installGOGGame (const std::string &gameId, const std::string &installPath="", const ProgressCallback &progressCallback=nullptr)
 Install a GOG game.
bool isDependencyInstalled (const std::string &prefixPath, const std::string &verbId) const
 Check if a dependency is installed in a prefix.
bool isEpicAvailable () const
 Check if Epic/Legendary is available.
bool isGOGAvailable () const
 Check if GOG integration is available (Heroic or gogdl).
bool isProtontricksAvailable () const
 Check if protontricks is available.
bool isStoreAuthenticated (StoreType store) const
 Check if authenticated to a store.
bool isStoreAvailable (StoreType store) const
 Check if a store backend is available (tools installed).
bool isWinetricksAvailable () const
 Check if winetricks is available.
void logoutEpic ()
 Log out of Epic.
void logoutGOG ()
 Log out of GOG.
bool needsSaveSync (const std::string &gameId) const
 Check if sync is needed.
void onGameExit (const std::string &gameId)
 Called when game exits (for auto-sync).
void onGameLaunch (const std::string &gameId)
 Called when game launches (for auto-sync).
StoreIntegrationController & operator= (const StoreIntegrationController &)=delete
StoreIntegrationController & operator= (StoreIntegrationController &&) noexcept
bool registerSaveLocation (const SaveLocation &location)
 Register a game's save location.
bool restoreSaveSnapshot (const std::string &snapshotId, bool backupCurrent=true)
 Restore saves from a snapshot.
PrefixDependencyStatus scanPrefixDependencies (const std::string &prefixPath) const
 Scan a Wine prefix for installed dependencies.
std::vector< WineDependency > searchDependencies (const std::string &query) const
 Search for dependencies.
void setAutoSync (const std::string &gameId, bool enabled)
 Enable/disable auto-sync for a game.
void setCloudSyncDirectory (const std::string &path)
 Set custom sync directory (e.g., Syncthing folder).
void setOnCloudSaveEvent (OnCloudSaveEvent callback)
void setOnDependencyEvent (OnDependencyEvent callback)
void setOnStoreSyncComplete (OnStoreSyncComplete callback)
void syncAllStores (const ProgressCallback &progressCallback=nullptr)
 Sync all stores (GOG, Epic, etc.).
int syncEpicLibrary ()
 Sync Epic library to game database.
int syncGOGLibrary ()
 Sync GOG library to game database.
std::future< bool > syncSaves (const std::string &gameId, SyncDirection direction, const ProgressCallback &progressCallback=nullptr)
 Sync saves with cloud/custom directory.
bool uninstallEpicGame (const std::string &appName)
 Uninstall an Epic game.
bool uninstallGOGGame (const std::string &gameId)
 Uninstall a GOG game.

Detailed Description

Definition at line 110 of file store_integration_controller.h.

Member Typedef Documentation

◆ OnCloudSaveEvent

Definition at line 115 of file store_integration_controller.h.

◆ OnDependencyEvent

Definition at line 116 of file store_integration_controller.h.

◆ OnStoreSyncComplete

Definition at line 114 of file store_integration_controller.h.

◆ ProgressCallback

using core::StoreIntegrationController::ProgressCallback = std::function<void(int percent, const std::string& status)>

Definition at line 117 of file store_integration_controller.h.

Constructor & Destructor Documentation

◆ StoreIntegrationController() [1/3]

core::StoreIntegrationController::StoreIntegrationController ( )

◆ ~StoreIntegrationController()

core::StoreIntegrationController::~StoreIntegrationController ( )
default

◆ StoreIntegrationController() [2/3]

core::StoreIntegrationController::StoreIntegrationController ( const StoreIntegrationController & )
delete

◆ StoreIntegrationController() [3/3]

core::StoreIntegrationController::StoreIntegrationController ( StoreIntegrationController && )
defaultnoexcept

Member Function Documentation

◆ authenticateEpic()

void core::StoreIntegrationController::authenticateEpic ( const std::function< void(bool success, const std::string &message)> & callback)

Start Epic authentication flow.

Definition at line 254 of file store_integration_controller.cpp.

References authenticateEpic().

Referenced by authenticateEpic(), and operator=().

◆ authenticateGOG()

void core::StoreIntegrationController::authenticateGOG ( const std::function< void(bool success, const std::string &message)> & callback)

Start GOG authentication flow.

Definition at line 169 of file store_integration_controller.cpp.

Referenced by operator=().

◆ cancelOperation()

void core::StoreIntegrationController::cancelOperation ( )

Cancel any ongoing operation.

Definition at line 765 of file store_integration_controller.cpp.

References cancelOperation().

Referenced by cancelOperation().

◆ checkAllUpdates()

◆ createSaveSnapshot()

std::optional< std::string > core::StoreIntegrationController::createSaveSnapshot ( const std::string & gameId,
const std::string & description = "" )

Create a save snapshot (backup).

Definition at line 351 of file store_integration_controller.cpp.

References createSaveSnapshot(), core::CloudSaveEvent::gameId, and core::CloudSaveEvent::SnapshotCreated.

Referenced by createSaveSnapshot(), and operator=().

◆ deleteSaveSnapshot()

bool core::StoreIntegrationController::deleteSaveSnapshot ( const std::string & snapshotId)

Delete a snapshot.

Definition at line 388 of file store_integration_controller.cpp.

References deleteSaveSnapshot().

Referenced by deleteSaveSnapshot(), and operator=().

◆ detectSaveLocations()

std::vector< SaveLocation > core::StoreIntegrationController::detectSaveLocations ( const std::string & gameName,
const std::string & prefixPath = "" ) const

Detect save locations for a game.

Definition at line 343 of file store_integration_controller.cpp.

References detectSaveLocations().

Referenced by detectSaveLocations(), and operator=().

◆ getAllDependencies()

std::vector< WineDependency > core::StoreIntegrationController::getAllDependencies ( ) const

Get all available dependencies.

Definition at line 485 of file store_integration_controller.cpp.

References getAllDependencies().

Referenced by getAllDependencies(), and operator=().

◆ getAllStoreGames()

◆ getAllStoreStatus()

std::vector< StoreStatus > core::StoreIntegrationController::getAllStoreStatus ( ) const

Get status of all available stores.

Definition at line 87 of file store_integration_controller.cpp.

References StoreIntegrationController(), core::Epic, getAllStoreStatus(), getStoreStatus(), and core::GOG.

Referenced by getAllStoreStatus(), and operator=().

◆ getDependenciesByCategory()

std::vector< WineDependency > core::StoreIntegrationController::getDependenciesByCategory ( DependencyCategory category) const

Get dependencies by category.

Definition at line 491 of file store_integration_controller.cpp.

References getDependenciesByCategory().

Referenced by getDependenciesByCategory(), and operator=().

◆ getEpicAuthStatus()

EpicAuthStatus core::StoreIntegrationController::getEpicAuthStatus ( ) const

Get Epic authentication status.

Definition at line 249 of file store_integration_controller.cpp.

References getEpicAuthStatus().

Referenced by getEpicAuthStatus(), and operator=().

◆ getEpicLibrary()

std::vector< EpicGameInfo > core::StoreIntegrationController::getEpicLibrary ( bool forceRefresh = false)

Get all Epic library games.

Definition at line 265 of file store_integration_controller.cpp.

References getEpicLibrary().

Referenced by getEpicLibrary(), and operator=().

◆ getGOGAuthStatus()

GOGAuthStatus core::StoreIntegrationController::getGOGAuthStatus ( ) const

Get GOG authentication status.

Definition at line 164 of file store_integration_controller.cpp.

Referenced by operator=().

◆ getGOGLibrary()

std::vector< GOGGameInfo > core::StoreIntegrationController::getGOGLibrary ( bool forceRefresh = false)

Get all GOG library games.

Definition at line 180 of file store_integration_controller.cpp.

Referenced by operator=().

◆ getInstalledEpicGames()

std::vector< EpicGameInfo > core::StoreIntegrationController::getInstalledEpicGames ( ) const

Get installed Epic games.

Definition at line 270 of file store_integration_controller.cpp.

References getInstalledEpicGames().

Referenced by getInstalledEpicGames(), and operator=().

◆ getInstalledGOGGames()

std::vector< GOGGameInfo > core::StoreIntegrationController::getInstalledGOGGames ( ) const

Get installed GOG games.

Definition at line 185 of file store_integration_controller.cpp.

Referenced by operator=().

◆ getRecommendedDependencies()

std::vector< std::string > core::StoreIntegrationController::getRecommendedDependencies ( ) const

Get recommended dependencies for gaming.

Definition at line 502 of file store_integration_controller.cpp.

References getRecommendedDependencies().

Referenced by getRecommendedDependencies(), and operator=().

◆ getSaveLocation()

std::optional< SaveLocation > core::StoreIntegrationController::getSaveLocation ( const std::string & gameId) const

Get save location for a game.

Definition at line 337 of file store_integration_controller.cpp.

References getSaveLocation().

Referenced by getSaveLocation(), and operator=().

◆ getSaveLocations()

std::vector< SaveLocation > core::StoreIntegrationController::getSaveLocations ( ) const

Get all registered save locations.

Definition at line 331 of file store_integration_controller.cpp.

References getSaveLocations().

Referenced by getSaveLocations(), and operator=().

◆ getSaveSnapshots()

std::vector< SaveSnapshot > core::StoreIntegrationController::getSaveSnapshots ( const std::string & gameId) const

Get all snapshots for a game.

Definition at line 377 of file store_integration_controller.cpp.

References getSaveSnapshots().

Referenced by getSaveSnapshots(), and operator=().

◆ getStoreStatus()

◆ getTotalBackupSize()

int64_t core::StoreIntegrationController::getTotalBackupSize ( ) const

Get total backup size.

Definition at line 466 of file store_integration_controller.cpp.

References getTotalBackupSize().

Referenced by getTotalBackupSize(), and operator=().

◆ importEpicGames()

int core::StoreIntegrationController::importEpicGames ( )

Import Epic games to main library.

Definition at line 317 of file store_integration_controller.cpp.

References importEpicGames(), and syncEpicLibrary().

Referenced by importEpicGames(), and operator=().

◆ importGOGGames()

int core::StoreIntegrationController::importGOGGames ( )

Import GOG games to main library.

Definition at line 233 of file store_integration_controller.cpp.

References importGOGGames(), and syncGOGLibrary().

Referenced by importGOGGames(), and operator=().

◆ installDependencies()

std::future< int > core::StoreIntegrationController::installDependencies ( const std::string & prefixPath,
const std::vector< std::string > & verbIds,
const ProgressCallback & progressCallback = nullptr )

◆ installDependency()

◆ installEpicGame()

std::future< bool > core::StoreIntegrationController::installEpicGame ( const std::string & appName,
const std::string & installPath = "",
const ProgressCallback & progressCallback = nullptr )

Install an Epic game.

Definition at line 276 of file store_integration_controller.cpp.

References installEpicGame().

Referenced by installEpicGame(), and operator=().

◆ installForSteamGame()

std::future< bool > core::StoreIntegrationController::installForSteamGame ( uint32_t steamAppId,
const std::vector< std::string > & verbIds,
const ProgressCallback & progressCallback = nullptr )

Install dependencies for a Steam/Proton game.

Definition at line 611 of file store_integration_controller.cpp.

References DependencyInstallProgress::currentStep, installForSteamGame(), and DependencyInstallProgress::percentComplete.

Referenced by installForSteamGame(), and operator=().

◆ installGamingPreset()

std::future< bool > core::StoreIntegrationController::installGamingPreset ( const std::string & prefixPath,
const ProgressCallback & progressCallback = nullptr )

Install gaming preset (vcrun, dxvk, fonts).

Definition at line 592 of file store_integration_controller.cpp.

References DependencyInstallProgress::currentStep, installGamingPreset(), and DependencyInstallProgress::percentComplete.

Referenced by installGamingPreset(), and operator=().

◆ installGOGGame()

std::future< bool > core::StoreIntegrationController::installGOGGame ( const std::string & gameId,
const std::string & installPath = "",
const ProgressCallback & progressCallback = nullptr )

Install a GOG game.

Definition at line 191 of file store_integration_controller.cpp.

Referenced by operator=().

◆ isDependencyInstalled()

bool core::StoreIntegrationController::isDependencyInstalled ( const std::string & prefixPath,
const std::string & verbId ) const

Check if a dependency is installed in a prefix.

Definition at line 513 of file store_integration_controller.cpp.

References isDependencyInstalled().

Referenced by isDependencyInstalled(), and operator=().

◆ isEpicAvailable()

bool core::StoreIntegrationController::isEpicAvailable ( ) const

Check if Epic/Legendary is available.

Definition at line 244 of file store_integration_controller.cpp.

References isEpicAvailable().

Referenced by getAllStoreGames(), isEpicAvailable(), operator=(), and syncAllStores().

◆ isGOGAvailable()

bool core::StoreIntegrationController::isGOGAvailable ( ) const

Check if GOG integration is available (Heroic or gogdl).

Definition at line 159 of file store_integration_controller.cpp.

Referenced by checkAllUpdates(), getAllStoreGames(), operator=(), and syncAllStores().

◆ isProtontricksAvailable()

bool core::StoreIntegrationController::isProtontricksAvailable ( ) const

Check if protontricks is available.

Definition at line 480 of file store_integration_controller.cpp.

References isProtontricksAvailable(), and WineDependencyManager::isProtontricksAvailable().

Referenced by isProtontricksAvailable(), and operator=().

◆ isStoreAuthenticated()

bool core::StoreIntegrationController::isStoreAuthenticated ( StoreType store) const

Check if authenticated to a store.

Definition at line 150 of file store_integration_controller.cpp.

References getStoreStatus(), and core::StoreStatus::isAuthenticated.

Referenced by operator=(), and syncAllStores().

◆ isStoreAvailable()

bool core::StoreIntegrationController::isStoreAvailable ( StoreType store) const

Check if a store backend is available (tools installed).

Definition at line 145 of file store_integration_controller.cpp.

References getStoreStatus(), and core::StoreStatus::isAvailable.

Referenced by operator=().

◆ isWinetricksAvailable()

bool core::StoreIntegrationController::isWinetricksAvailable ( ) const

Check if winetricks is available.

Definition at line 475 of file store_integration_controller.cpp.

References isWinetricksAvailable(), and WineDependencyManager::isWinetricksAvailable().

Referenced by isWinetricksAvailable(), and operator=().

◆ logoutEpic()

void core::StoreIntegrationController::logoutEpic ( )

Log out of Epic.

Definition at line 260 of file store_integration_controller.cpp.

References logoutEpic().

Referenced by logoutEpic(), and operator=().

◆ logoutGOG()

void core::StoreIntegrationController::logoutGOG ( )

Log out of GOG.

Definition at line 175 of file store_integration_controller.cpp.

Referenced by operator=().

◆ needsSaveSync()

bool core::StoreIntegrationController::needsSaveSync ( const std::string & gameId) const

Check if sync is needed.

Definition at line 441 of file store_integration_controller.cpp.

References needsSaveSync().

Referenced by needsSaveSync(), and operator=().

◆ onGameExit()

void core::StoreIntegrationController::onGameExit ( const std::string & gameId)

Called when game exits (for auto-sync).

Definition at line 456 of file store_integration_controller.cpp.

References onGameExit().

Referenced by onGameExit(), and operator=().

◆ onGameLaunch()

void core::StoreIntegrationController::onGameLaunch ( const std::string & gameId)

Called when game launches (for auto-sync).

Definition at line 451 of file store_integration_controller.cpp.

References onGameLaunch().

Referenced by onGameLaunch(), and operator=().

◆ operator=() [1/2]

StoreIntegrationController & core::StoreIntegrationController::operator= ( const StoreIntegrationController & )
delete

◆ operator=() [2/2]

◆ registerSaveLocation()

bool core::StoreIntegrationController::registerSaveLocation ( const SaveLocation & location)

Register a game's save location.

Definition at line 326 of file store_integration_controller.cpp.

References registerSaveLocation().

Referenced by operator=(), and registerSaveLocation().

◆ restoreSaveSnapshot()

bool core::StoreIntegrationController::restoreSaveSnapshot ( const std::string & snapshotId,
bool backupCurrent = true )

Restore saves from a snapshot.

Definition at line 382 of file store_integration_controller.cpp.

References restoreSaveSnapshot().

Referenced by operator=(), and restoreSaveSnapshot().

◆ scanPrefixDependencies()

PrefixDependencyStatus core::StoreIntegrationController::scanPrefixDependencies ( const std::string & prefixPath) const

Scan a Wine prefix for installed dependencies.

Definition at line 508 of file store_integration_controller.cpp.

References scanPrefixDependencies().

Referenced by operator=(), and scanPrefixDependencies().

◆ searchDependencies()

std::vector< WineDependency > core::StoreIntegrationController::searchDependencies ( const std::string & query) const

Search for dependencies.

Definition at line 497 of file store_integration_controller.cpp.

References searchDependencies().

Referenced by operator=(), and searchDependencies().

◆ setAutoSync()

void core::StoreIntegrationController::setAutoSync ( const std::string & gameId,
bool enabled )

Enable/disable auto-sync for a game.

Definition at line 446 of file store_integration_controller.cpp.

References setAutoSync().

Referenced by operator=(), and setAutoSync().

◆ setCloudSyncDirectory()

void core::StoreIntegrationController::setCloudSyncDirectory ( const std::string & path)

Set custom sync directory (e.g., Syncthing folder).

Definition at line 461 of file store_integration_controller.cpp.

References setCloudSyncDirectory().

Referenced by operator=(), and setCloudSyncDirectory().

◆ setOnCloudSaveEvent()

void core::StoreIntegrationController::setOnCloudSaveEvent ( OnCloudSaveEvent callback)

Definition at line 749 of file store_integration_controller.cpp.

References setOnCloudSaveEvent().

Referenced by setOnCloudSaveEvent().

◆ setOnDependencyEvent()

void core::StoreIntegrationController::setOnDependencyEvent ( OnDependencyEvent callback)

Definition at line 755 of file store_integration_controller.cpp.

References setOnDependencyEvent().

Referenced by setOnDependencyEvent().

◆ setOnStoreSyncComplete()

void core::StoreIntegrationController::setOnStoreSyncComplete ( OnStoreSyncComplete callback)

Definition at line 743 of file store_integration_controller.cpp.

References setOnStoreSyncComplete().

Referenced by setOnStoreSyncComplete().

◆ syncAllStores()

void core::StoreIntegrationController::syncAllStores ( const ProgressCallback & progressCallback = nullptr)

◆ syncEpicLibrary()

int core::StoreIntegrationController::syncEpicLibrary ( )

Sync Epic library to game database.

Definition at line 296 of file store_integration_controller.cpp.

References core::Epic, core::StoreSyncEvent::store, and syncEpicLibrary().

Referenced by importEpicGames(), operator=(), syncAllStores(), and syncEpicLibrary().

◆ syncGOGLibrary()

int core::StoreIntegrationController::syncGOGLibrary ( )

Sync GOG library to game database.

Definition at line 212 of file store_integration_controller.cpp.

References core::GOG, core::StoreSyncEvent::store, and syncGOGLibrary().

Referenced by importGOGGames(), operator=(), syncAllStores(), and syncGOGLibrary().

◆ syncSaves()

std::future< bool > core::StoreIntegrationController::syncSaves ( const std::string & gameId,
SyncDirection direction,
const ProgressCallback & progressCallback = nullptr )

◆ uninstallEpicGame()

bool core::StoreIntegrationController::uninstallEpicGame ( const std::string & appName)

Uninstall an Epic game.

Definition at line 291 of file store_integration_controller.cpp.

References uninstallEpicGame().

Referenced by operator=(), and uninstallEpicGame().

◆ uninstallGOGGame()

bool core::StoreIntegrationController::uninstallGOGGame ( const std::string & gameId)

Uninstall a GOG game.

Definition at line 207 of file store_integration_controller.cpp.

References uninstallGOGGame().

Referenced by operator=(), and uninstallGOGGame().


The documentation for this class was generated from the following files: