Use Cases

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
Use casePurpose
RecognizeDocumentTextUseCaseEnsure all pages in a document have current text recognition
RecognizePageTextUseCaseRecognize a page with the on-device ML Kit model
UpdatePageTextUseCasePersist user corrections to recognized text
SearchPageTextUseCaseSearch the page-text index and return matching pages
SuggestSearchCorrectionUseCaseSuggest a correction from indexed page vocabulary
ObserveRecentSearchesUseCaseObserve saved recent queries
AddRecentSearchUseCaseRecord a submitted query
RemoveRecentSearchUseCaseRemove one recent query
ClearRecentSearchesUseCaseClear recent query history

Document signing

Use casePurpose
ObserveSignaturesUseCaseObserve saved signatures and initials
SaveSignatureUseCaseSave a drawn or imported ink mask locally
ExtractSignatureInkUseCaseExtract signature ink from an imported image
DeleteSignatureUseCaseDelete a reusable signature
LoadDocumentMarkupsUseCaseLoad editable marks on a Scanly document's pages
SaveDocumentMarkupsUseCaseSave mark changes and composite signed page images
OpenPdfSignSessionUseCaseOpen and inspect a PDF for signing
SignPdfUseCaseRender marks into a new signed PDF
ClosePdfSignSessionUseCaseRelease a PDF signing session

Legacy archive cleanup

Use casePurpose
DeleteLegacyArchiveLeftoversUseCaseRemove leftover temporary files from the retired backup/restore flow during upgrade

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
ClearExportCacheUseCaseRemove temporary generated exports
DeleteEmptyDocumentsUseCase / DeleteEmptyGroupsUseCaseClean empty library items
LoadSettingsContentUseCaseLoad FAQs and licenses
ObserveOnboardingCompletedUseCaseFlow of onboarding flag
CompleteOnboardingUseCaseMark onboarding done
GetAppStorageUsageUseCaseCalculate storage byte counts
ClearAllAppDataUseCaseWipe all local data
ObserveRatingPromptStateUseCase, DismissSettingsRatingCardUseCase, MarkAppRatedUseCaseManage Settings rating-card state

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