#include <UIKit/UIKit.h>
#include <AudioToolbox/AudioToolbox.h>
+#import <AVFoundation/AVFoundation.h>
#include "Decoder.h"
-#include "ParsedResult.h"
+#include "parsedResults/ParsedResult.h"
#include "OverlayView.h"
@protocol ZXingDelegate;
-//@interface ZXingWidgetController : UIImagePickerController <DecoderDelegate, CancelDelegate> {
-@interface ZXingWidgetController : UIViewController<DecoderDelegate, CancelDelegate, UIImagePickerControllerDelegate,UINavigationControllerDelegate> {
+#if !TARGET_IPHONE_SIMULATOR
+#define HAS_AVFF 1
+#endif
+
+@interface ZXingWidgetController : UIViewController<DecoderDelegate,
+ CancelDelegate,
+ UINavigationControllerDelegate
+#if HAS_AVFF
+ , AVCaptureVideoDataOutputSampleBufferDelegate
+#endif
+ > {
NSSet *readers;
ParsedResult *result;
- UIImagePickerController *imagePicker;
- NSArray *actions;
OverlayView *overlayView;
SystemSoundID beepSound;
BOOL showCancel;
id<ZXingDelegate> delegate;
BOOL wasCancelled;
BOOL oneDMode;
+#if HAS_AVFF
+ AVCaptureSession *captureSession;
+ AVCaptureVideoPreviewLayer *prevLayer;
+#endif
+ BOOL decoding;
}
+#if HAS_AVFF
+@property (nonatomic, retain) AVCaptureSession *captureSession;
+@property (nonatomic, retain) AVCaptureVideoPreviewLayer *prevLayer;
+#endif
@property (nonatomic, retain ) NSSet *readers;
@property (nonatomic, assign) id<ZXingDelegate> delegate;
-@property (nonatomic, assign) NSURL *soundToPlay;
+@property (nonatomic, retain) NSURL *soundToPlay;
@property (nonatomic, retain) ParsedResult *result;
-@property (nonatomic, retain) NSArray *actions;
@property (nonatomic, retain) OverlayView *overlayView;
- (id)initWithDelegate:(id<ZXingDelegate>)delegate showCancel:(BOOL)shouldShowCancel OneDMode:(BOOL)shouldUseoOneDMode;
- (BOOL)fixedFocus;
-- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker;
@end
@protocol ZXingDelegate
- (void)zxingController:(ZXingWidgetController*)controller didScanResult:(NSString *)result;
- (void)zxingControllerDidCancel:(ZXingWidgetController*)controller;
-@end
\ No newline at end of file
+@end