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

interface UserDataRecovery {
    +ErrorCode supported(const QString &partitionInfo)
    +QString getDefaultBackupDir(const QString &rootPath)
    +ErrorCode userDataBackup(const QString &fromDir, const QString &toDir)
    +ErrorCode userDataRestore(const QString &fromDir, const QString &toDir)
    +BackupInfoList listSystemBackup()
}


class RsyncUserData {
    +ErrorCode supported(const QString &partitionInfo)
    +QString getDefaultBackupDir(const QString &rootPath)
    +ErrorCode userDataBackup(const QString &fromDir, const QString &toDir)
    +ErrorCode userDataRestore(const QString &fromDir, const QString &toDir)
    +BackupInfoList listSystemBackup()
}

class BtrfsSnapperUserData {
    +ErrorCode supported(const QString &partitionInfo)
    +QString getDefaultBackupDir(const QString &rootPath)
    +ErrorCode userDataBackup(const QString &fromDir, const QString &toDir)
    +ErrorCode userDataRestore(const QString &fromDir, const QString &toDir)
    +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 RecoveryFactory {
    +SystemRecoveryPtr createSystemRecoveryHandle();
    +UserDataRecoveryPtr createUserDataRecoveryHandle();
}

UserDataRecovery *- RecoveryService
UserDataRecovery <|-- RsyncUserData
UserDataRecovery <|-- BtrfsSnapperUserData
RsyncUserData *-- RecoveryFactory
BtrfsSnapperUserData *-- RecoveryFactory

@enduml