Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ocr intent #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api/src/main/java/org/idpass/smartscanner/api/ScannerConstants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ object ScannerConstants {
// Scanner
const val MODE = "mode"
const val RESULT = "result"
const val LANGUAGE = "language"

// Types
const val BARCODE = "barcode"
Expand Down Expand Up @@ -106,6 +107,13 @@ object ScannerConstants {
const val JSON_PATH = "json_path"
const val QRCODE_JSON_VALUE = "qr_code_json_value"
const val QRCODE_TEXT = "qr_code_text"

// OCR
const val OCR_IMAGE = "image"
const val OCR_VALUE = "value"
const val OCR_TYPE = "type"
const val OCR_REGEX = "regex"

// ODK
const val IDPASS_ODK_INTENT_DATA = "odk_intent_data"
const val IDPASS_ODK_PREFIX_EXTRA = "prefix"
Expand All @@ -116,10 +124,12 @@ object ScannerConstants {
const val IDPASS_SMARTSCANNER_MRZ_INTENT = "org.idpass.smartscanner.MRZ_SCAN"
const val IDPASS_SMARTSCANNER_NFC_INTENT = "org.idpass.smartscanner.NFC_SCAN"
const val IDPASS_SMARTSCANNER_QRCODE_INTENT = "org.idpass.smartscanner.QRCODE_SCAN"
const val IDPASS_SMARTSCANNER_OCR_INTENT = "org.idpass.smartscanner.OCR_SCAN"
// Intents ODK
const val IDPASS_SMARTSCANNER_ODK_BARCODE_INTENT = "org.idpass.smartscanner.odk.BARCODE_SCAN"
const val IDPASS_SMARTSCANNER_ODK_IDPASS_LITE_INTENT = "org.idpass.smartscanner.odk.IDPASS_LITE_SCAN"
const val IDPASS_SMARTSCANNER_ODK_MRZ_INTENT = "org.idpass.smartscanner.odk.MRZ_SCAN"
const val IDPASS_SMARTSCANNER_ODK_NFC_INTENT = "org.idpass.smartscanner.odk.NFC_SCAN"
const val IDPASS_SMARTSCANNER_ODK_QRCODE_INTENT = "org.idpass.smartscanner.odk.QRCODE_SCAN"
const val IDPASS_SMARTSCANNER_ODK_OCR_INTENT = "org.idpass.smartscanner.odk.OCR_SCAN"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.idpass.smartscanner.api.ScannerConstants.IDPASS_SMARTSCANNER_BARCODE_
import org.idpass.smartscanner.api.ScannerConstants.IDPASS_SMARTSCANNER_IDPASS_LITE_INTENT
import org.idpass.smartscanner.api.ScannerConstants.IDPASS_SMARTSCANNER_MRZ_INTENT
import org.idpass.smartscanner.api.ScannerConstants.IDPASS_SMARTSCANNER_NFC_INTENT
import org.idpass.smartscanner.api.ScannerConstants.IDPASS_SMARTSCANNER_OCR_INTENT
import org.idpass.smartscanner.api.ScannerConstants.IDPASS_SMARTSCANNER_QRCODE_INTENT

class ScannerIntent {
Expand Down Expand Up @@ -56,5 +57,8 @@ class ScannerIntent {
}
return intent
}

@JvmStatic
fun intentOCR(): Intent = Intent(IDPASS_SMARTSCANNER_OCR_INTENT)
}
}