2008-06-19 01:52:37 -07:00
|
|
|
//
|
|
|
|
// DecoderViewController.h
|
|
|
|
// ZXing
|
|
|
|
//
|
|
|
|
// Created by Christian Brunschen on 22/05/2008.
|
|
|
|
/*
|
2008-06-19 13:56:24 -07:00
|
|
|
* Copyright 2008 ZXing authors
|
2008-06-19 01:52:37 -07:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#import "Decoder.h"
|
|
|
|
#import "DecoderDelegate.h"
|
2008-07-02 07:22:23 -07:00
|
|
|
#import "ScannedImageView.h"
|
2008-06-19 01:52:37 -07:00
|
|
|
|
|
|
|
@class ParsedResult;
|
|
|
|
@class Scan;
|
|
|
|
@class TwoDDecoderResult;
|
|
|
|
@class ResultAction;
|
|
|
|
|
|
|
|
|
|
|
|
@interface DecoderViewController : UIViewController <DecoderDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate> {
|
|
|
|
IBOutlet UIBarItem *cameraBarItem;
|
|
|
|
IBOutlet UIBarItem *savedPhotosBarItem;
|
|
|
|
IBOutlet UIBarItem *libraryBarItem;
|
|
|
|
IBOutlet UIBarItem *archiveBarItem;
|
|
|
|
IBOutlet UIBarItem *actionBarItem;
|
|
|
|
|
2008-08-01 06:04:23 -07:00
|
|
|
IBOutlet UIView *messageView;
|
|
|
|
IBOutlet UITextView *messageTextView;
|
|
|
|
IBOutlet UIButton *messageHelpButton;
|
2008-07-02 07:22:23 -07:00
|
|
|
IBOutlet ScannedImageView *imageView;
|
2008-06-19 01:52:37 -07:00
|
|
|
IBOutlet UIToolbar *toolbar;
|
|
|
|
|
|
|
|
Decoder *decoder;
|
|
|
|
ParsedResult *result;
|
|
|
|
NSArray *actions;
|
2008-07-02 07:22:23 -07:00
|
|
|
|
|
|
|
NSMutableArray *resultPointViews;
|
2008-06-19 01:52:37 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
@property (nonatomic, retain) UIBarItem *cameraBarItem;
|
|
|
|
@property (nonatomic, retain) UIBarItem *savedPhotosBarItem;
|
|
|
|
@property (nonatomic, retain) UIBarItem *libraryBarItem;
|
|
|
|
@property (nonatomic, retain) UIBarItem *archiveBarItem;
|
|
|
|
@property (nonatomic, retain) UIBarItem *actionBarItem;
|
|
|
|
|
2008-08-01 06:04:23 -07:00
|
|
|
@property (nonatomic, retain) UIView *messageView;
|
|
|
|
@property (nonatomic, retain) UITextView *messageTextView;
|
|
|
|
@property (nonatomic, retain) UIButton *messageHelpButton;
|
2008-07-02 07:22:23 -07:00
|
|
|
@property (nonatomic, retain) ScannedImageView *imageView;
|
2008-06-19 01:52:37 -07:00
|
|
|
@property (nonatomic, retain) UIToolbar *toolbar;
|
|
|
|
|
|
|
|
@property (nonatomic, retain) Decoder *decoder;
|
|
|
|
@property (nonatomic, retain) ParsedResult *result;
|
|
|
|
@property (nonatomic, retain) NSArray *actions;
|
|
|
|
|
2008-07-02 07:22:23 -07:00
|
|
|
@property (nonatomic, retain) NSMutableArray *resultPointViews;
|
|
|
|
|
2008-08-01 06:04:23 -07:00
|
|
|
- (void)clearImageView;
|
2008-06-19 01:52:37 -07:00
|
|
|
- (void)updateToolbar;
|
|
|
|
- (void)pickAndDecodeFromSource:(UIImagePickerControllerSourceType) sourceType;
|
|
|
|
- (IBAction)pickAndDecode:(id)sender;
|
2008-08-01 06:04:23 -07:00
|
|
|
- (void)showMessage:(NSString *)message helpButton:(BOOL)showHelpButton;
|
2008-06-19 01:52:37 -07:00
|
|
|
- (IBAction)performResultAction:(id)sender;
|
|
|
|
- (IBAction)showArchive:(id)sender;
|
|
|
|
- (void)showScan:(Scan *)scan;
|
|
|
|
|
|
|
|
/* DecoderDelegate methods */
|
|
|
|
|
2008-10-13 09:09:09 -07:00
|
|
|
- (void)decoder:(Decoder *)decoder willDecodeImage:(UIImage *)image usingSubset:(UIImage *)subset;
|
2008-06-25 06:17:06 -07:00
|
|
|
- (void)decoder:(Decoder *)decoder decodingImage:(UIImage *)image usingSubset:(UIImage *)subset progress:(NSString *) message;
|
|
|
|
- (void)decoder:(Decoder *)decoder didDecodeImage:(UIImage *)image usingSubset:(UIImage *)subset withResult:(TwoDDecoderResult *)result;
|
2008-06-19 01:52:37 -07:00
|
|
|
|
|
|
|
/* UIImagePickerControllerDelegate methods */
|
|
|
|
|
|
|
|
- (void)imagePickerController:(UIImagePickerController *)picker
|
|
|
|
didFinishPickingImage:(UIImage *)image
|
|
|
|
editingInfo:(NSDictionary *)editingInfo;
|
|
|
|
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker;
|
|
|
|
|
|
|
|
/* UINavigationControllerDelegate methods */
|
|
|
|
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
|
|
|
|
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
|
|
|
|
|
|
|
|
@end
|