diff --git a/Classes/ChatRoomTableViewController.h b/Classes/ChatRoomTableViewController.h index 5256ce087..d118a363a 100644 --- a/Classes/ChatRoomTableViewController.h +++ b/Classes/ChatRoomTableViewController.h @@ -22,15 +22,10 @@ @interface ChatRoomTableViewController : UITableViewController { @private - BOOL editMode; NSArray *data; NSString *remoteContact; } @property (nonatomic, retain) NSString *remoteContact; -- (void) toggleEditMode; -- (void) enterEditMode; -- (void) exitEditMode; - @end diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m index fa2250948..80f9a4ede 100644 --- a/Classes/ChatRoomTableViewController.m +++ b/Classes/ChatRoomTableViewController.m @@ -33,22 +33,14 @@ data = [[ChatModel listMessages:remoteContact] retain]; } -- (void) toggleEditMode { - editMode = !editMode; - [(UITableView*)[self view] reloadData]; + +#pragma mark - Property Functions + +- (void)setRemoteContact:(NSString *)aremoteContact { + self->remoteContact = aremoteContact; + [[self tableView] reloadData]; } -- (void) enterEditMode { - if(!editMode) { - [self toggleEditMode]; - } -} - -- (void) exitEditMode { - if(editMode) { - [self toggleEditMode]; - } -} #pragma mark - UITableViewDataSource Functions @@ -68,17 +60,13 @@ } [cell setChat:[data objectAtIndex:[indexPath row]]]; - if(editMode) - [cell enterEditMode]; - else - [cell exitEditMode]; [cell update]; return cell; } -#pragma mark - UITableViewelegate Functions +#pragma mark - UITableViewDelegate Functions - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIChatRoomHeader *headerController = [[UIChatRoomHeader alloc] init]; diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index d51977911..6be06c8e7 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -41,6 +41,7 @@ [tableController release]; [messageField release]; [sendButton release]; + [editButton release]; [super dealloc]; } @@ -83,7 +84,7 @@ name:@"LinphoneTextReceived" object:nil]; - [tableController exitEditMode]; + [[tableController tableView] setEditing:FALSE]; [editButton setOff]; [[tableController tableView] reloadData]; } @@ -179,7 +180,7 @@ } - (IBAction)onEditClick:(id)event { - [tableController toggleEditMode]; + [[tableController tableView] setEditing:![[tableController tableView] isEditing] animated:TRUE]; } - (IBAction)onSendClick:(id)event { diff --git a/Classes/ChatTableViewController.h b/Classes/ChatTableViewController.h index 9b5ca4c03..91965b7f6 100644 --- a/Classes/ChatTableViewController.h +++ b/Classes/ChatTableViewController.h @@ -21,12 +21,7 @@ @interface ChatTableViewController : UITableViewController { @private - BOOL editMode; NSArray *data; } -- (void) toggleEditMode; -- (void) enterEditMode; -- (void) exitEditMode; - @end diff --git a/Classes/ChatTableViewController.m b/Classes/ChatTableViewController.m index 287d881a1..769179480 100644 --- a/Classes/ChatTableViewController.m +++ b/Classes/ChatTableViewController.m @@ -28,13 +28,6 @@ #pragma mark - Lifecycle Functions -- (id)init { - if((self = [super init]) != nil) { - self->editMode = false; - } - return self; -} - - (void)dealloc { if(data != nil) [data release]; @@ -50,23 +43,6 @@ data = [[ChatModel listConversations] retain]; } -- (void) toggleEditMode { - editMode = !editMode; - [(UITableView*)[self view] reloadData]; -} - -- (void) enterEditMode { - if(!editMode) { - [self toggleEditMode]; - } -} - -- (void) exitEditMode { - if(editMode) { - [self toggleEditMode]; - } -} - #pragma mark - UITableViewDataSource Functions - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView @@ -88,10 +64,6 @@ } [cell setChat:[data objectAtIndex:[indexPath row]]]; - if(editMode) - [cell enterEditMode]; - else - [cell exitEditMode]; [cell update]; return cell; diff --git a/Classes/ChatViewController.m b/Classes/ChatViewController.m index 3e5279bca..8a92ae4b6 100644 --- a/Classes/ChatViewController.m +++ b/Classes/ChatViewController.m @@ -57,7 +57,7 @@ name:@"LinphoneTextReceived" object:nil]; - [tableController exitEditMode]; + [[tableController tableView] setEditing:FALSE]; [editButton setOff]; [[tableController tableView] reloadData]; } @@ -99,7 +99,7 @@ } - (IBAction)onEditClick:(id)event { - [tableController toggleEditMode]; + [[tableController tableView] setEditing:![[tableController tableView] isEditing] animated:TRUE]; } @end diff --git a/Classes/LinphoneUI/UIPauseResumeButton.h b/Classes/ContactDetailsTableViewController.h similarity index 73% rename from Classes/LinphoneUI/UIPauseResumeButton.h rename to Classes/ContactDetailsTableViewController.h index fe5a80e30..955868e99 100644 --- a/Classes/LinphoneUI/UIPauseResumeButton.h +++ b/Classes/ContactDetailsTableViewController.h @@ -1,6 +1,6 @@ -/* UIMuteButton.h +/* ContactDetailsTableViewController.h * - * Copyright (C) 2011 Belledonne Comunications, Grenoble, France + * 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 @@ -15,14 +15,18 @@ * 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 "UIToggleButton.h" - - -@interface UIPauseResumeButton : UIToggleButton { +#import +@interface ContactDetailsTableViewController : UITableViewController { +@private + ABRecordRef contact; + NSMutableArray *dataCache; + ABAddressBookRef addressBook; } +@property (nonatomic, assign) ABRecordRef contact; + @end diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m new file mode 100644 index 000000000..d8f355650 --- /dev/null +++ b/Classes/ContactDetailsTableViewController.m @@ -0,0 +1,208 @@ +/* ContactDetailsTableViewController.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 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 "ContactDetailsTableViewController.h" +#import "UIContactDetailsHeader.h" +#import "PhoneMainView.h" + +@implementation ContactDetailsTableViewController + +@synthesize contact; + + +#pragma mark - Lifecycle Functions + +- (void)initContactDetailsTableViewController { + addressBook = ABAddressBookCreate(); + dataCache = [[NSMutableArray alloc] init]; +} + +- (id)init { + self = [super init]; + if (self) { + [self initContactDetailsTableViewController]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (self) { + [self initContactDetailsTableViewController]; + } + return self; +} + +- (void)dealloc { + [dataCache dealloc]; + [super dealloc]; +} + + +#pragma mark - ViewController Functions + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + ABAddressBookRegisterExternalChangeCallback (addressBook, sync_toc_address_book, self); +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_toc_address_book, self); +} + + +#pragma mark - + +static void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) { + ContactDetailsTableViewController* controller = (ContactDetailsTableViewController*)context; + ABRecordID recordID = ABRecordGetRecordID([controller contact]); + ABRecordRef newRecord = ABAddressBookGetPersonWithRecordID(addressBook, recordID); + if(newRecord) { + [controller setContact:newRecord]; + } +} + +- (void)loadData { + [dataCache removeAllObjects]; + + if(contact == NULL) + return; + + // Phone numbers + { + ABMultiValueRef lMap = ABRecordCopyValue(contact, kABPersonPhoneProperty); + NSMutableArray *subArray = [[NSMutableArray alloc] init]; + for(int i = 0; i < ABMultiValueGetCount(lMap); ++i) { + CFStringRef lValue = ABMultiValueCopyValueAtIndex(lMap, i); + CFStringRef lLabel = ABMultiValueCopyLabelAtIndex(lMap, i); + CFStringRef lLocalizedLabel = ABAddressBookCopyLocalizedLabel(lLabel); + [subArray addObject:[NSArray arrayWithObjects:[NSString stringWithString:(NSString*)lValue], [NSString stringWithString:(NSString*)lLocalizedLabel], nil]]; + if(lLocalizedLabel) + CFRelease(lLocalizedLabel); + CFRelease(lLabel); + CFRelease(lValue); + } + [dataCache addObject:subArray]; + CFRelease(lMap); + } + + // SIP (IM) + { + ABMultiValueRef lMap = ABRecordCopyValue(contact, kABPersonInstantMessageProperty); + NSMutableArray *subArray = [[NSMutableArray alloc] init]; + for(int i = 0; i < ABMultiValueGetCount(lMap); ++i) { + CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i); + if(CFDictionaryContainsKey(lDict, @"service")) { + if(CFStringCompare((CFStringRef)@"SIP", CFDictionaryGetValue(lDict, @"service"), kCFCompareCaseInsensitive) == 0) { + CFStringRef lValue = CFDictionaryGetValue(lDict, @"username"); + CFStringRef lLabel = ABMultiValueCopyLabelAtIndex(lMap, i); + CFStringRef lLocalizedLabel = ABAddressBookCopyLocalizedLabel(lLabel); + [subArray addObject:[NSArray arrayWithObjects:[NSString stringWithString:(NSString*)lValue], [NSString stringWithString:(NSString*)lLocalizedLabel], nil]]; + if(lLocalizedLabel) + CFRelease(lLocalizedLabel); + CFRelease(lLabel); + + } + } + CFRelease(lDict); + } + [dataCache addObject:subArray]; + CFRelease(lMap); + } +} + + +#pragma mark - Property Functions + +- (void)setContact:(ABRecordRef)acontact { + self->contact = acontact; + [[self tableView] reloadData]; +} + + +#pragma mark - UITableViewDataSource Functions + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + [self loadData]; + return [dataCache count]; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + NSMutableDictionary *dict = [dataCache objectAtIndex:section]; + return [dict count]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ContactDetailsCell"]; + if (cell == nil) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:@"ContactDetailsCell"]; + //[cell setSelectedBackgroundView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"list_hightlight.png"]]]; + } + NSMutableArray *sectionDict = [dataCache objectAtIndex:[indexPath section]]; + NSArray *tuple = [sectionDict objectAtIndex:[indexPath row]]; + [cell.textLabel setText:[tuple objectAtIndex:1]]; + [cell.detailTextLabel setText:[tuple objectAtIndex:0]]; + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + NSMutableArray *sectionDict = [dataCache objectAtIndex:[indexPath section]]; + NSArray *tuple = [sectionDict objectAtIndex:[indexPath row]]; + + NSString *dest = [tuple objectAtIndex:0]; + if(![dest hasPrefix:@"sip:"]) + dest = [NSString stringWithFormat:@"sip:%@", [tuple objectAtIndex:0]]; + CFStringRef lDisplayName = ABRecordCopyCompositeName(contact); + NSString *displayName = [NSString stringWithString:(NSString*) lDisplayName]; + CFRelease(lDisplayName); + + // Go to dialer view + NSDictionary *dict = [[[NSDictionary alloc] initWithObjectsAndKeys: + [[[NSArray alloc] initWithObjects: dest, displayName, nil] autorelease] + , @"call:displayName:", + nil] autorelease]; + [[PhoneMainView instance] changeView:PhoneView_Dialer dict:dict]; +} + + +#pragma mark - UITableViewDelegate Functions + +- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { + if(section == 0) { + UIContactDetailsHeader *headerController = [[UIContactDetailsHeader alloc] init]; + UIView *headerView = [headerController view]; + [headerController setContact:contact]; + [headerController update]; + [headerController release]; + return headerView; + } else { + return [[UIView alloc] initWithFrame:CGRectZero]; + } +} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + if(section == 0) + return [UIContactDetailsHeader height]; + else { + return 0.000001f; // Hack UITableView = 0 + } +} + +@end diff --git a/Classes/ContactDetailsViewController.h b/Classes/ContactDetailsViewController.h new file mode 100644 index 000000000..bf50a77b3 --- /dev/null +++ b/Classes/ContactDetailsViewController.h @@ -0,0 +1,36 @@ +/* ContactDetailsViewController.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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import +#import + +#import "UICompositeViewController.h" +#import "ContactDetailsTableViewController.h" + +@interface ContactDetailsViewController : UIViewController { + ContactDetailsTableViewController *tableController; + ABRecordRef contact; +} + +@property (nonatomic, assign) ABRecordRef contact; +@property (nonatomic, retain) IBOutlet ContactDetailsTableViewController *tableController; + +- (IBAction)onBackClick:(id)event; + +@end diff --git a/Classes/ContactDetailsViewController.m b/Classes/ContactDetailsViewController.m new file mode 100644 index 000000000..c025949a1 --- /dev/null +++ b/Classes/ContactDetailsViewController.m @@ -0,0 +1,70 @@ +/* ContactDetailsViewController.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 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 "ContactDetailsViewController.h" +#import "PhoneMainView.h" + +@implementation ContactDetailsViewController + +@synthesize tableController; +@synthesize contact; + +#pragma mark - Lifecycle Functions + +- (id)init { + return [super initWithNibName:@"ContactDetailsViewController" bundle:[NSBundle mainBundle]]; +} + +- (void)dealloc { + [tableController release]; + + [super dealloc]; +} + + +#pragma mark - Property Functions + + +- (void)setContact:(ABRecordRef)acontact { + self->contact = acontact; + [tableController setContact:contact]; +} + + +#pragma mark - UICompositeViewDelegate Functions + ++ (UICompositeViewDescription*) compositeViewDescription { + UICompositeViewDescription *description = [UICompositeViewDescription alloc]; + description->content = @"ContactDetailsViewController"; + description->tabBar = @"UIMainBar"; + description->tabBarEnabled = true; + description->stateBar = nil; + description->stateBarEnabled = false; + description->fullscreen = false; + return description; +} + + +#pragma mark - Action Functions + +- (IBAction)onBackClick:(id)event { + [[PhoneMainView instance] popView]; +} + +@end diff --git a/Classes/ContactDetailsViewController.xib b/Classes/ContactDetailsViewController.xib new file mode 100644 index 000000000..91f6d8dd2 --- /dev/null +++ b/Classes/ContactDetailsViewController.xib @@ -0,0 +1,392 @@ + + + + 1296 + 11E53 + 2182 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1181 + + + IBUITableViewController + IBUIButton + IBUIImageView + IBUIView + IBUITableView + IBProxyObject + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 292 + {320, 460} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + numpad_background.png + + + + + 290 + + + + 292 + {160, 58} + + + + _NS:9 + NO + + Add contact + + IBCocoaTouchFramework + 0 + 0 + NO + + 3 + MC41AA + + + NSImage + contact_back_over.png + + + NSImage + contact_back_default.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + + 292 + {{160, 0}, {160, 58}} + + + + _NS:9 + NO + + Add contact + + IBCocoaTouchFramework + 0 + 0 + NO + + + NSImage + contact_edit_over.png + + + NSImage + contact_edit_default.png + + + + + + {320, 58} + + + + _NS:9 + + 3 + MQA + + 2 + + + IBCocoaTouchFramework + + + + 306 + {{0, 59}, {320, 401}} + + + + _NS:9 + + 3 + MCAwAA + + YES + IBCocoaTouchFramework + YES + 1 + 2 + 0 + YES + 44 + 10 + 10 + + + {{0, 20}, {320, 460}} + + + + + 3 + MQA + + + + IBCocoaTouchFramework + + + + + 1 + 1 + + IBCocoaTouchFramework + NO + + + + + + + view + + + + 3 + + + + tableController + + + + 27 + + + + onBackClick: + + + 7 + + 10 + + + + dataSource + + + + 28 + + + + delegate + + + + 29 + + + + view + + + + 26 + + + + + + 0 + + + + + + 1 + + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + + + + + header + + + 8 + + + editButton + + + 9 + + + backButton + + + 11 + + + background + + + 19 + + + tableView + + + 20 + + + + tableController + + + + + ContactDetailsViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + ContactDetailsTableViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + + 29 + + + + + ContactDetailsTableViewController + UITableViewController + + IBProjectSource + ./Classes/ContactDetailsTableViewController.h + + + + ContactDetailsViewController + UIViewController + + onBackClick: + id + + + onBackClick: + + onBackClick: + id + + + + tableController + ContactDetailsTableViewController + + + tableController + + tableController + ContactDetailsTableViewController + + + + IBProjectSource + ./Classes/ContactDetailsViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + + {320, 117} + {320, 117} + {320, 117} + {320, 117} + {640, 523} + + 1181 + + diff --git a/Classes/ContactsTableViewController.h b/Classes/ContactsTableViewController.h index 696b0ef7e..7ae506cb8 100644 --- a/Classes/ContactsTableViewController.h +++ b/Classes/ContactsTableViewController.h @@ -26,6 +26,9 @@ OrderedDictionary* addressBookMap; ABAddressBookRef addressBook; + BOOL sipFilter; } +@property (nonatomic, assign) BOOL sipFilter; + @end diff --git a/Classes/ContactsTableViewController.m b/Classes/ContactsTableViewController.m index f67ce8f71..643fbb361 100644 --- a/Classes/ContactsTableViewController.m +++ b/Classes/ContactsTableViewController.m @@ -24,67 +24,129 @@ @implementation ContactsTableViewController -void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) { - ContactsTableViewController* controller = (ContactsTableViewController*)context; - OrderedDictionary* lAddressBookMap = controller->addressBookMap; - @synchronized (lAddressBookMap) { - - // Reset Address book - - [lAddressBookMap removeAllObjects]; - - NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook); - for (id lPerson in lContacts) { - CFStringRef lFirstName = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonFirstNameProperty); - CFStringRef lLocalizedFirstName = (lFirstName != nil)? ABAddressBookCopyLocalizedLabel(lFirstName): nil; - CFStringRef lLastName = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonLastNameProperty); - CFStringRef lLocalizedLastName = (lLastName != nil)? ABAddressBookCopyLocalizedLabel(lLastName): nil; - NSString *name = nil; - if(lLocalizedFirstName != nil && lLocalizedLastName != nil) { - name=[NSString stringWithFormat:@"%@%@", [(NSString *)lLocalizedFirstName retain], [(NSString *)lLocalizedLastName retain]]; - } else if(lLocalizedLastName != nil) { - name=[NSString stringWithFormat:@"%@",[(NSString *)lLocalizedLastName retain]]; - } else if(lLocalizedFirstName != nil) { - name=[NSString stringWithFormat:@"%@",[(NSString *)lLocalizedFirstName retain]]; - } - if(name != nil) { - // Put in correct subDic - NSString *firstChar = [[name substringToIndex:1] uppercaseString]; - OrderedDictionary *subDic =[lAddressBookMap objectForKey: firstChar]; - if(subDic == nil) { - subDic = [[OrderedDictionary alloc] init]; - [lAddressBookMap insertObject:subDic forKey:firstChar selector:@selector(caseInsensitiveCompare:)]; - } - [subDic insertObject:lPerson forKey:name selector:@selector(caseInsensitiveCompare:)]; - } - if(lLocalizedLastName != nil) - CFRelease(lLocalizedLastName); - if(lLastName != nil) - CFRelease(lLastName); - if(lLocalizedFirstName != nil) - CFRelease(lLocalizedFirstName); - if(lFirstName != nil) - CFRelease(lFirstName); - } - CFRelease(lContacts); +@synthesize sipFilter; + +#pragma mark - Lifecycle Functions + +- (void)initContactsTableViewController { + addressBookMap = [[OrderedDictionary alloc] init]; + addressBook = ABAddressBookCreate(); +} + +- (id)init { + self = [super init]; + if (self) { + [self initContactsTableViewController]; } + return self; +} + +- (id)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (self) { + [self initContactsTableViewController]; + } + return self; +} + +- (void)dealloc { + [super dealloc]; + [addressBookMap removeAllObjects]; +} + + +#pragma mark - Property Functions + +- (void)setSipFilter:(BOOL)asipFilter { + self->sipFilter = asipFilter; + [[self tableView] reloadData]; +} + + +#pragma mark - + +static void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) { + ContactsTableViewController* controller = (ContactsTableViewController*)context; [(UITableView *)controller.view reloadData]; } #pragma mark - ViewController Functions -- (void) viewDidLoad { - addressBookMap = [[OrderedDictionary alloc] init]; - addressBook = ABAddressBookCreate(); +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; ABAddressBookRegisterExternalChangeCallback (addressBook, sync_toc_address_book, self); - sync_toc_address_book(addressBook, nil, self); +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_toc_address_book, self); } #pragma mark - UITableViewDataSource Functions +- (void)reloadData { + @synchronized (addressBookMap) { + + // Reset Address book + [addressBookMap removeAllObjects]; + + NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook); + for (id lPerson in lContacts) { + BOOL add = true; + if(sipFilter) { + add = false; + ABMultiValueRef lMap = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonInstantMessageProperty); + for(int i = 0; i < ABMultiValueGetCount(lMap); ++i) { + CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i); + if(CFDictionaryContainsKey(lDict, @"service")) { + if(CFStringCompare((CFStringRef)@"SIP", CFDictionaryGetValue(lDict, @"service"), kCFCompareCaseInsensitive) == 0) { + add = true; + } + } + CFRelease(lDict); + } + } + if(add) { + CFStringRef lFirstName = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonFirstNameProperty); + CFStringRef lLocalizedFirstName = (lFirstName != nil)? ABAddressBookCopyLocalizedLabel(lFirstName): nil; + CFStringRef lLastName = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonLastNameProperty); + CFStringRef lLocalizedLastName = (lLastName != nil)? ABAddressBookCopyLocalizedLabel(lLastName): nil; + NSString *name = nil; + if(lLocalizedFirstName != nil && lLocalizedLastName != nil) { + name=[NSString stringWithFormat:@"%@%@", [(NSString *)lLocalizedFirstName retain], [(NSString *)lLocalizedLastName retain]]; + } else if(lLocalizedLastName != nil) { + name=[NSString stringWithFormat:@"%@",[(NSString *)lLocalizedLastName retain]]; + } else if(lLocalizedFirstName != nil) { + name=[NSString stringWithFormat:@"%@",[(NSString *)lLocalizedFirstName retain]]; + } + if(name != nil) { + // Put in correct subDic + NSString *firstChar = [[name substringToIndex:1] uppercaseString]; + OrderedDictionary *subDic =[addressBookMap objectForKey: firstChar]; + if(subDic == nil) { + subDic = [[OrderedDictionary alloc] init]; + [addressBookMap insertObject:subDic forKey:firstChar selector:@selector(caseInsensitiveCompare:)]; + } + [subDic insertObject:lPerson forKey:name selector:@selector(caseInsensitiveCompare:)]; + } + if(lLocalizedLastName != nil) + CFRelease(lLocalizedLastName); + if(lLastName != nil) + CFRelease(lLastName); + if(lLocalizedFirstName != nil) + CFRelease(lLocalizedFirstName); + if(lFirstName != nil) + CFRelease(lFirstName); + } + } + CFRelease(lContacts); + } +} + - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + [self reloadData]; return [addressBookMap count]; } @@ -115,35 +177,13 @@ void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { OrderedDictionary *subDic = [addressBookMap objectForKey: [addressBookMap keyAtIndex: [indexPath section]]]; ABRecordRef lPerson = [subDic objectForKey: [subDic keyAtIndex:[indexPath row]]]; - // TODO - ABMultiValueRef lPhoneNumbers = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonPhoneProperty); - for(CFIndex i = 0; i < ABMultiValueGetCount(lPhoneNumbers); i++) { - CFStringRef lLabel = ABMultiValueCopyLabelAtIndex(lPhoneNumbers, i); - if ([(NSString*)lLabel isEqualToString:(NSString*)kABPersonPhoneMainLabel]) { - CFStringRef lNumber = ABMultiValueCopyValueAtIndex(lPhoneNumbers,i); - NSString *number = [(NSString *)lNumber retain]; - - // Go to dialer view - NSDictionary *dict = [[[NSDictionary alloc] initWithObjectsAndKeys: - [[[NSArray alloc] initWithObjects: number, nil] autorelease] - , @"setAddress:", - nil] autorelease]; - [[PhoneMainView instance] changeView:PhoneView_Dialer dict:dict]; - - CFRelease(lNumber); - break; - } - CFRelease(lLabel); - } - CFRelease(lPhoneNumbers); -} - -#pragma mark - Lifecycle Functions - -- (void)dealloc { - [super dealloc]; - [addressBookMap removeAllObjects]; + // Go to Contact details view + NSDictionary *dict = [[[NSDictionary alloc] initWithObjectsAndKeys: + [[[NSArray alloc] initWithObjects: lPerson, nil] autorelease] + , @"setContact:", + nil] autorelease]; + [[PhoneMainView instance] changeView:PhoneView_ContactDetails dict:dict push:TRUE]; } @end diff --git a/Classes/ContactsViewController.m b/Classes/ContactsViewController.m index 1bfd43ea6..add579a53 100644 --- a/Classes/ContactsViewController.m +++ b/Classes/ContactsViewController.m @@ -35,6 +35,7 @@ typedef enum _HistoryView { History_MAX } HistoryView; + #pragma mark - Lifecycle Functions - (id)init { @@ -70,7 +71,7 @@ typedef enum _HistoryView { - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - [self.tableView reloadData]; + [self changeView:History_All]; } - (void)viewDidLoad { @@ -91,18 +92,22 @@ typedef enum _HistoryView { - (void)changeView: (HistoryView) view { if(view == History_All) { + + [tableController setSipFilter:FALSE]; allButton.selected = TRUE; } else { allButton.selected = FALSE; } if(view == History_Linphone) { + [tableController setSipFilter:TRUE]; linphoneButton.selected = TRUE; } else { linphoneButton.selected = FALSE; } } + #pragma mark - Action Functions - (IBAction)onAllClick: (id) event { diff --git a/Classes/DialerViewController.h b/Classes/DialerViewController.h index 8a90e2b63..2eedfca28 100644 --- a/Classes/DialerViewController.h +++ b/Classes/DialerViewController.h @@ -54,8 +54,10 @@ BOOL transferMode; } -- (void)setAddress:(NSString*) address; -- (void)setTransferMode:(NSNumber*) enable; +- (void)setAddress:(NSString*)address; +- (void)setTransferMode:(NSNumber*)enable; +- (void)call:(NSString*)address displayName:(NSString *)displayName; +- (void)call:(NSString*)address; @property (nonatomic, retain) IBOutlet UITextField* addressField; @property (nonatomic, retain) IBOutlet UIButton* addContactButton; diff --git a/Classes/DialerViewController.m b/Classes/DialerViewController.m index df5cf434e..2d3c3f250 100644 --- a/Classes/DialerViewController.m +++ b/Classes/DialerViewController.m @@ -193,6 +193,13 @@ [self callUpdate:call state:state]; } +- (void)call:(NSString*)address { + [self call:address displayName:nil]; +} + +- (void)call:(NSString*)address displayName:(NSString *)displayName { + [[LinphoneManager instance] call:address displayName:displayName transfer:transferMode]; +} #pragma mark - UITextFieldDelegate Functions diff --git a/Classes/HistoryTableViewController.h b/Classes/HistoryTableViewController.h index 09f55b9e7..9b2dc7aef 100644 --- a/Classes/HistoryTableViewController.h +++ b/Classes/HistoryTableViewController.h @@ -21,11 +21,10 @@ @interface HistoryTableViewController : UITableViewController { @private - BOOL editMode; + BOOL missedFilter; + NSMutableArray *callLogs; } -- (void) toggleEditMode; -- (void) enterEditMode; -- (void) exitEditMode; +@property (nonatomic, assign) BOOL missedFilter; @end diff --git a/Classes/HistoryTableViewController.m b/Classes/HistoryTableViewController.m index 99c18004e..15f4bba32 100644 --- a/Classes/HistoryTableViewController.m +++ b/Classes/HistoryTableViewController.m @@ -24,26 +24,70 @@ @implementation HistoryTableViewController +@synthesize missedFilter; #pragma mark - Lifecycle Functions +- (void)initHistoryTableViewController { + callLogs = [[NSMutableArray alloc] init]; + missedFilter = false; +} + - (id)init { - if((self = [super init]) != nil) { - self->editMode = false; + self = [super init]; + if (self) { + [self initHistoryTableViewController]; } return self; } +- (id)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (self) { + [self initHistoryTableViewController]; + } + return self; +} + +- (void)dealloc { + [callLogs release]; + [super dealloc]; +} + + +#pragma mark - Property Functions + +- (void)setMissedFilter:(BOOL)amissedFilter { + self->missedFilter = amissedFilter; + [[self tableView] reloadData]; +} + #pragma mark - UITableViewDataSource Functions +- (void)loadData { + [callLogs removeAllObjects]; + const MSList * logs = linphone_core_get_call_logs([LinphoneManager getLc]); + while(logs != NULL) { + LinphoneCallLog* log = (LinphoneCallLog *) logs->data; + if(missedFilter) { + if (log->status == LinphoneCallMissed) { + [callLogs addObject:[NSValue valueWithPointer: log]]; + } + } else { + [callLogs addObject:[NSValue valueWithPointer: log]]; + } + logs = ms_list_next(logs); + } +} + - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - const MSList * logs = linphone_core_get_call_logs([LinphoneManager getLc]); - return ms_list_size(logs); + [self loadData]; + return [callLogs count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { @@ -52,15 +96,8 @@ cell = [[UIHistoryCell alloc] initWithIdentifier:@"UIHistoryCell"]; } - const MSList * logs = linphone_core_get_call_logs([LinphoneManager getLc]); - LinphoneCallLog* callLogs = ms_list_nth_data(logs, indexPath.row); - - if(editMode) - [cell enterEditMode]; - else - [cell exitEditMode]; - - [cell setCallLog:callLogs]; + LinphoneCallLog *log = [[callLogs objectAtIndex:[indexPath row]] pointerValue]; + [cell setCallLog:log]; [cell update]; return cell; @@ -72,13 +109,12 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:NO]; - const MSList * logs = linphone_core_get_call_logs([LinphoneManager getLc]); - LinphoneCallLog* callLogs = ms_list_nth_data(logs, indexPath.row) ; + LinphoneCallLog *log = [[callLogs objectAtIndex:[indexPath row]] pointerValue]; LinphoneAddress* partyToCall; - if (callLogs->dir == LinphoneCallIncoming) { - partyToCall=callLogs->from; + if (log->dir == LinphoneCallIncoming) { + partyToCall=log->from; } else { - partyToCall=callLogs->to; + partyToCall=log->to; } const char* username = linphone_address_get_username(partyToCall)!=0?linphone_address_get_username(partyToCall):""; const char* displayName = linphone_address_get_display_name(partyToCall)!=0?linphone_address_get_display_name(partyToCall):""; @@ -99,8 +135,8 @@ // Go to dialer view NSDictionary *dict = [[[NSDictionary alloc] initWithObjectsAndKeys: - [[[NSArray alloc] initWithObjects: phoneNumber, nil] autorelease] - , @"setAddress:", + [[[NSArray alloc] initWithObjects: phoneNumber, dispName, nil] autorelease] + , @"call:displayName:", nil] autorelease]; [[PhoneMainView instance] changeView:PhoneView_Dialer dict:dict]; @@ -108,25 +144,5 @@ [dispName release]; } - -#pragma mark - - -- (void) toggleEditMode { - editMode = !editMode; - [(UITableView*)[self view] reloadData]; -} - -- (void) enterEditMode { - if(!editMode) { - [self toggleEditMode]; - } -} - -- (void) exitEditMode { - if(editMode) { - [self toggleEditMode]; - } -} - @end diff --git a/Classes/HistoryViewController.m b/Classes/HistoryViewController.m index 6faf08aa8..f60c676ac 100644 --- a/Classes/HistoryViewController.m +++ b/Classes/HistoryViewController.m @@ -70,7 +70,8 @@ typedef enum _HistoryView { - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - [tableController exitEditMode]; + [[tableController tableView] setEditing:FALSE]; + [self changeView: History_All]; [editButton setOff]; [self.tableView reloadData]; } @@ -98,12 +99,14 @@ typedef enum _HistoryView { - (void)changeView: (HistoryView) view { if(view == History_All) { allButton.selected = TRUE; + [tableController setMissedFilter:FALSE]; } else { allButton.selected = FALSE; } if(view == History_Missed) { missedButton.selected = TRUE; + [tableController setMissedFilter:TRUE]; } else { missedButton.selected = FALSE; } @@ -121,7 +124,7 @@ typedef enum _HistoryView { } - (IBAction)onEditClick:(id) event { - [tableController toggleEditMode]; + [[tableController tableView] setEditing:![[tableController tableView] isEditing] animated:TRUE]; } diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index 7328d6df2..1b7a54a21 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -57,6 +57,7 @@ typedef struct _LinphoneCallAppData { @interface LinphoneManager : NSObject { @protected SCNetworkReachabilityRef proxyReachability; + @private NSTimer* mIterateTimer; id mLogView; @@ -82,6 +83,9 @@ typedef struct _LinphoneCallAppData { + (NSString *)getPreferenceForCodec: (const char*) name withRate: (int) rate; + (BOOL)codecIsSupported:(NSString *) prefName; + +- (void)call:(NSString *)address displayName:(NSString*)displayName transfer:(BOOL)transfer; + - (void)startLibLinphone; - (BOOL)isNotIphone3G; - (void)destroyLibLinphone; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 3bac80534..b7396a70c 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -25,6 +25,7 @@ #import #import #import +#import #import "LinphoneManager.h" #import "FastAddressBook.h" @@ -363,6 +364,7 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo [chat setRemoteContact:[NSString stringWithUTF8String:linphone_address_get_username(from)]]; [chat setMessage:[NSString stringWithUTF8String:message]]; [chat setDirection:[NSNumber numberWithInt:1]]; + [chat setTime:[NSDate date]]; [chat create]; // Post event @@ -820,4 +822,74 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach return NO; } + +- (void)call:(NSString *)address displayName:(NSString*)displayName transfer:(BOOL)transfer { + if (!linphone_core_is_network_reachabled(theLinphoneCore)) { + UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Network Error",nil) + message:NSLocalizedString(@"There is no network connection available, enable WIFI or WWAN prior to place a call",nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Continue",nil) + otherButtonTitles:nil]; + [error show]; + [error release]; + return; + } + + CTCallCenter* ct = [[CTCallCenter alloc] init]; + if ([ct.currentCalls count] > 0) { + ms_error("GSM call in progress, cancelling outgoing SIP call request"); + UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot make call",nil) + message:NSLocalizedString(@"Please terminate GSM call",nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Continue",nil) + otherButtonTitles:nil]; + [error show]; + [error release]; + [ct release]; + return; + } + [ct release]; + + LinphoneProxyConfig* proxyCfg; + //get default proxy + linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg); + LinphoneCallParams* lcallParams = linphone_core_create_default_call_parameters([LinphoneManager getLc]); + + if ([address length] == 0) return; //just return + if ([address hasPrefix:@"sip:"]) { + LinphoneAddress* linphoneAddress = linphone_address_new([address cStringUsingEncoding:[NSString defaultCStringEncoding]]); + if(displayName!=nil) { + linphone_address_set_display_name(linphoneAddress,[displayName cStringUsingEncoding:[NSString defaultCStringEncoding]]); + } + if(transfer) { + linphone_core_transfer_call([LinphoneManager getLc], linphone_core_get_current_call([LinphoneManager getLc]), [address cStringUsingEncoding:[NSString defaultCStringEncoding]]); + } else { + linphone_core_invite_address_with_params([LinphoneManager getLc], linphoneAddress, lcallParams); + } + linphone_address_destroy(linphoneAddress); + } else if ( proxyCfg==nil){ + UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid sip address",nil) + message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a call or use a valid sip address (I.E sip:john@example.net)",nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Continue",nil) + otherButtonTitles:nil]; + [error show]; + [error release]; + } else { + char normalizedUserName[256]; + LinphoneAddress* linphoneAddress = linphone_address_new(linphone_core_get_identity([LinphoneManager getLc])); + linphone_proxy_config_normalize_number(proxyCfg,[address cStringUsingEncoding:[NSString defaultCStringEncoding]],normalizedUserName,sizeof(normalizedUserName)); + linphone_address_set_username(linphoneAddress, normalizedUserName); + if(displayName!=nil) { + linphone_address_set_display_name(linphoneAddress,[displayName cStringUsingEncoding:[NSString defaultCStringEncoding]]); + } + if(transfer) { + linphone_core_transfer_call([LinphoneManager getLc], linphone_core_get_current_call([LinphoneManager getLc]), normalizedUserName); + } else { + linphone_core_invite_address_with_params([LinphoneManager getLc], linphoneAddress,lcallParams); + } + } + linphone_call_params_destroy(lcallParams); +} + @end diff --git a/Classes/LinphoneUI/UICallButton.m b/Classes/LinphoneUI/UICallButton.m index 12d647da7..b34ff5e1b 100644 --- a/Classes/LinphoneUI/UICallButton.m +++ b/Classes/LinphoneUI/UICallButton.m @@ -62,71 +62,11 @@ [super dealloc]; } + #pragma mark - --(void) touchUp:(id) sender { - if (!linphone_core_is_network_reachabled([LinphoneManager getLc])) { - UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Network Error",nil) - message:NSLocalizedString(@"There is no network connection available, enable WIFI or WWAN prior to place a call",nil) - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue",nil) - otherButtonTitles:nil]; - [error show]; - [error release]; - return; - } - - CTCallCenter* ct = [[CTCallCenter alloc] init]; - if ([ct.currentCalls count] > 0) { - ms_error("GSM call in progress, cancelling outgoing SIP call request"); - UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot make call",nil) - message:NSLocalizedString(@"Please terminate GSM call",nil) - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue",nil) - otherButtonTitles:nil]; - [error show]; - [error release]; - [ct release]; - return; - } - [ct release]; - - if (TRUE /*!linphone_core_in_call([LinphoneManager getLc])*/) { - LinphoneProxyConfig* proxyCfg; - //get default proxy - linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg); - LinphoneCallParams* lcallParams = linphone_core_create_default_call_parameters([LinphoneManager getLc]); - - if ([addressField.text length] == 0) return; //just return - if ([addressField.text hasPrefix:@"sip:"]) { - linphone_core_invite_with_params([LinphoneManager getLc],[addressField.text cStringUsingEncoding:[NSString defaultCStringEncoding]],lcallParams); - } else if ( proxyCfg==nil){ - UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid sip address",nil) - message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a call or use a valid sip address (I.E sip:john@example.net)",nil) - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue",nil) - otherButtonTitles:nil]; - [error show]; - [error release]; - } else { - char normalizedUserName[256]; - NSString* toUserName = [NSString stringWithString:[addressField text]]; - NSString* lDisplayName = [[LinphoneManager instance] getDisplayNameFromAddressBook:toUserName andUpdateCallLog:nil]; - - linphone_proxy_config_normalize_number(proxyCfg,[toUserName cStringUsingEncoding:[NSString defaultCStringEncoding]],normalizedUserName,sizeof(normalizedUserName)); - LinphoneAddress* tmpAddress = linphone_address_new(linphone_core_get_identity([LinphoneManager getLc])); - linphone_address_set_username(tmpAddress,normalizedUserName); - linphone_address_set_display_name(tmpAddress,(lDisplayName)?[lDisplayName cStringUsingEncoding:[NSString defaultCStringEncoding]]:nil); - - - linphone_core_invite_address_with_params([LinphoneManager getLc],tmpAddress,lcallParams) ; - - linphone_address_destroy(tmpAddress); - } - linphone_call_params_destroy(lcallParams); - } else if (linphone_core_inc_invite_pending([LinphoneManager getLc])) { - linphone_core_accept_call([LinphoneManager getLc],linphone_core_get_current_call([LinphoneManager getLc])); - } +- (void)touchUp:(id) sender { + [[LinphoneManager instance] call:[addressField text] displayName:nil transfer:FALSE]; } @end diff --git a/Classes/LinphoneUI/UIChatCell.h b/Classes/LinphoneUI/UIChatCell.h index 9fdb9f7af..d66e7bfad 100644 --- a/Classes/LinphoneUI/UIChatCell.h +++ b/Classes/LinphoneUI/UIChatCell.h @@ -40,8 +40,6 @@ - (id)initWithIdentifier:(NSString*)identifier; - (void)update; -- (void)enterEditMode; -- (void)exitEditMode; - (IBAction)onDetailsClick:(id)event; - (IBAction)onDeleteClick:(id)event; diff --git a/Classes/LinphoneUI/UIChatCell.m b/Classes/LinphoneUI/UIChatCell.m index aa1969582..5b97b2738 100644 --- a/Classes/LinphoneUI/UIChatCell.m +++ b/Classes/LinphoneUI/UIChatCell.m @@ -91,14 +91,25 @@ [chatContentLabel setFrame: chatContentFrame]; } -- (void)enterEditMode { - [deleteButton setHidden:false]; - [detailsButton setHidden:true]; +- (void)setEditing:(BOOL)editing { + [self setEditing:editing animated:FALSE]; } -- (void)exitEditMode { - [detailsButton setHidden:false]; - [deleteButton setHidden:true]; +- (void)setEditing:(BOOL)editing animated:(BOOL)animated { + if(animated) { + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:0.3]; + } + if(editing) { + [deleteButton setAlpha:1.0f]; + [detailsButton setAlpha:0.0f]; + } else { + [detailsButton setAlpha:1.0f]; + [deleteButton setAlpha:0.0f]; + } + if(animated) { + [UIView commitAnimations]; + } } #pragma mark - Action Functions diff --git a/Classes/LinphoneUI/UIChatCell.xib b/Classes/LinphoneUI/UIChatCell.xib index f8738e424..9d6d04987 100644 --- a/Classes/LinphoneUI/UIChatCell.xib +++ b/Classes/LinphoneUI/UIChatCell.xib @@ -127,7 +127,6 @@ {{276, 0}, {44, 44}} - _NS:9 NO IBCocoaTouchFramework @@ -162,7 +161,7 @@ - -2147483356 + 292 {{276, 0}, {44, 44}} @@ -206,7 +205,6 @@ {320, 44} - _NS:9 NO IBCocoaTouchFramework @@ -221,7 +219,6 @@ {320, 44} - _NS:9 NO @@ -409,17 +406,20 @@ UIChatCell UITableViewCell - - onDetailsClick: - id - - - onDetailsClick: - + + id + id + + + + onDeleteClick: + id + + onDetailsClick: id - + UIImageView UILabel diff --git a/Classes/LinphoneUI/UIChatRoomCell.h b/Classes/LinphoneUI/UIChatRoomCell.h index abc320f0f..113bf0bd1 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.h +++ b/Classes/LinphoneUI/UIChatRoomCell.h @@ -41,9 +41,6 @@ - (void)update; -- (void)enterEditMode; -- (void)exitEditMode; - - (IBAction)onDeleteClick:(id)event; @end diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index 5f77fc7a8..0ee530fbd 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -61,6 +61,40 @@ static UIFont *CELL_FONT = nil; #pragma mark - - (void)update { + if(chat != nil) { + [messageLabel setText:[chat message]]; + } +} + +- (void)setEditing:(BOOL)editing { + [self setEditing:editing animated:FALSE]; +} + +- (void)setEditing:(BOOL)editing animated:(BOOL)animated { + if(animated) { + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:0.3]; + } + if(editing) { + [deleteButton setAlpha:1.0f]; + } else { + [deleteButton setAlpha:0.0f]; + } + if(animated) { + [UIView commitAnimations]; + } +} + +- (void)resizeContent { + // Resize content + { + CGRect frame = [contentView frame]; + frame.origin.x = 0.0f; + frame.origin.y = 0.0f; + frame.size = [self frame].size; + [ contentView setFrame:frame]; + } + if(chat != nil) { if([chat direction]) { [backgroundImage setImage:[TUNinePatchCache imageOfSize:[backgroundImage bounds].size @@ -69,11 +103,14 @@ static UIFont *CELL_FONT = nil; [backgroundImage setImage:[TUNinePatchCache imageOfSize:[backgroundImage bounds].size forNinePatchNamed:@"chat_bubble_outgoing"]]; } - [messageLabel setText:[chat message]]; } - CGRect frame = [messageLabel frame]; - frame.size.height = [UIChatRoomCell messageHeight:[chat message]]; - [messageLabel setFrame:frame]; + + // Resize message + { + CGRect frame = [messageLabel frame]; + frame.size.height = [UIChatRoomCell messageHeight:[chat message]]; + [messageLabel setFrame:frame]; + } } + (CGFloat)messageHeight:(NSString*)message { @@ -94,21 +131,12 @@ static UIFont *CELL_FONT = nil; return height; } -- (void)enterEditMode { - [deleteButton setHidden:false]; -} - -- (void)exitEditMode { - [deleteButton setHidden:true]; -} #pragma mark - View Functions - (void)layoutSubviews { - // Resize content - CGRect frame = [contentView frame]; - frame.size = [self frame].size; - [contentView setFrame:frame]; + [super layoutSubviews]; + [self resizeContent]; } diff --git a/Classes/LinphoneUI/UIChatRoomCell.xib b/Classes/LinphoneUI/UIChatRoomCell.xib index 57cdb4968..5cc6c4476 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.xib +++ b/Classes/LinphoneUI/UIChatRoomCell.xib @@ -91,7 +91,7 @@ - -2147483351 + 297 {{236, 28}, {44, 44}} diff --git a/Classes/LinphoneUI/UIChatRoomHeader.xib b/Classes/LinphoneUI/UIChatRoomHeader.xib index 937c1726d..c8bdedf3d 100644 --- a/Classes/LinphoneUI/UIChatRoomHeader.xib +++ b/Classes/LinphoneUI/UIChatRoomHeader.xib @@ -39,7 +39,7 @@ 292 - {{-13, -1}, {131, 107}} + {{-13, -5}, {131, 107}} @@ -54,7 +54,7 @@ 274 - {{20, 10}, {65, 65}} + {{20, 6}, {65, 65}} @@ -69,7 +69,7 @@ 292 - {{101, 31}, {199, 43}} + {{101, 27}, {199, 43}} _NS:9 @@ -159,8 +159,8 @@ 4 - + diff --git a/Classes/LinphoneUI/UIConferenceHeader.xib b/Classes/LinphoneUI/UIConferenceHeader.xib index 6839db24a..f88d15e85 100644 --- a/Classes/LinphoneUI/UIConferenceHeader.xib +++ b/Classes/LinphoneUI/UIConferenceHeader.xib @@ -48,7 +48,7 @@ IBCocoaTouchFramework NSImage - champ-titre-conference.png + header_conference.png @@ -57,6 +57,7 @@ {{224, 14}, {25, 25}} + _NS:9 NO IBCocoaTouchFramework @@ -267,7 +268,7 @@ YES 3 - {640, 135} + {640, 135} {43, 50} {43, 46} {43, 46} diff --git a/Classes/LinphoneUI/UIContactCell.h b/Classes/LinphoneUI/UIContactCell.h index d7376d0ad..3032d6f1b 100644 --- a/Classes/LinphoneUI/UIContactCell.h +++ b/Classes/LinphoneUI/UIContactCell.h @@ -23,10 +23,12 @@ @interface UIContactCell : UITableViewCell { UILabel *firstNameLabel; UILabel *lastNameLabel; + UIImageView *avatarImage; } @property (nonatomic, retain) IBOutlet UILabel* firstNameLabel; @property (nonatomic, retain) IBOutlet UILabel* lastNameLabel; +@property (nonatomic, retain) IBOutlet UIImageView *avatarImage; - (void)update:(ABRecordRef) record; diff --git a/Classes/LinphoneUI/UIContactCell.m b/Classes/LinphoneUI/UIContactCell.m index c5ebbf8dd..5f25f29fd 100644 --- a/Classes/LinphoneUI/UIContactCell.m +++ b/Classes/LinphoneUI/UIContactCell.m @@ -23,6 +23,7 @@ @synthesize firstNameLabel; @synthesize lastNameLabel; +@synthesize avatarImage; #pragma mark - Lifecycle Functions @@ -43,6 +44,7 @@ - (void) dealloc { [firstNameLabel release]; [lastNameLabel release]; + [avatarImage release]; [super dealloc]; } @@ -65,12 +67,12 @@ CFStringRef lLocalizedLastName = (lFirstName != nil)?ABAddressBookCopyLocalizedLabel(lLastName):nil; if(lLocalizedFirstName != nil) - [firstNameLabel setText: [(NSString *)lLocalizedFirstName retain]]; + [firstNameLabel setText: (NSString *)lLocalizedFirstName]; else [firstNameLabel setText: @""]; if(lLocalizedLastName != nil) - [lastNameLabel setText: [(NSString *)lLocalizedLastName retain]]; + [lastNameLabel setText: (NSString *)lLocalizedLastName]; else [lastNameLabel setText: @""]; @@ -83,6 +85,17 @@ if(lFirstName != nil) CFRelease(lFirstName); + NSData *imgData = (NSData *)ABPersonCopyImageDataWithFormat(record, kABPersonImageFormatThumbnail); + if(imgData != NULL) { + UIImage *img = [[UIImage alloc] initWithData:imgData]; + [avatarImage setImage:img]; + [img release]; + } else { + [avatarImage setImage:[UIImage imageNamed:@"avatar_unknown_small.png"]]; + } + + + // // Adapt size // diff --git a/Classes/LinphoneUI/UIContactCell.xib b/Classes/LinphoneUI/UIContactCell.xib index 0b24a4a60..bfa83f78e 100644 --- a/Classes/LinphoneUI/UIContactCell.xib +++ b/Classes/LinphoneUI/UIContactCell.xib @@ -36,10 +36,21 @@ 292 + + + 292 + {{6, 6}, {32, 32}} + + + + _NS:9 + NO + IBCocoaTouchFramework + 274 - {{10, 0}, {55, 44}} + {{46, 0}, {55, 44}} @@ -75,7 +86,7 @@ 274 - {{75, 0}, {200, 44}} + {{111, 0}, {200, 44}} _NS:328 @@ -108,6 +119,7 @@ {320, 44} + _NS:9 3 @@ -175,6 +187,14 @@ 22 + + + avatarImage + + + + 24 + @@ -199,8 +219,9 @@ 16 - + + @@ -228,6 +249,12 @@ background + + 23 + + + avatarImage + @@ -239,13 +266,14 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 22 + 24 @@ -253,10 +281,15 @@ UIContactCell UITableViewCell + UIImageView UILabel UILabel + + avatarImage + UIImageView + firstNameLabel UILabel diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.h b/Classes/LinphoneUI/UIContactDetailsHeader.h new file mode 100644 index 000000000..5cc437676 --- /dev/null +++ b/Classes/LinphoneUI/UIContactDetailsHeader.h @@ -0,0 +1,39 @@ +/* UIContactDetailsHeader.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 +#import + +@interface UIContactDetailsHeader : UIViewController { + UILabel *contactLabel; + UIImageView *avatarImage; + + ABRecordRef contact; +} + +@property (assign) ABRecordRef contact; + +@property (nonatomic, retain) IBOutlet UILabel *contactLabel; +@property (nonatomic, retain) IBOutlet UIImageView *avatarImage; + ++ (CGFloat)height; + +- (void)update; + +@end diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.m b/Classes/LinphoneUI/UIContactDetailsHeader.m new file mode 100644 index 000000000..75f61c6d4 --- /dev/null +++ b/Classes/LinphoneUI/UIContactDetailsHeader.m @@ -0,0 +1,81 @@ +/* UIContactDetailsHeader.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 "UIContactDetailsHeader.h" + +@implementation UIContactDetailsHeader + +@synthesize avatarImage; +@synthesize contactLabel; +@synthesize contact; + + +#pragma mark - Lifecycle Functions + +- (id)init { + return [super initWithNibName:@"UIContactDetailsHeader" bundle:[NSBundle mainBundle]]; +} + +- (void)dealloc { + [avatarImage release]; + [contactLabel release]; + [super dealloc]; +} + + +#pragma mark - + +- (void)update { + if(contact) { + // Avatar image + { + NSData *imgData = (NSData *)ABPersonCopyImageDataWithFormat(contact, kABPersonImageFormatThumbnail); + if(imgData != NULL) { + UIImage *img = [[UIImage alloc] initWithData:imgData]; + [avatarImage setImage:img]; + [img release]; + } else { + [avatarImage setImage:[UIImage imageNamed:@"avatar_unknown_small.png"]]; + } + } + + // Contact label + { + CFStringRef lFirstName = ABRecordCopyValue(contact, kABPersonFirstNameProperty); + CFStringRef lLocalizedFirstName = (lFirstName != nil)?ABAddressBookCopyLocalizedLabel(lFirstName):nil; + CFStringRef lLastName = ABRecordCopyValue(contact, kABPersonLastNameProperty); + CFStringRef lLocalizedLastName = (lFirstName != nil)?ABAddressBookCopyLocalizedLabel(lLastName):nil; + [contactLabel setText:[NSString stringWithFormat:@"%@ %@", (NSString*)lLocalizedFirstName, (NSString*)lLocalizedLastName]]; + if(lLocalizedLastName != nil) + CFRelease(lLocalizedLastName); + if(lLastName != nil) + CFRelease(lLastName); + if(lLocalizedFirstName != nil) + CFRelease(lLocalizedFirstName); + if(lFirstName != nil) + CFRelease(lFirstName); + } + } +} + ++ (CGFloat)height { + return 80.0f; +} + +@end diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.xib b/Classes/LinphoneUI/UIContactDetailsHeader.xib new file mode 100644 index 000000000..978e7d5ed --- /dev/null +++ b/Classes/LinphoneUI/UIContactDetailsHeader.xib @@ -0,0 +1,244 @@ + + + + 1296 + 11E53 + 2182 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1181 + + + IBUIImageView + IBUIView + IBUILabel + IBProxyObject + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 292 + + + + 292 + {{-13, -5}, {131, 107}} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + avatar_shadow_small.png + + + + + 274 + {{20, 6}, {65, 65}} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + avatar_unknown_small.png + + + + + 292 + {{101, 27}, {199, 43}} + + + _NS:9 + NO + YES + 7 + NO + IBCocoaTouchFramework + Contact1 + + 3 + MC4zMzMzMzMzMzMzAA + + + 0 + 10 + + 1 + 22 + + + Helvetica + 22 + 16 + + + + {320, 80} + + + + _NS:9 + + 3 + MCAwAA + + IBCocoaTouchFramework + + + + + + + view + + + + 5 + + + + avatarImage + + + + 9 + + + + contactLabel + + + + 11 + + + + + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + + + + + + + + 6 + + + avatarImage + + + 7 + + + avatarShadowBackground + + + 8 + + + contactLabel + + + + + UIContactDetailsHeader + 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 + + + + + + 11 + + + + + UIContactDetailsHeader + UIViewController + + UIImageView + UILabel + + + + avatarImage + UIImageView + + + contactLabel + UILabel + + + + IBProjectSource + ./Classes/UIContactDetailsHeader.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + + {262, 214} + {131, 131} + + 1181 + + diff --git a/Classes/LinphoneUI/UIHistoryCell.h b/Classes/LinphoneUI/UIHistoryCell.h index 59e4b8ea9..d42efde08 100644 --- a/Classes/LinphoneUI/UIHistoryCell.h +++ b/Classes/LinphoneUI/UIHistoryCell.h @@ -43,7 +43,5 @@ - (IBAction)onDelete:(id) event; - (void)update; -- (void)enterEditMode; -- (void)exitEditMode; @end diff --git a/Classes/LinphoneUI/UIHistoryCell.m b/Classes/LinphoneUI/UIHistoryCell.m index 3ca3d5592..378f145fa 100644 --- a/Classes/LinphoneUI/UIHistoryCell.m +++ b/Classes/LinphoneUI/UIHistoryCell.m @@ -93,25 +93,35 @@ partyToDisplay = callLog->to; } - const char* username = linphone_address_get_username(partyToDisplay)!=0?linphone_address_get_username(partyToDisplay):""; - //const char* displayName = linphone_address_get_display_name(partyToDisplay); - + const char* username = (linphone_address_get_display_name(partyToDisplay) != 0)? linphone_address_get_display_name(partyToDisplay):linphone_address_get_username(partyToDisplay); + [displayNameLabel setText:[NSString stringWithUTF8String: username]]; [imageView setImage: image]; } -- (void)enterEditMode { - [deleteButton setHidden:false]; - [detailsButton setHidden:true]; +- (void)setEditing:(BOOL)editing { + [self setEditing:editing animated:FALSE]; } -- (void)exitEditMode { +- (void)setEditing:(BOOL)editing animated:(BOOL)animated { + if(animated) { + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:0.3]; + } + if(editing) { + [deleteButton setAlpha:1.0f]; + [detailsButton setAlpha:0.0f]; + } else { #ifdef DETAILS_DISABLED - [detailsButton setHidden:true]; + [detailsButton setAlpha:0.0f]; #else - [detailsButton setHidden:false]; + [detailsButtonsetAlpha:1.0f]; #endif - [deleteButton setHidden:true]; + [deleteButton setAlpha:0.0f]; + } + if(animated) { + [UIView commitAnimations]; + } } @end diff --git a/Classes/LinphoneUI/UIHistoryCell.xib b/Classes/LinphoneUI/UIHistoryCell.xib index bba065224..d921b21d4 100644 --- a/Classes/LinphoneUI/UIHistoryCell.xib +++ b/Classes/LinphoneUI/UIHistoryCell.xib @@ -125,7 +125,7 @@ - -2147483356 + 292 {{276, 0}, {44, 44}} diff --git a/Classes/LinphoneUI/UIMainBar.m b/Classes/LinphoneUI/UIMainBar.m index f49ba5535..8c498efd1 100644 --- a/Classes/LinphoneUI/UIMainBar.m +++ b/Classes/LinphoneUI/UIMainBar.m @@ -86,7 +86,7 @@ } else { historyButton.selected = FALSE; } - if(view == PhoneView_Contacts) { + if(view == PhoneView_Contacts || view == PhoneView_ContactDetails) { contactsButton.selected = TRUE; } else { contactsButton.selected = FALSE; @@ -101,7 +101,7 @@ } else { settingsButton.selected = FALSE; } - if(view == PhoneView_Chat) { + if(view == PhoneView_Chat || view == PhoneView_ChatRoom) { chatButton.selected = TRUE; } else { chatButton.selected = FALSE; diff --git a/Classes/LinphoneUI/UIPauseResumeButton.m b/Classes/LinphoneUI/UIPauseResumeButton.m deleted file mode 100644 index 22f7db8b3..000000000 --- a/Classes/LinphoneUI/UIPauseResumeButton.m +++ /dev/null @@ -1,69 +0,0 @@ -/* UIMuteButton.m - * - * Copyright (C) 2011 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 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 "UIPauseResumeButton.h" -#include "LinphoneManager.h" - - -@implementation UIPauseResumeButton - - - --(void) onOn { - LinphoneCall* c = linphone_core_get_current_call([LinphoneManager getLc]); - if (c) { - linphone_core_pause_call([LinphoneManager getLc], c); - } -} --(void) onOff { - const MSList* c = linphone_core_get_calls([LinphoneManager getLc]); - if (c) { - linphone_core_resume_call([LinphoneManager getLc], (LinphoneCall*) c->data); - } -} --(bool) isInitialStateOn { - @try { - LinphoneCall* c = linphone_core_get_current_call([LinphoneManager getLc]); - - if (c) { - return linphone_call_get_state(c) == LinphoneCallPaused; - } else { - /* if current call is paused -> c == null */ - return true; - } - } @catch(NSException* e) { - //not ready yet - return false; - } - -} - -/* -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect { - // Drawing code. -} -*/ - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/Classes/LinphoneUI/UITransferButton.m b/Classes/LinphoneUI/UITransferButton.m index 6a105db9b..564e14a4f 100644 --- a/Classes/LinphoneUI/UITransferButton.m +++ b/Classes/LinphoneUI/UITransferButton.m @@ -61,71 +61,11 @@ [super dealloc]; } + #pragma mark - --(void) touchUp:(id) sender { - if (!linphone_core_is_network_reachabled([LinphoneManager getLc])) { - UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Network Error",nil) - message:NSLocalizedString(@"There is no network connection available, enable WIFI or WWAN prior to place a call",nil) - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue",nil) - otherButtonTitles:nil]; - [error show]; - [error release]; - return; - } - - CTCallCenter* ct = [[CTCallCenter alloc] init]; - if ([ct.currentCalls count] > 0) { - ms_error("GSM call in progress, cancelling outgoing SIP call request"); - UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot make call",nil) - message:NSLocalizedString(@"Please terminate GSM call",nil) - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue",nil) - otherButtonTitles:nil]; - [error show]; - [error release]; - [ct release]; - return; - } - [ct release]; - - if (TRUE /*!linphone_core_in_call([LinphoneManager getLc])*/) { - LinphoneProxyConfig* proxyCfg; - //get default proxy - linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg); - LinphoneCallParams* lcallParams = linphone_core_create_default_call_parameters([LinphoneManager getLc]); - - if ([addressField.text length] == 0) return; //just return - if ([addressField.text hasPrefix:@"sip:"]) { - linphone_core_transfer_call([LinphoneManager getLc], linphone_core_get_current_call([LinphoneManager getLc]), [addressField.text cStringUsingEncoding:[NSString defaultCStringEncoding]]); - } else if ( proxyCfg==nil){ - UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid sip address",nil) - message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a call or use a valid sip address (I.E sip:john@example.net)",nil) - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue",nil) - otherButtonTitles:nil]; - [error show]; - [error release]; - } else { - char normalizedUserName[256]; - NSString* toUserName = [NSString stringWithString:[addressField text]]; - NSString* lDisplayName = [[LinphoneManager instance] getDisplayNameFromAddressBook:toUserName andUpdateCallLog:nil]; - - linphone_proxy_config_normalize_number(proxyCfg,[toUserName cStringUsingEncoding:[NSString defaultCStringEncoding]],normalizedUserName,sizeof(normalizedUserName)); - LinphoneAddress* tmpAddress = linphone_address_new(linphone_core_get_identity([LinphoneManager getLc])); - linphone_address_set_username(tmpAddress,normalizedUserName); - linphone_address_set_display_name(tmpAddress,(lDisplayName)?[lDisplayName cStringUsingEncoding:[NSString defaultCStringEncoding]]:nil); - - - linphone_core_transfer_call([LinphoneManager getLc], linphone_core_get_current_call([LinphoneManager getLc]), normalizedUserName); - - linphone_address_destroy(tmpAddress); - } - linphone_call_params_destroy(lcallParams); - } else if (linphone_core_inc_invite_pending([LinphoneManager getLc])) { - linphone_core_accept_call([LinphoneManager getLc],linphone_core_get_current_call([LinphoneManager getLc])); - } +- (void)touchUp:(id) sender { + [[LinphoneManager instance] call:[addressField text] displayName:nil transfer:TRUE]; } @end diff --git a/Classes/Model/ChatModel.m b/Classes/Model/ChatModel.m index bf81c131b..45e553b30 100644 --- a/Classes/Model/ChatModel.m +++ b/Classes/Model/ChatModel.m @@ -199,7 +199,7 @@ return [[[NSArray alloc] init] autorelease]; } - const char *sql = [[NSString stringWithFormat:@"SELECT id, localContact, remoteContact, direction, message, time FROM chat WHERE remoteContact=\"%@\" ORDER BY time ASC", + const char *sql = [[NSString stringWithFormat:@"SELECT id, localContact, remoteContact, direction, message, time FROM chat WHERE remoteContact=\"%@\" ORDER BY time DESC", contact] UTF8String]; sqlite3_stmt *sqlStatement; if (sqlite3_prepare(database, sql, -1, &sqlStatement, NULL) != SQLITE_OK) { diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index 3bb0af14d..fab26455c 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -33,6 +33,7 @@ typedef enum _PhoneView { PhoneView_Chat, PhoneView_ChatRoom, PhoneView_Contacts, + PhoneView_ContactDetails, PhoneView_InCall, PhoneView_IncomingCall, PhoneView_END diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 7b2cc2ef4..a74aea4df 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -33,6 +33,7 @@ #import "SettingsViewController.h" #import "FirstLoginViewController.h" #import "WizardViewController.h" +#import "ContactDetailsViewController.h" #import "AbstractCall.h" @@ -118,6 +119,7 @@ static PhoneMainView* phoneMainViewInstance=nil; [viewDescriptions setObject:[SettingsViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_Settings]]; [viewDescriptions setObject:[FirstLoginViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_FirstLogin]]; [viewDescriptions setObject:[WizardViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_Wizard]]; + [viewDescriptions setObject:[ContactDetailsViewController compositeViewDescription] forKey:[NSNumber numberWithInt:PhoneView_ContactDetails]]; } - (void)viewWillAppear:(BOOL)animated { diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index 5cf73de15..cef482195 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -24,13 +24,13 @@ @synthesize addressBook; - -(Contact*) getMatchingRecord:(NSString*) number { +- (Contact*)getMatchingRecord:(NSString*) number { @synchronized (mAddressBookMap){ return (Contact*) [mAddressBookMap objectForKey:number]; } } -+(NSString*) appendCountryCodeIfPossible:(NSString*) number { ++ (NSString*)appendCountryCodeIfPossible:(NSString*) number { if (![number hasPrefix:@"+"] && ![number hasPrefix:@"00"]) { NSString* lCountryCode = [[LinphoneManager instance].settingsStore objectForKey:@"countrycode_preference"]; if (lCountryCode && [lCountryCode length]>0) { @@ -40,7 +40,8 @@ } return number; } -+(NSString*) normalizePhoneNumber:(NSString*) number { + ++ (NSString*)normalizePhoneNumber:(NSString*) number { NSString* lNormalizedNumber = [(NSString*)number stringByReplacingOccurrencesOfString:@" " withString:@""]; lNormalizedNumber = [lNormalizedNumber stringByReplacingOccurrencesOfString:@"(" withString:@""]; lNormalizedNumber = [lNormalizedNumber stringByReplacingOccurrencesOfString:@")" withString:@""]; @@ -48,6 +49,7 @@ lNormalizedNumber = [FastAddressBook appendCountryCodeIfPossible:lNormalizedNumber]; return lNormalizedNumber; } + void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) { NSMutableDictionary* lAddressBookMap = (NSMutableDictionary*)context; @synchronized (lAddressBookMap) { @@ -73,31 +75,40 @@ void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void CFRelease(lContacts); } } --(FastAddressBook*) init { + +- (FastAddressBook*)init { if ((self = [super init])) { mAddressBookMap = [[NSMutableDictionary alloc] init]; addressBook = ABAddressBookCreate(); - ABAddressBookRegisterExternalChangeCallback (addressBook,sync_address_book,mAddressBookMap); + ABAddressBookRegisterExternalChangeCallback (addressBook, sync_address_book, mAddressBookMap); sync_address_book(addressBook,nil,mAddressBookMap); } return self; } +- (void)dealloc { + ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, mAddressBookMap); + + [super dealloc]; +} + @end @implementation Contact @synthesize record; @synthesize numberType; --(id) initWithRecord:(ABRecordRef) aRecord ofType:(NSString*) type { +- (id)initWithRecord:(ABRecordRef) aRecord ofType:(NSString*) type { if ((self = [super init])) { record=CFRetain(aRecord); numberType= [type?type:@"unknown" retain]; } return self; } + - (void)dealloc { CFRelease(record); [numberType release]; [super dealloc]; } + @end diff --git a/Resources/cancel_default.png b/Resources/cancel_default.png deleted file mode 100644 index 069a5185d..000000000 Binary files a/Resources/cancel_default.png and /dev/null differ diff --git a/Resources/cancel_over.png b/Resources/cancel_over.png deleted file mode 100644 index 8da4f454f..000000000 Binary files a/Resources/cancel_over.png and /dev/null differ diff --git a/Resources/contact_back_default.png b/Resources/contact_back_default.png new file mode 100644 index 000000000..3c90a7bb6 Binary files /dev/null and b/Resources/contact_back_default.png differ diff --git a/Resources/contact_back_over.png b/Resources/contact_back_over.png new file mode 100644 index 000000000..ce56ede38 Binary files /dev/null and b/Resources/contact_back_over.png differ diff --git a/Resources/contact_edit_default.png b/Resources/contact_edit_default.png new file mode 100644 index 000000000..428ce5df8 Binary files /dev/null and b/Resources/contact_edit_default.png differ diff --git a/Resources/contact_edit_over.png b/Resources/contact_edit_over.png new file mode 100644 index 000000000..62c0a4c34 Binary files /dev/null and b/Resources/contact_edit_over.png differ diff --git a/Resources/contact_number.png b/Resources/contact_number.png new file mode 100644 index 000000000..31efad8aa Binary files /dev/null and b/Resources/contact_number.png differ diff --git a/Resources/contact_number_over.png b/Resources/contact_number_over.png new file mode 100644 index 000000000..44813921c Binary files /dev/null and b/Resources/contact_number_over.png differ diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index f30b4deb9..bd29d5d5e 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -153,6 +153,18 @@ 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 */; }; + D3128FE115AABC7E00A2147A /* ContactDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3128FDF15AABC7E00A2147A /* ContactDetailsViewController.m */; }; + D3128FE215AABC7E00A2147A /* ContactDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3128FDF15AABC7E00A2147A /* ContactDetailsViewController.m */; }; + D3128FE315AABC7E00A2147A /* ContactDetailsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3128FE015AABC7E00A2147A /* ContactDetailsViewController.xib */; }; + D3128FE415AABC7E00A2147A /* ContactDetailsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3128FE015AABC7E00A2147A /* ContactDetailsViewController.xib */; }; + D3128FEF15AABE4E00A2147A /* contact_back_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3128FE715AABE4E00A2147A /* contact_back_default.png */; }; + D3128FF015AABE4E00A2147A /* contact_back_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3128FE715AABE4E00A2147A /* contact_back_default.png */; }; + D3128FF115AABE4E00A2147A /* contact_back_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3128FE815AABE4E00A2147A /* contact_back_over.png */; }; + D3128FF215AABE4E00A2147A /* contact_back_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3128FE815AABE4E00A2147A /* contact_back_over.png */; }; + D3128FF315AABE4E00A2147A /* contact_edit_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3128FE915AABE4E00A2147A /* contact_edit_default.png */; }; + D3128FF415AABE4E00A2147A /* contact_edit_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3128FE915AABE4E00A2147A /* contact_edit_default.png */; }; + D3128FF515AABE4E00A2147A /* contact_edit_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3128FEA15AABE4E00A2147A /* contact_edit_over.png */; }; + D3128FF615AABE4E00A2147A /* contact_edit_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3128FEA15AABE4E00A2147A /* contact_edit_over.png */; }; D3196D2D15A3199D007FEEBA /* list_hightlight.png in Resources */ = {isa = PBXBuildFile; fileRef = D3196D2C15A3199D007FEEBA /* list_hightlight.png */; }; D3196D2E15A3199D007FEEBA /* list_hightlight.png in Resources */ = {isa = PBXBuildFile; fileRef = D3196D2C15A3199D007FEEBA /* list_hightlight.png */; }; D3196D3415A321E3007FEEBA /* options_add_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3196D3015A321E2007FEEBA /* options_add_default.png */; }; @@ -362,6 +374,16 @@ D37B96B815A1A6F20005CCD2 /* call_state_delete_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D37B96B515A1A6F20005CCD2 /* call_state_delete_default.png */; }; D37B96B915A1A6F20005CCD2 /* call_state_delete_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D37B96B615A1A6F20005CCD2 /* call_state_delete_over.png */; }; D37B96BA15A1A6F20005CCD2 /* call_state_delete_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D37B96B615A1A6F20005CCD2 /* call_state_delete_over.png */; }; + D37C638E15AAD251009D0BAC /* contact_number_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D37C638C15AAD251009D0BAC /* contact_number_over.png */; }; + D37C638F15AAD251009D0BAC /* contact_number_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D37C638C15AAD251009D0BAC /* contact_number_over.png */; }; + D37C639015AAD251009D0BAC /* contact_number.png in Resources */ = {isa = PBXBuildFile; fileRef = D37C638D15AAD251009D0BAC /* contact_number.png */; }; + D37C639115AAD251009D0BAC /* contact_number.png in Resources */ = {isa = PBXBuildFile; fileRef = D37C638D15AAD251009D0BAC /* contact_number.png */; }; + D37C639515AADDAF009D0BAC /* UIContactDetailsHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = D37C639315AADDAE009D0BAC /* UIContactDetailsHeader.m */; }; + D37C639615AADDAF009D0BAC /* UIContactDetailsHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = D37C639315AADDAE009D0BAC /* UIContactDetailsHeader.m */; }; + D37C639715AADDAF009D0BAC /* UIContactDetailsHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37C639415AADDAF009D0BAC /* UIContactDetailsHeader.xib */; }; + D37C639815AADDAF009D0BAC /* UIContactDetailsHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37C639415AADDAF009D0BAC /* UIContactDetailsHeader.xib */; }; + D37C639B15AADEF6009D0BAC /* ContactDetailsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D37C639A15AADEF5009D0BAC /* ContactDetailsTableViewController.m */; }; + D37C639C15AADEF6009D0BAC /* ContactDetailsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D37C639A15AADEF5009D0BAC /* ContactDetailsTableViewController.m */; }; D37DC6C11594AE1800B2A5EB /* LinphoneCoreSettingsStore.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */; }; D37DC6C21594AE1800B2A5EB /* LinphoneCoreSettingsStore.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */; }; D37DC6ED1594AE6F00B2A5EB /* IASKAppSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6C61594AE6F00B2A5EB /* IASKAppSettingsViewController.m */; }; @@ -667,10 +689,6 @@ D3F83F7D1582253100336684 /* decline_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F761582253100336684 /* decline_default.png */; }; D3F83F7E1582253100336684 /* decline_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F771582253100336684 /* decline_over.png */; }; D3F83F7F1582253100336684 /* decline_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F771582253100336684 /* decline_over.png */; }; - D3F83F841582278D00336684 /* cancel_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F801582278D00336684 /* cancel_default.png */; }; - D3F83F851582278D00336684 /* cancel_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F801582278D00336684 /* cancel_default.png */; }; - D3F83F861582278D00336684 /* cancel_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F811582278D00336684 /* cancel_over.png */; }; - D3F83F871582278D00336684 /* cancel_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F811582278D00336684 /* cancel_over.png */; }; D3F83F8E15822ABE00336684 /* PhoneMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F83F8D15822ABD00336684 /* PhoneMainView.m */; }; D3F83F8F15822ABE00336684 /* PhoneMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F83F8D15822ABD00336684 /* PhoneMainView.m */; }; D3F83F9215824D3600336684 /* LinphoneApp.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F9115824D3500336684 /* LinphoneApp.xib */; }; @@ -1001,6 +1019,13 @@ 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 = ""; }; + D3128FDE15AABC7E00A2147A /* ContactDetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailsViewController.h; sourceTree = ""; }; + D3128FDF15AABC7E00A2147A /* ContactDetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailsViewController.m; sourceTree = ""; }; + D3128FE015AABC7E00A2147A /* ContactDetailsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactDetailsViewController.xib; sourceTree = ""; }; + D3128FE715AABE4E00A2147A /* contact_back_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_back_default.png; path = Resources/contact_back_default.png; sourceTree = ""; }; + D3128FE815AABE4E00A2147A /* contact_back_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_back_over.png; path = Resources/contact_back_over.png; sourceTree = ""; }; + D3128FE915AABE4E00A2147A /* contact_edit_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_edit_default.png; path = Resources/contact_edit_default.png; sourceTree = ""; }; + D3128FEA15AABE4E00A2147A /* contact_edit_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_edit_over.png; path = Resources/contact_edit_over.png; sourceTree = ""; }; D3196D2C15A3199D007FEEBA /* list_hightlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = list_hightlight.png; path = Resources/list_hightlight.png; sourceTree = ""; }; D3196D3015A321E2007FEEBA /* options_add_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = options_add_default.png; path = Resources/options_add_default.png; sourceTree = ""; }; D3196D3115A321E2007FEEBA /* options_add_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = options_add_over.png; path = Resources/options_add_over.png; sourceTree = ""; }; @@ -1130,6 +1155,13 @@ D377BBF915A19DA6002B696B /* video_on_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = video_on_disabled.png; path = Resources/video_on_disabled.png; sourceTree = ""; }; D37B96B515A1A6F20005CCD2 /* call_state_delete_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = call_state_delete_default.png; path = Resources/call_state_delete_default.png; sourceTree = ""; }; D37B96B615A1A6F20005CCD2 /* call_state_delete_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = call_state_delete_over.png; path = Resources/call_state_delete_over.png; sourceTree = ""; }; + D37C638C15AAD251009D0BAC /* contact_number_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_number_over.png; path = Resources/contact_number_over.png; sourceTree = ""; }; + D37C638D15AAD251009D0BAC /* contact_number.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_number.png; path = Resources/contact_number.png; sourceTree = ""; }; + D37C639215AADDAE009D0BAC /* UIContactDetailsHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIContactDetailsHeader.h; sourceTree = ""; }; + D37C639315AADDAE009D0BAC /* UIContactDetailsHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIContactDetailsHeader.m; sourceTree = ""; }; + D37C639415AADDAF009D0BAC /* UIContactDetailsHeader.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UIContactDetailsHeader.xib; sourceTree = ""; }; + D37C639915AADEF4009D0BAC /* ContactDetailsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailsTableViewController.h; sourceTree = ""; }; + D37C639A15AADEF5009D0BAC /* ContactDetailsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailsTableViewController.m; sourceTree = ""; }; D37DC6BF1594AE1800B2A5EB /* LinphoneCoreSettingsStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinphoneCoreSettingsStore.h; sourceTree = ""; }; D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LinphoneCoreSettingsStore.m; sourceTree = ""; }; D37DC6C51594AE6F00B2A5EB /* IASKAppSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKAppSettingsViewController.h; sourceTree = ""; }; @@ -1322,8 +1354,6 @@ D3F83F751582253100336684 /* accept_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = accept_over.png; path = Resources/accept_over.png; sourceTree = ""; }; D3F83F761582253100336684 /* decline_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = decline_default.png; path = Resources/decline_default.png; sourceTree = ""; }; D3F83F771582253100336684 /* decline_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = decline_over.png; path = Resources/decline_over.png; sourceTree = ""; }; - D3F83F801582278D00336684 /* cancel_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cancel_default.png; path = Resources/cancel_default.png; sourceTree = ""; }; - D3F83F811582278D00336684 /* cancel_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cancel_over.png; path = Resources/cancel_over.png; sourceTree = ""; }; D3F83F8C158229C500336684 /* PhoneMainView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhoneMainView.h; sourceTree = ""; }; D3F83F8D15822ABD00336684 /* PhoneMainView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneMainView.m; sourceTree = ""; }; D3F83F9115824D3500336684 /* LinphoneApp.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LinphoneApp.xib; sourceTree = ""; }; @@ -1449,6 +1479,11 @@ 22E0A820111C44E100B04932 /* ConsoleViewController.h */, 22E0A81F111C44E100B04932 /* ConsoleViewController.m */, 22E0A81E111C44E100B04932 /* ConsoleViewController.xib */, + D37C639915AADEF4009D0BAC /* ContactDetailsTableViewController.h */, + D37C639A15AADEF5009D0BAC /* ContactDetailsTableViewController.m */, + D3128FDE15AABC7E00A2147A /* ContactDetailsViewController.h */, + D3128FDF15AABC7E00A2147A /* ContactDetailsViewController.m */, + D3128FE015AABC7E00A2147A /* ContactDetailsViewController.xib */, D3549814158761CF000081D8 /* ContactsTableViewController.h */, D3549815158761D0000081D8 /* ContactsTableViewController.m */, D35497FB15875372000081D8 /* ContactsViewController.h */, @@ -1744,6 +1779,9 @@ D3A55FBA15877E5E003FD403 /* UIContactCell.h */, D3A55FBB15877E5E003FD403 /* UIContactCell.m */, D3A55FBE15877E69003FD403 /* UIContactCell.xib */, + D37C639215AADDAE009D0BAC /* UIContactDetailsHeader.h */, + D37C639315AADDAE009D0BAC /* UIContactDetailsHeader.m */, + D37C639415AADDAF009D0BAC /* UIContactDetailsHeader.xib */, 2248E90C12F7E4CF00220D9C /* UIDigitButton.h */, 2248E90D12F7E4CF00220D9C /* UIDigitButton.m */, 22BB1A67132FF16A005CD7AA /* UIEraseButton.h */, @@ -1938,7 +1976,6 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( - D3D14E7B15A711700074A527 /* avatar_shadow_small.png */, D3F83F741582253100336684 /* accept_default.png */, D3F83F751582253100336684 /* accept_over.png */, D3D6A39B159B0EEF005F692C /* add_call_default.png */, @@ -1948,6 +1985,7 @@ D3ED3E6815861A53006C0DE4 /* add_contact_disabled.png */, D3ED3E6915861A53006C0DE4 /* add_contact_over.png */, D3F34F2F1599B008005BE94F /* avatar_shadow.png */, + D3D14E7B15A711700074A527 /* avatar_shadow_small.png */, D31B4B261598A390002E6C72 /* avatar_unknown.png */, D31B4B271598A390002E6C72 /* avatar_unknown_small.png */, D3211BBB159CBFD60098460B /* back_default.png */, @@ -1976,8 +2014,6 @@ D31C9C8D158A1C1000756B45 /* call_status_incoming.png */, D31C9C8E158A1C1000756B45 /* call_status_missed.png */, D31C9C8F158A1C1000756B45 /* call_status_outgoing.png */, - D3F83F801582278D00336684 /* cancel_default.png */, - D3F83F811582278D00336684 /* cancel_over.png */, D36C43CC158F2F370048BA40 /* cell_call.png */, D3211BB8159C8A820098460B /* cell_call_first.png */, D38D14AD15A30B3D008497E8 /* cell_call_first_hightlight.png */, @@ -2004,6 +2040,12 @@ D3B9A3DE15A58C450096EA4E /* chat_send_over.png */, D31AAF61159B5B6E002C6B02 /* conference_default.png */, D31AAF62159B5B6E002C6B02 /* conference_over.png */, + D3128FE715AABE4E00A2147A /* contact_back_default.png */, + D3128FE815AABE4E00A2147A /* contact_back_over.png */, + D3128FE915AABE4E00A2147A /* contact_edit_default.png */, + D3128FEA15AABE4E00A2147A /* contact_edit_over.png */, + D37C638D15AAD251009D0BAC /* contact_number.png */, + D37C638C15AAD251009D0BAC /* contact_number_over.png */, D354980E15875608000081D8 /* contacts_add_default.png */, D354980F15875608000081D8 /* contacts_add_over.png */, D354980315875534000081D8 /* contacts_all_default.png */, @@ -2442,8 +2484,6 @@ D3F83F7A1582253100336684 /* accept_over.png in Resources */, D3F83F7C1582253100336684 /* decline_default.png in Resources */, D3F83F7E1582253100336684 /* decline_over.png in Resources */, - D3F83F841582278D00336684 /* cancel_default.png in Resources */, - D3F83F861582278D00336684 /* cancel_over.png in Resources */, D3F83F9215824D3600336684 /* LinphoneApp.xib in Resources */, D3ED3E411585FB4A006C0DE4 /* numpad_background.png in Resources */, D3ED3E451585FB8C006C0DE4 /* dialer_address_background.png in Resources */, @@ -2595,6 +2635,14 @@ D389363B15A6D53200A3A3AA /* chat_bubble_outgoing.9.png in Resources */, D3D14E7915A70EE30074A527 /* UIChatRoomHeader.xib in Resources */, D3D14E7C15A711700074A527 /* avatar_shadow_small.png in Resources */, + D3128FE315AABC7E00A2147A /* ContactDetailsViewController.xib in Resources */, + D3128FEF15AABE4E00A2147A /* contact_back_default.png in Resources */, + D3128FF115AABE4E00A2147A /* contact_back_over.png in Resources */, + D3128FF315AABE4E00A2147A /* contact_edit_default.png in Resources */, + D3128FF515AABE4E00A2147A /* contact_edit_over.png in Resources */, + D37C638E15AAD251009D0BAC /* contact_number_over.png in Resources */, + D37C639015AAD251009D0BAC /* contact_number.png in Resources */, + D37C639715AADDAF009D0BAC /* UIContactDetailsHeader.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2663,8 +2711,6 @@ D3F83F7B1582253100336684 /* accept_over.png in Resources */, D3F83F7D1582253100336684 /* decline_default.png in Resources */, D3F83F7F1582253100336684 /* decline_over.png in Resources */, - D3F83F851582278D00336684 /* cancel_default.png in Resources */, - D3F83F871582278D00336684 /* cancel_over.png in Resources */, D3F83F9315824D3600336684 /* LinphoneApp.xib in Resources */, D3ED3E421585FB4A006C0DE4 /* numpad_background.png in Resources */, D3ED3E461585FB8C006C0DE4 /* dialer_address_background.png in Resources */, @@ -2815,6 +2861,14 @@ D389363C15A6D53200A3A3AA /* chat_bubble_outgoing.9.png in Resources */, D3D14E7A15A70EE30074A527 /* UIChatRoomHeader.xib in Resources */, D3D14E7D15A711700074A527 /* avatar_shadow_small.png in Resources */, + D3128FE415AABC7E00A2147A /* ContactDetailsViewController.xib in Resources */, + D3128FF015AABE4E00A2147A /* contact_back_default.png in Resources */, + D3128FF215AABE4E00A2147A /* contact_back_over.png in Resources */, + D3128FF415AABE4E00A2147A /* contact_edit_default.png in Resources */, + D3128FF615AABE4E00A2147A /* contact_edit_over.png in Resources */, + D37C638F15AAD251009D0BAC /* contact_number_over.png in Resources */, + D37C639115AAD251009D0BAC /* contact_number.png in Resources */, + D37C639815AADDAF009D0BAC /* UIContactDetailsHeader.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2897,6 +2951,9 @@ D389362615A6D19800A3A3AA /* CPAnimationSequence.m in Sources */, D389362815A6D19800A3A3AA /* CPAnimationStep.m in Sources */, D3D14E7715A70EE30074A527 /* UIChatRoomHeader.m in Sources */, + D3128FE115AABC7E00A2147A /* ContactDetailsViewController.m in Sources */, + D37C639515AADDAF009D0BAC /* UIContactDetailsHeader.m in Sources */, + D37C639B15AADEF6009D0BAC /* ContactDetailsTableViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2976,6 +3033,9 @@ D389362715A6D19800A3A3AA /* CPAnimationSequence.m in Sources */, D389362915A6D19800A3A3AA /* CPAnimationStep.m in Sources */, D3D14E7815A70EE30074A527 /* UIChatRoomHeader.m in Sources */, + D3128FE215AABC7E00A2147A /* ContactDetailsViewController.m in Sources */, + D37C639615AADDAF009D0BAC /* UIContactDetailsHeader.m in Sources */, + D37C639C15AADEF6009D0BAC /* ContactDetailsTableViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };