2 * Copyright 2009 Jeff Verkoeyen
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <UIKit/UIKit.h>
18 #include <AudioToolbox/AudioToolbox.h>
19 #import <AVFoundation/AVFoundation.h>
21 #include "parsedResults/ParsedResult.h"
22 #include "OverlayView.h"
24 @protocol ZXingDelegate;
26 #if !TARGET_IPHONE_SIMULATOR
30 @interface ZXingWidgetController : UIViewController<DecoderDelegate,
32 UINavigationControllerDelegate
34 , AVCaptureVideoDataOutputSampleBufferDelegate
39 OverlayView *overlayView;
40 SystemSoundID beepSound;
43 id<ZXingDelegate> delegate;
47 AVCaptureSession *captureSession;
48 AVCaptureVideoPreviewLayer *prevLayer;
54 @property (nonatomic, retain) AVCaptureSession *captureSession;
55 @property (nonatomic, retain) AVCaptureVideoPreviewLayer *prevLayer;
57 @property (nonatomic, retain ) NSSet *readers;
58 @property (nonatomic, assign) id<ZXingDelegate> delegate;
59 @property (nonatomic, retain) NSURL *soundToPlay;
60 @property (nonatomic, retain) ParsedResult *result;
61 @property (nonatomic, retain) OverlayView *overlayView;
63 - (id)initWithDelegate:(id<ZXingDelegate>)delegate showCancel:(BOOL)shouldShowCancel OneDMode:(BOOL)shouldUseoOneDMode;
68 @protocol ZXingDelegate
69 - (void)zxingController:(ZXingWidgetController*)controller didScanResult:(NSString *)result;
70 - (void)zxingControllerDidCancel:(ZXingWidgetController*)controller;