//
//  TimerView.h
//  ZeroRec
//
//  Created by AIG-Soft on 2011/2/24
//  Copyright 2011 AIG-Soft. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SetupViewController.h"
#import	"TimerView.h"
#import "Setup.h"

@class TimerView;

@protocol TimerViewDelegate <NSObject>
@optional
-(void)AtTimerViewClose:(TimerView *)timerView;

@end


// 本来時刻指定はUIDatePickerを使うべきだろうが、1画面開始と終了の2つを表示したいにもかかわらず
// 時刻表示はLocalに従ってしまい24時制表示固定ができず幅が固定できないのでUIPickerViewを使って作り出している。
@interface TimerView : UIViewController
<UIPickerViewDelegate,UIPickerViewDataSource>
{
}
@property (nonatomic,strong) NSMutableArray	*hours;
@property (nonatomic,strong) NSMutableArray	*mins;
@property (nonatomic,weak) IBOutlet	UIPickerView	*pickerViewRecStart;
@property (nonatomic,weak) IBOutlet	UIPickerView	*pickerViewRecEnd;
@property (nonatomic,weak) IBOutlet	UIButton		*btn24Hour;
@property (nonatomic,weak) IBOutlet	UIButton		*btn24HourLandscape;
@property (nonatomic,weak) IBOutlet	UILabel			*lbl24Hour;
@property (nonatomic,weak) IBOutlet	UILabel			*lbl24HourLandscape;
@property (nonatomic,weak) id <TimerViewDelegate> delegate;

- (void)initTimerView:(NSString *)title;
- (void)setTimer:(NSUInteger)sh StartMin:(NSUInteger)sm EndHour:(NSUInteger)eh EndMin:(NSUInteger)em;
- (IBAction)set24Hour;

NSInteger searchHour(NSUInteger h);
NSInteger searchMin(NSUInteger m);
NSInteger getHour(NSUInteger h);
NSInteger getMin(NSUInteger m);

enum { // 桁位置
	COLUM_HOUR=0
,	COLUM_MIN
	// 桁数
,	MAX_COLUM
};

@end