Mobile API Reference  MicroStrategy 2019
BarcodeScannerController.h
Go to the documentation of this file.
1 
2 
3 #import <UIKit/UIKit.h>
4 #import <AVFoundation/AVFoundation.h>
5 #import "BarCodeCB.h"
7 //#import "ZBarImageScanner.h"
8 
9 /* whether we are using an actual device or not. Simulator doesn't have the AVFoundation libraries for camera */
10 #if !TARGET_OS_EMBEDDED
11  #define SIMULATOR_COMPILATION 1
12 #else
13  #define SIMULATOR_COMPILATION 0
14 #endif
15 
16 #if (SIMULATOR_COMPILATION || __IPHONE_OS_VERSION_MAX_ALLOWED < 40000)
17  #define CAN_USE_AVCAPTURE 0
18 #else
19  #define CAN_USE_AVCAPTURE 1
20 #endif
21 
23 @class ZBarImageScanner;
24 @class ZBarSymbol;
25 
26 @protocol BarcodeScannerControllerDelegate <UINavigationControllerDelegate, UIImagePickerControllerDelegate>
27 - (void)barcodeScannerController:(BarcodeScannerController*)self didFinishScanning:(BarCodeCB *)result;
28 @end
29 
30 #if CAN_USE_AVCAPTURE == 0
31 @interface BarcodeScannerController : UIViewController
32 <KeypadInputControllerDelegate>
33 #else
34 
35 @interface BarcodeScannerController : UIViewController
36 <KeypadInputControllerDelegate, AVCaptureVideoDataOutputSampleBufferDelegate>
37 #endif
38 {
39  BarCodeCB *readerCB;
40  NSTimer *timer;
41  NSString *codes[10];
42  int codeIndex;
44  UIView *originalView;
46  UIToolbar *toolBar;
47  UIButton *cancelButton;
48  UIImageView *scanView;
49  UIImageView *lensCover;
50  UITextField *textField;
52  UISegmentedControl *toggleCamera;
53  UIBarButtonItem *segmentButton;
54  UIView *keypadView;
55  NSString *currentValue;
56  id<BarcodeScannerControllerDelegate> __weak delegate;
57  CGRect scanCrop;
58  ZBarImageScanner *scanner;
59  NSInteger maxScanDimension;
60  ZBarSymbol *symbol;
61  CALayer *boxLayer;
62  UIView *boxView;
66  CGRect customFrame;
67 
68 #if CAN_USE_AVCAPTURE
69  AVCaptureSession *session;
70  AVCaptureVideoDataOutput *captureOutput;
71  AVCaptureDeviceInput *captureInput;
72  AVCaptureDevice *device;
73  AVCaptureVideoPreviewLayer *prevLayer;
74 #endif
75 }
76 
77 @property(nonatomic,weak) id<BarcodeScannerControllerDelegate> delegate;
78 @property(nonatomic, copy) NSString *currentValue;
79 @property CGRect customFrame;
80 
81 #if CAN_USE_AVCAPTURE
82 // access to configure image scanner
83 @property (readonly, nonatomic) ZBarImageScanner *scanner;
84 #endif
85 
86 - (void) cancelScan;
87 
88 + (BOOL) isAvailable;
89 
90 @end
91 
BOOL scanSuccess
Definition: BarcodeScannerController.h:63
signed char BOOL
Definition: PDCwtypes.h:101
KeypadInputController * vwKeypadInput
Definition: BarcodeScannerController.h:51
NSString * codes[10]
Definition: BarcodeScannerController.h:41
CGRect customFrame
Definition: BarcodeScannerController.h:66
ZBarImageScanner * scanner
Definition: BarcodeScannerController.h:58
UIToolbar * toolBar
Definition: BarcodeScannerController.h:46
UIButton * cancelButton
Definition: BarcodeScannerController.h:47
UIBarButtonItem * segmentButton
Definition: BarcodeScannerController.h:53
Definition: BarcodeScannerController.h:31
BOOL isVertical
Definition: BarcodeScannerController.h:43
UIView * boxView
Definition: BarcodeScannerController.h:62
BOOL statusBarHidden
Definition: BarcodeScannerController.h:65
UIImageView * lensCover
Definition: BarcodeScannerController.h:49
id< BarcodeScannerControllerDelegate > __weak delegate
Definition: BarcodeScannerController.h:56
UISegmentedControl * toggleCamera
Definition: BarcodeScannerController.h:52
UITextField * textField
Definition: BarcodeScannerController.h:50
CALayer * boxLayer
Definition: BarcodeScannerController.h:61
UIView * keypadView
Definition: BarcodeScannerController.h:54
ZBarSymbol * symbol
Definition: BarcodeScannerController.h:60
BOOL cameraActive
Definition: BarcodeScannerController.h:45
< KeypadInputControllerDelegate > NSTimer * timer
Definition: BarcodeScannerController.h:38
BOOL isOS4Available
Definition: BarcodeScannerController.h:64
UIImageView * scanView
Definition: BarcodeScannerController.h:48
Definition: BarCodeCB.h:29
CGRect scanCrop
Definition: BarcodeScannerController.h:57
NSInteger maxScanDimension
Definition: BarcodeScannerController.h:59
NSString * currentValue
Definition: BarcodeScannerController.h:55
UIView * originalView
Definition: BarcodeScannerController.h:44
int codeIndex
Definition: BarcodeScannerController.h:42
Definition: KeypadInputController.h:18