barkoder-nativescript 1.2.9 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/barkoder-nativescript.android.ts +1092 -813
  2. package/barkoder-nativescript.ios.ts +1140 -818
  3. package/package.json +1 -1
  4. package/platforms/android/barkoder.aar +0 -0
  5. package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/Barkoder +0 -0
  6. package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/Headers/iBarkoder.h +1 -0
  7. package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/Barkoder +0 -0
  8. package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/Headers/iBarkoder.h +1 -0
  9. package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/_CodeSignature/CodeResources +2 -2
  10. package/platforms/ios/BarkoderSDK.xcframework/Info.plist +5 -5
  11. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/BarkoderSDK +0 -0
  12. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Headers/BarkoderSDK-Swift.h +46 -28
  13. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Info.plist +0 -0
  14. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.abi.json +111 -44
  15. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  16. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/BarkoderSDK +0 -0
  17. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Headers/BarkoderSDK-Swift.h +92 -56
  18. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Info.plist +0 -0
  19. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +111 -44
  20. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  21. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +111 -44
  22. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  23. package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/_CodeSignature/CodeResources +22 -22
  24. package/README.md +0 -115
@@ -1,840 +1,1119 @@
1
- import { BarkoderConstants } from './barkoder-nativescript.common';
1
+ import { BarkoderConstants } from "./barkoder-nativescript.common";
2
2
  import * as application from "@nativescript/core/application";
3
- import { View } from '@nativescript/core';
4
- import { BarkoderView } from './barkoder-nativescript.common';
3
+ import { View } from "@nativescript/core";
4
+ import { BarkoderView } from "./barkoder-nativescript.common";
5
5
 
6
- const androidSupport = global.androidx && global.androidx.appcompat ? global.androidx.core.app : android.support.v4.app;
6
+ const androidSupport =
7
+ global.androidx && global.androidx.appcompat
8
+ ? global.androidx.core.app
9
+ : android.support.v4.app;
7
10
  declare const com, global: any;
8
11
 
9
12
  const context = application.android.context;
10
13
  const Manifest = android.Manifest;
11
14
 
