Use Cases

All 73 use case classes under domain/usecase/ (including pdftools/ and qr/), grouped by area.

ViewModels call use cases. Use cases call repository interfaces (or thin processors).

Document lifecycle

Use casePurpose
CreateDocumentUseCaseCreate empty document
DeleteDocumentUseCaseDelete document and all pages
RenameDocumentUseCaseUpdate document title
ObserveDocumentUseCaseFlow of single document
ObserveDocumentsUseCaseFlow of all documents
ObserveRecentDocumentsUseCaseRecent documents (limit 8)
ObserveUngroupedDocumentsUseCaseDocuments without a group
SuggestDocumentTitleUseCaseGenerate a duplicate-safe date-based document title

Page lifecycle

Use casePurpose
PreparePageCaptureUseCaseAllocate paths for new page capture
PrepareReplacementCaptureUseCaseAllocate paths for page retake
FinalizeCapturedPageUseCaseRun processing and persist page
ObservePageUseCaseFlow of single page
ObserveDocumentPagesUseCaseFlow of pages in a document
UpdatePageEditsUseCaseSave crop / rotation / filter / adjustments and reprocess
DetectDocumentCornersUseCaseStill-image AI crop detection for the crop screen
MovePageUseCaseReorder page within document
DeletePageUseCaseRemove page from document
ImportImagesUseCaseImport gallery images as pages

Groups

Use casePurpose
CreateGroupUseCaseCreate document group
DeleteGroupUseCaseDelete group (documents become ungrouped)
RenameGroupUseCaseUpdate group title
SetDocumentGroupUseCaseAssign or remove document from group
ObserveGroupsUseCaseFlow of all groups
ObserveGroupUseCaseFlow of single group
ObserveRecentGroupsUseCaseRecent groups (limit 6)
ObserveGroupDocumentsUseCaseDocuments in a group
SuggestGroupTitleUseCaseGenerate a duplicate-safe date-based group title

Export

Use casePurpose
ExportDocumentPdfUseCaseGenerate document PDF
ExportDocumentImageArchiveUseCaseGenerate document image ZIP
PrepareDocumentPdfShareUseCasePrepare PDF share artifact
PrepareDocumentImageShareUseCasePrepare image share artifact
ExportGroupPdfUseCaseGenerate merged group PDF
ExportGroupZippedPdfsUseCaseGenerate zipped PDF set for group
PrepareGroupPdfShareUseCasePrepare merged PDF share
PrepareGroupZippedPdfsShareUseCasePrepare zipped PDFs share
SaveExportArtifactUseCaseCopy an export into the configured shared-storage base folder

Library backup and restore

Use casePurpose
EstimateLibraryBackupUseCaseCalculate source, required, and available destination bytes
StartLibraryBackupUseCaseEnqueue a unique background .scanly backup
StartLibraryRestoreUseCaseEnqueue validated Replace or Merge restore
ObserveLibraryArchiveWorkUseCaseObserve WorkManager phase and progress
CancelLibraryArchiveWorkUseCaseCancel the active backup or restore

Settings and app data

Use casePurpose
ObserveThemeModeUseCaseFlow of current theme mode
SetThemeModeUseCasePersist theme mode
ObservePureBlackEnabledUseCaseFlow of pure black (AMOLED) preference
SetPureBlackEnabledUseCasePersist pure black preference
ObserveLiveDetectionModelUseCaseFlow of manual live-preview corner model
SetLiveDetectionModelUseCasePersist live-preview corner model
ObservePostProcessingModelUseCaseFlow of manual post-processing corner model
SetPostProcessingModelUseCasePersist post-processing corner model
ObserveAutomaticModelSelectionUseCaseFlow of automatic model-selection flag
SetAutomaticModelSelectionUseCasePersist automatic model-selection flag
ObserveDocumentGateEnabledUseCaseFlow of physical-document gate flag
SetDocumentGateEnabledUseCasePersist physical-document gate flag
ObserveExportDestinationUseCaseFlow of the configured export base folder
SetExportDestinationUseCasePersist a custom SAF base folder
ResetExportDestinationUseCaseReturn to Downloads/Scanly
LoadSettingsContentUseCaseLoad FAQs and licenses
ObserveOnboardingCompletedUseCaseFlow of onboarding flag
CompleteOnboardingUseCaseMark onboarding done
GetAppStorageUsageUseCaseCalculate storage byte counts
ClearAllAppDataUseCaseWipe all local data

Tools — QR

Use casePurpose
GenerateQrBitmapUseCaseEncode text/URL as a QR bitmap
SaveQrPngUseCasePersist QR PNG for save/share

Tools — PDF toolkit

Use casePurpose
InspectPdfUseCaseProbe device or library PDF metadata
MergePdfsUseCaseMerge multiple PDFs
CompressPdfUseCaseRe-encode with quality presets
SetPdfPasswordUseCaseProtect with open password
RemovePdfPasswordUseCaseRemove existing password
WatermarkPdfUseCaseApply text watermark
RenderWatermarkPreviewUseCaseDebounced first-page watermark proof
RenderPdfPageUseCaseRender a page bitmap for reader/preview
PreparePdfToolShareUseCaseFileProvider share for tool outputs

Updates

Use casePurpose
CheckForAppUpdateUseCaseDelegate to the GitHub or Google Play repository selected by the build type

View source on GitHub · Markdown