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