diff --git a/Classes/AdvancedPhoneViewController.h b/Classes/AdvancedPhoneViewController.h new file mode 100644 index 000000000..d4f0dea02 --- /dev/null +++ b/Classes/AdvancedPhoneViewController.h @@ -0,0 +1,28 @@ +/* AdvancedPhoneViewController.h + * + * Copyright (C) 2009 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import +#import "PhoneViewController.h" + + +@interface AdvancedPhoneViewController : PhoneViewController { + IncallViewController* mIncallViewController; +} + +@end diff --git a/Classes/AdvancedPhoneViewController.m b/Classes/AdvancedPhoneViewController.m new file mode 100644 index 000000000..411f87f3d --- /dev/null +++ b/Classes/AdvancedPhoneViewController.m @@ -0,0 +1,75 @@ +/* AdvancedPhoneViewController.m + * + * Copyright (C) 2009 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import "AdvancedPhoneViewController.h" + + +@implementation AdvancedPhoneViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + mIncallViewController = [[IncallViewController alloc] initWithNibName:@"IncallViewController" + bundle:[NSBundle mainBundle]]; +} + +-(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + [super displayDialerFromUI:viewCtrl + forUser:username + withDisplayName:displayName]; + + [mIncallViewController displayDialerFromUI:viewCtrl + forUser:username + withDisplayName:displayName]; + +} +-(void) displayCallInProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + /*[super displayCallInProgressFromUI:viewCtrl + forUser:username + withDisplayName:displayName];*/ + + [self presentModalViewController:mIncallViewController animated:true]; + + [mIncallViewController displayCallInProgressFromUI:viewCtrl + forUser:username + withDisplayName:displayName]; + +} +-(void) displayIncallFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + [super displayIncallFromUI:viewCtrl + forUser:username + withDisplayName:displayName]; + + [mIncallViewController displayIncallFromUI:viewCtrl + forUser:username + withDisplayName:displayName]; + +} +-(void) displayStatus:(NSString*) message { + [super displayStatus:message]; + [mIncallViewController displayStatus:message]; +} + +- (void)dealloc { + [mIncallViewController release]; + [super dealloc]; + +} + + +@end diff --git a/Classes/IncallViewController.h b/Classes/IncallViewController.h index f42ab0d15..432b7adef 100644 --- a/Classes/IncallViewController.h +++ b/Classes/IncallViewController.h @@ -32,7 +32,7 @@ UILabel* peerNumber; UIDuration* callDuration; UILabel* status; - UIHangUpButton* end; + UIHangUpButton* endCtrl; UIButton* dialer; UIMuteButton* mute; UISpeakerButton* speaker; @@ -54,6 +54,7 @@ UIDigitButton* star; UIDigitButton* zero; UIDigitButton* hash; + UIHangUpButton* endPad; UIButton* close; ABPeoplePickerNavigationController* myPeoplePickerController; @@ -70,7 +71,7 @@ @property (nonatomic, retain) IBOutlet UILabel* peerNumber; @property (nonatomic, retain) IBOutlet UILabel* callDuration; @property (nonatomic, retain) IBOutlet UILabel* status; -@property (nonatomic, retain) IBOutlet UIButton* end; +@property (nonatomic, retain) IBOutlet UIButton* endCtrl; @property (nonatomic, retain) IBOutlet UIButton* dialer; @property (nonatomic, retain) IBOutlet UIButton* mute; @property (nonatomic, retain) IBOutlet UIButton* speaker; @@ -90,5 +91,5 @@ @property (nonatomic, retain) IBOutlet UIButton* zero; @property (nonatomic, retain) IBOutlet UIButton* hash; @property (nonatomic, retain) IBOutlet UIButton* close; - +@property (nonatomic, retain) IBOutlet UIButton* endPad; @end diff --git a/Classes/IncallViewController.m b/Classes/IncallViewController.m index edb614294..6a3e2ab05 100644 --- a/Classes/IncallViewController.m +++ b/Classes/IncallViewController.m @@ -32,7 +32,7 @@ @synthesize peerNumber; @synthesize callDuration; @synthesize status; -@synthesize end; +@synthesize endCtrl; @synthesize close; @synthesize mute; @synthesize dialer; @@ -51,7 +51,7 @@ @synthesize star; @synthesize zero; @synthesize hash; - +@synthesize endPad; /* // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. @@ -71,6 +71,7 @@ //Controls [mute initWithOnImage:[UIImage imageNamed:@"mic_muted.png"] offImage:[UIImage imageNamed:@"mic_active.png"] ]; [speaker initWithOnImage:[UIImage imageNamed:@"Speaker-32-on.png"] offImage:[UIImage imageNamed:@"Speaker-32-off.png"] ]; + //Dialer init [zero initWithNumber:'0']; @@ -101,7 +102,14 @@ [status setText:message]; } +-(void) displayPad:(bool) enable { + [controlSubView setHidden:enable]; + [padSubView setHidden:!enable]; +} -(void) displayCallInProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + //restaure view + [self displayPad:false]; + if (displayName && [displayName length]>0) { [peerName setText:displayName]; [peerNumber setText:username]; @@ -122,8 +130,7 @@ - (IBAction)doAction:(id)sender { if (sender == dialer) { - [controlSubView setHidden:true]; - [padSubView setHidden:false]; + [self displayPad:true]; } else if (sender == contacts) { // start people picker @@ -132,8 +139,7 @@ [self presentModalViewController: myPeoplePickerController animated:true]; } else if (sender == close) { - [controlSubView setHidden:false]; - [padSubView setHidden:true]; + [self displayPad:false]; } } diff --git a/Classes/IncallViewController.xib b/Classes/IncallViewController.xib index a2dbffce9..74b79c19f 100644 --- a/Classes/IncallViewController.xib +++ b/Classes/IncallViewController.xib @@ -538,7 +538,7 @@ - {{400, 110}, {270, 317}} + {{25, 110}, {270, 317}} 3 @@ -570,15 +570,6 @@ YES - - - doAction: - - - 7 - - 20 - view @@ -587,15 +578,6 @@ 23 - - - doAction: - - - 7 - - 42 - controlSubView @@ -612,15 +594,6 @@ 45 - - - doAction: - - - 7 - - 47 - dialer @@ -629,15 +602,6 @@ 49 - - - doAction: - - - 7 - - 50 - close @@ -646,14 +610,6 @@ 51 - - - end - - - - 53 - one @@ -710,60 +666,6 @@ 60 - - - doAction: - - - 1 - - 61 - - - - doAction: - - - 1 - - 62 - - - - doAction: - - - 1 - - 63 - - - - doAction: - - - 1 - - 64 - - - - doAction: - - - 1 - - 65 - - - - doAction: - - - 1 - - 66 - four @@ -772,15 +674,6 @@ 67 - - - doAction: - - - 1 - - 68 - five @@ -789,15 +682,6 @@ 69 - - - doAction: - - - 1 - - 70 - six @@ -806,15 +690,6 @@ 71 - - - doAction: - - - 1 - - 72 - seven @@ -823,15 +698,6 @@ 73 - - - doAction: - - - 1 - - 74 - eight @@ -840,24 +706,6 @@ 75 - - - doAction: - - - 1 - - 76 - - - - doAction: - - - 1 - - 77 - mute @@ -866,15 +714,6 @@ 80 - - - doAction: - - - 7 - - 81 - speaker @@ -883,15 +722,6 @@ 82 - - - doAction: - - - 7 - - 83 - contacts @@ -932,6 +762,49 @@ 94 + + + endPad + + + + 98 + + + + endCtrl + + + + 99 + + + + doAction: + + + 7 + + 100 + + + + doAction: + + + 7 + + 101 + + + + doAction: + + + 7 + + 103 + @@ -1083,7 +956,7 @@ 31 - start + star 32 @@ -1272,7 +1145,7 @@ - 94 + 103 @@ -1301,7 +1174,8 @@ controlSubView dialer eight - end + endCtrl + endPad five four hash @@ -1335,6 +1209,7 @@ UIButton UIButton UIButton + UIButton UIView UILabel UILabel @@ -1358,7 +1233,8 @@ controlSubView dialer eight - end + endCtrl + endPad five four hash @@ -1404,7 +1280,11 @@ UIButton - end + endCtrl + UIButton + + + endPad UIButton