12
-
13
15
  export class BarkoderViewAndroid extends View {
14
- public bkdView : any
15
- public bkd : any
16
- public bkdConfig : any
17
- public bkdHelper : any
18
-
19
- constructor() {
20
- super();
21
- this.bkdConfig = com.barkoder.BarkoderConfig
22
- this.bkd = new com.barkoder.Barkoder()
23
- this.bkdView = new com.barkoder.BarkoderView(context, true)
24
- this.bkdView.config = new com.barkoder.BarkoderConfig(context, "asdad", null);
25
- this.bkdHelper = new com.barkoder.BarkoderHelper()
26
- // console.log(this._licenseKey)
27
- this.nativeView = this.bkdView
28
-
29
- }
30
-
31
- startScanning(BarkoderResultCallback: BarkoderConstants.BarkoderResultCallback): void {
32
- const resultCallback = new com.barkoder.interfaces.BarkoderResultCallback({
33
- scanningFinished: (results: any[], thumbnails: any[], resultImage: any) => {
34
- BarkoderResultCallback.scanningFinished(results, thumbnails, resultImage);
35
- }
36
- });
37
- this.bkdView.startScanning(resultCallback);
38
- }
39
-
40
- stopScanning(): void {
41
- this.bkdView.stopScanning()
42
- }
43
-
44
- pauseScanning() : void {
45
- this.bkdView.pauseScanning()
46
- }
47
-
48
- isFlashAvailable(callback : BarkoderConstants.FlashAvailableCallback) {
49
- const isFlashAvailableCallback = new com.barkoder.interfaces.FlashAvailableCallback({
50
- onFlashAvailable: (isFlashAvailable: any) => {
51
- callback.onFlashAvailable(isFlashAvailable)
52
- }
53
- });
54
- this.bkdView.isFlashAvailable(isFlashAvailableCallback)
55
- }
56
-
57
- setFlashEnabled(enabled : boolean) : void {
58
- this.bkdView.setFlashEnabled(enabled)
59
- }
60
-
61
- getMaxZoomFactor(callback : BarkoderConstants.MaxZoomAvailableCallback) {
62
- const MaxZoomCallback = new com.barkoder.interfaces.MaxZoomAvailableCallback({
63
- onMaxZoomAvailable: (maxZoomFacttor: any) => {
64
- callback.onMaxZoomAvailable(maxZoomFacttor)
65
- }
66
- });
67
- this.bkdView.getMaxZoomFactor(MaxZoomCallback)
68
- }
69
-
70
- setZoomFactor(zoomFactor : number) : void {
71
- this.bkdView.setZoomFactor(zoomFactor)
72
- }
73
-
74
- getLocationLineColorHex() : any {
75
- return this.bkdView.config.getLocationLineColor()
76
- }
77
-
78
- setLocationLineColor(locationLineColor : string) : void {
79
- const locationColor = this.hexToAndroidColor(locationLineColor)
80
- this.bkdView.config.setLocationLineColor(locationColor)
81
- }
82
-
83
- setRoiLineColor(roiLineColor: string) : void {
84
- const roiLineColorHex = this.hexToAndroidColor(roiLineColor)
85
- this.bkdView.config.setRoiLineColor(roiLineColorHex)
86
- }
87
-
88
- setRoiLineWidth(roiLineWidth : number) : void {
89
- this.bkdView.config.setRoiLineWidth(roiLineWidth)
16
+ public bkdView: any;
17
+ public bkd: any;
18
+ public bkdConfig: any;
19
+ public bkdHelper: any;
20
+
21
+ constructor() {
22
+ super();
23
+ this.bkdConfig = com.barkoder.BarkoderConfig;
24
+ this.bkd = new com.barkoder.Barkoder();
25
+ this.bkdView = new com.barkoder.BarkoderView(context, true);
26
+ this.bkdView.config = new com.barkoder.BarkoderConfig(
27
+ context,
28
+ "LICENSE_KEY",
29
+ null
30
+ );
31
+ this.bkdHelper = new com.barkoder.BarkoderHelper();
32
+ this.nativeView = this.bkdView;
33
+ }
34
+
35
+ /**
36
+ * Initiates the barcode scanning process, allowing the application to detect and decode barcodes from the device's camera feed
37
+ */
38
+ startScanning(
39
+ BarkoderResultCallback: BarkoderConstants.BarkoderResultCallback
40
+ ): void {
41
+ const resultCallback = new com.barkoder.interfaces.BarkoderResultCallback({
42
+ scanningFinished: (
43
+ results: any[],
44
+ thumbnails: any[],
45
+ resultImage: any
46
+ ) => {
47
+ BarkoderResultCallback.scanningFinished(
48
+ results,
49
+ thumbnails,
50
+ resultImage
51
+ );
52
+ },
53
+ });
54
+ this.bkdView.startScanning(resultCallback);
55
+ }
56
+
57
+ /**
58
+ * Halts the barcode scanning process, stopping the camera from capturing and processing barcode information
59
+ */
60
+ stopScanning(): void {
61
+ this.bkdView.stopScanning();
62
+ }
63
+
64
+ pauseScanning(): void {
65
+ this.bkdView.pauseScanning();
66
+ }
67
+
68
+ /**
69
+ * Checks whether the device has a built-in flash (torch) that can be used for illumination during barcode scanning
70
+ */
71
+ isFlashAvailable(callback: BarkoderConstants.FlashAvailableCallback) {
72
+ const isFlashAvailableCallback = new com.barkoder.interfaces.FlashAvailableCallback(
73
+ {
74
+ onFlashAvailable: (isFlashAvailable: any) => {
75
+ callback.onFlashAvailable(isFlashAvailable);
76
+ },
90
77
  }
91
-
92
- setRoiOverlayBackgroundColor(roiOverlayBackgroundColor) : void {
93
- const roiOberlayBackgroundColor = this.hexToAndroidColor(roiOverlayBackgroundColor)
94
- this.bkdView.config.setRoiOverlayBackgroundColor(roiOberlayBackgroundColor)
95
- }
96
-
97
- setCloseSessionOnResultEnabled(enabled : boolean) : void {
98
- this.bkdView.config.setCloseSessionOnResultEnabled(enabled)
99
- }
100
-
101
- setImageResultEnabled(enabled : boolean): void {
102
- this.bkdView.config.setImageResultEnabled(enabled);
103
- }
104
-
105
- setLocationInImageResultEnabled(enabled : boolean) : void {
106
- this.bkdView.config.setLocationInImageResultEnabled(enabled)
107
- }
108
-
109
- setLocationInPreviewEnabled(enabled : boolean) : void {
110
- this.bkdView.config.setLocationInPreviewEnabled(enabled)
111
- }
112
-
113
- setPinchToZoomEnabled(enabled : boolean) : void {
114
- this.bkdView.config.setPinchToZoomEnabled(enabled)
115
- }
116
-
117
- setRegionOfInterestVisible(enabled : boolean) : void {
118
- this.bkdView.config.setRegionOfInterestVisible(enabled)
119
- }
120
-
121
- setRegionOfInterest(
122
- left : number, top : number, width : number, height : number
123
- ) : void {
124
- this.bkdView.config.setRegionOfInterest(
125
- left, top, width, height
126
- );
127
- }
128
-
129
- setBeepOnSuccessEnabled(enabled : boolean) : void {
130
- this.bkdView.config.setBeepOnSuccessEnabled(enabled)
131
- }
132
-
133
- setVibrateOnSuccessEnabled(enabled: boolean) : void {
134
- this.bkdView.config.setVibrateOnSuccessEnabled(enabled)
135
- }
136
-
137
- getEncodingCharacterSet() : any {
138
- return this.bkdView.config.getDecoderConfig().encodingCharacterSet
139
- }
140
-
141
- getDecodingSpeed(): any {
142
- return this.bkdView.config.getDecoderConfig().decodingSpeed
143
- }
144
-
145
- getFormattingType() : any {
146
- return this.bkdView.config.getDecoderConfig().formattingType
147
- }
148
-
149
- setLocationLineWidth(width : number) : void {
150
- const roundedValue = Math.round(width * 100) / 100;
151
- this.bkdView.config.setLocationLineWidth(roundedValue);
152
- }
153
-
154
- getLocationLineWidth(): any {
155
- return this.bkdView.config.getLocationLineWidth();
156
- }
157
-
158
- getRoiLineWidth() : any {
159
- return this.bkdView.config.getRoiLineWidth()
160
- }
161
-
162
- getRoiOverlayBackgroundColorHex() : any {
163
- return this.bkdView.config.getRoiOverlayBackgroundColor()
164
- }
165
-
166
- isCloseSessionOnResultEnabled() : any {
167
- return this.bkdView.config.isCloseSessionOnResultEnabled()
168
- }
169
-
170
- isImageResultEnabled() : any {
171
- return this.bkdView.config.isImageResultEnabled()
172
- }
173
-
174
- isLocationInImageResultEnabled() : any {
175
- return this.bkdView.config.isLocationInImageResultEnabled()
176
- }
177
-
178
- getRegionOfInterest() : any {
179
- return this.bkdView.config.getRegionOfInterest()
180
- }
181
-
182
- getThreadsLimit() : any {
183
- return this.bkdConfig.GetThreadsLimit()
184
- }
185
-
186
- setThreadsLimit(threadsLimit : number) : void {
187
- this.bkdConfig.SetThreadsLimit(threadsLimit)
188
- }
189
-
190
- isLocationInPreviewEnabled() : Promise <any> {
191
- return this.bkdView.config.isLocationInPreviewEnabled()
192
- }
193
-
194
- isPinchToZoomEnabled() : Promise <any> {
195
- return this.bkdView.config.isPinchToZoomEnabled()
196
- }
197
-
198
- isRegionOfInterestVisible() : Promise <any> {
199
- return this.bkdView.config.isRegionOfInterestVisible()
200
- }
201
-
202
- isBeepOnSuccessEnabled() : Promise <any> {
203
- return this.bkdView.config.isBeepOnSuccessEnabled()
204
- }
205
-
206
- isVibrateOnSuccessEnabled() : Promise <any> {
207
- return this.bkdView.config.isVibrateOnSuccessEnabled()
208
- }
209
-
210
- getVersion() : any {
211
- return com.barkoder.Barkoder.GetVersion()
212
- }
213
-
214
- getMsiCheckSumType() : any {
215
- return this.bkdView.config.getDecoderConfig().Msi.checksumType
216
- }
217
-
218
- getCode39CheckSumType() : any {
219
- return this.bkdView.config.getDecoderConfig().Code39.checksumType
220
- }
221
-
222
- getCode11CheckSumType() : any {
223
- return this.bkdView.config.getDecoderConfig().Code11.checksumType
224
- }
225
-
226
- setBarkoderResolution(barkoderResolution : BarkoderConstants.BarkoderResolution) : void {
227
- if(barkoderResolution == BarkoderConstants.BarkoderResolution.NORMAL) {
228
- this.bkdView.config.setBarkoderResolution(com.barkoder.enums.BarkoderResolution.Normal);
229
- ;
230
- } else if (barkoderResolution == BarkoderConstants.BarkoderResolution.HIGH) {
231
- this.bkdView.config.setBarkoderResolution(com.barkoder.enums.BarkoderResolution.HIGH);
232
- }
233
- }
234
-
235
- getBarkoderResolution() : any {
236
- return this.bkdView.config.getBarkoderResolution()
237
- }
238
-
239
- setEncodingCharacterSet(encodingCharSet : any) : void {
240
- this.bkdView.config.getDecoderConfig().encodingCharacterSet = encodingCharSet
241
- }
242
-
243
- setDecodingSpeed(decodingSpeed: BarkoderConstants.DecodingSpeed): void {
244
- if(decodingSpeed == BarkoderConstants.DecodingSpeed.Slow) {
245
- this.bkdView.config.getDecoderConfig().decodingSpeed =
246
- com.barkoder.Barkoder.DecodingSpeed.Slow;
247
- } else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Fast){
248
- this.bkdView.config.getDecoderConfig().decodingSpeed =
249
- com.barkoder.Barkoder.DecodingSpeed.Fast;
250
- } else if(decodingSpeed == BarkoderConstants.DecodingSpeed.Normal){
251
- this.bkdView.config.getDecoderConfig().decodingSpeed =
252
- com.barkoder.Barkoder.DecodingSpeed.Normal;
253
- } else {
254
- console.log("Not avilbilable Decoding Speed")
255
- }
256
- }
257
-
258
- setFormattingType(formattingType: BarkoderConstants.FormattingType) {
259
- switch (formattingType) {
260
- case BarkoderConstants.FormattingType.Disabled:
261
- this.bkdView.config.getDecoderConfig().formattingType
262
- = com.barkoder.Barkoder.FormattingType.Disabled
263
- break;
264
- case BarkoderConstants.FormattingType.Automatic:
265
- this.bkdView.config.getDecoderConfig().formattingType
266
- = com.barkoder.Barkoder.FormattingType.Automatic
267
- break;
268
- case BarkoderConstants.FormattingType.GS1:
269
- this.bkdView.config.getDecoderConfig().formattingType
270
- = com.barkoder.Barkoder.FormattingType.GS1
271
- break;
272
- case BarkoderConstants.FormattingType.AAMVA:
273
- this.bkdView.config.getDecoderConfig().formattingType
274
- = com.barkoder.Barkoder.FormattingType.AAMVA
275
- break;
276
- }
277
- }
278
-
279
- setMsiCheckSumType(msiCheckSumType : BarkoderConstants.MsiChecksumType) {
280
- switch (msiCheckSumType) {
281
- case BarkoderConstants.MsiChecksumType.Disabled:
282
- this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Disabled
283
- break;
284
- case BarkoderConstants.MsiChecksumType.Mod10:
285
- this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod10
286
- break;
287
- case BarkoderConstants.MsiChecksumType.Mod11:
288
- this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod11
289
- break;
290
- case BarkoderConstants.MsiChecksumType.Mod1010:
291
- this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod1010
292
- break;
293
- case BarkoderConstants.MsiChecksumType.Mod1110:
294
- this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod1110
295
- break;
296
- case BarkoderConstants.MsiChecksumType.Mod11IBM:
297
- this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod11IBM
298
- break;
299
- case BarkoderConstants.MsiChecksumType.Mod1110IBM:
300
- this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod1110IBM
301
- break;
302
- }
303
- }
304
-
305
- setCode39CheckSumType(code39ChecksumType : BarkoderConstants.Code39ChecksumType) {
306
- switch(code39ChecksumType) {
307
- case BarkoderConstants.Code39ChecksumType.Disabled:
308
- this.bkdView.config.getDecoderConfig().Code39.checksumType = com.barkoder.Barkoder.Code39ChecksumType.Disabled
309
- break;
310
- case BarkoderConstants.Code39ChecksumType.Enabled:
311
- this.bkdView.config.getDecoderConfig().Code39.checksumType = com.barkoder.Barkoder.Code39ChecksumType.Enabled
312
- break;
313
- }
314
- }
315
-
316
- setCode11CheckSumType(code11CheckSumType : BarkoderConstants.Code11ChecksumType) {
317
- switch(code11CheckSumType) {
318
- case BarkoderConstants.Code11ChecksumType.Disabled:
319
- this.bkdView.config.getDecoderConfig().Code11.checksumType = com.barkoder.Barkoder.Code11ChecksumType.Disabled
320
- break;
321
- case BarkoderConstants.Code11ChecksumType.Single:
322
- this.bkdView.config.getDecoderConfig().Code11.checksumType = com.barkoder.Barkoder.Code11ChecksumType.Single
323
- break;
324
- case BarkoderConstants.Code11ChecksumType.Double:
325
- this.bkdView.config.getDecoderConfig().Code11.checksumType = com.barkoder.Barkoder.Code11ChecksumType.Double
326
- break;
327
- }
328
- }
329
-
330
- isBarcodeTypeEnabled(decoder: BarkoderConstants.DecoderType) : boolean {
331
- switch (decoder) {
332
- case BarkoderConstants.DecoderType.Aztec:
333
- return this.bkdView.config.getDecoderConfig().Aztec.enabled;
334
- case BarkoderConstants.DecoderType.AztecCompact:
335
- return this.bkdView.config.getDecoderConfig().AztecCompact.enabled;
336
- case BarkoderConstants.DecoderType.QR:
337
- return this.bkdView.config.getDecoderConfig().QR.enabled;
338
- case BarkoderConstants.DecoderType.QRMicro:
339
- return this.bkdView.config.getDecoderConfig().QRMicro.enabled;
340
- case BarkoderConstants.DecoderType.Code128:
341
- return this.bkdView.config.getDecoderConfig().Code128.enabled;
342
- case BarkoderConstants.DecoderType.Code93:
343
- return this.bkdView.config.getDecoderConfig().Code93.enabled;
344
- case BarkoderConstants.DecoderType.Code39:
345
- return this.bkdView.config.getDecoderConfig().Code39.enabled;
346
- case BarkoderConstants.DecoderType.Telepen:
347
- return this.bkdView.config.getDecoderConfig().Telepen.enabled;
348
- case BarkoderConstants.DecoderType.Code11:
349
- return this.bkdView.config.getDecoderConfig().Code11.enabled;
350
- case BarkoderConstants.DecoderType.Msi:
351
- return this.bkdView.config.getDecoderConfig().Msi.enabled;
352
- case BarkoderConstants.DecoderType.UpcA:
353
- return this.bkdView.config.getDecoderConfig().UpcA.enabled;
354
- case BarkoderConstants.DecoderType.UpcE:
355
- return this.bkdView.config.getDecoderConfig().UpcE.enabled;
356
- case BarkoderConstants.DecoderType.UpcE1:
357
- return this.bkdView.config.getDecoderConfig().UpcE1.enabled;
358
- case BarkoderConstants.DecoderType.Ean13:
359
- return this.bkdView.config.getDecoderConfig().Ean13.enabled;
360
- case BarkoderConstants.DecoderType.Ean8:
361
- return this.bkdView.config.getDecoderConfig().Ean8.enabled;
362
- case BarkoderConstants.DecoderType.PDF417:
363
- return this.bkdView.config.getDecoderConfig().PDF417.enabled;
364
- case BarkoderConstants.DecoderType.PDF417Micro:
365
- return this.bkdView.config.getDecoderConfig().PDF417Micro.enabled;
366
- case BarkoderConstants.DecoderType.Datamatrix:
367
- return this.bkdView.config.getDecoderConfig().Datamatrix.enabled;
368
- case BarkoderConstants.DecoderType.Code25:
369
- return this.bkdView.config.getDecoderConfig().Code25.enabled;
370
- case BarkoderConstants.DecoderType.Interleaved25:
371
- return this.bkdView.config.getDecoderConfig().Interleaved25.enabled;
372
- case BarkoderConstants.DecoderType.ITF14:
373
- return this.bkdView.config.getDecoderConfig().ITF14.enabled;
374
- case BarkoderConstants.DecoderType.IATA25:
375
- return this.bkdView.config.getDecoderConfig().IATA25.enabled;
376
- case BarkoderConstants.DecoderType.Matrix25:
377
- return this.bkdView.config.getDecoderConfig().Matrix25.enabled;
378
- case BarkoderConstants.DecoderType.Datalogic25:
379
- return this.bkdView.config.getDecoderConfig().Datalogic25.enabled;
380
- case BarkoderConstants.DecoderType.COOP25:
381
- return this.bkdView.config.getDecoderConfig().COOP25.enabled;
382
- case BarkoderConstants.DecoderType.Dotcode:
383
- return this.bkdView.config.getDecoderConfig().Dotcode.enabled;
384
- }
385
- }
386
-
387
- setBarcodeTypeEnabled(decoders: BarkoderConstants.DecoderType[]): void {
388
- this.bkdView.config.getDecoderConfig().Aztec.enabled = false;
389
- this.bkdView.config.getDecoderConfig().AztecCompact.enabled = false;
390
- this.bkdView.config.getDecoderConfig().QR.enabled = false;
391
- this.bkdView.config.getDecoderConfig().QRMicro.enabled = false;
392
- this.bkdView.config.getDecoderConfig().Code128.enabled = false;
393
- this.bkdView.config.getDecoderConfig().Code93.enabled = false;
394
- this.bkdView.config.getDecoderConfig().Code39.enabled = false;
395
- this.bkdView.config.getDecoderConfig().Telepen.enabled = false;
396
- this.bkdView.config.getDecoderConfig().Code11.enabled = false;
397
- this.bkdView.config.getDecoderConfig().Codabar.enabled = false;
398
- this.bkdView.config.getDecoderConfig().Msi.enabled = false;
399
- this.bkdView.config.getDecoderConfig().UpcA.enabled = false;
400
- this.bkdView.config.getDecoderConfig().UpcE.enabled = false;
401
- this.bkdView.config.getDecoderConfig().UpcE1.enabled = false;
402
- this.bkdView.config.getDecoderConfig().Ean13.enabled = false;
403
- this.bkdView.config.getDecoderConfig().Ean8.enabled = false;
404
- this.bkdView.config.getDecoderConfig().PDF417.enabled = false;
405
- this.bkdView.config.getDecoderConfig().PDF417Micro.enabled = false;
406
- this.bkdView.config.getDecoderConfig().Datamatrix.enabled = false;
407
- this.bkdView.config.getDecoderConfig().Code25.enabled = false;
408
- this.bkdView.config.getDecoderConfig().Interleaved25.enabled = false;
409
- this.bkdView.config.getDecoderConfig().ITF14.enabled = false;
410
- this.bkdView.config.getDecoderConfig().IATA25.enabled = false;
411
- this.bkdView.config.getDecoderConfig().Matrix25.enabled = false;
412
- this.bkdView.config.getDecoderConfig().Datalogic25.enabled = false;
413
- this.bkdView.config.getDecoderConfig().COOP25.enabled = false;
414
- this.bkdView.config.getDecoderConfig().Dotcode.enabled = false;
415
- decoders.forEach((dt: BarkoderConstants.DecoderType) => {
416
- switch (dt) {
417
- case BarkoderConstants.DecoderType.Aztec:
418
- this.bkdView.config.getDecoderConfig().Aztec.enabled = true;
419
- break;
420
- case BarkoderConstants.DecoderType.AztecCompact:
421
- this.bkdView.config.getDecoderConfig().AztecCompact.enabled = true;
422
- break;
423
- case BarkoderConstants.DecoderType.QR:
424
- this.bkdView.config.getDecoderConfig().QR.enabled = true;
425
- break;
426
- case BarkoderConstants.DecoderType.QRMicro:
427
- this.bkdView.config.getDecoderConfig().QRMicro.enabled = true;
428
- break;
429
- case BarkoderConstants.DecoderType.Code128:
430
- this.bkdView.config.getDecoderConfig().Code128.enabled = true;
431
- break;
432
- case BarkoderConstants.DecoderType.Code93:
433
- this.bkdView.config.getDecoderConfig().Code93.enabled = true;
434
- break;
435
- case BarkoderConstants.DecoderType.Code39:
436
- this.bkdView.config.getDecoderConfig().Code39.enabled = true;
437
- break;
438
- case BarkoderConstants.DecoderType.Telepen:
439
- this.bkdView.config.getDecoderConfig().Telepen.enabled = true;
440
- break;
441
- case BarkoderConstants.DecoderType.Code11:
442
- this.bkdView.config.getDecoderConfig().Code11.enabled = true;
443
- break;
444
- case BarkoderConstants.DecoderType.Msi:
445
- this.bkdView.config.getDecoderConfig().Msi.enabled = true;
446
- break;
447
- case BarkoderConstants.DecoderType.UpcA:
448
- this.bkdView.config.getDecoderConfig().UpcA.enabled = true;
449
- break;
450
- case BarkoderConstants.DecoderType.UpcE:
451
- this.bkdView.config.getDecoderConfig().UpcE.enabled = true;
452
- break;
453
- case BarkoderConstants.DecoderType.UpcE1:
454
- this.bkdView.config.getDecoderConfig().UpcE1.enabled = true;
455
- break;
456
- case BarkoderConstants.DecoderType.Ean13:
457
- this.bkdView.config.getDecoderConfig().Ean13.enabled = true;
458
- break;
459
- case BarkoderConstants.DecoderType.Ean8:
460
- this.bkdView.config.getDecoderConfig().Ean8.enabled = true;
461
- break;
462
- case BarkoderConstants.DecoderType.PDF417:
463
- this.bkdView.config.getDecoderConfig().PDF417.enabled = true;
464
- break;
465
- case BarkoderConstants.DecoderType.PDF417Micro:
466
- this.bkdView.config.getDecoderConfig().PDF417Micro.enabled = true;
467
- break;
468
- case BarkoderConstants.DecoderType.Datamatrix:
469
- this.bkdView.config.getDecoderConfig().Datamatrix.enabled = true;
470
- break;
471
- case BarkoderConstants.DecoderType.Code25:
472
- this.bkdView.config.getDecoderConfig().Code25.enabled = true;
473
- break;
474
- case BarkoderConstants.DecoderType.Interleaved25:
475
- this.bkdView.config.getDecoderConfig().Interleaved25.enabled = true;
476
- break;
477
- case BarkoderConstants.DecoderType.ITF14:
478
- this.bkdView.config.getDecoderConfig().ITF14.enabled = true;
479
- break;
480
- case BarkoderConstants.DecoderType.IATA25:
481
- this.bkdView.config.getDecoderConfig().IATA25.enabled = true;
482
- break;
483
- case BarkoderConstants.DecoderType.Matrix25:
484
- this.bkdView.config.getDecoderConfig().Matrix25.enabled = true;
485
- break;
486
- case BarkoderConstants.DecoderType.Datalogic25:
487
- this.bkdView.config.getDecoderConfig().Datalogic25.enabled = true;
488
- break;
489
- case BarkoderConstants.DecoderType.COOP25:
490
- this.bkdView.config.getDecoderConfig().COOP25.enabled = true;
491
- break;
492
- case BarkoderConstants.DecoderType.Dotcode:
493
- this.bkdView.config.getDecoderConfig().Dotcode.enabled = true;
494
- break;
495
- default:
496
- break;
497
- }
498
- });
78
+ );
79
+ this.bkdView.isFlashAvailable(isFlashAvailableCallback);
80
+ }
81
+
82
+ /**
83
+ * Enables or disables the device's flash (torch) for illumination during barcode scanning
84
+ * @param enabled
85
+ */
86
+ setFlashEnabled(enabled: boolean): void {
87
+ this.bkdView.setFlashEnabled(enabled);
88
+ }
89
+
90
+ /**
91
+ * Retrieves the maximum available zoom factor for the device's camera
92
+ */
93
+ getMaxZoomFactor(callback: BarkoderConstants.MaxZoomAvailableCallback) {
94
+ const MaxZoomCallback = new com.barkoder.interfaces.MaxZoomAvailableCallback(
95
+ {
96
+ onMaxZoomAvailable: (maxZoomFacttor: any) => {
97
+ callback.onMaxZoomAvailable(maxZoomFacttor);
98
+ },
499
99
  }
500
-
501
- setBarcodeTypeLengthRange(decoder: BarkoderConstants.DecoderType, minimumLength:number, maximumLength: number) {
502
- switch (decoder) {
503
- case BarkoderConstants.DecoderType.Aztec:
504
- this.bkdView.config.getDecoderConfig().Aztec.minimumLength = minimumLength
505
- this.bkdView.config.getDecoderConfig().Aztec.maximumLength = maximumLength
506
- break;
507
- case BarkoderConstants.DecoderType.AztecCompact:
508
- this.bkdView.config.getDecoderConfig().AztecCompact.minimumLength = minimumLength
509
- this.bkdView.config.getDecoderConfig().AztecCompact.maximumLength = maximumLength
510
- break;
511
- case BarkoderConstants.DecoderType.QR:
512
- this.bkdView.config.getDecoderConfig().QR.minimumLength = minimumLength
513
- this.bkdView.config.getDecoderConfig().QR.maximumLength = maximumLength
514
- break;
515
- case BarkoderConstants.DecoderType.QRMicro:
516
- this.bkdView.config.getDecoderConfig().QRMicro.minimumLength = minimumLength
517
- this.bkdView.config.getDecoderConfig().QRMicro.maximumLength = maximumLength
518
- break;
519
- case BarkoderConstants.DecoderType.Code128:
520
- this.bkdView.config.getDecoderConfig().Code128.minimumLength = minimumLength
521
- this.bkdView.config.getDecoderConfig().Code128.maximumLength = maximumLength
522
- break;
523
- case BarkoderConstants.DecoderType.Code93:
524
- this.bkdView.config.getDecoderConfig().Code93.minimumLength = minimumLength
525
- this.bkdView.config.getDecoderConfig().Code93.maximumLength = maximumLength
526
- break;
527
- case BarkoderConstants.DecoderType.Code39:
528
- this.bkdView.config.getDecoderConfig().Code39.minimumLength = minimumLength
529
- this.bkdView.config.getDecoderConfig().Code39.maximumLength = maximumLength
530
- break;
531
- case BarkoderConstants.DecoderType.Telepen:
532
- this.bkdView.config.getDecoderConfig().Telepen.minimumLength = minimumLength
533
- this.bkdView.config.getDecoderConfig().Telepen.maximumLength = maximumLength
534
- break;
535
- case BarkoderConstants.DecoderType.Code11:
536
- this.bkdView.config.getDecoderConfig().Code11.minimumLength = minimumLength
537
- this.bkdView.config.getDecoderConfig().Code11.maximumLength = maximumLength
538
- break;
539
- case BarkoderConstants.DecoderType.Msi:
540
- this.bkdView.config.getDecoderConfig().Msi.minimumLength = minimumLength
541
- this.bkdView.config.getDecoderConfig().Msi.maximumLength = maximumLength
542
- break;
543
- case BarkoderConstants.DecoderType.UpcA:
544
- this.bkdView.config.getDecoderConfig().UpcA.minimumLength = minimumLength
545
- this.bkdView.config.getDecoderConfig().UpcA.maximumLength = maximumLength
546
- break;
547
- case BarkoderConstants.DecoderType.UpcE:
548
- this.bkdView.config.getDecoderConfig().UpcE.minimumLength = minimumLength
549
- this.bkdView.config.getDecoderConfig().UpcE.maximumLength = maximumLength
550
- break;
551
- case BarkoderConstants.DecoderType.UpcE1:
552
- this.bkdView.config.getDecoderConfig().UpcE1.minimumLength = minimumLength
553
- this.bkdView.config.getDecoderConfig().UpcE1.maximumLength = maximumLength
554
- break;
555
- case BarkoderConstants.DecoderType.Ean13:
556
- this.bkdView.config.getDecoderConfig().Ean13.minimumLength = minimumLength
557
- this.bkdView.config.getDecoderConfig().Ean13.maximumLength = maximumLength
558
- break;
559
- case BarkoderConstants.DecoderType.Ean8:
560
- this.bkdView.config.getDecoderConfig().Ean8.minimumLength = minimumLength
561
- this.bkdView.config.getDecoderConfig().Ean8.maximumLength = maximumLength
562
- break;
563
- case BarkoderConstants.DecoderType.PDF417:
564
- this.bkdView.config.getDecoderConfig().PDF417.minimumLength = minimumLength
565
- this.bkdView.config.getDecoderConfig().PDF417.maximumLength = maximumLength
566
- break;
567
- case BarkoderConstants.DecoderType.PDF417Micro:
568
- this.bkdView.config.getDecoderConfig().PDF417Micro.minimumLength = minimumLength
569
- this.bkdView.config.getDecoderConfig().PDF417Micro.maximumLength = maximumLength
570
- break;
571
- case BarkoderConstants.DecoderType.Datamatrix:
572
- this.bkdView.config.getDecoderConfig().Datamatrix.minimumLength = minimumLength
573
- this.bkdView.config.getDecoderConfig().Datamatrix.maximumLength = maximumLength
574
- break;
575
- case BarkoderConstants.DecoderType.Code25:
576
- this.bkdView.config.getDecoderConfig().Code25.minimumLength = minimumLength
577
- this.bkdView.config.getDecoderConfig().Code25.maximumLength = maximumLength
578
- break;
579
- case BarkoderConstants.DecoderType.Interleaved25:
580
- this.bkdView.config.getDecoderConfig().Interleaved25.minimumLength = minimumLength
581
- this.bkdView.config.getDecoderConfig().Interleaved25.maximumLength = maximumLength
582
- break;
583
- case BarkoderConstants.DecoderType.ITF14:
584
- this.bkdView.config.getDecoderConfig().ITF14.minimumLength = minimumLength
585
- this.bkdView.config.getDecoderConfig().ITF14.maximumLength = maximumLength
586
- break;
587
- case BarkoderConstants.DecoderType.IATA25:
588
- this.bkdView.config.getDecoderConfig().IATA25.minimumLength = minimumLength
589
- this.bkdView.config.getDecoderConfig().IATA25.maximumLength = maximumLength
590
- break;
591
- case BarkoderConstants.DecoderType.Matrix25:
592
- this.bkdView.config.getDecoderConfig().Matrix25.minimumLength = minimumLength
593
- this.bkdView.config.getDecoderConfig().Matrix25.maximumLength = maximumLength
594
- break;
595
- case BarkoderConstants.DecoderType.Datalogic25:
596
- this.bkdView.config.getDecoderConfig().Datalogic25.minimumLength = minimumLength
597
- this.bkdView.config.getDecoderConfig().Datalogic25.maximumLength = maximumLength
598
- break;
599
- case BarkoderConstants.DecoderType.COOP25:
600
- this.bkdView.config.getDecoderConfig().COOP25.minimumLength = minimumLength
601
- this.bkdView.config.getDecoderConfig().COOP25.maximumLength = maximumLength
602
- break;
603
- case BarkoderConstants.DecoderType.Dotcode:
604
- this.bkdView.config.getDecoderConfig().Dotcode.minimumLength = minimumLength
605
- this.bkdView.config.getDecoderConfig().Dotcode.maximumLength = maximumLength
606
- break;
607
- default:
608
- break;
609
- }
100
+ );
101
+ this.bkdView.getMaxZoomFactor(MaxZoomCallback);
102
+ }
103
+
104
+ /**
105
+ * Sets the zoom factor for the device's camera, adjusting the level of zoom during barcode scanning
106
+ * @param zoomFactor
107
+ */
108
+ setZoomFactor(zoomFactor: number): void {
109
+ this.bkdView.setZoomFactor(zoomFactor);
110
+ }
111
+
112
+ /**
113
+ * Retrieves the hexadecimal color code representing the line color used to indicate the location of detected barcodes
114
+ */
115
+ getLocationLineColorHex(): any {
116
+ return this.bkdView.config.getLocationLineColor();
117
+ }
118
+
119
+ /**
120
+ * Sets the color of the lines used to indicate the location of detected barcodes on the camera feed
121
+ */
122
+ setLocationLineColor(locationLineColor: string): void {
123
+ const locationColor = this.hexToAndroidColor(locationLineColor);
124
+ this.bkdView.config.setLocationLineColor(locationColor);
125
+ }
126
+
127
+ /**
128
+ * Sets the color of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed
129
+ */
130
+ setRoiLineColor(roiLineColor: string): void {
131
+ const roiLineColorHex = this.hexToAndroidColor(roiLineColor);
132
+ this.bkdView.config.setRoiLineColor(roiLineColorHex);
133
+ }
134
+
135
+ /**
136
+ * Sets the width of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed
137
+ */
138
+ setRoiLineWidth(roiLineWidth: number): void {
139
+ this.bkdView.config.setRoiLineWidth(roiLineWidth);
140
+ }
141
+
142
+ /**
143
+ * Sets the background color of the overlay within the Region of Interest (ROI) for barcode scanning on the camera feed
144
+ */
145
+ setRoiOverlayBackgroundColor(roiOverlayBackgroundColor): void {
146
+ const roiOberlayBackgroundColor = this.hexToAndroidColor(
147
+ roiOverlayBackgroundColor
148
+ );
149
+ this.bkdView.config.setRoiOverlayBackgroundColor(roiOberlayBackgroundColor);
150
+ }
151
+
152
+ /**
153
+ * Enables or disables the automatic closing of the scanning session upon detecting a barcode result
154
+ */
155
+ setCloseSessionOnResultEnabled(enabled: boolean): void {
156
+ this.bkdView.config.setCloseSessionOnResultEnabled(enabled);
157
+ }
158
+
159
+ /**
160
+ * Enables or disables the capturing and processing of image data when a barcode is successfully detected
161
+ */
162
+ setImageResultEnabled(enabled: boolean): void {
163
+ this.bkdView.config.setImageResultEnabled(enabled);
164
+ }
165
+
166
+ /**
167
+ * Enables or disables the inclusion of barcode location information within the image data result
168
+ */
169
+ setLocationInImageResultEnabled(enabled: boolean): void {
170
+ this.bkdView.config.setLocationInImageResultEnabled(enabled);
171
+ }
172
+
173
+ /**
174
+ * Enables or disables the display of barcode location information on the camera preview
175
+ */
176
+ setLocationInPreviewEnabled(enabled: boolean): void {
177
+ this.bkdView.config.setLocationInPreviewEnabled(enabled);
178
+ }
179
+
180
+ /**
181
+ * Enables or disables the pinch-to-zoom feature for adjusting the zoom level during barcode scanning
182
+ */
183
+ setPinchToZoomEnabled(enabled: boolean): void {
184
+ this.bkdView.config.setPinchToZoomEnabled(enabled);
185
+ }
186
+
187
+ /**
188
+ * Sets the visibility of the Region of Interest (ROI) on the camera preview
189
+ */
190
+ setRegionOfInterestVisible(enabled: boolean): void {
191
+ this.bkdView.config.setRegionOfInterestVisible(enabled);
192
+ }
193
+
194
+ /**
195
+ * Defines the Region of Interest (ROI) on the camera preview for barcode scanning, specifying an area where the application focuses on detecting barcodes
196
+ */
197
+ setRegionOfInterest(
198
+ left: number,
199
+ top: number,
200
+ width: number,
201
+ height: number
202
+ ): void {
203
+ this.bkdView.config.setRegionOfInterest(left, top, width, height);
204
+ }
205
+
206
+ /**
207
+ * Enables or disables the audible beep sound upon successfully decoding a barcode
208
+ */
209
+ setBeepOnSuccessEnabled(enabled: boolean): void {
210
+ this.bkdView.config.setBeepOnSuccessEnabled(enabled);
211
+ }
212
+
213
+ /**
214
+ * Enables or disables the device vibration upon successfully decoding a barcode.
215
+ */
216
+ setVibrateOnSuccessEnabled(enabled: boolean): void {
217
+ this.bkdView.config.setVibrateOnSuccessEnabled(enabled);
218
+ }
219
+
220
+ /**
221
+ * Retrieves the character set used for encoding barcode data
222
+ */
223
+ getEncodingCharacterSet(): any {
224
+ return this.bkdView.config.getDecoderConfig().encodingCharacterSet;
225
+ }
226
+
227
+ /**
228
+ * Retrieves the current decoding speed setting for barcode scanning
229
+ */
230
+ getDecodingSpeed(): any {
231
+ return this.bkdView.config.getDecoderConfig().decodingSpeed;
232
+ }
233
+
234
+ /**
235
+ * Retrieves the formatting type used for presenting decoded barcode data
236
+ */
237
+ getFormattingType(): any {
238
+ return this.bkdView.config.getDecoderConfig().formattingType;
239
+ }
240
+
241
+ /**
242
+ * Sets the width of the lines indicating the location of detected barcodes on the camera feed
243
+ */
244
+ setLocationLineWidth(width: number): void {
245
+ const roundedValue = Math.round(width * 100) / 100;
246
+ this.bkdView.config.setLocationLineWidth(roundedValue);
247
+ }
248
+
249
+ /**
250
+ * Retrieves the current width setting for the lines indicating the location of detected barcodes on the camera feed
251
+ */
252
+ getLocationLineWidth(): any {
253
+ return this.bkdView.config.getLocationLineWidth();
254
+ }
255
+
256
+ /**
257
+ * Retrieves the current width setting for the lines outlining the Region of Interest (ROI) on the camera preview
258
+ */
259
+ getRoiLineWidth(): any {
260
+ return this.bkdView.config.getRoiLineWidth();
261
+ }
262
+
263
+ /**
264
+ * Retrieves the hexadecimal color code representing the background color of the overlay within the Region of Interest (ROI) on the camera preview
265
+ */
266
+ getRoiOverlayBackgroundColorHex(): any {
267
+ return this.bkdView.config.getRoiOverlayBackgroundColor();
268
+ }
269
+
270
+ /**
271
+ * Enables or disables the automatic closing of the scanning session upon detecting a barcode result
272
+ */
273
+ isCloseSessionOnResultEnabled(): any {
274
+ return this.bkdView.config.isCloseSessionOnResultEnabled();
275
+ }
276
+
277
+ /**
278
+ * Enables or disables the capturing and processing of image data when a barcode is successfully detected
279
+ */
280
+ isImageResultEnabled(): any {
281
+ return this.bkdView.config.isImageResultEnabled();
282
+ }
283
+
284
+ /**
285
+ * Enables or disables the inclusion of barcode location information within the image data result
286
+ */
287
+ isLocationInImageResultEnabled(): any {
288
+ return this.bkdView.config.isLocationInImageResultEnabled();
289
+ }
290
+
291
+ /**
292
+ * Retrieves the region of interest (ROI)
293
+ */
294
+ getRegionOfInterest(): any {
295
+ return this.bkdView.config.getRegionOfInterest();
296
+ }
297
+
298
+ /**
299
+ * Retrieves the threads limit
300
+ */
301
+ getThreadsLimit(): any {
302
+ return this.bkdConfig.GetThreadsLimit();
303
+ }
304
+
305
+ /**
306
+ * Sets the threads limit
307
+ */
308
+ setThreadsLimit(threadsLimit: number): void {
309
+ this.bkdConfig.SetThreadsLimit(threadsLimit);
310
+ }
311
+
312
+ /**
313
+ * Checks if location in preview is enabled
314
+ */
315
+ isLocationInPreviewEnabled(): Promise<any> {
316
+ return this.bkdView.config.isLocationInPreviewEnabled();
317
+ }
318
+
319
+ /**
320
+ * Checks if pinch to zoom is enabled
321
+ */
322
+ isPinchToZoomEnabled(): Promise<any> {
323
+ return this.bkdView.config.isPinchToZoomEnabled();
324
+ }
325
+
326
+ /**
327
+ * Checks if the region of interest (ROI) is visible
328
+ */
329
+ isRegionOfInterestVisible(): Promise<any> {
330
+ return this.bkdView.config.isRegionOfInterestVisible();
331
+ }
332
+
333
+ /**
334
+ * Retrieves the value indicating whether a beep sound is played on successful barcode scanning
335
+ */
336
+ isBeepOnSuccessEnabled(): Promise<any> {
337
+ return this.bkdView.config.isBeepOnSuccessEnabled();
338
+ }
339
+
340
+ /**
341
+ * Retrieves the value indicating whether vibration is enabled on successful barcode scanning
342
+ */
343
+ isVibrateOnSuccessEnabled(): Promise<any> {
344
+ return this.bkdView.config.isVibrateOnSuccessEnabled();
345
+ }
346
+
347
+ /**
348
+ * Retrieves the version of the Barkoder library
349
+ */
350
+ getVersion(): any {
351
+ return com.barkoder.Barkoder.GetVersion();
352
+ }
353
+
354
+ /**
355
+ * Retrieves the MSI checksum type
356
+ */
357
+ getMsiCheckSumType(): any {
358
+ return this.bkdView.config.getDecoderConfig().Msi.checksumType;
359
+ }
360
+
361
+ /**
362
+ * Retrieves the checksum type for Code 39 barcodes
363
+ */
364
+ getCode39CheckSumType(): any {
365
+ return this.bkdView.config.getDecoderConfig().Code39.checksumType;
366
+ }
367
+
368
+ /**
369
+ * Retrieves the Code11 checksum type
370
+ */
371
+ getCode11CheckSumType(): any {
372
+ return this.bkdView.config.getDecoderConfig().Code11.checksumType;
373
+ }
374
+
375
+ /**
376
+ * Sets the resolution for barcode scanning
377
+ */
378
+ setBarkoderResolution(
379
+ barkoderResolution: BarkoderConstants.BarkoderResolution
380
+ ): void {
381
+ if (barkoderResolution == BarkoderConstants.BarkoderResolution.NORMAL) {
382
+ this.bkdView.config.setBarkoderResolution(
383
+ com.barkoder.enums.BarkoderResolution.Normal
384
+ );
385
+ } else if (
386
+ barkoderResolution == BarkoderConstants.BarkoderResolution.HIGH
387
+ ) {
388
+ this.bkdView.config.setBarkoderResolution(
389
+ com.barkoder.enums.BarkoderResolution.HIGH
390
+ );
610
391
  }
611
-
612
- getBarcodeTypeMaximumLenght(decoder: BarkoderConstants.DecoderType) : any {
613
- switch (decoder) {
614
- case BarkoderConstants.DecoderType.Aztec:
615
- return this.bkdView.config.getDecoderConfig().Aztec.maximumLength
616
- case BarkoderConstants.DecoderType.AztecCompact:
617
- return this.bkdView.config.getDecoderConfig().AztecCompact.maximumLength
618
- case BarkoderConstants.DecoderType.QR:
619
- return this.bkdView.config.getDecoderConfig().QR.maximumLength
620
- case BarkoderConstants.DecoderType.QRMicro:
621
- return this.bkdView.config.getDecoderConfig().QRMicro.maximumLength
622
- case BarkoderConstants.DecoderType.Code128:
623
- return this.bkdView.config.getDecoderConfig().Code128.maximumLength
624
- case BarkoderConstants.DecoderType.Code93:
625
- return this.bkdView.config.getDecoderConfig().Code93.maximumLength
626
- case BarkoderConstants.DecoderType.Code39:
627
- return this.bkdView.config.getDecoderConfig().Code39.maximumLength
628
- case BarkoderConstants.DecoderType.Telepen:
629
- return this.bkdView.config.getDecoderConfig().Telepen.maximumLength
630
- case BarkoderConstants.DecoderType.Code11:
631
- return this.bkdView.config.getDecoderConfig().Code11.maximumLength
632
- case BarkoderConstants.DecoderType.Msi:
633
- return this.bkdView.config.getDecoderConfig().Msi.maximumLength
634
- case BarkoderConstants.DecoderType.UpcA:
635
- return this.bkdView.config.getDecoderConfig().UpcA.maximumLength
636
- case BarkoderConstants.DecoderType.UpcE:
637
- return this.bkdView.config.getDecoderConfig().UpcE.maximumLength
638
- case BarkoderConstants.DecoderType.UpcE1:
639
- return this.bkdView.config.getDecoderConfig().UpcE1.maximumLength
640
- case BarkoderConstants.DecoderType.Ean13:
641
- return this.bkdView.config.getDecoderConfig().Ean13.maximumLength
642
- case BarkoderConstants.DecoderType.Ean8:
643
- return this.bkdView.config.getDecoderConfig().Ean8.maximumLength
644
- case BarkoderConstants.DecoderType.PDF417:
645
- return this.bkdView.config.getDecoderConfig().PDF417.maximumLength
646
- case BarkoderConstants.DecoderType.PDF417Micro:
647
- return this.bkdView.config.getDecoderConfig().PDF417Micro.maximumLength
648
- case BarkoderConstants.DecoderType.Datamatrix:
649
- return this.bkdView.config.getDecoderConfig().Datamatrix.maximumLength
650
- case BarkoderConstants.DecoderType.Code25:
651
- return this.bkdView.config.getDecoderConfig().Code25.maximumLength
652
- case BarkoderConstants.DecoderType.Interleaved25:
653
- return this.bkdView.config.getDecoderConfig().Interleaved25.maximumLength
654
- case BarkoderConstants.DecoderType.ITF14:
655
- return this.bkdView.config.getDecoderConfig().ITF14.maximumLength
656
- case BarkoderConstants.DecoderType.IATA25:
657
- return this.bkdView.config.getDecoderConfig().IATA25.maximumLength
658
- case BarkoderConstants.DecoderType.Matrix25:
659
- return this.bkdView.config.getDecoderConfig().Matrix25.maximumLength
660
- case BarkoderConstants.DecoderType.Datalogic25:
661
- return this.bkdView.config.getDecoderConfig().Datalogic25.maximumLength
662
- case BarkoderConstants.DecoderType.COOP25:
663
- return this.bkdView.config.getDecoderConfig().COOP25.maximumLength
664
- case BarkoderConstants.DecoderType.Dotcode:
665
- return this.bkdView.config.getDecoderConfig().Dotcode.maximumLength
666
- }
392
+ }
393
+
394
+ /**
395
+ * Retrieves the resolution for barcode scanning
396
+ */
397
+ getBarkoderResolution(): any {
398
+ return this.bkdView.config.getBarkoderResolution();
399
+ }
400
+
401
+ /**
402
+ * Sets the encoding character set for barcode scanning
403
+ */
404
+ setEncodingCharacterSet(encodingCharSet: any): void {
405
+ this.bkdView.config.getDecoderConfig().encodingCharacterSet = encodingCharSet;
406
+ }
407
+
408
+ /**
409
+ * Sets the decoding speed for barcode scanning
410
+ */
411
+ setDecodingSpeed(decodingSpeed: BarkoderConstants.DecodingSpeed): void {
412
+ if (decodingSpeed == BarkoderConstants.DecodingSpeed.Slow) {
413
+ this.bkdView.config.getDecoderConfig().decodingSpeed =
414
+ com.barkoder.Barkoder.DecodingSpeed.Slow;
415
+ } else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Fast) {
416
+ this.bkdView.config.getDecoderConfig().decodingSpeed =
417
+ com.barkoder.Barkoder.DecodingSpeed.Fast;
418
+ } else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Normal) {
419
+ this.bkdView.config.getDecoderConfig().decodingSpeed =
420
+ com.barkoder.Barkoder.DecodingSpeed.Normal;
421
+ } else {
422
+ console.log("Not avilbilable Decoding Speed");
667
423
  }
668
-
669
- getBarcodeTypeMinimumLenght(decoder: BarkoderConstants.DecoderType) : any {
670
- switch (decoder) {
671
- case BarkoderConstants.DecoderType.Aztec:
672
- return this.bkdView.config.getDecoderConfig().Aztec.minimumLength
673
- case BarkoderConstants.DecoderType.AztecCompact:
674
- return this.bkdView.config.getDecoderConfig().AztecCompact.minimumLength
675
- case BarkoderConstants.DecoderType.QR:
676
- return this.bkdView.config.getDecoderConfig().QR.minimumLength
677
- case BarkoderConstants.DecoderType.QRMicro:
678
- return this.bkdView.config.getDecoderConfig().QRMicro.minimumLength
679
- case BarkoderConstants.DecoderType.Code128:
680
- return this.bkdView.config.getDecoderConfig().Code128.minimumLength
681
- case BarkoderConstants.DecoderType.Code93:
682
- return this.bkdView.config.getDecoderConfig().Code93.minimumLength
683
- case BarkoderConstants.DecoderType.Code39:
684
- return this.bkdView.config.getDecoderConfig().Code39.minimumLength
685
- case BarkoderConstants.DecoderType.Telepen:
686
- return this.bkdView.config.getDecoderConfig().Telepen.minimumLength
687
- case BarkoderConstants.DecoderType.Code11:
688
- return this.bkdView.config.getDecoderConfig().Code11.minimumLength
689
- case BarkoderConstants.DecoderType.Msi:
690
- return this.bkdView.config.getDecoderConfig().Msi.minimumLength
691
- case BarkoderConstants.DecoderType.UpcA:
692
- return this.bkdView.config.getDecoderConfig().UpcA.minimumLength
693
- case BarkoderConstants.DecoderType.UpcE:
694
- return this.bkdView.config.getDecoderConfig().UpcE.minimumLength
695
- case BarkoderConstants.DecoderType.UpcE1:
696
- return this.bkdView.config.getDecoderConfig().UpcE1.minimumLength
697
- case BarkoderConstants.DecoderType.Ean13:
698
- return this.bkdView.config.getDecoderConfig().Ean13.minimumLength
699
- case BarkoderConstants.DecoderType.Ean8:
700
- return this.bkdView.config.getDecoderConfig().Ean8.minimumLength
701
- case BarkoderConstants.DecoderType.PDF417:
702
- return this.bkdView.config.getDecoderConfig().PDF417.minimumLength
703
- case BarkoderConstants.DecoderType.PDF417Micro:
704
- return this.bkdView.config.getDecoderConfig().PDF417Micro.minimumLength
705
- case BarkoderConstants.DecoderType.Datamatrix:
706
- return this.bkdView.config.getDecoderConfig().Datamatrix.minimumLength
707
- case BarkoderConstants.DecoderType.Code25:
708
- return this.bkdView.config.getDecoderConfig().Code25.minimumLength
709
- case BarkoderConstants.DecoderType.Interleaved25:
710
- return this.bkdView.config.getDecoderConfig().Interleaved25.minimumLength
711
- case BarkoderConstants.DecoderType.ITF14:
712
- return this.bkdView.config.getDecoderConfig().ITF14.minimumLength
713
- case BarkoderConstants.DecoderType.IATA25:
714
- return this.bkdView.config.getDecoderConfig().IATA25.minimumLength
715
- case BarkoderConstants.DecoderType.Matrix25:
716
- return this.bkdView.config.getDecoderConfig().Matrix25.minimumLength
717
- case BarkoderConstants.DecoderType.Datalogic25:
718
- return this.bkdView.config.getDecoderConfig().Datalogic25.minimumLength
719
- case BarkoderConstants.DecoderType.COOP25:
720
- return this.bkdView.config.getDecoderConfig().COOP25.minimumLength
721
- case BarkoderConstants.DecoderType.Dotcode:
722
- return this.bkdView.config.getDecoderConfig().Dotcode.minimumLength
723
- }
424
+ }
425
+
426
+ /**
427
+ * Sets the formatting type for barcode scanning
428
+ */
429
+ setFormattingType(formattingType: BarkoderConstants.FormattingType) {
430
+ switch (formattingType) {
431
+ case BarkoderConstants.FormattingType.Disabled:
432
+ this.bkdView.config.getDecoderConfig().formattingType =
433
+ com.barkoder.Barkoder.FormattingType.Disabled;
434
+ break;
435
+ case BarkoderConstants.FormattingType.Automatic:
436
+ this.bkdView.config.getDecoderConfig().formattingType =
437
+ com.barkoder.Barkoder.FormattingType.Automatic;
438
+ break;
439
+ case BarkoderConstants.FormattingType.GS1:
440
+ this.bkdView.config.getDecoderConfig().formattingType =
441
+ com.barkoder.Barkoder.FormattingType.GS1;
442
+ break;
443
+ case BarkoderConstants.FormattingType.AAMVA:
444
+ this.bkdView.config.getDecoderConfig().formattingType =
445
+ com.barkoder.Barkoder.FormattingType.AAMVA;
446
+ break;
724
447
  }
725
-
726
- setMaximumResultsCount(maximumResultsCount : number): void {
727
- this.bkdView.config.getDecoderConfig().maximumResultsCount = maximumResultsCount
448
+ }
449
+
450
+ /**
451
+ * Sets the MSI checksum type
452
+ */
453
+ setMsiCheckSumType(msiCheckSumType: BarkoderConstants.MsiChecksumType) {
454
+ switch (msiCheckSumType) {
455
+ case BarkoderConstants.MsiChecksumType.Disabled:
456
+ this.bkdView.config.getDecoderConfig().Msi.checksumType =
457
+ com.barkoder.Barkoder.MsiChecksumType.Disabled;
458
+ break;
459
+ case BarkoderConstants.MsiChecksumType.Mod10:
460
+ this.bkdView.config.getDecoderConfig().Msi.checksumType =
461
+ com.barkoder.Barkoder.MsiChecksumType.Mod10;
462
+ break;
463
+ case BarkoderConstants.MsiChecksumType.Mod11:
464
+ this.bkdView.config.getDecoderConfig().Msi.checksumType =
465
+ com.barkoder.Barkoder.MsiChecksumType.Mod11;
466
+ break;
467
+ case BarkoderConstants.MsiChecksumType.Mod1010:
468
+ this.bkdView.config.getDecoderConfig().Msi.checksumType =
469
+ com.barkoder.Barkoder.MsiChecksumType.Mod1010;
470
+ break;
471
+ case BarkoderConstants.MsiChecksumType.Mod1110:
472
+ this.bkdView.config.getDecoderConfig().Msi.checksumType =
473
+ com.barkoder.Barkoder.MsiChecksumType.Mod1110;
474
+ break;
475
+ case BarkoderConstants.MsiChecksumType.Mod11IBM:
476
+ this.bkdView.config.getDecoderConfig().Msi.checksumType =
477
+ com.barkoder.Barkoder.MsiChecksumType.Mod11IBM;
478
+ break;
479
+ case BarkoderConstants.MsiChecksumType.Mod1110IBM:
480
+ this.bkdView.config.getDecoderConfig().Msi.checksumType =
481
+ com.barkoder.Barkoder.MsiChecksumType.Mod1110IBM;
482
+ break;
728
483
  }
729
-
730
- setDuplicatesDelayMs(duplicateDelayMs : number) : void {
731
- this.bkdView.config.getDecoderConfig().duplicatesDelayMs = duplicateDelayMs
484
+ }
485
+
486
+ /**
487
+ * Sets the Code39 checksum type
488
+ */
489
+ setCode39CheckSumType(
490
+ code39ChecksumType: BarkoderConstants.Code39ChecksumType
491
+ ) {
492
+ switch (code39ChecksumType) {
493
+ case BarkoderConstants.Code39ChecksumType.Disabled:
494
+ this.bkdView.config.getDecoderConfig().Code39.checksumType =
495
+ com.barkoder.Barkoder.Code39ChecksumType.Disabled;
496
+ break;
497
+ case BarkoderConstants.Code39ChecksumType.Enabled:
498
+ this.bkdView.config.getDecoderConfig().Code39.checksumType =
499
+ com.barkoder.Barkoder.Code39ChecksumType.Enabled;
500
+ break;
732
501
  }
733
-
734
- setMulticodeCachingDuration(multicodeCachingDuration : number) : void {
735
- this.bkdConfig.SetMulticodeCachingDuration(multicodeCachingDuration)
502
+ }
503
+
504
+ /**
505
+ * Sets the Code11 checksum type
506
+ */
507
+ setCode11CheckSumType(
508
+ code11CheckSumType: BarkoderConstants.Code11ChecksumType
509
+ ) {
510
+ switch (code11CheckSumType) {
511
+ case BarkoderConstants.Code11ChecksumType.Disabled:
512
+ this.bkdView.config.getDecoderConfig().Code11.checksumType =
513
+ com.barkoder.Barkoder.Code11ChecksumType.Disabled;
514
+ break;
515
+ case BarkoderConstants.Code11ChecksumType.Single:
516
+ this.bkdView.config.getDecoderConfig().Code11.checksumType =
517
+ com.barkoder.Barkoder.Code11ChecksumType.Single;
518
+ break;
519
+ case BarkoderConstants.Code11ChecksumType.Double:
520
+ this.bkdView.config.getDecoderConfig().Code11.checksumType =
521
+ com.barkoder.Barkoder.Code11ChecksumType.Double;
522
+ break;
736
523
  }
737
-
738
- setMulticodeCachingEnabled(multiCodeCachingEnabled : boolean) : void {
739
- this.bkdConfig.SetMulticodeCachingEnabled(multiCodeCachingEnabled)
740
- }
741
-
742
- getMaximumResultsCount() : any {
743
- return this.bkdView.config.getDecoderConfig().maximumResultsCount
744
- }
745
-
746
- getDuplicatesDelayMs() : any {
747
- return this.bkdView.config.getDecoderConfig().duplicatesDelayMs
748
- }
749
-
750
- setDatamatrixDpmModeEnabled(dpmModeEnabled : boolean) : void {
751
- this.bkdView.config.getDecoderConfig().Datamatrix.dpmMode = dpmModeEnabled
752
- }
753
-
754
- setUpcEanDeblurEnabled(enabled : boolean) : void {
755
- this.bkdView.config.getDecoderConfig().upcEanDeblur = enabled
756
- }
757
-
758
- setEnableMisshaped1DEnabled(enabled : boolean) : void {
759
- this.bkdView.config.getDecoderConfig().enableMisshaped1D = enabled
760
- }
761
-
762
- setBarcodeThumbnailOnResultEnabled(enabled : boolean) : void{
763
- this.bkdView.config.setThumbnailOnResultEnabled(enabled)
764
- }
765
-
766
- isBarcodeThumbnailOnResultEnabled() : any{
767
- return this.bkdView.config.getThumbnailOnResulEnabled()
768
- }
769
-
770
- setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans : number) : void {
771
- this.bkdView.config.setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans)
524
+ }
525
+
526
+ /**
527
+ * Checks if a specific barcode type is enabled
528
+ */
529
+ isBarcodeTypeEnabled(decoder: BarkoderConstants.DecoderType): boolean {
530
+ switch (decoder) {
531
+ case BarkoderConstants.DecoderType.Aztec:
532
+ return this.bkdView.config.getDecoderConfig().Aztec.enabled;
533
+ case BarkoderConstants.DecoderType.AztecCompact:
534
+ return this.bkdView.config.getDecoderConfig().AztecCompact.enabled;
535
+ case BarkoderConstants.DecoderType.QR:
536
+ return this.bkdView.config.getDecoderConfig().QR.enabled;
537
+ case BarkoderConstants.DecoderType.QRMicro:
538
+ return this.bkdView.config.getDecoderConfig().QRMicro.enabled;
539
+ case BarkoderConstants.DecoderType.Code128:
540
+ return this.bkdView.config.getDecoderConfig().Code128.enabled;
541
+ case BarkoderConstants.DecoderType.Code93:
542
+ return this.bkdView.config.getDecoderConfig().Code93.enabled;
543
+ case BarkoderConstants.DecoderType.Code39:
544
+ return this.bkdView.config.getDecoderConfig().Code39.enabled;
545
+ case BarkoderConstants.DecoderType.Telepen:
546
+ return this.bkdView.config.getDecoderConfig().Telepen.enabled;
547
+ case BarkoderConstants.DecoderType.Code11:
548
+ return this.bkdView.config.getDecoderConfig().Code11.enabled;
549
+ case BarkoderConstants.DecoderType.Msi:
550
+ return this.bkdView.config.getDecoderConfig().Msi.enabled;
551
+ case BarkoderConstants.DecoderType.UpcA:
552
+ return this.bkdView.config.getDecoderConfig().UpcA.enabled;
553
+ case BarkoderConstants.DecoderType.UpcE:
554
+ return this.bkdView.config.getDecoderConfig().UpcE.enabled;
555
+ case BarkoderConstants.DecoderType.UpcE1:
556
+ return this.bkdView.config.getDecoderConfig().UpcE1.enabled;
557
+ case BarkoderConstants.DecoderType.Ean13:
558
+ return this.bkdView.config.getDecoderConfig().Ean13.enabled;
559
+ case BarkoderConstants.DecoderType.Ean8:
560
+ return this.bkdView.config.getDecoderConfig().Ean8.enabled;
561
+ case BarkoderConstants.DecoderType.PDF417:
562
+ return this.bkdView.config.getDecoderConfig().PDF417.enabled;
563
+ case BarkoderConstants.DecoderType.PDF417Micro:
564
+ return this.bkdView.config.getDecoderConfig().PDF417Micro.enabled;
565
+ case BarkoderConstants.DecoderType.Datamatrix:
566
+ return this.bkdView.config.getDecoderConfig().Datamatrix.enabled;
567
+ case BarkoderConstants.DecoderType.Code25:
568
+ return this.bkdView.config.getDecoderConfig().Code25.enabled;
569
+ case BarkoderConstants.DecoderType.Interleaved25:
570
+ return this.bkdView.config.getDecoderConfig().Interleaved25.enabled;
571
+ case BarkoderConstants.DecoderType.ITF14:
572
+ return this.bkdView.config.getDecoderConfig().ITF14.enabled;
573
+ case BarkoderConstants.DecoderType.IATA25:
574
+ return this.bkdView.config.getDecoderConfig().IATA25.enabled;
575
+ case BarkoderConstants.DecoderType.Matrix25:
576
+ return this.bkdView.config.getDecoderConfig().Matrix25.enabled;
577
+ case BarkoderConstants.DecoderType.Datalogic25:
578
+ return this.bkdView.config.getDecoderConfig().Datalogic25.enabled;
579
+ case BarkoderConstants.DecoderType.COOP25:
580
+ return this.bkdView.config.getDecoderConfig().COOP25.enabled;
581
+ case BarkoderConstants.DecoderType.Dotcode:
582
+ return this.bkdView.config.getDecoderConfig().Dotcode.enabled;
772
583
  }
773
-
774
- getThresholdBetweenDuplicatesScans() : Promise <any> {
775
- return this.bkdView.config.getThresholdBetweenDuplicatesScans()
584
+ }
585
+
586
+ /**
587
+ * Sets whether a specific barcode type is enabled
588
+ */
589
+ setBarcodeTypeEnabled(decoders: BarkoderConstants.DecoderType[]): void {
590
+ this.bkdView.config.getDecoderConfig().Aztec.enabled = false;
591
+ this.bkdView.config.getDecoderConfig().AztecCompact.enabled = false;
592
+ this.bkdView.config.getDecoderConfig().QR.enabled = false;
593
+ this.bkdView.config.getDecoderConfig().QRMicro.enabled = false;
594
+ this.bkdView.config.getDecoderConfig().Code128.enabled = false;
595
+ this.bkdView.config.getDecoderConfig().Code93.enabled = false;
596
+ this.bkdView.config.getDecoderConfig().Code39.enabled = false;
597
+ this.bkdView.config.getDecoderConfig().Telepen.enabled = false;
598
+ this.bkdView.config.getDecoderConfig().Code11.enabled = false;
599
+ this.bkdView.config.getDecoderConfig().Codabar.enabled = false;
600
+ this.bkdView.config.getDecoderConfig().Msi.enabled = false;
601
+ this.bkdView.config.getDecoderConfig().UpcA.enabled = false;
602
+ this.bkdView.config.getDecoderConfig().UpcE.enabled = false;
603
+ this.bkdView.config.getDecoderConfig().UpcE1.enabled = false;
604
+ this.bkdView.config.getDecoderConfig().Ean13.enabled = false;
605
+ this.bkdView.config.getDecoderConfig().Ean8.enabled = false;
606
+ this.bkdView.config.getDecoderConfig().PDF417.enabled = false;
607
+ this.bkdView.config.getDecoderConfig().PDF417Micro.enabled = false;
608
+ this.bkdView.config.getDecoderConfig().Datamatrix.enabled = false;
609
+ this.bkdView.config.getDecoderConfig().Code25.enabled = false;
610
+ this.bkdView.config.getDecoderConfig().Interleaved25.enabled = false;
611
+ this.bkdView.config.getDecoderConfig().ITF14.enabled = false;
612
+ this.bkdView.config.getDecoderConfig().IATA25.enabled = false;
613
+ this.bkdView.config.getDecoderConfig().Matrix25.enabled = false;
614
+ this.bkdView.config.getDecoderConfig().Datalogic25.enabled = false;
615
+ this.bkdView.config.getDecoderConfig().COOP25.enabled = false;
616
+ this.bkdView.config.getDecoderConfig().Dotcode.enabled = false;
617
+ decoders.forEach((dt: BarkoderConstants.DecoderType) => {
618
+ switch (dt) {
619
+ case BarkoderConstants.DecoderType.Aztec:
620
+ this.bkdView.config.getDecoderConfig().Aztec.enabled = true;
621
+ break;
622
+ case BarkoderConstants.DecoderType.AztecCompact:
623
+ this.bkdView.config.getDecoderConfig().AztecCompact.enabled = true;
624
+ break;
625
+ case BarkoderConstants.DecoderType.QR:
626
+ this.bkdView.config.getDecoderConfig().QR.enabled = true;
627
+ break;
628
+ case BarkoderConstants.DecoderType.QRMicro:
629
+ this.bkdView.config.getDecoderConfig().QRMicro.enabled = true;
630
+ break;
631
+ case BarkoderConstants.DecoderType.Code128:
632
+ this.bkdView.config.getDecoderConfig().Code128.enabled = true;
633
+ break;
634
+ case BarkoderConstants.DecoderType.Code93:
635
+ this.bkdView.config.getDecoderConfig().Code93.enabled = true;
636
+ break;
637
+ case BarkoderConstants.DecoderType.Code39:
638
+ this.bkdView.config.getDecoderConfig().Code39.enabled = true;
639
+ break;
640
+ case BarkoderConstants.DecoderType.Telepen:
641
+ this.bkdView.config.getDecoderConfig().Telepen.enabled = true;
642
+ break;
643
+ case BarkoderConstants.DecoderType.Code11:
644
+ this.bkdView.config.getDecoderConfig().Code11.enabled = true;
645
+ break;
646
+ case BarkoderConstants.DecoderType.Msi:
647
+ this.bkdView.config.getDecoderConfig().Msi.enabled = true;
648
+ break;
649
+ case BarkoderConstants.DecoderType.UpcA:
650
+ this.bkdView.config.getDecoderConfig().UpcA.enabled = true;
651
+ break;
652
+ case BarkoderConstants.DecoderType.UpcE:
653
+ this.bkdView.config.getDecoderConfig().UpcE.enabled = true;
654
+ break;
655
+ case BarkoderConstants.DecoderType.UpcE1:
656
+ this.bkdView.config.getDecoderConfig().UpcE1.enabled = true;
657
+ break;
658
+ case BarkoderConstants.DecoderType.Ean13:
659
+ this.bkdView.config.getDecoderConfig().Ean13.enabled = true;
660
+ break;
661
+ case BarkoderConstants.DecoderType.Ean8:
662
+ this.bkdView.config.getDecoderConfig().Ean8.enabled = true;
663
+ break;
664
+ case BarkoderConstants.DecoderType.PDF417:
665
+ this.bkdView.config.getDecoderConfig().PDF417.enabled = true;
666
+ break;
667
+ case BarkoderConstants.DecoderType.PDF417Micro:
668
+ this.bkdView.config.getDecoderConfig().PDF417Micro.enabled = true;
669
+ break;
670
+ case BarkoderConstants.DecoderType.Datamatrix:
671
+ this.bkdView.config.getDecoderConfig().Datamatrix.enabled = true;
672
+ break;
673
+ case BarkoderConstants.DecoderType.Code25:
674
+ this.bkdView.config.getDecoderConfig().Code25.enabled = true;
675
+ break;
676
+ case BarkoderConstants.DecoderType.Interleaved25:
677
+ this.bkdView.config.getDecoderConfig().Interleaved25.enabled = true;
678
+ break;
679
+ case BarkoderConstants.DecoderType.ITF14:
680
+ this.bkdView.config.getDecoderConfig().ITF14.enabled = true;
681
+ break;
682
+ case BarkoderConstants.DecoderType.IATA25:
683
+ this.bkdView.config.getDecoderConfig().IATA25.enabled = true;
684
+ break;
685
+ case BarkoderConstants.DecoderType.Matrix25:
686
+ this.bkdView.config.getDecoderConfig().Matrix25.enabled = true;
687
+ break;
688
+ case BarkoderConstants.DecoderType.Datalogic25:
689
+ this.bkdView.config.getDecoderConfig().Datalogic25.enabled = true;
690
+ break;
691
+ case BarkoderConstants.DecoderType.COOP25:
692
+ this.bkdView.config.getDecoderConfig().COOP25.enabled = true;
693
+ break;
694
+ case BarkoderConstants.DecoderType.Dotcode:
695
+ this.bkdView.config.getDecoderConfig().Dotcode.enabled = true;
696
+ break;
697
+ default:
698
+ break;
699
+ }
700
+ });
701
+ }
702
+
703
+ /**
704
+ * Sets the length range for the specified barcode type
705
+ */
706
+ setBarcodeTypeLengthRange(
707
+ decoder: BarkoderConstants.DecoderType,
708
+ minimumLength: number,
709
+ maximumLength: number
710
+ ) {
711
+ switch (decoder) {
712
+ case BarkoderConstants.DecoderType.Aztec:
713
+ this.bkdView.config.getDecoderConfig().Aztec.minimumLength = minimumLength;
714
+ this.bkdView.config.getDecoderConfig().Aztec.maximumLength = maximumLength;
715
+ break;
716
+ case BarkoderConstants.DecoderType.AztecCompact:
717
+ this.bkdView.config.getDecoderConfig().AztecCompact.minimumLength = minimumLength;
718
+ this.bkdView.config.getDecoderConfig().AztecCompact.maximumLength = maximumLength;
719
+ break;
720
+ case BarkoderConstants.DecoderType.QR:
721
+ this.bkdView.config.getDecoderConfig().QR.minimumLength = minimumLength;
722
+ this.bkdView.config.getDecoderConfig().QR.maximumLength = maximumLength;
723
+ break;
724
+ case BarkoderConstants.DecoderType.QRMicro:
725
+ this.bkdView.config.getDecoderConfig().QRMicro.minimumLength = minimumLength;
726
+ this.bkdView.config.getDecoderConfig().QRMicro.maximumLength = maximumLength;
727
+ break;
728
+ case BarkoderConstants.DecoderType.Code128:
729
+ this.bkdView.config.getDecoderConfig().Code128.minimumLength = minimumLength;
730
+ this.bkdView.config.getDecoderConfig().Code128.maximumLength = maximumLength;
731
+ break;
732
+ case BarkoderConstants.DecoderType.Code93:
733
+ this.bkdView.config.getDecoderConfig().Code93.minimumLength = minimumLength;
734
+ this.bkdView.config.getDecoderConfig().Code93.maximumLength = maximumLength;
735
+ break;
736
+ case BarkoderConstants.DecoderType.Code39:
737
+ this.bkdView.config.getDecoderConfig().Code39.minimumLength = minimumLength;
738
+ this.bkdView.config.getDecoderConfig().Code39.maximumLength = maximumLength;
739
+ break;
740
+ case BarkoderConstants.DecoderType.Telepen:
741
+ this.bkdView.config.getDecoderConfig().Telepen.minimumLength = minimumLength;
742
+ this.bkdView.config.getDecoderConfig().Telepen.maximumLength = maximumLength;
743
+ break;
744
+ case BarkoderConstants.DecoderType.Code11:
745
+ this.bkdView.config.getDecoderConfig().Code11.minimumLength = minimumLength;
746
+ this.bkdView.config.getDecoderConfig().Code11.maximumLength = maximumLength;
747
+ break;
748
+ case BarkoderConstants.DecoderType.Msi:
749
+ this.bkdView.config.getDecoderConfig().Msi.minimumLength = minimumLength;
750
+ this.bkdView.config.getDecoderConfig().Msi.maximumLength = maximumLength;
751
+ break;
752
+ case BarkoderConstants.DecoderType.UpcA:
753
+ this.bkdView.config.getDecoderConfig().UpcA.minimumLength = minimumLength;
754
+ this.bkdView.config.getDecoderConfig().UpcA.maximumLength = maximumLength;
755
+ break;
756
+ case BarkoderConstants.DecoderType.UpcE:
757
+ this.bkdView.config.getDecoderConfig().UpcE.minimumLength = minimumLength;
758
+ this.bkdView.config.getDecoderConfig().UpcE.maximumLength = maximumLength;
759
+ break;
760
+ case BarkoderConstants.DecoderType.UpcE1:
761
+ this.bkdView.config.getDecoderConfig().UpcE1.minimumLength = minimumLength;
762
+ this.bkdView.config.getDecoderConfig().UpcE1.maximumLength = maximumLength;
763
+ break;
764
+ case BarkoderConstants.DecoderType.Ean13:
765
+ this.bkdView.config.getDecoderConfig().Ean13.minimumLength = minimumLength;
766
+ this.bkdView.config.getDecoderConfig().Ean13.maximumLength = maximumLength;
767
+ break;
768
+ case BarkoderConstants.DecoderType.Ean8:
769
+ this.bkdView.config.getDecoderConfig().Ean8.minimumLength = minimumLength;
770
+ this.bkdView.config.getDecoderConfig().Ean8.maximumLength = maximumLength;
771
+ break;
772
+ case BarkoderConstants.DecoderType.PDF417:
773
+ this.bkdView.config.getDecoderConfig().PDF417.minimumLength = minimumLength;
774
+ this.bkdView.config.getDecoderConfig().PDF417.maximumLength = maximumLength;
775
+ break;
776
+ case BarkoderConstants.DecoderType.PDF417Micro:
777
+ this.bkdView.config.getDecoderConfig().PDF417Micro.minimumLength = minimumLength;
778
+ this.bkdView.config.getDecoderConfig().PDF417Micro.maximumLength = maximumLength;
779
+ break;
780
+ case BarkoderConstants.DecoderType.Datamatrix:
781
+ this.bkdView.config.getDecoderConfig().Datamatrix.minimumLength = minimumLength;
782
+ this.bkdView.config.getDecoderConfig().Datamatrix.maximumLength = maximumLength;
783
+ break;
784
+ case BarkoderConstants.DecoderType.Code25:
785
+ this.bkdView.config.getDecoderConfig().Code25.minimumLength = minimumLength;
786
+ this.bkdView.config.getDecoderConfig().Code25.maximumLength = maximumLength;
787
+ break;
788
+ case BarkoderConstants.DecoderType.Interleaved25:
789
+ this.bkdView.config.getDecoderConfig().Interleaved25.minimumLength = minimumLength;
790
+ this.bkdView.config.getDecoderConfig().Interleaved25.maximumLength = maximumLength;
791
+ break;
792
+ case BarkoderConstants.DecoderType.ITF14:
793
+ this.bkdView.config.getDecoderConfig().ITF14.minimumLength = minimumLength;
794
+ this.bkdView.config.getDecoderConfig().ITF14.maximumLength = maximumLength;
795
+ break;
796
+ case BarkoderConstants.DecoderType.IATA25:
797
+ this.bkdView.config.getDecoderConfig().IATA25.minimumLength = minimumLength;
798
+ this.bkdView.config.getDecoderConfig().IATA25.maximumLength = maximumLength;
799
+ break;
800
+ case BarkoderConstants.DecoderType.Matrix25:
801
+ this.bkdView.config.getDecoderConfig().Matrix25.minimumLength = minimumLength;
802
+ this.bkdView.config.getDecoderConfig().Matrix25.maximumLength = maximumLength;
803
+ break;
804
+ case BarkoderConstants.DecoderType.Datalogic25:
805
+ this.bkdView.config.getDecoderConfig().Datalogic25.minimumLength = minimumLength;
806
+ this.bkdView.config.getDecoderConfig().Datalogic25.maximumLength = maximumLength;
807
+ break;
808
+ case BarkoderConstants.DecoderType.COOP25:
809
+ this.bkdView.config.getDecoderConfig().COOP25.minimumLength = minimumLength;
810
+ this.bkdView.config.getDecoderConfig().COOP25.maximumLength = maximumLength;
811
+ break;
812
+ case BarkoderConstants.DecoderType.Dotcode:
813
+ this.bkdView.config.getDecoderConfig().Dotcode.minimumLength = minimumLength;
814
+ this.bkdView.config.getDecoderConfig().Dotcode.maximumLength = maximumLength;
815
+ break;
816
+ default:
817
+ break;
776
818
  }
777
-
778
- getMulticodeCachingEnabled() : any {
779
- return this.bkdConfig.IsMulticodeCachingEnabled()
819
+ }
820
+
821
+ getBarcodeTypeMaximumLenght(decoder: BarkoderConstants.DecoderType): any {
822
+ switch (decoder) {
823
+ case BarkoderConstants.DecoderType.Aztec:
824
+ return this.bkdView.config.getDecoderConfig().Aztec.maximumLength;
825
+ case BarkoderConstants.DecoderType.AztecCompact:
826
+ return this.bkdView.config.getDecoderConfig().AztecCompact
827
+ .maximumLength;
828
+ case BarkoderConstants.DecoderType.QR:
829
+ return this.bkdView.config.getDecoderConfig().QR.maximumLength;
830
+ case BarkoderConstants.DecoderType.QRMicro:
831
+ return this.bkdView.config.getDecoderConfig().QRMicro.maximumLength;
832
+ case BarkoderConstants.DecoderType.Code128:
833
+ return this.bkdView.config.getDecoderConfig().Code128.maximumLength;
834
+ case BarkoderConstants.DecoderType.Code93:
835
+ return this.bkdView.config.getDecoderConfig().Code93.maximumLength;
836
+ case BarkoderConstants.DecoderType.Code39:
837
+ return this.bkdView.config.getDecoderConfig().Code39.maximumLength;
838
+ case BarkoderConstants.DecoderType.Telepen:
839
+ return this.bkdView.config.getDecoderConfig().Telepen.maximumLength;
840
+ case BarkoderConstants.DecoderType.Code11:
841
+ return this.bkdView.config.getDecoderConfig().Code11.maximumLength;
842
+ case BarkoderConstants.DecoderType.Msi:
843
+ return this.bkdView.config.getDecoderConfig().Msi.maximumLength;
844
+ case BarkoderConstants.DecoderType.UpcA:
845
+ return this.bkdView.config.getDecoderConfig().UpcA.maximumLength;
846
+ case BarkoderConstants.DecoderType.UpcE:
847
+ return this.bkdView.config.getDecoderConfig().UpcE.maximumLength;
848
+ case BarkoderConstants.DecoderType.UpcE1:
849
+ return this.bkdView.config.getDecoderConfig().UpcE1.maximumLength;
850
+ case BarkoderConstants.DecoderType.Ean13:
851
+ return this.bkdView.config.getDecoderConfig().Ean13.maximumLength;
852
+ case BarkoderConstants.DecoderType.Ean8:
853
+ return this.bkdView.config.getDecoderConfig().Ean8.maximumLength;
854
+ case BarkoderConstants.DecoderType.PDF417:
855
+ return this.bkdView.config.getDecoderConfig().PDF417.maximumLength;
856
+ case BarkoderConstants.DecoderType.PDF417Micro:
857
+ return this.bkdView.config.getDecoderConfig().PDF417Micro.maximumLength;
858
+ case BarkoderConstants.DecoderType.Datamatrix:
859
+ return this.bkdView.config.getDecoderConfig().Datamatrix.maximumLength;
860
+ case BarkoderConstants.DecoderType.Code25:
861
+ return this.bkdView.config.getDecoderConfig().Code25.maximumLength;
862
+ case BarkoderConstants.DecoderType.Interleaved25:
863
+ return this.bkdView.config.getDecoderConfig().Interleaved25
864
+ .maximumLength;
865
+ case BarkoderConstants.DecoderType.ITF14:
866
+ return this.bkdView.config.getDecoderConfig().ITF14.maximumLength;
867
+ case BarkoderConstants.DecoderType.IATA25:
868
+ return this.bkdView.config.getDecoderConfig().IATA25.maximumLength;
869
+ case BarkoderConstants.DecoderType.Matrix25:
870
+ return this.bkdView.config.getDecoderConfig().Matrix25.maximumLength;
871
+ case BarkoderConstants.DecoderType.Datalogic25:
872
+ return this.bkdView.config.getDecoderConfig().Datalogic25.maximumLength;
873
+ case BarkoderConstants.DecoderType.COOP25:
874
+ return this.bkdView.config.getDecoderConfig().COOP25.maximumLength;
875
+ case BarkoderConstants.DecoderType.Dotcode:
876
+ return this.bkdView.config.getDecoderConfig().Dotcode.maximumLength;
780
877
  }
781
-
782
- getMulticodeCachingDuration() : any {
783
- return this.bkdConfig.GetMulticodeCachingDuration()
784
- }
785
-
786
- isUpcEanDeblurEnabled() : any {
787
- return this.bkdView.config.getDecoderConfig().upcEanDeblur
878
+ }
879
+
880
+ getBarcodeTypeMinimumLenght(decoder: BarkoderConstants.DecoderType): any {
881
+ switch (decoder) {
882
+ case BarkoderConstants.DecoderType.Aztec:
883
+ return this.bkdView.config.getDecoderConfig().Aztec.minimumLength;
884
+ case BarkoderConstants.DecoderType.AztecCompact:
885
+ return this.bkdView.config.getDecoderConfig().AztecCompact
886
+ .minimumLength;
887
+ case BarkoderConstants.DecoderType.QR:
888
+ return this.bkdView.config.getDecoderConfig().QR.minimumLength;
889
+ case BarkoderConstants.DecoderType.QRMicro:
890
+ return this.bkdView.config.getDecoderConfig().QRMicro.minimumLength;
891
+ case BarkoderConstants.DecoderType.Code128:
892
+ return this.bkdView.config.getDecoderConfig().Code128.minimumLength;
893
+ case BarkoderConstants.DecoderType.Code93:
894
+ return this.bkdView.config.getDecoderConfig().Code93.minimumLength;
895
+ case BarkoderConstants.DecoderType.Code39:
896
+ return this.bkdView.config.getDecoderConfig().Code39.minimumLength;
897
+ case BarkoderConstants.DecoderType.Telepen:
898
+ return this.bkdView.config.getDecoderConfig().Telepen.minimumLength;
899
+ case BarkoderConstants.DecoderType.Code11:
900
+ return this.bkdView.config.getDecoderConfig().Code11.minimumLength;
901
+ case BarkoderConstants.DecoderType.Msi:
902
+ return this.bkdView.config.getDecoderConfig().Msi.minimumLength;
903
+ case BarkoderConstants.DecoderType.UpcA:
904
+ return this.bkdView.config.getDecoderConfig().UpcA.minimumLength;
905
+ case BarkoderConstants.DecoderType.UpcE:
906
+ return this.bkdView.config.getDecoderConfig().UpcE.minimumLength;
907
+ case BarkoderConstants.DecoderType.UpcE1:
908
+ return this.bkdView.config.getDecoderConfig().UpcE1.minimumLength;
909
+ case BarkoderConstants.DecoderType.Ean13:
910
+ return this.bkdView.config.getDecoderConfig().Ean13.minimumLength;
911
+ case BarkoderConstants.DecoderType.Ean8:
912
+ return this.bkdView.config.getDecoderConfig().Ean8.minimumLength;
913
+ case BarkoderConstants.DecoderType.PDF417:
914
+ return this.bkdView.config.getDecoderConfig().PDF417.minimumLength;
915
+ case BarkoderConstants.DecoderType.PDF417Micro:
916
+ return this.bkdView.config.getDecoderConfig().PDF417Micro.minimumLength;
917
+ case BarkoderConstants.DecoderType.Datamatrix:
918
+ return this.bkdView.config.getDecoderConfig().Datamatrix.minimumLength;
919
+ case BarkoderConstants.DecoderType.Code25:
920
+ return this.bkdView.config.getDecoderConfig().Code25.minimumLength;
921
+ case BarkoderConstants.DecoderType.Interleaved25:
922
+ return this.bkdView.config.getDecoderConfig().Interleaved25
923
+ .minimumLength;
924
+ case BarkoderConstants.DecoderType.ITF14:
925
+ return this.bkdView.config.getDecoderConfig().ITF14.minimumLength;
926
+ case BarkoderConstants.DecoderType.IATA25:
927
+ return this.bkdView.config.getDecoderConfig().IATA25.minimumLength;
928
+ case BarkoderConstants.DecoderType.Matrix25:
929
+ return this.bkdView.config.getDecoderConfig().Matrix25.minimumLength;
930
+ case BarkoderConstants.DecoderType.Datalogic25:
931
+ return this.bkdView.config.getDecoderConfig().Datalogic25.minimumLength;
932
+ case BarkoderConstants.DecoderType.COOP25:
933
+ return this.bkdView.config.getDecoderConfig().COOP25.minimumLength;
934
+ case BarkoderConstants.DecoderType.Dotcode:
935
+ return this.bkdView.config.getDecoderConfig().Dotcode.minimumLength;
788
936
  }
789
-
790
- isMisshaped1DEnabled() : any {
791
- return this.bkdView.config.getDecoderConfig().enableMisshaped1D
937
+ }
938
+
939
+ /**
940
+ * Sets the maximum number of results to be returned from barcode scanning
941
+ */
942
+ setMaximumResultsCount(maximumResultsCount: number): void {
943
+ this.bkdView.config.getDecoderConfig().maximumResultsCount = maximumResultsCount;
944
+ }
945
+
946
+ /**
947
+ * Sets the delay in milliseconds for considering duplicate barcodes during scanning
948
+ */
949
+ setDuplicatesDelayMs(duplicateDelayMs: number): void {
950
+ this.bkdView.config.getDecoderConfig().duplicatesDelayMs = duplicateDelayMs;
951
+ }
952
+
953
+ /**
954
+ * Sets the caching duration (in milliseconds) for multi-code results
955
+ */
956
+ setMulticodeCachingDuration(multicodeCachingDuration: number): void {
957
+ this.bkdConfig.SetMulticodeCachingDuration(multicodeCachingDuration);
958
+ }
959
+
960
+ /**
961
+ * Sets whether multi-code caching is enabled
962
+ */
963
+ setMulticodeCachingEnabled(multiCodeCachingEnabled: boolean): void {
964
+ this.bkdConfig.SetMulticodeCachingEnabled(multiCodeCachingEnabled);
965
+ }
966
+
967
+ /**
968
+ * Retrieves the maximum number of results to be returned from barcode scanning at once
969
+ */
970
+ getMaximumResultsCount(): any {
971
+ return this.bkdView.config.getDecoderConfig().maximumResultsCount;
972
+ }
973
+
974
+ /**
975
+ * Retrieves the delay in milliseconds for considering duplicate barcodes during scanning
976
+ */
977
+ getDuplicatesDelayMs(): any {
978
+ return this.bkdView.config.getDecoderConfig().duplicatesDelayMs;
979
+ }
980
+
981
+ /**
982
+ * Sets whether the Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.
983
+ */
984
+ setDatamatrixDpmModeEnabled(dpmModeEnabled: boolean): void {
985
+ this.bkdView.config.getDecoderConfig().Datamatrix.dpmMode = dpmModeEnabled;
986
+ }
987
+
988
+ /**
989
+ * Sets whether the deblurring feature for UPC/EAN barcodes is enabled
990
+ */
991
+ setUpcEanDeblurEnabled(enabled: boolean): void {
992
+ this.bkdView.config.getDecoderConfig().upcEanDeblur = enabled;
993
+ }
994
+
995
+ /**
996
+ * Sets whether the detection of misshaped 1D barcodes is enabled
997
+ */
998
+ setEnableMisshaped1DEnabled(enabled: boolean): void {
999
+ this.bkdView.config.getDecoderConfig().enableMisshaped1D = enabled;
1000
+ }
1001
+
1002
+ /**
1003
+ * Sets whether to enable barcode thumbnail on result
1004
+ */
1005
+ setBarcodeThumbnailOnResultEnabled(enabled: boolean): void {
1006
+ this.bkdView.config.setThumbnailOnResultEnabled(enabled);
1007
+ }
1008
+
1009
+ /**
1010
+ * Retrieve whether to enable barcode thumbnail on result
1011
+ */
1012
+ isBarcodeThumbnailOnResultEnabled(): any {
1013
+ return this.bkdView.config.getThumbnailOnResulEnabled();
1014
+ }
1015
+
1016
+ /**
1017
+ * Sets the threshold between duplicate scans
1018
+ */
1019
+ setThresholdBetweenDuplicatesScans(
1020
+ thresholdBetweenDuplicatesScans: number
1021
+ ): void {
1022
+ this.bkdView.config.setThresholdBetweenDuplicatesScans(
1023
+ thresholdBetweenDuplicatesScans
1024
+ );
1025
+ }
1026
+
1027
+ /**
1028
+ * Retrieves the threshold between duplicate scans
1029
+ */
1030
+ getThresholdBetweenDuplicatesScans(): Promise<any> {
1031
+ return this.bkdView.config.getThresholdBetweenDuplicatesScans();
1032
+ }
1033
+
1034
+ /**
1035
+ * Retrieves whether multi-code caching is enabled
1036
+ */
1037
+ getMulticodeCachingEnabled(): any {
1038
+ return this.bkdConfig.IsMulticodeCachingEnabled();
1039
+ }
1040
+
1041
+ /**
1042
+ * Retrieves the caching duration (in milliseconds) for multi-code results
1043
+ */
1044
+ getMulticodeCachingDuration(): any {
1045
+ return this.bkdConfig.GetMulticodeCachingDuration();
1046
+ }
1047
+
1048
+ /**
1049
+ * Retrieves the value indicating whether deblurring is enabled for UPC/EAN barcodes
1050
+ */
1051
+ isUpcEanDeblurEnabled(): any {
1052
+ return this.bkdView.config.getDecoderConfig().upcEanDeblur;
1053
+ }
1054
+
1055
+ /**
1056
+ * Checks if the detection of misshaped 1D barcodes is enabled
1057
+ */
1058
+ isMisshaped1DEnabled(): any {
1059
+ return this.bkdView.config.getDecoderConfig().enableMisshaped1D;
1060
+ }
1061
+
1062
+ /**
1063
+ * Checks if VIN restrictions are enabled
1064
+ */
1065
+ isVINRestrictionsEnabled(): any {
1066
+ return this.bkdView.config.getDecoderConfig().enableVINRestrictions;
1067
+ }
1068
+
1069
+ /**
1070
+ * Sets whether Vehicle Identification Number (VIN) restrictions are enabled
1071
+ */
1072
+ setEnableVINRestrictions(vinRestrictionsEnabled: boolean): void {
1073
+ this.bkdView.config.getDecoderConfig().enableVINRestrictions = vinRestrictionsEnabled;
1074
+ }
1075
+
1076
+ setLicenseKey(licenseKey: string): void {
1077
+ this.bkdView.config = new com.barkoder.BarkoderConfig(
1078
+ context,
1079
+ licenseKey,
1080
+ null
1081
+ );
1082
+ }
1083
+
1084
+ /**
1085
+ * Configures the Barkoder functionality based on the provided configuration
1086
+ */
1087
+ configureBarkoder(config: BarkoderConstants.BarkoderConfig): void {
1088
+ const BarkoderHelper = com.barkoder.BarkoderHelper;
1089
+ const JSONObject = org.json.JSONObject;
1090
+
1091
+ try {
1092
+ const jsonString = config.toJsonString();
1093
+
1094
+ const javaJSONObject = new JSONObject(jsonString);
1095
+
1096
+ BarkoderHelper.applyJsonToConfig(this.bkdView.config, javaJSONObject);
1097
+ } catch (e) {
1098
+ console.error("Error applying JSON to BarkoderConfig:", e);
792
1099
  }
1100
+ }
793
1101
 
794
- isVINRestrictionsEnabled() : any {
795
- return this.bkdView.config.getDecoderConfig().enableVINRestrictions
796
- }
1102
+ private hexToAndroidColor(hexColor: string): number {
1103
+ hexColor = hexColor.replace("#", "");
1104
+ const red = parseInt(hexColor.substring(0, 2), 16);
1105
+ const green = parseInt(hexColor.substring(2, 4), 16);
1106
+ const blue = parseInt(hexColor.substring(4, 6), 16);
1107
+ const androidColor = android.graphics.Color.rgb(red, green, blue);
797
1108
 
798
- setEnableVINRestrictions(vinRestrictionsEnabled: boolean) : void {
799
- this.bkdView.config.getDecoderConfig().enableVINRestrictions = vinRestrictionsEnabled
800
- }
801
-
802
- setLicenseKey(licenseKey: string): void {
803
- this.bkdView.config = new com.barkoder.BarkoderConfig(context, licenseKey, null);
804
- }
805
-
806
- configureBarkoder(config: BarkoderConstants.BarkoderConfig): void {
807
- const BarkoderHelper = com.barkoder.BarkoderHelper;
808
- const JSONObject = org.json.JSONObject;
1109
+ return androidColor;
1110
+ }
809
1111
 
810
- try {
811
- const jsonString = config.toJsonString();
1112
+ getPropertiesAndMethods(obj: any): void {
1113
+ const propertiesAndMethods: string[] = [];
812
1114
 
813
- const javaJSONObject = new JSONObject(jsonString);
814
-
815
- BarkoderHelper.applyJsonToConfig(this.bkdView.config, javaJSONObject);
816
- } catch (e) {
817
- console.error("Error applying JSON to BarkoderConfig:", e);
818
- }
819
- }
820
-
821
- private hexToAndroidColor(hexColor: string): number {
822
- hexColor = hexColor.replace("#", "");
823
- const red = parseInt(hexColor.substring(0, 2), 16);
824
- const green = parseInt(hexColor.substring(2, 4), 16);
825
- const blue = parseInt(hexColor.substring(4, 6), 16);
826
- const androidColor = android.graphics.Color.rgb(red, green, blue);
827
-
828
- return androidColor;
1115
+ for (let key in obj) {
1116
+ console.log(`Key: ${key}, Value: ${obj[key]}`);
829
1117
  }
830
-
831
- getPropertiesAndMethods(obj: any): void {
832
- const propertiesAndMethods: string[] = [];
833
-
834
- for (let key in obj) {
835
- console.log(`Key: ${key}, Value: ${obj[key]}`);
836
- }
837
- }
838
-
1118
+ }
839
1119
  }
840
-