@startuml
'https://plantuml.com/class-diagram

interface SystemRecovery {
    +ErrorCode supported(const QString &partitionInfo)
    +QString getDefaultBackupDir(const QString &rootPath)
    +ErrorCode systemBackup(const QString &fromDir, const QString &toDir)
    +ErrorCode systemRestore(const QString &fromDir, const QString &toDir)
    +ErrorCode createUImg(const QString &backupDir)
    +BackupInfoList listSystemBackup()
}


class RecoveryService {
    +QString listSystem();
    +QString SystemBackup(const QString &toDir = "");
    +QString SystemRestore(const QString &fromDir);
    +QString UserDataBackup(const QString &toDir = "");
    +QString UserDataRestore(const QString &fromDir);
    +QString CreateUImg(const QString &fromDir, const QString &toDir);
    +void removeBackup(const QString &backup);
    +QString GetRecord();
    +QString listSystemBackup();
    +QString listUserDataBackup();

    -SystemRecoveryPtr m_pSystemRecovery;
    -UserDataRecoveryPtr m_pUserDataRecovery;
}

class RsyncSystem {
    +ErrorCode supported(const QString &partitionInfo)
    +QString getDefaultBackupDir(const QString &rootPath)
    +ErrorCode systemBackup(const QString &fromDir, const QString &toDir)
    +ErrorCode systemRestore(const QString &fromDir, const QString &toDir)
    +ErrorCode createUImg(const QString &backupDir)
    +BackupInfoList listSystemBackup()
}

class BtrfsSnapperSystem {
    +ErrorCode supported(const QString &partitionInfo)
    +QString getDefaultBackupDir(const QString &rootPath)
    +ErrorCode systemBackup(const QString &fromDir, const QString &toDir)
    +ErrorCode systemRestore(const QString &fromDir, const QString &toDir)
    +ErrorCode createUImg(const QString &backupDir)
    +BackupInfoList listSystemBackup()
}

class OSTreeSystem {
    +ErrorCode supported(const QString &partitionInfo)
    +QString getDefaultBackupDir(const QString &rootPath)
    +ErrorCode systemBackup(const QString &fromDir, const QString &toDir)
    +ErrorCode systemRestore(const QString &fromDir, const QString &toDir)
    +ErrorCode createUImg(const QString &backupDir)
    +BackupInfoList listSystemBackup()
}

class RecoveryFactory {
    +SystemRecoveryPtr createSystemRecoveryHandle();
    +UserDataRecoveryPtr createUserDataRecoveryHandle();
}

SystemRecovery *- RecoveryService
SystemRecovery <|-- RsyncSystem
SystemRecovery <|-- BtrfsSnapperSystem
SystemRecovery <|-- OSTreeSystem
RsyncSystem *-- RecoveryFactory
BtrfsSnapperSystem *-- RecoveryFactory
OSTreeSystem *-- RecoveryFactory



@enduml