the very simple test app that calls the ZXingWidget
[zxing.git] / iphone / Classes / DecoderViewController.h
1 //
2 //  DecoderViewController.h
3 //  ZXing
4 //
5 //  Created by Christian Brunschen on 22/05/2008.
6 /*
7  * Copyright 2008 ZXing authors
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21
22 #import <UIKit/UIKit.h>
23 #import "Decoder.h"
24 #import "DecoderDelegate.h"
25 #import "ScannedImageView.h"
26
27 @class ParsedResult;
28 @class Scan;
29 @class TwoDDecoderResult;
30 @class ResultAction;
31
32
33 @interface DecoderViewController : UIViewController <DecoderDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate> {
34   IBOutlet UIBarItem *cameraBarItem;
35   IBOutlet UIBarItem *savedPhotosBarItem;
36   IBOutlet UIBarItem *libraryBarItem;
37   IBOutlet UIBarItem *archiveBarItem;
38   IBOutlet UIBarItem *actionBarItem;
39
40   IBOutlet UIView *messageView;
41   IBOutlet UITextView *messageTextView;
42   IBOutlet UIButton *messageHelpButton;
43   IBOutlet ScannedImageView *imageView;
44   IBOutlet UIToolbar *toolbar;
45   UIImagePickerController *picker;
46
47   Decoder *decoder;
48   ParsedResult *result;
49   NSArray *actions;
50
51   NSMutableArray *resultPointViews;
52 }
53
54 @property (nonatomic, retain) UIBarItem *cameraBarItem;
55 @property (nonatomic, retain) UIBarItem *savedPhotosBarItem;
56 @property (nonatomic, retain) UIBarItem *libraryBarItem;
57 @property (nonatomic, retain) UIBarItem *archiveBarItem;
58 @property (nonatomic, retain) UIBarItem *actionBarItem;
59
60 @property (nonatomic, retain) UIView *messageView;
61 @property (nonatomic, retain) UITextView *messageTextView;
62 @property (nonatomic, retain) UIButton *messageHelpButton;
63 @property (nonatomic, retain) ScannedImageView *imageView;
64 @property (nonatomic, retain) UIImagePickerController *picker;
65 @property (nonatomic, retain) UIToolbar *toolbar;
66
67 @property (nonatomic, retain) Decoder *decoder;
68 @property (nonatomic, retain) ParsedResult *result;
69 @property (nonatomic, retain) NSArray *actions;
70
71 @property (nonatomic, retain) NSMutableArray *resultPointViews;
72
73 - (void)clearImageView;
74 - (void)updateToolbar;
75 - (void)pickAndDecodeFromSource:(UIImagePickerControllerSourceType) sourceType;
76 - (IBAction)pickAndDecode:(id)sender;
77 - (void)showMessage:(NSString *)message helpButton:(BOOL)showHelpButton;
78 - (IBAction)performResultAction:(id)sender;
79 - (IBAction)showArchive:(id)sender;
80 - (void)showScan:(Scan *)scan;
81
82 /* DecoderDelegate methods */
83
84 - (void)decoder:(Decoder *)decoder willDecodeImage:(UIImage *)image usingSubset:(UIImage *)subset;
85 - (void)decoder:(Decoder *)decoder decodingImage:(UIImage *)image usingSubset:(UIImage *)subset progress:(NSString *) message;
86 - (void)decoder:(Decoder *)decoder didDecodeImage:(UIImage *)image usingSubset:(UIImage *)subset withResult:(TwoDDecoderResult *)result;
87
88 /* UIImagePickerControllerDelegate methods */
89
90 - (void)imagePickerController:(UIImagePickerController *)picker
91 didFinishPickingMediaWithInfo:(NSDictionary *)info;
92 - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker;
93
94 /* UINavigationControllerDelegate methods */
95 - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
96 - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
97
98 @end