SBSBarcodePicker.h
Go to the documentation of this file.
1 //
2 // SBSBarcodePicker.h
3 // ScanditBarcodeScanner
4 //
5 // Created by Marco Biasini on 12/06/15.
6 // Copyright (c) 2015 Scandit AG. All rights reserved.
7 //
8 
9 #import <UIKit/UIKit.h>
10 #import <AVFoundation/AVFoundation.h>
11 #import <CoreGraphics/CoreGraphics.h>
12 #import <CoreVideo/CoreVideo.h>
13 #import <CoreMedia/CoreMedia.h>
14 #import "SBSBarcodeGenerator.h"
15 #import "SBSCommon.h"
16 #import "SBSParser.h"
17 #import "SBSParserDataFormat.h"
18 
19 
20 @class SBSScanSession;
21 @class SBSScanSettings;
22 @class SBSBarcodePicker;
24 @protocol SBSPropertyObserver;
25 @protocol SBSWarningsObserver;
26 
34 
52 - (void)barcodePicker:(nonnull SBSBarcodePicker *)barcodePicker
53  didProcessFrame:(nonnull CMSampleBufferRef)frame
54  session:(nonnull SBSScanSession *)session;
55 
56 @end
57 
67 @protocol SBSScanDelegate
68 
85 - (void)barcodePicker:(nonnull SBSBarcodePicker *)picker didScan:(nonnull SBSScanSession *)session;
86 
87 @end
88 
90 
101 - (void)barcodePicker:(nonnull SBSBarcodePicker *)picker failedToValidateLicense:(nonnull NSString *)errorMessage;
102 
103 @end
104 
145 @interface SBSBarcodePicker : UIViewController
146 
162 @property (nonatomic, assign) UIInterfaceOrientationMask allowedInterfaceOrientations;
163 
172 @property (nonnull, nonatomic, strong) SBSOverlayController *overlayController;
173 
185 @property (nullable, nonatomic, weak) id<SBSScanDelegate> scanDelegate;
186 
197 @property (nullable, nonatomic, weak) id<SBSProcessFrameDelegate> processFrameDelegate;
198 
208 @property (nullable, nonatomic, weak) id<SBSLicenseValidationDelegate> licenseValidationDelegate;
209 
215 @property (readonly, nonatomic) SBSCameraFacingDirection cameraFacingDirection;
216 
228 @property (nonatomic, assign) AVCaptureVideoOrientation cameraPreviewOrientation;
229 
236 @property (nonatomic, assign) BOOL autoFocusOnTapEnabled;
237 
247 @property (nonatomic, assign) BOOL pinchToZoomEnabled;
248 
265 - (nonnull instancetype)initWithSettings:(nullable SBSScanSettings *)settings SBS_DESIGNATED_INITIALIZER;
266 
269 
285 - (void)applyScanSettings:(nonnull SBSScanSettings *)settings
286  completionHandler:(nullable void (^)(void))handler;
287 
289 
300 - (void)addPropertyObserver:(nullable id<SBSPropertyObserver>)observer SBS_SWIFT_NAME(addPropertyObserver(_:));
301 
311 - (void)removePropertyObserver:(nullable id<SBSPropertyObserver>)observer SBS_SWIFT_NAME(removePropertyObserver(_:));
312 
315 
328 - (void)startScanning;
329 
345 - (void)startScanningInPausedState:(BOOL)paused;
346 
365 - (void)startScanningInPausedState:(BOOL)paused completionHandler:(nullable void (^)(void))handler;
366 
377 - (void)stopScanningWithCompletionHandler:(nullable void (^)(void))handler;
378 
388 - (void)stopScanning;
389 
403 - (void)resumeScanning;
404 
420 - (void)resumeScanningWithCompletionHandler:(nullable void (^)(void))handler;
421 
433 - (void)pauseScanning;
434 
448 - (void)pauseScanningWithCompletionHandler:(nullable void (^)(void))handler;
449 
451 
454 
472 - (CGPoint)convertPointToPickerCoordinates:(CGPoint)point;
473 
475 
483 - (BOOL)isScanning;
484 
486 
489 
499 - (BOOL)supportsCameraFacing:(SBSCameraFacingDirection)facing;
500 
509 - (BOOL)changeToCameraFacing:(SBSCameraFacingDirection)facing;
510 
518 - (BOOL)switchCameraFacing;
520 
523 
536 - (void)switchTorchOn:(BOOL)on;
538 
541 
554 - (BOOL)setRelativeZoom:(float)zoom;
556 
559 
573 - (nullable SBSParser *)parserForFormat:(SBSParserDataFormat)dataFormat error:(NSError * _Nullable * _Nullable)outError;
575 
578 
595 - (nullable SBSBarcodeGenerator *)barcodeGeneratorForSymbology:(SBSSymbology)symbology error:(NSError * _Nullable * _Nullable)outError;
597 
605 - (void)addWarningsObserver:(nullable id<SBSWarningsObserver>)observer;
606 
614 - (void)removeWarningsObserver:(nullable id<SBSWarningsObserver>)observer;
615 
616 @end
void resumeScanning()
Resume scanning codes.
Definition: SBSBarcodePicker.h:89
void pauseScanning()
Pause scanning but keep preview on.
Controls the camera and orchestrates the barcode scanning process.
Definition: SBSBarcodePicker.h:145
BOOL pinchToZoomEnabled
Whether pinch to zoom is enabled.
Definition: SBSBarcodePicker.h:247
SBSCameraFacingDirection
Definition: SBSCommon.h:40
controls the scan screen user interface.
Definition: SBSOverlayController.h:103
BOOL autoFocusOnTapEnabled
Whether tapping on the screen should trigger an auto-focus.
Definition: SBSBarcodePicker.h:236
id< SBSScanDelegate > scanDelegate
The scan delegate for this barcode picker.
Definition: SBSBarcodePicker.h:185
Holds settings that affect the recognition of barcodes, such as enabled barcode symbologies, scanning hot spot etc.
Definition: SBSScanSettings.h:29
Defines the Protocol for a scan event delegate.
Definition: SBSBarcodePicker.h:67
void startScanning()
Starts/restarts the camera and the scanning process.
SBSCameraFacingDirection cameraFacingDirection
The facing direction of the used camera.
Definition: SBSBarcodePicker.h:215
SBSSymbology
Enumerates the symbologies supported by Scandit Barcode Scanner.
Definition: SBSCode.h:44
Protocol for accessing the processed sample buffers.
Definition: SBSBarcodePicker.h:33
Holds all barcodes that were decoded in the current session.
Definition: SBSScanSession.h:39
A barcode generator.
Definition: SBSBarcodeGenerator.h:39
id< SBSLicenseValidationDelegate > licenseValidationDelegate
The license validation delegate for this barcode picker.
Definition: SBSBarcodePicker.h:208
Defines the interface for a data string parser. Parsers are capable of parsing one particular data fo...
Definition: SBSParser.h:62
id< SBSProcessFrameDelegate > processFrameDelegate
The process frame delegate for this barcode picker.
Definition: SBSBarcodePicker.h:197
BOOL switchCameraFacing()
Changes to the opposite camera facing if it is supported.
SBSOverlayController * overlayController
The overlay controller controls the scan user interface.
Definition: SBSBarcodePicker.h:172
AVCaptureVideoOrientation cameraPreviewOrientation
The orientation of the camera preview.
Definition: SBSBarcodePicker.h:228
UIInterfaceOrientationMask allowedInterfaceOrientations
Orientations that the barcode picker is allowed to rotate to.
Definition: SBSBarcodePicker.h:162
BOOL isScanning()
Returns YES if scanning is in progress.
void stopScanning()
Stop scanning and the video preview.