diff --git a/Classes/ConferenceCallDetailView.m b/Classes/ConferenceCallDetailView.m index 231fcb4ce..7ae8a4d6d 100644 --- a/Classes/ConferenceCallDetailView.m +++ b/Classes/ConferenceCallDetailView.m @@ -136,8 +136,8 @@ NSTimer *callQualityRefresher; UILabel* label = (UILabel*) [cell viewWithTag:2]; /* update cell content */ - LinphoneCall* call = [IncallViewController retrieveCallAtIndex:indexPath.row inConference:YES]; - [IncallViewController updateCellImageView:image Label:label DetailLabel:nil AndAccessoryView:nil withCall:call]; + LinphoneCall* call = [InCallViewController retrieveCallAtIndex:indexPath.row inConference:YES]; + [InCallViewController updateCellImageView:image Label:label DetailLabel:nil AndAccessoryView:nil withCall:call]; cell.accessoryType = UITableViewCellAccessoryNone; if (cell.accessoryView == nil) { @@ -150,7 +150,7 @@ NSTimer *callQualityRefresher; } } UIImageView* callquality = (UIImageView*) [cell viewWithTag:3]; - [IncallViewController updateIndicator:callquality withCallQuality:linphone_call_get_average_quality(call)]; + [InCallViewController updateIndicator:callquality withCallQuality:linphone_call_get_average_quality(call)]; tableView.rowHeight = 80; return cell; diff --git a/Classes/ContactTableViewController.h b/Classes/ContactTableViewController.h index 5b4bd1a2b..5141d7a03 100644 --- a/Classes/ContactTableViewController.h +++ b/Classes/ContactTableViewController.h @@ -20,9 +20,10 @@ #import #import #import +#import "OrderedDictionary.h" @interface ContactTableViewController : UITableViewController { - NSMutableDictionary* addressBookMap; + OrderedDictionary* addressBookMap; ABAddressBookRef addressBook; } diff --git a/Classes/ContactTableViewController.m b/Classes/ContactTableViewController.m index 11b639d9f..885a8a9d6 100644 --- a/Classes/ContactTableViewController.m +++ b/Classes/ContactTableViewController.m @@ -18,26 +18,21 @@ */ #include "ContactTableViewController.h" -#import "LinphoneManager.h" #import "FastAddressBook.h" #import "ContactCell.h" @implementation ContactTableViewController #pragma mark Table view methods -NSString *contactTOC = @"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) { ContactTableViewController* controller = (ContactTableViewController*)context; - NSMutableDictionary* lAddressBookMap = controller->addressBookMap; + OrderedDictionary* lAddressBookMap = controller->addressBookMap; @synchronized (lAddressBookMap) { // Reset Address book + [lAddressBookMap removeAllObjects]; - - for(int i = 0; i < [contactTOC length]; i++) { - [lAddressBookMap setObject: [[NSMutableDictionary alloc] init] forKey:[contactTOC substringWithRange:NSMakeRange(i, 1)]]; - } NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook); for (id lPerson in lContacts) { @@ -46,34 +41,34 @@ void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, // Put in correct subDic NSString *firstChar = [[(NSString *)lLocalizedLabel substringToIndex:1] uppercaseString]; - NSMutableDictionary *subDic =[lAddressBookMap objectForKey: firstChar]; + OrderedDictionary *subDic =[lAddressBookMap objectForKey: firstChar]; if(subDic == nil) { - subDic = [[NSMutableDictionary alloc] init]; - [lAddressBookMap setObject: subDic forKey:firstChar]; + subDic = [[OrderedDictionary alloc] init]; + [lAddressBookMap insertObject:subDic forKey:firstChar selector:@selector(caseInsensitiveCompare:)]; } - [subDic setObject:lPerson forKey:[(NSString *)lLocalizedLabel retain]]; + [subDic insertObject:lPerson forKey:[(NSString *)lLocalizedLabel retain] selector:@selector(caseInsensitiveCompare:)]; if (lLocalizedLabel) CFRelease(lLocalizedLabel); CFRelease(lValue); } CFRelease(lContacts); } - [controller.view reloadData]; + [(UITableView *)controller.view reloadData]; } - (void) viewDidLoad { - addressBookMap = [[NSMutableDictionary alloc] init]; + addressBookMap = [[OrderedDictionary alloc] init]; addressBook = ABAddressBookCreate(); ABAddressBookRegisterExternalChangeCallback (addressBook, sync_toc_address_book, self); sync_toc_address_book(addressBook, nil, self); } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return [contactTOC length]; + return [addressBookMap count]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return [(NSMutableDictionary *)[addressBookMap objectForKey: [contactTOC substringWithRange:NSMakeRange(section, 1)]] count]; + return [(OrderedDictionary *)[addressBookMap objectForKey: [addressBookMap keyAtIndex: section]] count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { @@ -82,17 +77,19 @@ void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, cell = [[ContactCell alloc] init]; } - NSMutableDictionary *subDic = [addressBookMap objectForKey: [contactTOC substringWithRange:NSMakeRange([indexPath section], 1)]]; + OrderedDictionary *subDic = [addressBookMap objectForKey: [addressBookMap keyAtIndex: [indexPath section]]]; [cell.label setText: (NSString *)[[subDic allKeys] objectAtIndex:[indexPath row]]]; return cell; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - return [contactTOC substringWithRange:NSMakeRange(section, 1)]; + return [addressBookMap keyAtIndex: section]; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + OrderedDictionary *subDic = [addressBookMap objectForKey: [addressBookMap keyAtIndex: [indexPath section]]]; + ABRecordRef lPerson = [subDic objectForKey: [subDic keyAtIndex:[indexPath row]]]; } - (void)dealloc { diff --git a/Classes/FirstLoginViewController.h b/Classes/FirstLoginViewController.h index e7930a9db..58d6db011 100644 --- a/Classes/FirstLoginViewController.h +++ b/Classes/FirstLoginViewController.h @@ -22,7 +22,7 @@ #import "LinphoneUIDelegates.h" -@interface FirstLoginViewController : UIViewController { +@interface FirstLoginViewController : UIViewController { UIButton* ok; UIButton* site; UITextField* username; diff --git a/Classes/FirstLoginViewController.m b/Classes/FirstLoginViewController.m index 69ae3149d..816cdb505 100644 --- a/Classes/FirstLoginViewController.m +++ b/Classes/FirstLoginViewController.m @@ -29,8 +29,6 @@ @synthesize activityIndicator; @synthesize site; - - - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; //[username setText:[[NSUserDefaults standardUserDefaults] stringForKey:@"username_preference"]]; @@ -43,18 +41,65 @@ siteUrl=@"http://www.linphone.org"; } [site setTitle:siteUrl forState:UIControlStateNormal]; + + // Set observer + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationUpdate:) name:@"LinphoneRegistrationUpdate" object:nil]; } +- (void)registrationUpdate: (NSNotification*) notif { + LinphoneRegistrationState state = [[notif.userInfo objectForKey: @"state"] intValue]; + switch (state) { + case LinphoneRegistrationOk: + { + [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"enable_first_login_view_preference"]; + [self.activityIndicator setHidden:true]; + [self dismissModalViewControllerAnimated:YES]; + break; + } + case LinphoneRegistrationNone: + case LinphoneRegistrationCleared: + { + [self.activityIndicator setHidden:true]; + break; + } + case LinphoneRegistrationFailed: + { + [self.activityIndicator setHidden:true]; + //default behavior if no registration delegates + + //UIAlertView* error = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"Registration failure for user %@",user] + // message:reason + // delegate:nil + // cancelButtonTitle:@"Continue" + // otherButtonTitles:nil ,nil]; + //[error show]; + //[error release]; + //erase uername passwd + [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"username_preference"]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"password_preference"]; + break; + } + case LinphoneRegistrationProgress: { + [self.activityIndicator setHidden:false]; + break; + } + default: break; + } +} + - (void)dealloc { [super dealloc]; [ok dealloc]; [site dealloc]; [username dealloc]; [activityIndicator dealloc]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; } - +- (void) viewDidUnload { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} -(void) doOk:(id)sender { if (sender == site) { @@ -87,33 +132,6 @@ } --(void) displayRegisteredFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"enable_first_login_view_preference"]; - [self.activityIndicator setHidden:true]; - [self dismissModalViewControllerAnimated:YES]; -} --(void) displayRegisteringFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain { - [self.activityIndicator setHidden:false]; -} --(void) displayRegistrationFailedFromUI:(UIViewController*) viewCtrl forUser:(NSString*) user withDisplayName:(NSString*) displayName onDomain:(NSString*)domain forReason:(NSString*) reason { - [self.activityIndicator setHidden:true]; - //default behavior if no registration delegates - - //UIAlertView* error = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"Registration failure for user %@",user] - // message:reason - // delegate:nil - // cancelButtonTitle:@"Continue" - // otherButtonTitles:nil ,nil]; - //[error show]; - //[error release]; - //erase uername passwd - [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"username_preference"]; - [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"password_preference"]; -} --(void) displayNotRegisteredFromUI:(UIViewController*) viewCtrl { - [self.activityIndicator setHidden:true]; -} - - (BOOL)textFieldShouldReturn:(UITextField *)theTextField { // When the user presses return, take focus away from the text field so that the keyboard is dismissed. diff --git a/Classes/InCallViewController.h b/Classes/InCallViewController.h index 5edb0f409..63388ce90 100644 --- a/Classes/InCallViewController.h +++ b/Classes/InCallViewController.h @@ -26,7 +26,7 @@ #import "VideoZoomHandler.h" @class VideoViewController; -@interface IncallViewController : UIViewController { +@interface InCallViewController : UIViewController { UIView* controlSubView, *hangUpView; diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index 0768fa60d..ae809015f 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -35,7 +35,7 @@ const NSInteger SECURE_BUTTON_TAG=5; -@implementation IncallViewController +@implementation InCallViewController @synthesize controlSubView; @synthesize padSubView; @@ -360,7 +360,7 @@ void addAnimationFadeTransition(UIView* view, float duration) { if (state == LinphoneCallStreamsRunning || state == LinphoneCallUpdated || state == LinphoneCallUpdatedByRemote) { if (linphone_call_params_video_enabled(linphone_call_get_current_params(currentCall))) { [addVideo setTitle:NSLocalizedString(@"-video", nil) forState:UIControlStateNormal]; - [IncallViewController updateIndicator: videoCallQuality withCallQuality:linphone_call_get_average_quality(currentCall)]; + [InCallViewController updateIndicator: videoCallQuality withCallQuality:linphone_call_get_average_quality(currentCall)]; } else { [addVideo setTitle:NSLocalizedString(@"+video", nil) forState:UIControlStateNormal]; } @@ -720,7 +720,7 @@ static void hideSpinner(LinphoneCall* lc, void* user_data); } static void hideSpinner(LinphoneCall* call, void* user_data) { - IncallViewController* thiz = (IncallViewController*) user_data; + InCallViewController* thiz = (InCallViewController*) user_data; [thiz hideSpinnerIndicator:call]; } @@ -1027,7 +1027,7 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { else cell.accessoryType = UITableViewCellAccessoryNone; } else { - LinphoneCall* call = [IncallViewController retrieveCallAtIndex:indexPath.row inConference:NO]; + LinphoneCall* call = [InCallViewController retrieveCallAtIndex:indexPath.row inConference:NO]; if (call == nil) return cell; // return dummy cell LinphoneMediaEncryption enc = linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)); @@ -1040,7 +1040,7 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { [view removeFromSuperview]; } } - [IncallViewController updateCellImageView:cell.imageView Label:cell.textLabel DetailLabel:cell.detailTextLabel AndAccessoryView:(UIView*)cell.accessoryView withCall:call]; + [InCallViewController updateCellImageView:cell.imageView Label:cell.textLabel DetailLabel:cell.detailTextLabel AndAccessoryView:(UIView*)cell.accessoryView withCall:call]; if (linphone_core_get_current_call(lc) == call) activeCallCell = cell; cell.accessoryType = UITableViewCellAccessoryNone; @@ -1050,7 +1050,7 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { [callquality setFrame:CGRectMake(0, 0, 28, 28)]; if (call->state == LinphoneCallStreamsRunning) { - [IncallViewController updateIndicator: callquality withCallQuality:linphone_call_get_average_quality(call)]; + [InCallViewController updateIndicator: callquality withCallQuality:linphone_call_get_average_quality(call)]; } else { [callquality setImage:nil]; @@ -1092,7 +1092,7 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { CGPoint currentTouchPos = [touch locationInView:self.callTableView]; NSIndexPath *path = [self.callTableView indexPathForRowAtPoint:currentTouchPos]; if (path) { - LinphoneCall* call = [IncallViewController retrieveCallAtIndex:path.row inConference:NO]; + LinphoneCall* call = [InCallViewController retrieveCallAtIndex:path.row inConference:NO]; // start action sheet to validate/unvalidate zrtp code CallDelegate* cd = [[CallDelegate alloc] init]; cd.eventType = CD_ZRTP; @@ -1233,7 +1233,7 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { bool inConf = (indexPath.row == 0 && linphone_core_get_conference_size(lc) > 0); - LinphoneCall* selectedCall = [IncallViewController retrieveCallAtIndex:indexPath.row inConference:inConf]; + LinphoneCall* selectedCall = [InCallViewController retrieveCallAtIndex:indexPath.row inConference:inConf]; if (inConf) { if (linphone_core_is_in_conference(lc)) diff --git a/Classes/InCallViewController.xib b/Classes/InCallViewController.xib index 81185bcd5..2bb8a21f5 100644 --- a/Classes/InCallViewController.xib +++ b/Classes/InCallViewController.xib @@ -2,23 +2,22 @@ 784 - 11C74 - 1938 - 1138.23 - 567.00 + 11E53 + 2182 + 1138.47 + 569.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 933 + 1181 YES - IBUIButton IBUIImageView - IBUIViewController - IBProxyObject - IBUIActivityIndicatorView + IBUIButton IBUITableView IBUIView + IBUIActivityIndicatorView + IBProxyObject YES @@ -38,824 +37,779 @@ IBFirstResponder IBCocoaTouchFramework - - - - 274 - - YES - - - 292 - - YES - - - 292 - {320, 480} - - - - _NS:196 - - 3 - MCAwAA - - IBCocoaTouchFramework - - - - 292 - {{240, 354}, {80, 106}} - - - - - IBCocoaTouchFramework - - - - 292 - {{4, 428}, {28, 28}} - - - - _NS:567 - NO - IBCocoaTouchFramework - - - - 292 - {{141, 212}, {37, 37}} - - - - _NS:1030 - NO - IBCocoaTouchFramework - NO - YES - 0 + + + 274 + + YES + + + 292 + + YES + + + 292 + {320, 480} + + + _NS:196 + + 3 + MCAwAA + IBCocoaTouchFramework - {320, 460} - - - - _NS:196 - - 2 - MC4wNTQ5MDE5NjA3OCAwLjA4MjM1Mjk0MTE4IDAuMTI5NDExNzY0NwA + + + 292 + {{240, 354}, {80, 106}} + + + + IBCocoaTouchFramework - NO - IBCocoaTouchFramework - - - - 292 - {320, 66} - - - - - 1 - MSAwIDAuMDgyMzIwMjU5MDQgMC4xOAA + + + 292 + {{4, 428}, {28, 28}} + + + _NS:567 + NO + IBCocoaTouchFramework - NO - NO - 0.0 - IBCocoaTouchFramework - 0 - 0 - Change camera - - 3 - MQA - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - 3 - MC41AA - - - NSImage - clavier-01-106px.png - - - Helvetica-Bold - Helvetica - 2 - 15 - - - Helvetica-Bold - 15 - 16 + + + 292 + {{141, 212}, {37, 37}} + + + _NS:1030 + NO + IBCocoaTouchFramework + NO + YES + 0 - - - 274 - {320, 251} - - - - _NS:418 - - YES - IBCocoaTouchFramework - YES - NO - 0 - YES - 44 - 22 - 22 + {320, 460} + + + _NS:196 + + 2 + MC4wNTQ5MDE5NjA3OCAwLjA4MjM1Mjk0MTE4IDAuMTI5NDExNzY0NwA - - - 292 - - YES - - - 292 - {{0, 1}, {320, 66}} - - - - - 1 - MSAwIDAuMDgyMzIwMjU5MDQgMC4xOAA - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - NSImage - stopcall-red.png - - - - - - - {{0, 393.5}, {320, 77}} - - - - _NS:196 - - IBCocoaTouchFramework + NO + IBCocoaTouchFramework + + + + 292 + {320, 66} + + + + 1 + MSAwIDAuMDgyMzIwMjU5MDQgMC4xOAA - - - 292 - - YES - - - 292 - {{80, 70}, {80, 66}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - NSImage - grouper.png - - - 2 - 17 - - - Helvetica-Bold - 17 - 16 - - - - - 292 - {{0, 4}, {107, 66}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - NSImage - mic_active.png - - - NSImage - micro_inverse.png - - - NSImage - micro.png - - - 2 - 2 - - - Helvetica-Bold - 18 - 16 - - - - - 292 - {{0, 70}, {80, 66}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - NSImage - ajouter.png - - - - - - - 292 - {{160, 70}, {80, 66}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - Transfer - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - - 2 - 15 - - - - - - 292 - {{240, 70}, {80, 66}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - 1 - MCAwIDAAA - - - NSImage - contact.png - - - - - - - -2147483356 - {{240, 70}, {80, 66}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - video - - - 3 - MC42NjY2NjY2NjY3AA - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - - NSImage - clavier-01-160px.png - - - - - - - -2147483356 - {{261.5, 84.5}, {37, 37}} - - - - _NS:1030 - NO - IBCocoaTouchFramework - NO - 0 - - - - 292 - {{107, 4}, {106, 66}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - NSImage - clavier.png - - - - - - - 292 - {{213, 4}, {107, 66}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - NSImage - HP_inverse.png - - - NSImage - HP.png - - - - - - - 292 - {{80, 70}, {80, 66}} - - - - - NO - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - - NSImage - pause_inactif.png - - - NSImage - pause.png - - - - - - {{0, 258.5}, {320, 135}} - - - - - NO - NO - IBCocoaTouchFramework + NO + NO + 0.0 + IBCocoaTouchFramework + 0 + 0 + Change camera + + 3 + MQA - - - -2147483356 - - YES - - - 292 - {{119, 251}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - close - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{119, 193}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{31, 19}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{119, 19}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 2 - - - - - - - - - 292 - {{207, 19}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 3 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{31, 77}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 4 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{119, 77}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 5 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{207, 77}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 6 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{31, 135}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 7 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{119, 135}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 8 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{207, 135}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 9 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{31, 193}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - * - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{207, 193}, {82, 52}} - - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - # - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - {{0, 71}, {320, 310}} - - - - - 3 - MC4yNAA - - NO - NO - IBCocoaTouchFramework + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + 3 + MC41AA + + + NSImage + clavier-01-106px.png + + + Helvetica-Bold + Helvetica + 2 + 15 + + + Helvetica-Bold + 15 + 16 - {{0, 20}, {320, 460}} - - - - - NO - IBCocoaTouchFramework - - - - 1 - 1 + + + 274 + {320, 251} + + + _NS:418 + + YES + IBCocoaTouchFramework + YES + NO + 0 + YES + 44 + 22 + 22 + + + + 292 + + YES + + + 292 + {{0, 1}, {320, 66}} + + + 1 + MSAwIDAuMDgyMzIwMjU5MDQgMC4xOAA + + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + NSImage + stopcall-red.png + + + + + + + {{0, 393.5}, {320, 77}} + + + _NS:196 + + IBCocoaTouchFramework + + + + 292 + + YES + + + 292 + {{80, 70}, {80, 66}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + NSImage + grouper.png + + + 2 + 17 + + + Helvetica-Bold + 17 + 16 + + + + + 292 + {{0, 4}, {107, 66}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + NSImage + mic_active.png + + + NSImage + micro_inverse.png + + + NSImage + micro.png + + + 2 + 2 + + + Helvetica-Bold + 18 + 16 + + + + + 292 + {{0, 70}, {80, 66}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + NSImage + ajouter.png + + + + + + + 292 + {{160, 70}, {80, 66}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + Transfer + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + + 2 + 15 + + + + + + 292 + {{240, 70}, {80, 66}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + 1 + MCAwIDAAA + + + NSImage + contact.png + + + + + + + -2147483356 + {{240, 70}, {80, 66}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + video + + + 3 + MC42NjY2NjY2NjY3AA + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + + NSImage + clavier-01-160px.png + + + + + + + -2147483356 + {{261.5, 84.5}, {37, 37}} + + + _NS:1030 + NO + IBCocoaTouchFramework + NO + 0 + + + + 292 + {{107, 4}, {106, 66}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + NSImage + clavier.png + + + + + + + 292 + {{213, 4}, {107, 66}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + NSImage + HP_inverse.png + + + NSImage + HP.png + + + + + + + 292 + {{80, 70}, {80, 66}} + + + + NO + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + + NSImage + pause_inactif.png + + + NSImage + pause.png + + + + + + {{0, 258.5}, {320, 135}} + + + + NO + NO + IBCocoaTouchFramework + + + + -2147483356 + + YES + + + 292 + {{119, 251}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + close + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{119, 193}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 0 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{31, 19}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{119, 19}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 2 + + + + + + + + + 292 + {{207, 19}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 3 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{31, 77}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 4 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{119, 77}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 5 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{207, 77}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 6 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{31, 135}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 7 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{119, 135}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 8 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{207, 135}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 9 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{31, 193}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + * + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{207, 193}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + # + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + {{0, 71}, {320, 310}} + + + + 3 + MC4yNAA + + NO + NO + IBCocoaTouchFramework + + {320, 460} + + + + NO IBCocoaTouchFramework - NO @@ -863,11 +817,11 @@ YES - videoCallQuality + videoCameraSwitch - + - 138 + 141 @@ -877,6 +831,14 @@ 130 + + + videoCallQuality + + + + 138 + videoView @@ -885,86 +847,6 @@ 133 - - - videoGroup - - - - 129 - - - - addVideo - - - - 125 - - - - mergeCalls - - - - 114 - - - - mute - - - - 80 - - - - addCall - - - - 112 - - - - contacts - - - - 84 - - - - dialer - - - - 49 - - - - speaker - - - - 82 - - - - pause - - - - 115 - - - - controlSubView - - - - 44 - callTableView @@ -975,91 +857,35 @@ - five + view - + - 69 + 23 - nine + videoGroup - + - 58 + 129 - seven + videoWaitingForFirstImage - + - 73 + 145 - six + star - + - 71 - - - - four - - - - 67 - - - - three - - - - 60 - - - - zero - - - - 55 - - - - two - - - - 59 - - - - close - - - - 51 - - - - hash - - - - 57 - - - - eight - - - - 75 + 56 @@ -1071,11 +897,91 @@ - star + eight - + - 56 + 75 + + + + hash + + + + 57 + + + + close + + + + 51 + + + + two + + + + 59 + + + + zero + + + + 55 + + + + three + + + + 60 + + + + four + + + + 67 + + + + six + + + + 71 + + + + seven + + + + 73 + + + + nine + + + + 58 + + + + five + + + + 69 @@ -1103,19 +1009,67 @@ - view + pause - + - 23 + 115 - videoCameraSwitch + speaker - + - 141 + 82 + + + + dialer + + + + 49 + + + + contacts + + + + 84 + + + + addCall + + + + 112 + + + + mute + + + + 80 + + + + mergeCalls + + + + 114 + + + + addVideo + + + + 125 @@ -1125,14 +1079,6 @@ 143 - - - videoWaitingForFirstImage - - - - 145 - transfer @@ -1141,6 +1087,14 @@ 150 + + + controlSubView + + + + 44 + doAction: @@ -1168,14 +1122,6 @@ 101 - - - dataSource - - - - 107 - delegate @@ -1184,6 +1130,14 @@ 108 + + + dataSource + + + + 107 + @@ -1207,42 +1161,49 @@ - - 2 - - - YES - - - - 9 YES - - - - - + + + + + - + + + + 140 + + + camswitch 126 YES - - - + + + video + + 106 + + + + + 144 + + + 137 @@ -1258,168 +1219,39 @@ 132 - - display - - - 26 - YES - - - - - - - - - - - - controls - - - 123 - - - video - - - 104 - - - merge - - - 16 - - - mute - - - 111 - - - addcall - - - 15 - - - contacts - - - 17 - - - dialer - - - 13 - - - speaker - - - 113 - - - pauseresume - - - 106 - - + + display 27 YES - - - - - - - - - - - - + + + + + + + + + + + + pad - 36 - + 31 + - 5 - - - 32 - - - 9 - - - 34 - - - 7 - - - 37 - - - 6 - - - 35 - - - 4 - - - 38 - - - 3 - - - 41 - - - 0 - - - 39 - - - 2 - - - 29 - - - close - - - 40 - - - hash - - - 33 - - - 8 + star 30 @@ -1428,10 +1260,70 @@ 1 - 31 - + 33 + - star + 8 + + + 40 + + + hash + + + 29 + + + close + + + 39 + + + 2 + + + 41 + + + 0 + + + 38 + + + 3 + + + 35 + + + 4 + + + 37 + + + 6 + + + 34 + + + 7 + + + 32 + + + 9 + + + 36 + + + 5 120 @@ -1450,10 +1342,71 @@ end - 140 - + 26 + + + YES + + + + + + + + + + + - camswitch + controls + + + 113 + + + pauseresume + + + 13 + + + speaker + + + 17 + + + dialer + + + 15 + + + contacts + + + 111 + + + addcall + + + 16 + + + mute + + + 104 + + + merge + + + 123 + + + video 142 @@ -1461,11 +1414,6 @@ video_update_indicator - - 144 - - - 147 @@ -1513,7 +1461,6 @@ 17.IBPluginDependency 18.CustomClassName 18.IBPluginDependency - 2.IBPluginDependency 26.IBPluginDependency 27.IBPluginDependency 29.IBPluginDependency @@ -1544,9 +1491,9 @@ 41.IBPluginDependency 9.IBPluginDependency - + YES - IncallViewController + InCallViewController com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1584,7 +1531,6 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton @@ -1625,559 +1571,19 @@ - 150 - - - - YES - - IncallViewController - UIViewController - - doAction: - id - - - doAction: - - doAction: - id - - - - YES - - YES - addCall - addVideo - callTableView - close - conferenceDetail - contacts - controlSubView - dialer - eight - endCtrl - five - four - hangUpView - hash - mergeCalls - mute - nine - one - padSubView - pause - seven - six - speaker - star - three - transfer - two - videoCallQuality - videoCameraSwitch - videoGroup - videoPreview - videoUpdateIndicator - videoView - videoViewController - videoWaitingForFirstImage - zero - - - YES - UIButton - UIToggleVideoButton - UITableView - UIButton - UIViewController - UIButton - UIView - UIButton - UIButton - UIButton - UIButton - UIButton - UIView - UIButton - UIButton - UIButton - UIButton - UIButton - UIView - UIButton - UIButton - UIButton - UIButton - UIButton - UIButton - UIButton - UIButton - UIImageView - UICamSwitch - UIView - UIView - UIActivityIndicatorView - UIView - VideoViewController - UIActivityIndicatorView - UIButton - - - - YES - - YES - addCall - addVideo - callTableView - close - conferenceDetail - contacts - controlSubView - dialer - eight - endCtrl - five - four - hangUpView - hash - mergeCalls - mute - nine - one - padSubView - pause - seven - six - speaker - star - three - transfer - two - videoCallQuality - videoCameraSwitch - videoGroup - videoPreview - videoUpdateIndicator - videoView - videoViewController - videoWaitingForFirstImage - zero - - - YES - - addCall - UIButton - - - addVideo - UIToggleVideoButton - - - callTableView - UITableView - - - close - UIButton - - - conferenceDetail - UIViewController - - - contacts - UIButton - - - controlSubView - UIView - - - dialer - UIButton - - - eight - UIButton - - - endCtrl - UIButton - - - five - UIButton - - - four - UIButton - - - hangUpView - UIView - - - hash - UIButton - - - mergeCalls - UIButton - - - mute - UIButton - - - nine - UIButton - - - one - UIButton - - - padSubView - UIView - - - pause - UIButton - - - seven - UIButton - - - six - UIButton - - - speaker - UIButton - - - star - UIButton - - - three - UIButton - - - transfer - UIButton - - - two - UIButton - - - videoCallQuality - UIImageView - - - videoCameraSwitch - UICamSwitch - - - videoGroup - UIView - - - videoPreview - UIView - - - videoUpdateIndicator - UIActivityIndicatorView - - - videoView - UIView - - - videoViewController - VideoViewController - - - videoWaitingForFirstImage - UIActivityIndicatorView - - - zero - UIButton - - - - - IBProjectSource - ./Classes/IncallViewController.h - - - - UICamSwitch - UIButton - - preview - UIView - - - preview - - preview - UIView - - - - IBProjectSource - ./Classes/UICamSwitch.h - - - - UIDigitButton - UIButton - - IBProjectSource - ./Classes/UIDigitButton.h - - - - UIHangUpButton - UIButton - - IBProjectSource - ./Classes/UIHangUpButton.h - - - - UIMuteButton - UIToggleButton - - IBProjectSource - ./Classes/UIMuteButton.h - - - - UISpeakerButton - UIToggleButton - - IBProjectSource - ./Classes/UISpeakerButton.h - - - - UIToggleButton - UIButton - - IBProjectSource - ./Classes/UIToggleButton.h - - - - UIToggleVideoButton - UIButton - - videoUpdateIndicator - UIActivityIndicatorView - - - videoUpdateIndicator - - videoUpdateIndicator - UIActivityIndicatorView - - - - IBProjectSource - ./Classes/UIToggleVideoButton.h - - - - VideoViewController - UIViewController - - YES - - YES - mCallQuality - mCallQualityLandLeft - mCallQualityLandRight - mCamSwitch - mCamSwitchLandLeft - mCamSwitchLandRight - mDisplay - mDisplayLandLeft - mDisplayLandRight - mHangUp - mHangUpLandLeft - mHangUpLandRight - mLandscapeLeft - mLandscapeRight - mMute - mMuteLandLeft - mMuteLandRight - mPortrait - mPreview - mPreviewLandLeft - mPreviewLandRight - - - YES - UIImageView - UIImageView - UIImageView - UICamSwitch - UICamSwitch - UICamSwitch - UIView - UIView - UIView - UIHangUpButton - UIHangUpButton - UIHangUpButton - UIView - UIView - UIMuteButton - UIMuteButton - UIMuteButton - UIView - UIView - UIView - UIView - - - - YES - - YES - mCallQuality - mCallQualityLandLeft - mCallQualityLandRight - mCamSwitch - mCamSwitchLandLeft - mCamSwitchLandRight - mDisplay - mDisplayLandLeft - mDisplayLandRight - mHangUp - mHangUpLandLeft - mHangUpLandRight - mLandscapeLeft - mLandscapeRight - mMute - mMuteLandLeft - mMuteLandRight - mPortrait - mPreview - mPreviewLandLeft - mPreviewLandRight - - - YES - - mCallQuality - UIImageView - - - mCallQualityLandLeft - UIImageView - - - mCallQualityLandRight - UIImageView - - - mCamSwitch - UICamSwitch - - - mCamSwitchLandLeft - UICamSwitch - - - mCamSwitchLandRight - UICamSwitch - - - mDisplay - UIView - - - mDisplayLandLeft - UIView - - - mDisplayLandRight - UIView - - - mHangUp - UIHangUpButton - - - mHangUpLandLeft - UIHangUpButton - - - mHangUpLandRight - UIHangUpButton - - - mLandscapeLeft - UIView - - - mLandscapeRight - UIView - - - mMute - UIMuteButton - - - mMuteLandLeft - UIMuteButton - - - mMuteLandRight - UIMuteButton - - - mPortrait - UIView - - - mPreview - UIView - - - mPreviewLandLeft - UIView - - - mPreviewLandRight - UIView - - - - - IBProjectSource - ./Classes/VideoViewController.h - - - + 159 + 0 IBCocoaTouchFramework com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 @@ -2203,7 +1609,7 @@ pause_inactif.png stopcall-red.png - + YES {107, 67} {107, 67} @@ -2221,6 +1627,6 @@ {62, 54} - 933 + 1181 diff --git a/Classes/LinphoneApp.xib b/Classes/LinphoneApp.xib index 745729525..2399bfd76 100644 --- a/Classes/LinphoneApp.xib +++ b/Classes/LinphoneApp.xib @@ -42,7 +42,6 @@ {320, 480} - 1 MSAxIDEAA @@ -81,6 +80,14 @@ 10 + + + window + + + + 12 + @@ -110,7 +117,7 @@ 4 - linphoneAppDelegate + LinphoneAppDelegate 9 @@ -127,7 +134,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - linphoneAppDelegate + LinphoneAppDelegate com.apple.InterfaceBuilder.IBCocoaTouchPlugin PhoneMainView com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -136,38 +143,27 @@ - 11 + 12 - ABPeoplePickerNavigationController - UINavigationController - - IBProjectSource - ./Classes/ABPeoplePickerNavigationController.h + LinphoneAppDelegate + NSObject + + window + UIWindow - - - MainScreenWithVideoPreview - UIViewController - - PhoneViewController - UIWindow - - - - phoneMainView - PhoneViewController - - + + window + window UIWindow - + IBProjectSource - ./Classes/MainScreenWithVideoPreview.h + ./Classes/LinphoneAppDelegate.h @@ -175,10 +171,10 @@ UIViewController UIView - UIView + UIViewController UIView - UIView - UIView + UIViewController + UIViewController UIView UIView @@ -187,21 +183,21 @@ addCallTabBar UIView - - callTabBar - UIView + + callTabBarController + UIViewController contentView UIView - - incomingTabBar - UIView + + mainTabBarController + UIViewController - - mainTabBar - UIView + + statusBarController + UIViewController statusBarView @@ -217,178 +213,6 @@ ./Classes/PhoneMainView.h - - PhoneViewController - UIViewController - - UITextField - UIButton - UIButton - UIButton - UIView - UIButton - UIEraseButton - UIButton - UIButton - UIButton - MainScreenWithVideoPreview - UITabBarController - UIButton - UIButton - UIButton - UIButton - UIButton - UILabel - UIView - UIButton - UIButton - UIButton - UIButton - - - - address - UITextField - - - backToCallView - UIButton - - - callLarge - UIButton - - - callShort - UIButton - - - dialerView - UIView - - - eight - UIButton - - - erase - UIEraseButton - - - five - UIButton - - - four - UIButton - - - hash - UIButton - - - mMainScreenWithVideoPreview - MainScreenWithVideoPreview - - - myTabBarController - UITabBarController - - - nine - UIButton - - - one - UIButton - - - seven - UIButton - - - six - UIButton - - - star - UIButton - - - status - UILabel - - - statusViewHolder - UIView - - - switchCamera - UIButton - - - three - UIButton - - - two - UIButton - - - zero - UIButton - - - - IBProjectSource - ./Classes/PhoneViewController.h - - - - UIEraseButton - UIButton - - IBProjectSource - ./Classes/UIEraseButton.h - - - - linphoneAppDelegate - NSObject - - UIView - ABPeoplePickerNavigationController - PhoneViewController - UITabBarController - UIWindow - - - - myContentView - UIView - - - myPeoplePickerController - ABPeoplePickerNavigationController - - - myPhoneViewController - PhoneViewController - - - myTabBarController - UITabBarController - - - window - UIWindow - - - - IBProjectSource - ./Classes/linphoneAppDelegate.h - - 0 diff --git a/Classes/LinphoneAppDelegate.h b/Classes/LinphoneAppDelegate.h index 1b812547e..daf864383 100644 --- a/Classes/LinphoneAppDelegate.h +++ b/Classes/LinphoneAppDelegate.h @@ -1,4 +1,4 @@ -/* linphoneAppDelegate.h +/* LinphoneAppDelegate.h * * Copyright (C) 2009 Belledonne Comunications, Grenoble, France * @@ -17,44 +17,22 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #import #import #import "CoreTelephony/CTCallCenter.h" -#define DIALER_TAB_INDEX 1 -#define CONTACTS_TAB_INDEX 2 -#define HISTORY_TAB_INDEX 0 -#define MORE_TAB_INDEX 3 - -@class ContactPickerDelegate; -@class IncallViewController; -@class PhoneViewController; -@class CallHistoryTableViewController; - - -@interface linphoneAppDelegate : NSObject { +@interface LinphoneAppDelegate : NSObject { UIWindow *window; - IBOutlet UITabBarController* myTabBarController; - IBOutlet ABPeoplePickerNavigationController* myPeoplePickerController; - IBOutlet PhoneViewController* myPhoneViewController; - CallHistoryTableViewController* myCallHistoryTableViewController; - ContactPickerDelegate* myContactPickerDelegate; - UIView *myContentView; CTCallCenter* callCenter; } -- (void) loadDefaultSettings:(NSDictionary *) appDefaults; --(void) setupUI; --(void) setupGSMInteraction; +- (void)loadDefaultSettings:(NSDictionary *) appDefaults; +- (void)setupUI; +- (void)setupGSMInteraction; --(void) startApplication; +- (void)startApplication; @property (nonatomic, retain) IBOutlet UIWindow *window; -@property (nonatomic, retain) IBOutlet UITabBarController* myTabBarController; -@property (nonatomic, retain) ABPeoplePickerNavigationController* myPeoplePickerController; -@property (nonatomic, retain) IBOutlet PhoneViewController* myPhoneViewController; -@property (nonatomic, retain) IBOutlet UIView* myContentView; @end diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 468a68302..4d4a92006 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -1,4 +1,4 @@ -/* linphoneAppDelegate.m +/* LinphoneAppDelegate.m * * Copyright (C) 2009 Belledonne Comunications, Grenoble, France * @@ -39,15 +39,11 @@ int __aeabi_idiv(int a, int b) { } #endif -@implementation linphoneAppDelegate +@implementation LinphoneAppDelegate @synthesize window; -@synthesize myTabBarController; -@synthesize myPeoplePickerController; -@synthesize myPhoneViewController; -@synthesize myContentView; --(void) handleGSMCallInteration: (id) cCenter { +- (void)handleGSMCallInteration: (id) cCenter { CTCallCenter* ct = (CTCallCenter*) cCenter; int callCount = [ct.currentCalls count]; @@ -66,7 +62,7 @@ int __aeabi_idiv(int a, int b) { } } --(void)applicationWillResignActive:(UIApplication *)application { +- (void)applicationWillResignActive:(UIApplication *)application { LinphoneCore* lc = [LinphoneManager getLc]; LinphoneCall* call = linphone_core_get_current_call(lc); if (call == NULL) @@ -135,7 +131,7 @@ int __aeabi_idiv(int a, int b) { } } -- (void) loadDefaultSettings:(NSDictionary *) appDefaults { +- (void)loadDefaultSettings:(NSDictionary *) appDefaults { NSString *settingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"]; if(!settingsBundle) { @@ -167,62 +163,13 @@ int __aeabi_idiv(int a, int b) { [[NSUserDefaults standardUserDefaults] synchronize]; } --(void) setupUI { +- (void)setupUI { - /*//as defined in PhoneMainView.xib - //dialer - myPhoneViewController = (PhoneViewController*) [myTabBarController.viewControllers objectAtIndex: DIALER_TAB_INDEX]; - myPhoneViewController.myTabBarController = myTabBarController; - //Call history - myCallHistoryTableViewController = [[CallHistoryTableViewController alloc] initWithNibName:@"CallHistoryTableViewController" - bundle:[NSBundle mainBundle]]; - UINavigationController *aCallHistNavigationController = [[UINavigationController alloc] initWithRootViewController:myCallHistoryTableViewController]; - aCallHistNavigationController.tabBarItem = [(UIViewController*)[myTabBarController.viewControllers objectAtIndex:HISTORY_TAB_INDEX] tabBarItem]; - - //people picker delegates - myContactPickerDelegate = [[ContactPickerDelegate alloc] init]; - //people picker - myPeoplePickerController = [[[ABPeoplePickerNavigationController alloc] init] autorelease]; - [myPeoplePickerController setDisplayedProperties:[NSArray arrayWithObject:[NSNumber numberWithInt:kABPersonPhoneProperty]]]; - [myPeoplePickerController setPeoplePickerDelegate:myContactPickerDelegate]; - //copy tab bar item - myPeoplePickerController.tabBarItem = [(UIViewController*)[myTabBarController.viewControllers objectAtIndex:CONTACTS_TAB_INDEX] tabBarItem]; - - //more tab - MoreViewController *moreViewController = [[MoreViewController alloc] initWithNibName:@"MoreViewController" bundle:[NSBundle mainBundle]]; - UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:moreViewController]; - [moreViewController release]; - //copy tab bar item - aNavigationController.tabBarItem = [(UIViewController*)[myTabBarController.viewControllers objectAtIndex:MORE_TAB_INDEX] tabBarItem]; - - //insert contact controller - NSMutableArray* newArray = [NSMutableArray arrayWithArray:self.myTabBarController.viewControllers]; - [newArray replaceObjectAtIndex:CONTACTS_TAB_INDEX withObject:myPeoplePickerController]; - [newArray replaceObjectAtIndex:MORE_TAB_INDEX withObject:aNavigationController]; - [aNavigationController release]; - [newArray replaceObjectAtIndex:HISTORY_TAB_INDEX withObject:aCallHistNavigationController]; - [aCallHistNavigationController release]; - - [myTabBarController setSelectedIndex:DIALER_TAB_INDEX]; - [myTabBarController setViewControllers:newArray animated:NO]; - //[window addSubview: myTabBarController.view]; - [myCallHistoryTableViewController loadView]; - // [myContentView addSubview:myCallHistoryTableViewController.view]; - //[window addSubview: myContentView]; - // [myContentViewController addChildViewController:myCallHistoryTableViewController]; - - [window makeKeyAndVisible]; - - [[LinphoneManager instance] setCallDelegate:myPhoneViewController]; - - [UIDevice currentDevice].batteryMonitoringEnabled = YES;*/ -/* - PhoneMainView *mainView = [[PhoneMainView alloc] initWithNibName:@"PhoneMainView" bundle:[NSBundle mainBundle]]; - [self.window addSubview:mainView.view]; - [self.window makeKeyAndVisible];*/ + // Change to default view + [[LinphoneManager instance] changeView: PhoneView_Dialer]; } --(void) setupGSMInteraction { +- (void)setupGSMInteraction { callCenter = [[CTCallCenter alloc] init]; callCenter.callEventHandler = ^(CTCall* call) { // post on main thread @@ -257,7 +204,7 @@ int __aeabi_idiv(int a, int b) { return YES; } --(void) startApplication { +- (void)startApplication { /* explicitely instanciate LinphoneManager */ LinphoneManager* lm = [[LinphoneManager alloc] init]; assert(lm == [LinphoneManager instance]); @@ -276,8 +223,7 @@ int __aeabi_idiv(int a, int b) { } - (void)dealloc { - //[window release]; - [myPeoplePickerController release]; + [window release]; [super dealloc]; } @@ -291,6 +237,4 @@ int __aeabi_idiv(int a, int b) { linphone_core_accept_call([LinphoneManager getLc], call); } - - @end diff --git a/Classes/LinphoneUI/LinphoneCallBar.h b/Classes/LinphoneUI/LinphoneCallBar.h new file mode 100644 index 000000000..d216a60bc --- /dev/null +++ b/Classes/LinphoneUI/LinphoneCallBar.h @@ -0,0 +1,26 @@ +/* LinphoneCallBar.h + * + * Copyright (C) 2012 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 + +@interface LinphoneCallBar : UIViewController { + +} + +@end diff --git a/Classes/LinphoneUI/LinphoneCallBar.m b/Classes/LinphoneUI/LinphoneCallBar.m new file mode 100644 index 000000000..b0868360e --- /dev/null +++ b/Classes/LinphoneUI/LinphoneCallBar.m @@ -0,0 +1,24 @@ +/* LinphoneCallBar.m + * + * Copyright (C) 2012 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 "LinphoneCallBar.h" + +@implementation LinphoneCallBar + +@end diff --git a/Classes/LinphoneUI/LinphoneCallBar.xib b/Classes/LinphoneUI/LinphoneCallBar.xib new file mode 100644 index 000000000..cf9e4e53b --- /dev/null +++ b/Classes/LinphoneUI/LinphoneCallBar.xib @@ -0,0 +1,484 @@ + + + + 1296 + 11E53 + 2182 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1181 + + + IBProxyObject + IBUIView + IBUIButton + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 292 + + + + -2147483356 + {320, 135} + + + + _NS:9 + + 3 + MQA + + 2 + + + -1 + NO + IBCocoaTouchFramework + + + + 292 + {80, 67} + + + + _NS:9 + NO + + Video + + IBCocoaTouchFramework + 0 + 0 + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + NSImage + video-ON-over.png + + + NSImage + video-ON-actif.png + + + NSImage + video-OFF-actif.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + + 292 + {{80, 0}, {80, 67}} + + + + _NS:9 + NO + + Micro + + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + NSImage + micro-ON-over.png + + + NSImage + micro-ON-actif.png + + + NSImage + micro-OFF-actif.png + + + + + + + 292 + {{160, 0}, {80, 67}} + + + + _NS:9 + NO + + Speaker + + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + NSImage + speacker-ON-over.png + + + NSImage + speacker-OFF-actif.png + + + + + + + + 292 + {{240, 0}, {80, 67}} + + + + _NS:9 + NO + + Add call + + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + NSImage + add-call-over.png + + + + NSImage + add-call-actif.png + + + + + + + 264 + {{0, 67}, {105, 68}} + + + + _NS:9 + NO + + Pause + + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + NSImage + pause-over.png + + + NSImage + pause-actif.png + + + + + + + + 264 + {{105, 67}, {111, 68}} + + + + _NS:9 + NO + + Hangup + + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + NSImage + raccrocher-over.png + + + NSImage + raccrocher-actif.png + + + + + + + + 264 + {{215, 67}, {105, 68}} + + + _NS:9 + NO + + Back + + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + NSImage + dialer-meteo-sortir-over.png + + + NSImage + dialer-meteo-sortir-actif.png + + + + + + + {320, 135} + + + + _NS:9 + + 1 + MCAxIDAuMTkxOTQ1NDc1NSAwAA + + NO + IBCocoaTouchFramework + + + + + + + view + + + + 13 + + + + + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + + + + + + + + + + + callTabBar + + + 5 + + + mask + + + 6 + + + back + + + 7 + + + hangup + + + 8 + + + pause + + + 9 + + + speaker + + + 10 + + + addCall + + + 11 + + + micro + + + 12 + + + video + + + + + LinphoneCallBar + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + + 13 + + + + + LinphoneCallBar + UIViewController + + IBProjectSource + ./Classes/LinphoneCallBar.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + + {160, 134} + {160, 134} + {209, 136} + {209, 136} + {160, 134} + {160, 134} + {160, 134} + {209, 136} + {209, 136} + {222, 136} + {222, 136} + {160, 134} + {160, 134} + {160, 134} + {160, 134} + {160, 134} + + 1181 + + diff --git a/Classes/LinphoneUI/LinphoneMainBar.m b/Classes/LinphoneUI/LinphoneMainBar.m index 3ff7e3060..a2d042cae 100644 --- a/Classes/LinphoneUI/LinphoneMainBar.m +++ b/Classes/LinphoneUI/LinphoneMainBar.m @@ -33,7 +33,7 @@ } - (void) receiveLinphoneMainViewChangeEvent: (NSNotification*) notif { - PhoneView view = [[notif.userInfo objectForKey: @"PhoneView"] intValue]; + PhoneView view = [[notif.userInfo objectForKey: @"view"] intValue]; if(view == PhoneView_History) { historyButton.selected = TRUE; } else { @@ -71,28 +71,23 @@ } - (IBAction) onHistoryClick: (id) sender { - NSDictionary* dict = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt:PhoneView_History] forKey:@"PhoneView"]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:dict]; + [[LinphoneManager instance] changeView:PhoneView_History]; } -(IBAction) onContactsClick: (id) event { - NSDictionary* dict = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt:PhoneView_Contacts] forKey:@"PhoneView"]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:dict]; + [[LinphoneManager instance] changeView:PhoneView_Contacts]; } -(IBAction) onDialerClick: (id) event { - NSDictionary* dict = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt:PhoneView_Dialer] forKey:@"PhoneView"]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:dict]; + [[LinphoneManager instance] changeView:PhoneView_Dialer]; } -(IBAction) onSettingsClick: (id) event { - NSDictionary* dict = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt:PhoneView_Settings] forKey:@"PhoneView"]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:dict]; + [[LinphoneManager instance] changeView:PhoneView_Settings]; } -(IBAction) onChatClick: (id) event { - NSDictionary* dict = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt:PhoneView_Chat] forKey:@"PhoneView"]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:dict]; + [[LinphoneManager instance] changeView:PhoneView_Chat]; } diff --git a/Classes/LinphoneUI/LinphoneManager.h b/Classes/LinphoneUI/LinphoneManager.h index 691ebd14f..fe3d26bf0 100644 --- a/Classes/LinphoneUI/LinphoneManager.h +++ b/Classes/LinphoneUI/LinphoneManager.h @@ -24,6 +24,16 @@ #import "LogView.h" #import "LinphoneUIDelegates.h" +typedef enum _PhoneView { + PhoneView_Dialer, + PhoneView_History, + PhoneView_Settings, + PhoneView_Chat, + PhoneView_Contacts, + PhoneView_InCall, + PhoneView_END +} PhoneView; + typedef enum _Connectivity { wifi, wwan @@ -57,7 +67,6 @@ typedef struct _LinphoneCallAppData { id mLogView; bool isbackgroundModeEnabled; id callDelegate; - id registrationDelegate; UIViewController* mCurrentViewController; Connectivity connectivity; @@ -65,6 +74,8 @@ typedef struct _LinphoneCallAppData { const char* frontCamId; const char* backCamId; + PhoneView currentView; + NSDictionary* currentSettings; @public @@ -94,8 +105,10 @@ typedef struct _LinphoneCallAppData { -(void) setupNetworkReachabilityCallback; -(void) refreshRegisters; +-(void) changeView:(PhoneView) view; +-(PhoneView) currentView; + @property (nonatomic, retain) id callDelegate; -@property (nonatomic, retain) id registrationDelegate; @property Connectivity connectivity; @property (readonly) const char* frontCamId; @property (readonly) const char* backCamId; diff --git a/Classes/LinphoneUI/LinphoneManager.m b/Classes/LinphoneUI/LinphoneManager.m index 1f2b3dded..9a88cbe3f 100644 --- a/Classes/LinphoneUI/LinphoneManager.m +++ b/Classes/LinphoneUI/LinphoneManager.m @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #import "LinphoneManager.h" #include "linphonecore_utils.h" #include @@ -52,7 +51,6 @@ extern void libmsbcg729_init(); #endif @implementation LinphoneManager @synthesize callDelegate; -@synthesize registrationDelegate; @synthesize connectivity; @synthesize frontCamId; @synthesize backCamId; @@ -65,10 +63,22 @@ extern void libmsbcg729_init(); } return self; } + +(LinphoneManager*) instance { return theLinphoneManager; } +-(void) changeView:(PhoneView) view { + currentView = view; + NSDictionary* dict = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt:currentView] forKey:@"view"]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:dict]; +} + +-(PhoneView) currentView { + return currentView; +} + + -(NSString*) getDisplayNameFromAddressBook:(NSString*) number andUpdateCallLog:(LinphoneCallLog*)log { //1 normalize NSString* lNormalizedNumber = [FastAddressBook normalizePhoneNumber:number]; @@ -356,37 +366,21 @@ static void linphone_iphone_transfer_state_changed(LinphoneCore* lc, LinphoneCal -(void) onRegister:(LinphoneCore *)lc cfg:(LinphoneProxyConfig*) cfg state:(LinphoneRegistrationState) state message:(const char*) message { ms_warning("NEW REGISTRATION STATE: '%s' (message: '%s')", linphone_registration_state_to_string(state), message); - LinphoneAddress* lAddress = linphone_address_new(linphone_proxy_config_get_identity(cfg)); - NSString* lUserName = linphone_address_get_username(lAddress)? [[NSString alloc] initWithUTF8String:linphone_address_get_username(lAddress) ]:@""; - NSString* lDisplayName = linphone_address_get_display_name(lAddress)? [[NSString alloc] initWithUTF8String:linphone_address_get_display_name(lAddress) ]:@""; - NSString* lDomain = [[NSString alloc] initWithUTF8String:linphone_address_get_domain(lAddress)]; - linphone_address_destroy(lAddress); - - if (state == LinphoneRegistrationOk) { - [[(LinphoneManager*)linphone_core_get_user_data(lc) registrationDelegate] displayRegisteredFromUI:nil - forUser:lUserName - withDisplayName:lDisplayName - onDomain:lDomain ]; - } else if (state == LinphoneRegistrationProgress) { - [registrationDelegate displayRegisteringFromUI:mCurrentViewController - forUser:lUserName - withDisplayName:lDisplayName - onDomain:lDomain ]; - - } else if (state == LinphoneRegistrationCleared || state == LinphoneRegistrationNone) { - [registrationDelegate displayNotRegisteredFromUI:mCurrentViewController]; - } else if (state == LinphoneRegistrationFailed ) { + // Post event + NSDictionary* dict = [[NSDictionary alloc] initWithObjectsAndKeys: + [NSNumber numberWithInt:state], @"state", + [[NSString stringWithFormat:@"%c", message] autorelease], @"message", + nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneRegistrationUpdate" object:self userInfo:dict]; + + // Show error + if (state == LinphoneRegistrationFailed) { NSString* lErrorMessage=nil; if (linphone_proxy_config_get_error(cfg) == LinphoneReasonBadCredentials) { lErrorMessage = NSLocalizedString(@"Bad credentials, check your account settings",nil); } else if (linphone_proxy_config_get_error(cfg) == LinphoneReasonNoResponse) { lErrorMessage = NSLocalizedString(@"SIP server unreachable",nil); } - [registrationDelegate displayRegistrationFailedFromUI:mCurrentViewController - forUser:lUserName - withDisplayName:lDisplayName - onDomain:lDomain - forReason:lErrorMessage]; if (lErrorMessage != nil && linphone_proxy_config_get_error(cfg) != LinphoneReasonNoResponse) { //do not report network connection issue on registration @@ -406,11 +400,6 @@ static void linphone_iphone_transfer_state_changed(LinphoneCore* lc, LinphoneCal } } - - [lUserName release]; - [lDisplayName release]; - [lDomain release]; - } static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyConfig* cfg, LinphoneRegistrationState state,const char* message) { [(LinphoneManager*)linphone_core_get_user_data(lc) onRegister:lc cfg:cfg state:state message:message]; diff --git a/Classes/LinphoneUI/LinphoneStatusBar.m b/Classes/LinphoneUI/LinphoneStatusBar.m index f721064a5..472202c9f 100644 --- a/Classes/LinphoneUI/LinphoneStatusBar.m +++ b/Classes/LinphoneUI/LinphoneStatusBar.m @@ -18,6 +18,7 @@ */ #import "LinphoneStatusBar.h" +#import "LinphoneManager.h" @implementation LinphoneStatusBar @@ -30,7 +31,7 @@ [super viewDidLoad]; // Set observer - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationStateChange:) name:@"LinphoneRegistrationStateChange" object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationUpdate:) name:@"LinphoneRegistrationUpdate" object:nil]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation @@ -38,9 +39,34 @@ return (interfaceOrientation == UIInterfaceOrientationPortrait); } -- (void) registrationStateChange: (NSNotification*) notif { - LinphoneRegistrationState state = [[notif.userInfo objectForKey: @"state"] intValue]; - NSString* message = [notif.userInfo objectForKey: @"message"]; +- (void)registrationUpdate: (NSNotification*) notif { + LinphoneProxyConfig* config; + linphone_core_get_default_proxy([LinphoneManager getLc], &config); + + LinphoneRegistrationState state; + NSString* message = nil; + + if (config == NULL) { + state = LinphoneRegistrationNone; + message = linphone_core_is_network_reachabled([LinphoneManager getLc]) ? NSLocalizedString(@"No SIP account configured", nil) : NSLocalizedString(@"Network down", nil); + } else { + state = linphone_proxy_config_get_state(config); + + switch (state) { + case LinphoneRegistrationOk: + message = @"Registered"; break; + case LinphoneRegistrationNone: + case LinphoneRegistrationCleared: + message = @"Not registered"; break; + case LinphoneRegistrationFailed: + message = @"Registration failed"; break; + case LinphoneRegistrationProgress: + message = @"Registration in progress"; break; + //case LinphoneRegistrationCleared: m= @"No SIP account"; break; + default: break; + } + } + label.hidden = NO; switch(state) { case LinphoneRegistrationCleared: diff --git a/Classes/LinphoneUI/LinphoneUIDelegates.h b/Classes/LinphoneUI/LinphoneUIDelegates.h index 4d6b0477d..4abdf0027 100644 --- a/Classes/LinphoneUI/LinphoneUIDelegates.h +++ b/Classes/LinphoneUI/LinphoneUIDelegates.h @@ -32,12 +32,3 @@ -(void) firstVideoFrameDecoded:(LinphoneCall*) call; @end - -@protocol LinphoneUIRegistrationDelegate -// UI changes for registration --(void) displayRegisteredFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain ; --(void) displayRegisteringFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain ; --(void) displayRegistrationFailedFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain forReason:(NSString*) reason; --(void) displayNotRegisteredFromUI:(UIViewController*) viewCtrl; -@end - diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index 82531de79..f9708a822 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -18,15 +18,7 @@ */ #import - -typedef enum _PhoneView { - PhoneView_Dialer, - PhoneView_History, - PhoneView_Settings, - PhoneView_Chat, - PhoneView_Contacts, - PhoneView_END -} PhoneView; +#import "LinphoneManager.h" @interface PhoneMainView : UIViewController { UIView *statusBarView; @@ -37,10 +29,9 @@ typedef enum _PhoneView { @private NSMutableDictionary *viewDescriptions; NSArray *views; - UIView *callTabBar; + UIViewController *callTabBarController; UIViewController *statusBarController; UIViewController *mainTabBarController; - UIView *incomingTabBar; UIView *addCallTabBar; } @@ -48,10 +39,9 @@ typedef enum _PhoneView { @property (nonatomic, retain) IBOutlet UIView* contentView; @property (nonatomic, retain) IBOutlet UIView* tabBarView; -@property (nonatomic, retain) IBOutlet UIView* callTabBar; +@property (nonatomic, retain) IBOutlet UIViewController* callTabBarController; @property (nonatomic, retain) IBOutlet UIViewController* statusBarController; @property (nonatomic, retain) IBOutlet UIViewController* mainTabBarController; -@property (nonatomic, retain) IBOutlet UIView* incomingTabBar; @property (nonatomic, retain) IBOutlet UIView* addCallTabBar; -(void) changeView: (NSNotification*) notif; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 555802c57..ba851eb9b 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -21,6 +21,7 @@ #import "PhoneViewController.h" #import "HistoryController.h" #import "ContactsController.h" +#import "InCallViewController.h" typedef enum _TabBar { TabBar_Main, @@ -44,10 +45,9 @@ typedef enum _TabBar { @synthesize contentView; @synthesize tabBarView; -@synthesize callTabBar; +@synthesize callTabBarController; @synthesize statusBarController; @synthesize mainTabBarController; -@synthesize incomingTabBar; @synthesize addCallTabBar; - (void) changeView: (NSNotification*) notif { @@ -74,25 +74,31 @@ typedef enum _TabBar { contentFrame.origin.y = 0; } - // Resize tabbar CGRect tabFrame = tabBarView.frame; - tabFrame.origin.y += tabFrame.size.height; - tabFrame.origin.x += tabFrame.size.width; - tabFrame.size.height = description->tabBar.view.frame.size.height; - tabFrame.size.width = description->tabBar.view.frame.size.width; - tabFrame.origin.y -= tabFrame.size.height; - tabFrame.origin.x -= tabFrame.size.width; - tabBarView.frame = tabFrame; - for (UIView *view in description->tabBar.view.subviews) { - if(view.tag == -1) { - contentFrame.size.height = tabFrame.origin.y - contentFrame.origin.y + view.frame.origin.y; - break; + if(description->tabBar != nil) { + tabBarView.hidden = false; + tabFrame.origin.y += tabFrame.size.height; + tabFrame.origin.x += tabFrame.size.width; + tabFrame.size.height = description->tabBar.view.frame.size.height; + tabFrame.size.width = description->tabBar.view.frame.size.width; + tabFrame.origin.y -= tabFrame.size.height; + tabFrame.origin.x -= tabFrame.size.width; + tabBarView.frame = tabFrame; + contentFrame.size.height = tabFrame.origin.y - contentFrame.origin.y; + for (UIView *view in description->tabBar.view.subviews) { + if(view.tag == -1) { + contentFrame.size.height += view.frame.origin.y; + break; + } } + [tabBarView addSubview: description->tabBar.view]; + } else { + tabBarView.hidden = true; + contentFrame.size.height = tabFrame.origin.y - tabFrame.size.height; } contentView.frame = contentFrame; - [tabBarView addSubview: description->tabBar.view]; } -(void)viewDidLoad { @@ -108,7 +114,9 @@ typedef enum _TabBar { // Status Bar [statusBarView addSubview: statusBarController.view]; + // // Main View + // PhoneViewController* myPhoneViewController = [[PhoneViewController alloc] initWithNibName:@"PhoneViewController" bundle:[NSBundle mainBundle]]; @@ -119,7 +127,10 @@ typedef enum _TabBar { mainViewDescription->statusEnabled = true; [viewDescriptions setObject:mainViewDescription forKey:[NSNumber numberWithInt: PhoneView_Dialer]]; + + // // Contacts View + // ContactsController* myContactsController = [[ContactsController alloc] initWithNibName:@"ContactsController" bundle:[NSBundle mainBundle]]; @@ -130,7 +141,10 @@ typedef enum _TabBar { contactsDescription->statusEnabled = false; [viewDescriptions setObject:contactsDescription forKey:[NSNumber numberWithInt: PhoneView_Contacts]]; + + // // Call History View + // HistoryController* myHistoryController = [[HistoryController alloc] initWithNibName:@"HistoryController" bundle:[NSBundle mainBundle]]; @@ -141,12 +155,23 @@ typedef enum _TabBar { historyDescription->statusEnabled = false; [viewDescriptions setObject:historyDescription forKey:[NSNumber numberWithInt: PhoneView_History]]; + + // + // InCall View + // + InCallViewController* myInCallController = [[InCallViewController alloc] + initWithNibName:@"InCallViewController" + bundle:[NSBundle mainBundle]]; + //[myHistoryController loadView]; + ViewsDescription *inCallDescription = [ViewsDescription alloc]; + inCallDescription->content = myInCallController; + inCallDescription->tabBar = callTabBarController; + inCallDescription->statusEnabled = false; + [viewDescriptions setObject:inCallDescription forKey:[NSNumber numberWithInt: PhoneView_InCall]]; + + // Set observer [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeView:) name:@"LinphoneMainViewChange" object:nil]; - - // Change to default view - NSDictionary* dict = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt:PhoneView_Dialer] forKey:@"PhoneView"]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:dict]; } - (void) viewDidUnload { diff --git a/Classes/PhoneMainView.xib b/Classes/PhoneMainView.xib index 378c59c86..2b2629153 100644 --- a/Classes/PhoneMainView.xib +++ b/Classes/PhoneMainView.xib @@ -100,290 +100,6 @@ IBCocoaTouchFramework - - - 292 - - YES - - - -2147483356 - {320, 135} - - - - _NS:9 - - 3 - MQA - - - -1 - NO - IBCocoaTouchFramework - - - - 292 - {80, 67} - - - - _NS:9 - NO - - Video - - IBCocoaTouchFramework - 0 - 0 - - 3 - MQA - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - NSImage - video-ON-over.png - - - NSImage - video-ON-actif.png - - - NSImage - video-OFF-actif.png - - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - - - - 292 - {{80, 0}, {80, 67}} - - - - _NS:9 - NO - - Micro - - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - micro-ON-over.png - - - NSImage - micro-ON-actif.png - - - NSImage - micro-OFF-actif.png - - - - - - - 292 - {{160, 0}, {80, 67}} - - - - _NS:9 - NO - - Speaker - - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - speacker-ON-over.png - - - NSImage - speacker-OFF-actif.png - - - - - - - - 292 - {{240, 0}, {80, 67}} - - - - _NS:9 - NO - - Add call - - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - add-call-over.png - - - - NSImage - add-call-actif.png - - - - - - - 264 - {{0, 67}, {105, 68}} - - - - _NS:9 - NO - - Pause - - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - pause-over.png - - - NSImage - pause-actif.png - - - - - - - - 264 - {{105, 67}, {111, 68}} - - - - _NS:9 - NO - - Hangup - - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - raccrocher-over.png - - - NSImage - raccrocher-actif.png - - - - - - - - 264 - {{215, 67}, {105, 68}} - - - _NS:9 - NO - - Back - - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - dialer-meteo-sortir-over.png - - - NSImage - dialer-meteo-sortir-actif.png - - - - - - - {320, 135} - - - - _NS:9 - - 1 - MCAxIDAuMTkxOTQ1NDc1NSAwAA - - NO - IBCocoaTouchFramework - 292 @@ -421,12 +137,18 @@ IBCocoaTouchFramework 0 0 - + + 3 + MQA + 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - + + 3 + MC41AA + NSImage decrocher-over.png @@ -435,8 +157,15 @@ NSImage decrocher-actif.png - - + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + @@ -467,7 +196,7 @@ refuser-actif.png - + {320, 77} @@ -534,7 +263,7 @@ contact-actif-add-call.png - + @@ -565,7 +294,7 @@ cancel-actif.png - + @@ -598,7 +327,7 @@ - + {320, 72} @@ -623,6 +352,16 @@ IBCocoaTouchFramework NO + + NO + + + 1 + 1 + + IBCocoaTouchFramework + NO + NO @@ -669,22 +408,6 @@ 164 - - - callTabBar - - - - 165 - - - - incomingTabBar - - - - 166 - statusBarView @@ -709,6 +432,14 @@ 193 + + + callTabBarController + + + + 196 + @@ -732,65 +463,6 @@ - - 111 - - - YES - - - - - - - - - - - callTabBar - - - 118 - - - video - - - 120 - - - micro - - - 122 - - - addCall - - - 121 - - - speaker - - - 117 - - - pause - - - 116 - - - hangup - - - 114 - - - back - 123 @@ -885,12 +557,6 @@ mask - - 172 - - - mask - 124 @@ -915,6 +581,12 @@ statusBarController + + 194 + + + callBarController + @@ -925,21 +597,6 @@ -1.IBPluginDependency -2.CustomClassName -2.IBPluginDependency - 111.IBPluginDependency - 114.IBPluginDependency - 114.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 116.IBPluginDependency - 116.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 117.IBPluginDependency - 117.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 118.IBPluginDependency - 118.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 120.IBPluginDependency - 120.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 121.IBPluginDependency - 121.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 122.IBPluginDependency - 122.IBUIButtonInspectorSelectedStateConfigurationMetadataKey 123.IBPluginDependency 124.IBPluginDependency 124.IBUIButtonInspectorSelectedStateConfigurationMetadataKey @@ -956,12 +613,13 @@ 152.IBPluginDependency 169.IBPluginDependency 170.IBPluginDependency - 172.IBPluginDependency 175.IBPluginDependency 178.CustomClassName 178.IBPluginDependency 190.CustomClassName 190.IBPluginDependency + 194.CustomClassName + 194.IBPluginDependency 53.IBPluginDependency @@ -972,21 +630,6 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1002,11 +645,12 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin LinphoneMainBar com.apple.InterfaceBuilder.IBCocoaTouchPlugin LinphoneStatusBar com.apple.InterfaceBuilder.IBCocoaTouchPlugin + LinphoneCallBar + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1022,11 +666,19 @@ - 193 + 196 YES + + LinphoneCallBar + UIViewController + + IBProjectSource + ./Classes/LinphoneCallBar.h + + LinphoneMainBar UIViewController @@ -1196,9 +848,8 @@ YES addCallTabBar - callTabBar + callTabBarController contentView - incomingTabBar mainTabBarController statusBarController statusBarView @@ -1207,8 +858,7 @@ YES UIView - UIView - UIView + UIViewController UIView UIViewController UIViewController @@ -1221,9 +871,8 @@ YES addCallTabBar - callTabBar + callTabBarController contentView - incomingTabBar mainTabBarController statusBarController statusBarView @@ -1236,17 +885,13 @@ UIView - callTabBar - UIView + callTabBarController + UIViewController contentView UIView - - incomingTabBar - UIView - mainTabBarController UIViewController @@ -1292,8 +937,6 @@ YES YES - add-call-actif.png - add-call-over.png cancel-actif.png cancel-over.png contact-actif-add-call.png @@ -1301,28 +944,12 @@ decrocher-actif.png decrocher-over.png dialer-actif.png - dialer-meteo-sortir-actif.png - dialer-meteo-sortir-over.png dialer-over.png - micro-OFF-actif.png - micro-ON-actif.png - micro-ON-over.png - pause-actif.png - pause-over.png - raccrocher-actif.png - raccrocher-over.png refuser-actif.png refuser-over.png - speacker-OFF-actif.png - speacker-ON-over.png - video-OFF-actif.png - video-ON-actif.png - video-ON-over.png YES - {160, 134} - {160, 134} {254, 144} {254, 144} {254, 144} @@ -1330,23 +957,9 @@ {320, 154} {320, 154} {132, 144} - {209, 136} - {209, 136} {132, 144} - {160, 134} - {160, 134} - {160, 134} - {209, 136} - {209, 136} - {222, 136} - {222, 136} {320, 154} {320, 154} - {160, 134} - {160, 134} - {160, 134} - {160, 134} - {160, 134} 1181 diff --git a/Classes/PhoneViewController.h b/Classes/PhoneViewController.h index 7d76898f3..1212237fa 100644 --- a/Classes/PhoneViewController.h +++ b/Classes/PhoneViewController.h @@ -15,7 +15,8 @@ * 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 #import "linphonecore.h" @@ -23,11 +24,11 @@ #import "CallDelegate.h" @class MainScreenWithVideoPreview; -@class IncallViewController; +@class InCallViewController; @class FirstLoginViewController; -@interface PhoneViewController : UIViewController { +@interface PhoneViewController : UIViewController { @private //UI definition @@ -61,7 +62,7 @@ UIActionSheet *mIncomingCallActionSheet; FirstLoginViewController* myFirstLoginViewController; - IncallViewController* mIncallViewController; + InCallViewController* mIncallViewController; MainScreenWithVideoPreview* mMainScreenWithVideoPreview; UIButton* switchCamera; @@ -96,4 +97,5 @@ @property (nonatomic, retain) IBOutlet UITabBarController* myTabBarController; @property (nonatomic, retain) IBOutlet MainScreenWithVideoPreview* mMainScreenWithVideoPreview; +-(IBAction) onAddContact: (id) event; @end diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index a97e57584..776270846 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -27,12 +27,13 @@ #include "MainScreenWithVideoPreview.h" #include "linphonecore.h" #include "private.h" +#import "PhoneMainView.h" @implementation PhoneViewController -@synthesize dialerView ; -@synthesize address ; -@synthesize callShort; -@synthesize callLarge; +@synthesize dialerView; +@synthesize address; +@synthesize callShort; +@synthesize callLarge; @synthesize status; @synthesize erase; @@ -57,52 +58,7 @@ @synthesize switchCamera; --(void) updateStatusSubView { - LinphoneCore* lc = 0; - @try { - lc = [LinphoneManager getLc]; - } @catch (NSException* exc) { - return; - } - - if (!lc) - return; - - BOOL enableCallButtons; - LinphoneProxyConfig* config; - linphone_core_get_default_proxy([LinphoneManager getLc], &config); - - LinphoneRegistrationState s; - NSString* m = nil; - - if (config == NULL) { - s = LinphoneRegistrationNone; - m = linphone_core_is_network_reachabled([LinphoneManager getLc]) ? NSLocalizedString(@"No SIP account configured", nil) : NSLocalizedString(@"Network down", nil); - } else { - s = linphone_proxy_config_get_state(config); - - switch (s) { - case LinphoneRegistrationOk: m = @"Registered"; break; - case LinphoneRegistrationNone: - case LinphoneRegistrationCleared: - m=@"Not registered"; break; - case LinphoneRegistrationFailed: m = @"Registration failed"; break; - case LinphoneRegistrationProgress: m = @"Registration in progress"; break; - //case LinphoneRegistrationCleared: m= @"No SIP account"; break; - default: break; - } - } - - // Change to registration state - NSDictionary* dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:s], @"state", m, @"message", nil]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneRegistrationStatusChange" object:self userInfo:dict]; - - [callLarge setEnabled:enableCallButtons]; - [callShort setEnabled:enableCallButtons]; - [backToCallView setEnabled:enableCallButtons]; -} - --(void) updateCallAndBackButtons { +- (void)updateCallAndBackButtons { @try { bool zeroCall = (linphone_core_get_calls_nb([LinphoneManager getLc]) == 0); @@ -121,8 +77,6 @@ [exc.name cStringUsingEncoding:[NSString defaultCStringEncoding]], [exc.reason cStringUsingEncoding:[NSString defaultCStringEncoding]]); } - - [self updateStatusSubView]; } @@ -133,13 +87,13 @@ bundle:[NSBundle mainBundle]]; [self presentModalViewController:myFirstLoginViewController animated:true]; } - [[LinphoneManager instance] setRegistrationDelegate:self]; + // [[LinphoneManager instance] setRegistrationDelegate:self]; [mMainScreenWithVideoPreview showPreview:YES]; [self updateCallAndBackButtons]; } --(void) viewDidDisappear:(BOOL)animated { +- (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; } @@ -168,7 +122,7 @@ [backToCallView addTarget:self action:@selector(backToCallViewPressed) forControlEvents:UIControlEventTouchUpInside]; if (mIncallViewController == nil) - mIncallViewController = [[IncallViewController alloc] initWithNibName:[LinphoneManager runningOnIpad]?@"InCallViewController-ipad":@"IncallViewController" + mIncallViewController = [[InCallViewController alloc] initWithNibName:[LinphoneManager runningOnIpad]?@"InCallViewController-ipad":@"InCallViewController" bundle:[NSBundle mainBundle]]; /*if (statusSubViewController == nil) { @@ -201,12 +155,12 @@ return YES; } --(void)viewWillAppear:(BOOL)animated { +- (void)viewWillAppear:(BOOL)animated { [self updateCallAndBackButtons]; [super viewWillAppear:animated]; } --(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { +- (void)displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { //cancel local notification, just in case if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)] @@ -236,18 +190,16 @@ forUser:username withDisplayName:displayName]; - [myTabBarController setSelectedIndex:DIALER_TAB_INDEX]; + //[myTabBarController setSelectedIndex:DIALER_TAB_INDEX]; [mMainScreenWithVideoPreview showPreview:YES]; } -//status reporting --(void) displayStatus:(NSString*) message { +- (void)displayStatus:(NSString*) message { [mIncallViewController displayStatus:message]; } - --(void) displayIncomingCall:(LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { +- (void)displayIncomingCall:(LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { [mMainScreenWithVideoPreview showPreview:NO]; if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)] && [UIApplication sharedApplication].applicationState != UIApplicationStateActive) { @@ -291,7 +243,7 @@ [mMainScreenWithVideoPreview showPreview:NO]; } --(void) backToCallViewPressed { +- (void)backToCallViewPressed { [UICallButton enableTransforMode:NO]; [self presentModalViewController:(UIViewController*)mIncallViewController animated:true]; @@ -307,7 +259,7 @@ } } --(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { +- (void)displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { [mMainScreenWithVideoPreview showPreview:NO]; if (self.presentedViewController != (UIViewController*)mIncallViewController) { [self presentModalViewController:(UIViewController*)mIncallViewController animated:true]; @@ -320,7 +272,7 @@ } --(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { +- (void)displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { [mMainScreenWithVideoPreview showPreview:NO]; if (self.presentedViewController != (UIViewController*)mIncallViewController && (call == 0x0 || linphone_call_get_dir(call)==LinphoneCallIncoming)){ @@ -341,7 +293,7 @@ } --(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { +- (void)displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { [mMainScreenWithVideoPreview showPreview:NO]; [mIncallViewController displayVideoCall:call FromUI:viewCtrl forUser:username @@ -351,7 +303,7 @@ [self updateCallAndBackButtons]; } --(void) displayAskToEnableVideoCall:(LinphoneCall*) call forUser:(NSString*) username withDisplayName:(NSString*) displayName { +- (void)displayAskToEnableVideoCall:(LinphoneCall*) call forUser:(NSString*) username withDisplayName:(NSString*) displayName { [mIncallViewController displayAskToEnableVideoCall:call forUser:username withDisplayName:displayName]; } @@ -394,35 +346,37 @@ [super dealloc]; } --(void) displayRegisteredFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain { +- (void)displayRegisteredFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain { if (myFirstLoginViewController != nil && self.modalViewController == myFirstLoginViewController) { - [myFirstLoginViewController displayRegisteredFromUI:viewCtrl forUser:username withDisplayName:displayName onDomain:domain]; + //[myFirstLoginViewController displayRegisteredFromUI:viewCtrl forUser:username withDisplayName:displayName onDomain:domain]; } - [self updateStatusSubView]; -} --(void) displayRegisteringFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain { - if (myFirstLoginViewController != nil && self.modalViewController == myFirstLoginViewController) { - [myFirstLoginViewController displayRegisteringFromUI:viewCtrl forUser:username withDisplayName:displayName onDomain:domain]; - } - [self updateStatusSubView]; -} --(void) displayRegistrationFailedFromUI:(UIViewController*) viewCtrl forUser:(NSString*) user withDisplayName:(NSString*) displayName onDomain:(NSString*)domain forReason:(NSString*) reason { - if (myFirstLoginViewController != nil && self.modalViewController == myFirstLoginViewController) { - [myFirstLoginViewController displayRegistrationFailedFromUI:viewCtrl forUser:user withDisplayName:displayName onDomain:domain forReason:reason]; - } - [self updateStatusSubView]; } --(void) displayNotRegisteredFromUI:(UIViewController*) viewCtrl { +- (void)displayRegisteringFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain { if (myFirstLoginViewController != nil && self.modalViewController == myFirstLoginViewController) { - [myFirstLoginViewController displayNotRegisteredFromUI:viewCtrl]; + //[myFirstLoginViewController displayRegisteringFromUI:viewCtrl forUser:username withDisplayName:displayName onDomain:domain]; } - [self updateStatusSubView]; } --(void) firstVideoFrameDecoded: (LinphoneCall*) call { +- (void)displayRegistrationFailedFromUI:(UIViewController*) viewCtrl forUser:(NSString*) user withDisplayName:(NSString*) displayName onDomain:(NSString*)domain forReason:(NSString*) reason { + if (myFirstLoginViewController != nil && self.modalViewController == myFirstLoginViewController) { + //[myFirstLoginViewController displayRegistrationFailedFromUI:viewCtrl forUser:user withDisplayName:displayName onDomain:domain forReason:reason]; + } +} + +- (void)displayNotRegisteredFromUI:(UIViewController*) viewCtrl { + if (myFirstLoginViewController != nil && self.modalViewController == myFirstLoginViewController) { + //[myFirstLoginViewController displayNotRegisteredFromUI:viewCtrl]; + } +} + +- (void)firstVideoFrameDecoded: (LinphoneCall*) call { [mIncallViewController firstVideoFrameDecoded:call]; } +- (IBAction)onAddContact: (id) event { + +} + @end diff --git a/Classes/PhoneViewController.xib b/Classes/PhoneViewController.xib index 0cc9a7acc..e7476dd81 100644 --- a/Classes/PhoneViewController.xib +++ b/Classes/PhoneViewController.xib @@ -51,6 +51,7 @@ 292 {105, 72} + _NS:9 NO @@ -96,6 +97,7 @@ 292 {{105, 0}, {110, 72}} + _NS:9 NO @@ -124,6 +126,7 @@ 292 {{215, 0}, {105, 72}} + _NS:9 NO @@ -150,6 +153,7 @@ {{0, 293}, {320, 72}} + _NS:9 @@ -171,6 +175,7 @@ 292 {320, 259} + _NS:9 NO @@ -188,6 +193,7 @@ 292 {{0, 11}, {107, 54}} + 1 @@ -225,6 +231,7 @@ 292 {{107, 11}, {106, 54}} + NO NO @@ -253,6 +260,7 @@ 292 {{213, 11}, {107, 54}} + NO NO @@ -277,6 +285,7 @@ 292 {{0, 73}, {107, 54}} + NO NO @@ -305,6 +314,7 @@ 292 {{107, 73}, {106, 54}} + NO NO @@ -333,6 +343,7 @@ 292 {{0, 135}, {107, 54}} + NO NO @@ -361,6 +372,7 @@ 292 {{213, 73}, {107, 54}} + NO NO @@ -389,6 +401,7 @@ 292 {{107, 135}, {106, 54}} + NO NO @@ -417,6 +430,7 @@ 292 {{213, 135}, {107, 54}} + NO NO @@ -445,6 +459,7 @@ 292 {{0, 197}, {107, 54}} + NO NO @@ -473,6 +488,7 @@ 292 {{107, 197}, {106, 54}} + NO NO @@ -501,6 +517,7 @@ 292 {{213, 197}, {107, 54}} + NO NO @@ -527,6 +544,7 @@ {{0, 58}, {320, 260}} + _NS:9 @@ -546,6 +564,7 @@ 292 {320, 80} + _NS:9 NO @@ -560,6 +579,7 @@ 292 {320, 60} + 3 @@ -595,6 +615,7 @@ {320, 80} + _NS:9 @@ -608,6 +629,7 @@ {320, 460} + _NS:9 @@ -756,6 +778,15 @@ 19 + + + onAddContact: + + + 7 + + 187 + @@ -920,8 +951,8 @@ YES - + toolBar @@ -962,6 +993,7 @@ 182.IBPluginDependency 183.IBPluginDependency 183.IBUIButtonInspectorSelectedStateConfigurationMetadataKey + 184.CustomClassName 184.IBPluginDependency 184.IBUIButtonInspectorSelectedStateConfigurationMetadataKey 185.CustomClassName @@ -1018,6 +1050,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UICallButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIEraseButton @@ -1073,9 +1106,275 @@ - 186 + 188 + + + + YES + + MainScreenWithVideoPreview + UIViewController + + YES + + YES + phoneMainView + window + + + YES + PhoneViewController + UIWindow + + + + YES + + YES + phoneMainView + window + + + YES + + phoneMainView + PhoneViewController + + + window + UIWindow + + + + + IBProjectSource + ./Classes/MainScreenWithVideoPreview.h + + + + PhoneViewController + UIViewController + + onAddContact: + id + + + onAddContact: + + onAddContact: + id + + + + YES + + YES + address + backToCallView + callLarge + callShort + dialerView + eight + erase + five + four + hash + mMainScreenWithVideoPreview + myTabBarController + nine + one + seven + six + star + status + statusViewHolder + switchCamera + three + two + zero + + + YES + UITextField + UIButton + UIButton + UIButton + UIView + UIButton + UIEraseButton + UIButton + UIButton + UIButton + MainScreenWithVideoPreview + UITabBarController + UIButton + UIButton + UIButton + UIButton + UIButton + UILabel + UIView + UIButton + UIButton + UIButton + UIButton + + + + YES + + YES + address + backToCallView + callLarge + callShort + dialerView + eight + erase + five + four + hash + mMainScreenWithVideoPreview + myTabBarController + nine + one + seven + six + star + status + statusViewHolder + switchCamera + three + two + zero + + + YES + + address + UITextField + + + backToCallView + UIButton + + + callLarge + UIButton + + + callShort + UIButton + + + dialerView + UIView + + + eight + UIButton + + + erase + UIEraseButton + + + five + UIButton + + + four + UIButton + + + hash + UIButton + + + mMainScreenWithVideoPreview + MainScreenWithVideoPreview + + + myTabBarController + UITabBarController + + + nine + UIButton + + + one + UIButton + + + seven + UIButton + + + six + UIButton + + + star + UIButton + + + status + UILabel + + + statusViewHolder + UIView + + + switchCamera + UIButton + + + three + UIButton + + + two + UIButton + + + zero + UIButton + + + + + IBProjectSource + ./Classes/PhoneViewController.h + + + + UICallButton + UIButton + + IBProjectSource + ./Classes/UICallButton.h + + + + UIDigitButton + UIButton + + IBProjectSource + ./Classes/UIDigitButton.h + + + + UIEraseButton + UIButton + + IBProjectSource + ./Classes/UIEraseButton.h + + + - 0 IBCocoaTouchFramework diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index a2b3c88fe..11fa0066c 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -258,6 +258,12 @@ 7066FC0C13E830E400EFC6DC /* libvpx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7066FC0B13E830E400EFC6DC /* libvpx.a */; }; 70E542F313E147E3002BA2C0 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F213E147E3002BA2C0 /* OpenGLES.framework */; }; 70E542F513E147EB002BA2C0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F413E147EB002BA2C0 /* QuartzCore.framework */; }; + D326483815887D5200930C67 /* OrderedDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = D326483715887D5200930C67 /* OrderedDictionary.m */; }; + D326483915887D5200930C67 /* OrderedDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = D326483715887D5200930C67 /* OrderedDictionary.m */; }; + D326483E1588950F00930C67 /* LinphoneCallBar.m in Sources */ = {isa = PBXBuildFile; fileRef = D326483C1588950F00930C67 /* LinphoneCallBar.m */; }; + D326483F1588950F00930C67 /* LinphoneCallBar.m in Sources */ = {isa = PBXBuildFile; fileRef = D326483C1588950F00930C67 /* LinphoneCallBar.m */; }; + D32648401588950F00930C67 /* LinphoneCallBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = D326483D1588950F00930C67 /* LinphoneCallBar.xib */; }; + D32648411588950F00930C67 /* LinphoneCallBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = D326483D1588950F00930C67 /* LinphoneCallBar.xib */; }; D347347A1580DDF1003C7B8C /* PhoneMainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D34734791580DDF1003C7B8C /* PhoneMainView.xib */; }; D347347E1580E5F8003C7B8C /* history-actif.png in Resources */ = {isa = PBXBuildFile; fileRef = D347347C1580E5F8003C7B8C /* history-actif.png */; }; D347347F1580E5F8003C7B8C /* history-selectionne.png in Resources */ = {isa = PBXBuildFile; fileRef = D347347D1580E5F8003C7B8C /* history-selectionne.png */; }; @@ -831,6 +837,11 @@ 70E542F213E147E3002BA2C0 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 70E542F413E147EB002BA2C0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 8D1107310486CEB800E47090 /* linphone-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "linphone-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; + D326483615887D5200930C67 /* OrderedDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OrderedDictionary.h; path = Utils/OrderedDictionary.h; sourceTree = ""; }; + D326483715887D5200930C67 /* OrderedDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OrderedDictionary.m; path = Utils/OrderedDictionary.m; sourceTree = ""; }; + D326483B1588950F00930C67 /* LinphoneCallBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinphoneCallBar.h; sourceTree = ""; }; + D326483C1588950F00930C67 /* LinphoneCallBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LinphoneCallBar.m; sourceTree = ""; }; + D326483D1588950F00930C67 /* LinphoneCallBar.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LinphoneCallBar.xib; sourceTree = ""; }; D34734791580DDF1003C7B8C /* PhoneMainView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PhoneMainView.xib; sourceTree = ""; }; D347347C1580E5F8003C7B8C /* history-actif.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "history-actif.png"; path = "Resources/history-actif.png"; sourceTree = ""; }; D347347D1580E5F8003C7B8C /* history-selectionne.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "history-selectionne.png"; path = "Resources/history-selectionne.png"; sourceTree = ""; }; @@ -1050,6 +1061,7 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( + D326483415887D4400930C67 /* Utils */, 340751E4150E4D0200B89C47 /* CallDelegate.h */, 2211DBBB14769C8200DEE054 /* CallDelegate.m */, D3ED3EA41587334B006C0DE4 /* CallHistoryTableViewController.h */, @@ -1319,6 +1331,9 @@ D3A55FBE15877E69003FD403 /* ContactCell.xib */, 223963151393CFAE001DE689 /* FastAddressBook.h */, 223963161393CFAF001DE689 /* FastAddressBook.m */, + D326483B1588950F00930C67 /* LinphoneCallBar.h */, + D326483C1588950F00930C67 /* LinphoneCallBar.m */, + D326483D1588950F00930C67 /* LinphoneCallBar.xib */, D3ED3E841586291B006C0DE4 /* LinphoneMainBar.h */, D3ED3E851586291B006C0DE4 /* LinphoneMainBar.m */, D3ED3E861586291C006C0DE4 /* LinphoneMainBar.xib */, @@ -1663,6 +1678,15 @@ name = Frameworks; sourceTree = ""; }; + D326483415887D4400930C67 /* Utils */ = { + isa = PBXGroup; + children = ( + D326483615887D5200930C67 /* OrderedDictionary.h */, + D326483715887D5200930C67 /* OrderedDictionary.m */, + ); + name = Utils; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -1898,6 +1922,7 @@ D354981C15876FE7000081D8 /* bouton-detail-contact-over.png in Resources */, D35498231587716B000081D8 /* LinphoneStatusBar.xib in Resources */, D3A55FBF15877E69003FD403 /* ContactCell.xib in Resources */, + D32648401588950F00930C67 /* LinphoneCallBar.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2047,6 +2072,7 @@ D354981D15876FE7000081D8 /* bouton-detail-contact-over.png in Resources */, D35498241587716B000081D8 /* LinphoneStatusBar.xib in Resources */, D3A55FC015877E69003FD403 /* ContactCell.xib in Resources */, + D32648411588950F00930C67 /* LinphoneCallBar.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2091,6 +2117,8 @@ D3549816158761D0000081D8 /* ContactTableViewController.m in Sources */, D35498211587716B000081D8 /* LinphoneStatusBar.m in Sources */, D3A55FBC15877E5E003FD403 /* ContactCell.m in Sources */, + D326483815887D5200930C67 /* OrderedDictionary.m in Sources */, + D326483E1588950F00930C67 /* LinphoneCallBar.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2132,6 +2160,8 @@ D3549817158761D0000081D8 /* ContactTableViewController.m in Sources */, D35498221587716B000081D8 /* LinphoneStatusBar.m in Sources */, D3A55FBD15877E5E003FD403 /* ContactCell.m in Sources */, + D326483915887D5200930C67 /* OrderedDictionary.m in Sources */, + D326483F1588950F00930C67 /* LinphoneCallBar.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };