LBXScanViewController.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. //
  2. // QQStyleQRScanViewController.h
  3. //
  4. // github:https://github.com/MxABC/LBXScan
  5. // Created by lbxia on 15/10/21.
  6. // Copyright © 2015年 lbxia. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <Foundation/Foundation.h>
  10. #import "LBXScanViewStyle.h"
  11. //
  12. //
  13. //#ifdef LBXScan_Define_ZXing
  14. //#import "ZXingWrapper.h" //ZXing扫码封装
  15. //#endif
  16. //
  17. //#ifdef LBXScan_Define_ZBar
  18. //#import "ZBarSDK.h"
  19. //#import "LBXZBarWrapper.h"//ZBar扫码封装
  20. //#endif
  21. @class LBXScanResult;
  22. @class LBXScanView;
  23. @class LBXScanNative;
  24. typedef NS_ENUM(NSInteger, SCANLIBRARYTYPE) {
  25. SLT_Native,
  26. SLT_ZXing,
  27. SLT_ZBar
  28. };
  29. // @[@"QRCode",@"BarCode93",@"BarCode128",@"BarCodeITF",@"EAN13"];
  30. typedef NS_ENUM(NSInteger, SCANCODETYPE) {
  31. SCT_QRCode, //QR二维码
  32. SCT_BarCode93,
  33. SCT_BarCode128,//支付条形码(支付宝、微信支付条形码)
  34. SCT_BarCodeITF,//燃气回执联 条形码?
  35. SCT_BarEAN13 //一般用做商品码
  36. };
  37. /**
  38. 扫码结果delegate,也可通过继承本控制器,override方法scanResultWithArray即可
  39. */
  40. @protocol LBXScanViewControllerDelegate <NSObject>
  41. @optional
  42. - (void)scanResultWithArray:(NSArray<LBXScanResult*>*)array;
  43. @end
  44. @interface LBXScanViewController : UIViewController<UIImagePickerControllerDelegate,UINavigationControllerDelegate>
  45. #pragma mark ---- 需要初始化参数 ------
  46. //当前选择的扫码库
  47. @property (nonatomic, assign) SCANLIBRARYTYPE libraryType;
  48. //
  49. /**
  50. 当前选择的识别码制
  51. - ZXing暂不支持类型选择
  52. */
  53. @property (nonatomic, assign) SCANCODETYPE scanCodeType;
  54. //扫码结果委托,另外一种方案是通过继承本控制器,override方法scanResultWithArray即可
  55. @property (nonatomic, weak) id<LBXScanViewControllerDelegate> delegate;
  56. /**
  57. @brief 是否需要扫码图像
  58. */
  59. @property (nonatomic, assign) BOOL isNeedScanImage;
  60. /**
  61. @brief 启动区域识别功能,ZBar暂不支持
  62. */
  63. @property(nonatomic,assign) BOOL isOpenInterestRect;
  64. /**
  65. 相机启动提示,如 相机启动中...
  66. */
  67. @property (nonatomic, copy) NSString *cameraInvokeMsg;
  68. /**
  69. * 界面效果参数
  70. */
  71. @property (nonatomic, strong) LBXScanViewStyle *style;
  72. #pragma mark ----- 扫码使用的库对象 -------
  73. /**
  74. @brief 扫码功能封装对象
  75. */
  76. @property (nonatomic,strong) LBXScanNative* scanObj;
  77. #pragma mark - 扫码界面效果及提示等
  78. /**
  79. @brief 扫码区域视图,二维码一般都是框
  80. */
  81. @property (nonatomic,strong) LBXScanView* qRScanView;
  82. /**
  83. @brief 扫码存储的当前图片
  84. */
  85. @property(nonatomic,strong) UIImage* scanImage;
  86. /**
  87. @brief 闪关灯开启状态记录
  88. */
  89. @property(nonatomic,assign)BOOL isOpenFlash;
  90. //打开相册
  91. - (void)openLocalPhoto:(BOOL)allowsEditing;
  92. //开关闪光灯
  93. - (void)openOrCloseFlash;
  94. //启动扫描
  95. - (void)reStartDevice;
  96. //关闭扫描
  97. - (void)stopScan;
  98. @end