Merge branch 'master' into apple_store

This commit is contained in:
Guillaume BIENKOWSKI 2014-10-03 15:26:38 +02:00
commit 645a8a6969
86 changed files with 4337 additions and 2603 deletions

5
.gitmodules vendored
View file

@ -25,12 +25,14 @@
[submodule "submodules/externals/x264"]
path = submodules/externals/x264
url = git://git.videolan.org/x264.git
ignore = dirty
[submodule "submodules/msx264"]
path = submodules/msx264
url = git://git.linphone.org/msx264.git
[submodule "submodules/externals/libvpx"]
path = submodules/externals/libvpx
url = http://git.chromium.org/webm/libvpx.git
ignore = dirty
[submodule "submodules/bzrtp"]
path = submodules/bzrtp
url = git://git.linphone.org/bzrtp.git
@ -55,15 +57,18 @@
[submodule "submodules/externals/opus"]
path = submodules/externals/opus
url = git://git.opus-codec.org/opus.git
ignore = dirty
[submodule "submodules/externals/libxml2"]
path = submodules/externals/libxml2
url = git://git.gnome.org/libxml2
ignore = dirty
[submodule "submodules/cunit"]
path = submodules/cunit
url = git://git.linphone.org/cunit.git
[submodule "submodules/externals/openh264"]
path = submodules/externals/openh264
url = https://github.com/cisco/openh264
ignore = dirty
[submodule "submodules/msopenh264"]
path = submodules/msopenh264
url = git://git.linphone.org/msopenh264.git

View file

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1072" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChatViewController">
@ -91,14 +90,11 @@
</textField>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
<tableViewController autoresizesArchivedViewToFullSize="NO" id="4" userLabel="tableController" customClass="ChatTableViewController">
<extendedEdge key="edgesForExtendedLayout"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
<nil key="simulatedDestinationMetrics"/>
<connections>
<outlet property="view" destination="6" id="13"/>
</connections>
@ -113,4 +109,9 @@
<image name="field_background.png" width="542" height="88"/>
<image name="toolsbar_background.png" width="5" height="88"/>
</resources>
</document>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1072" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ContactsViewController">
@ -11,6 +11,7 @@
<outlet property="allButton" destination="4" id="27"/>
<outlet property="backButton" destination="87" id="90"/>
<outlet property="linphoneButton" destination="5" id="31"/>
<outlet property="searchBar" destination="5jE-oF-d45" id="xfS-xo-2Bm"/>
<outlet property="toolBar" destination="3" id="n95-dF-EoN"/>
<outlet property="view" destination="2" id="16"/>
</connections>
@ -21,7 +22,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" id="3" userLabel="toolBar">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="88"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="toolsbar_background.png" id="92" userLabel="background">
@ -109,11 +110,21 @@
<action selector="onBackClick:" destination="-1" eventType="touchUpInside" id="89"/>
</connections>
</button>
<searchBar contentMode="redraw" id="5jE-oF-d45" userLabel="searchBar">
<rect key="frame" x="0.0" y="44" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textInputTraits key="textInputTraits"/>
<connections>
<outlet property="delegate" destination="-1" id="4jL-Rv-dW7"/>
</connections>
</searchBar>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
</objects>
<resources>
@ -127,4 +138,9 @@
<image name="contacts_linphone_selected.png" width="213" height="88"/>
<image name="toolsbar_background.png" width="5" height="88"/>
</resources>
</document>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1072" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DialerViewController">
@ -63,7 +63,7 @@
<rect key="frame" x="0.0" y="58" width="320" height="260"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="38" userLabel="1" customClass="UIDigitButton">
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="38" userLabel="1" customClass="UIDigitButtonLongVoiceMail">
<rect key="frame" x="0.0" y="11" width="107" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.40000001000000002" green="1" blue="1" alpha="0.0" colorSpace="calibratedRGB"/>
@ -194,7 +194,7 @@
<outlet property="addressField" destination="4" id="249"/>
</connections>
</button>
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="40" userLabel="0" customClass="UIDigitButton">
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="40" userLabel="0" customClass="UIDigitButtonLongPlus">
<rect key="frame" x="107" y="197" width="106" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="0"/>
@ -316,6 +316,8 @@
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
</objects>
<resources>
@ -363,4 +365,9 @@
<image name="transfer_call_disabled.png" width="214" height="138"/>
<image name="transfer_call_over.png" width="214" height="138"/>
</resources>
</document>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="5056" systemVersion="13C1021" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DialerViewController">
@ -111,7 +111,7 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="280"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="19" userLabel="1" customClass="UIDigitButton">
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="19" userLabel="1" customClass="UIDigitButtonLongVoiceMail">
<rect key="frame" x="0.0" y="11" width="107" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.40000001000000002" green="1" blue="1" alpha="0.0" colorSpace="calibratedRGB"/>
@ -242,7 +242,7 @@
<outlet property="addressField" destination="6" id="35"/>
</connections>
</button>
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="10" userLabel="0" customClass="UIDigitButton">
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="10" userLabel="0" customClass="UIDigitButtonLongPlus">
<rect key="frame" x="107" y="197" width="106" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="0"/>
@ -350,6 +350,8 @@
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
</objects>
<resources>
@ -401,4 +403,9 @@
<image name="transfer_call_disabled.png" width="371" height="170"/>
<image name="transfer_call_over.png" width="371" height="170"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

View file

@ -73,7 +73,7 @@
- (void)addChatEntry:(LinphoneChatMessage*)chat {
messageList = ms_list_append(messageList, chat);
messageList = ms_list_append(messageList, linphone_chat_message_ref(chat));
int pos = ms_list_size(messageList) - 1;
[self.tableView beginUpdates];

View file

@ -333,7 +333,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta
[LinphoneManager setValueInMessageAppData:[internalUrl absoluteString] forKey:@"localimage" inMessage:msg];
}
[tableController addChatEntry:linphone_chat_message_ref(msg)];
[tableController addChatEntry:msg];
[tableController scrollToBottom:true];
return TRUE;
}
@ -790,12 +790,13 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta
[UIView setAnimationCurve:curve];
[UIView setAnimationBeginsFromCurrentState:TRUE];
if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
if(([[UIDevice currentDevice].systemVersion floatValue] < 8) &&
UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
int width = endFrame.size.height;
endFrame.size.height = endFrame.size.width;
endFrame.size.width = width;
}
// Resize chat view
{
CGRect viewFrame = [[self view] frame];

View file

@ -110,11 +110,22 @@ static UICompositeViewDescription *compositeDescription = nil;
-(void) startChatRoom {
//Push ChatRoom
LinphoneChatRoom* room = linphone_core_get_or_create_chat_room([LinphoneManager getLc], [addressField.text UTF8String]);
if( room != nil ){
ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController);
if(controller != nil) {
LinphoneChatRoom* room = linphone_core_get_or_create_chat_room([LinphoneManager getLc], [addressField.text UTF8String]);
[controller setChatRoom:room];
}
} else {
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid address", nil)
message:@"Please specify the entire SIP address for the chat"
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
otherButtonTitles:nil];
[alert show];
[alert release];
}
addressField.text = @"";
}
@ -123,7 +134,8 @@ static UICompositeViewDescription *compositeDescription = nil;
[ContactSelection setSelectionMode:ContactSelectionModeMessage];
[ContactSelection setAddAddress:nil];
[ContactSelection setSipFilter: [LinphoneManager instance].contactFilter];
[ContactSelection setEmailFilter:FALSE];
[ContactSelection enableEmailFilter:FALSE];
[ContactSelection setNameOrEmailFilter:nil];
[[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE];
} else {
[self startChatRoom];

View file

@ -74,6 +74,12 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
- (void)initContactDetailsTableViewController {
dataCache = [[NSMutableArray alloc] init];
// pre-fill the data-cache with empty arrays
for(int i=ContactSections_Number; i< ContactSections_MAX; i++){
[dataCache addObject:@[]];
}
labelArray = [[NSMutableArray alloc] initWithObjects:
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"],
[NSString stringWithString:(NSString*)kABPersonPhoneMobileLabel],
@ -201,7 +207,8 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
if(CFStringCompare((CFStringRef)[LinphoneManager instance].contactSipField, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) {
add = true;
}
} else { //check domain
} else {
//check domain
LinphoneAddress* address = linphone_address_new([(NSString*)CFDictionaryGetValue(lDict,kABPersonInstantMessageUsernameKey) UTF8String]);
if (address) {
if ([[ContactSelection getSipFilter] compare:@"*" options:NSCaseInsensitiveSearch] == NSOrderedSame) {

View file

@ -4,18 +4,18 @@
*
* 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
* 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 "ContactsTableViewController.h"
#import "UIContactCell.h"
@ -33,237 +33,273 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf
#pragma mark - Lifecycle Functions
- (void)initContactsTableViewController {
addressBookMap = [[OrderedDictionary alloc] init];
avatarMap = [[NSMutableDictionary alloc] init];
addressBook = ABAddressBookCreateWithOptions(nil, nil);
ABAddressBookRegisterExternalChangeCallback(addressBook, sync_address_book, self);
addressBookMap = [[OrderedDictionary alloc] init];
avatarMap = [[NSMutableDictionary alloc] init];
addressBook = ABAddressBookCreateWithOptions(nil, nil);
ABAddressBookRegisterExternalChangeCallback(addressBook, sync_address_book, self);
}
- (id)init {
self = [super init];
if (self) {
self = [super init];
if (self) {
[self initContactsTableViewController];
}
return self;
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
self = [super initWithCoder:decoder];
if (self) {
[self initContactsTableViewController];
}
return self;
}
return self;
}
- (void)dealloc {
ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, self);
CFRelease(addressBook);
[addressBookMap release];
[avatarMap release];
[super dealloc];
ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, self);
CFRelease(addressBook);
[addressBookMap release];
[avatarMap release];
[super dealloc];
}
#pragma mark -
#pragma mark -
- (BOOL)contactHasValidSipDomain:(ABRecordRef)person {
// Check if one of the contact' sip URI matches the expected SIP filter
ABMultiValueRef personSipAddresses = ABRecordCopyValue(person, kABPersonInstantMessageProperty);
BOOL match = false;
NSString * filter = [ContactSelection getSipFilter];
for(int i = 0; i < ABMultiValueGetCount(personSipAddresses) && !match; ++i) {
CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(personSipAddresses, i);
if(CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) {
CFStringRef serviceKey = CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey);
if (CFStringCompare((CFStringRef)[LinphoneManager instance].contactSipField, serviceKey, kCFCompareCaseInsensitive) == 0) {
match = true;
}
} else {
//check domain
LinphoneAddress* address = linphone_address_new([(NSString*)CFDictionaryGetValue(lDict,kABPersonInstantMessageUsernameKey) UTF8String]);
if (address) {
NSString* domain = [NSString stringWithCString:linphone_address_get_domain(address)
encoding:[NSString defaultCStringEncoding]];
if (([filter compare:@"*" options:NSCaseInsensitiveSearch] == NSOrderedSame)
|| ([filter compare:domain options:NSCaseInsensitiveSearch] == NSOrderedSame)) {
match = true;
}
linphone_address_destroy(address);
}
}
CFRelease(lDict);
}
return match;
}
static int ms_strcmpfuz(const char * fuzzy_word, const char * sentence) {
if (! fuzzy_word || !sentence) {
return fuzzy_word == sentence;
}
const char * c = fuzzy_word;
const char * within_sentence = sentence;
for (; c != NULL && *c != '\0' && within_sentence != NULL; ++c) {
within_sentence = strchr(within_sentence, *c);
// Could not find c character in sentence. Abort.
if (within_sentence == NULL) {
break;
}
// since strchr returns the index of the matched char, move forward
within_sentence++;
}
// If the whole fuzzy was found, returns 0. Otherwise returns number of characters left.
return (within_sentence != NULL ? 0 : fuzzy_word + strlen(fuzzy_word) - c);
}
- (void)loadData {
[LinphoneLogger logc:LinphoneLoggerLog format:"Load contact list"];
@synchronized (addressBookMap) {
// Reset Address book
[addressBookMap removeAllObjects];
NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);
for (id lPerson in lContacts) {
BOOL add = true;
if([ContactSelection getSipFilter] || [ContactSelection getEmailFilter]) {
add = false;
}
if([ContactSelection getSipFilter]) {
ABMultiValueRef lMap = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonInstantMessageProperty);
for(int i = 0; i < ABMultiValueGetCount(lMap); ++i) {
CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i);
if(CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) {
CFStringRef serviceKey = CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey);
CFStringRef username = username=CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey);
if(CFStringCompare((CFStringRef)[LinphoneManager instance].contactSipField, serviceKey, kCFCompareCaseInsensitive) == 0) {
add = true;
} else {
add=false;
[LinphoneLogger logc:LinphoneLoggerLog format:"Load contact list"];
@synchronized (addressBookMap) {
// Reset Address book
[addressBookMap removeAllObjects];
NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);
for (id lPerson in lContacts) {
BOOL add = true;
ABRecordRef person = (ABRecordRef)lPerson;
// Do not add the contact directly if we set some filter
if([ContactSelection getSipFilter] || [ContactSelection emailFilterEnabled]) {
add = false;
}
if([ContactSelection getSipFilter] && [self contactHasValidSipDomain:person]) {
add = true;
}
if (!add && [ContactSelection emailFilterEnabled]) {
ABMultiValueRef personEmailAddresses = ABRecordCopyValue(person, kABPersonEmailProperty);
// Add this contact if it has an email
add = (ABMultiValueGetCount(personEmailAddresses) > 0);
CFRelease(personEmailAddresses);
}
if(add) {
CFStringRef lFirstName = ABRecordCopyValue(person, kABPersonFirstNameProperty);
CFStringRef lLocalizedFirstName = (lFirstName != nil)? ABAddressBookCopyLocalizedLabel(lFirstName): nil;
CFStringRef lLastName = ABRecordCopyValue(person, kABPersonLastNameProperty);
CFStringRef lLocalizedLastName = (lLastName != nil)? ABAddressBookCopyLocalizedLabel(lLastName): nil;
CFStringRef lOrganization = ABRecordCopyValue(person, kABPersonOrganizationProperty);
CFStringRef lLocalizedlOrganization = (lOrganization != nil)? ABAddressBookCopyLocalizedLabel(lOrganization): 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]];
} else if(lLocalizedlOrganization != nil) {
name=[NSString stringWithFormat:@"%@",[(NSString *)lLocalizedlOrganization retain]];
}
if(name != nil && [name length] > 0) {
// Add the contact only if it fuzzy match filter too (if any)
if ([ContactSelection getNameOrEmailFilter] == nil ||
(ms_strcmpfuz([[[ContactSelection getNameOrEmailFilter] lowercaseString] UTF8String], [[name lowercaseString] UTF8String]) == 0)) {
// Put in correct subDic
NSString *firstChar = [[name substringToIndex:1] uppercaseString];
if([firstChar characterAtIndex:0] < 'A' || [firstChar characterAtIndex:0] > 'Z') {
firstChar = @"#";
}
} else {
//check domain
LinphoneAddress* address = linphone_address_new([(NSString*)CFDictionaryGetValue(lDict,kABPersonInstantMessageUsernameKey) UTF8String]);
if (address) {
if ([[ContactSelection getSipFilter] compare:@"*" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
add = true;
} else {
NSString* domain = [NSString stringWithCString:linphone_address_get_domain(address)
encoding:[NSString defaultCStringEncoding]];
add = [domain compare:[ContactSelection getSipFilter] options:NSCaseInsensitiveSearch] == NSOrderedSame;
}
linphone_address_destroy(address);
} else {
add = false;
}
}
CFRelease(lDict);
}
CFRelease(lMap);
}
if ((add == false) && [ContactSelection getEmailFilter]) {
ABMultiValueRef lMap = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonEmailProperty);
if (ABMultiValueGetCount(lMap) > 0) {
add = true;
}
CFRelease(lMap);
}
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;
CFStringRef lOrganization = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonOrganizationProperty);
CFStringRef lLocalizedlOrganization = (lOrganization != nil)? ABAddressBookCopyLocalizedLabel(lOrganization): 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]];
} else if(lLocalizedlOrganization != nil) {
name=[NSString stringWithFormat:@"%@",[(NSString *)lLocalizedlOrganization retain]];
}
if(name != nil && [name length] > 0) {
// Put in correct subDic
NSString *firstChar = [[name substringToIndex:1] uppercaseString];
if([firstChar characterAtIndex:0] < 'A' || [firstChar characterAtIndex:0] > 'Z') {
firstChar = @"#";
}
OrderedDictionary *subDic =[addressBookMap objectForKey: firstChar];
if(subDic == nil) {
subDic = [[[OrderedDictionary alloc] init] autorelease];
[addressBookMap insertObject:subDic forKey:firstChar selector:@selector(caseInsensitiveCompare:)];
}
[subDic insertObject:lPerson forKey:name selector:@selector(caseInsensitiveCompare:)];
}
if(lLocalizedlOrganization != nil)
CFRelease(lLocalizedlOrganization);
if(lOrganization != nil)
CFRelease(lOrganization);
if(lLocalizedLastName != nil)
CFRelease(lLocalizedLastName);
if(lLastName != nil)
CFRelease(lLastName);
if(lLocalizedFirstName != nil)
CFRelease(lLocalizedFirstName);
if(lFirstName != nil)
CFRelease(lFirstName);
}
}
if (lContacts) CFRelease(lContacts);
}
[self.tableView reloadData];
OrderedDictionary *subDic =[addressBookMap objectForKey: firstChar];
if(subDic == nil) {
subDic = [[[OrderedDictionary alloc] init] autorelease];
[addressBookMap insertObject:subDic forKey:firstChar selector:@selector(caseInsensitiveCompare:)];
}
[subDic insertObject:lPerson forKey:name selector:@selector(caseInsensitiveCompare:)];
}
}
if(lLocalizedlOrganization != nil)
CFRelease(lLocalizedlOrganization);
if(lOrganization != nil)
CFRelease(lOrganization);
if(lLocalizedLastName != nil)
CFRelease(lLocalizedLastName);
if(lLastName != nil)
CFRelease(lLastName);
if(lLocalizedFirstName != nil)
CFRelease(lLocalizedFirstName);
if(lFirstName != nil)
CFRelease(lFirstName);
}
}
if (lContacts)
CFRelease(lContacts);
}
[self.tableView reloadData];
}
static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) {
ContactsTableViewController* controller = (ContactsTableViewController*)context;
ABAddressBookRevert(addressBook);
[controller->avatarMap removeAllObjects];
[controller loadData];
ContactsTableViewController* controller = (ContactsTableViewController*)context;
ABAddressBookRevert(addressBook);
[controller->avatarMap removeAllObjects];
[controller loadData];
}
#pragma mark - ViewController Functions
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[super viewWillDisappear:animated];
}
#pragma mark - UITableViewDataSource Functions
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
return [addressBookMap allKeys];
return [addressBookMap allKeys];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [addressBookMap count];
return [addressBookMap count];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [(OrderedDictionary *)[addressBookMap objectForKey: [addressBookMap keyAtIndex: section]] count];
return [(OrderedDictionary *)[addressBookMap objectForKey: [addressBookMap keyAtIndex: section]] count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *kCellId = @"UIContactCell";
UIContactCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId];
if (cell == nil) {
cell = [[[UIContactCell alloc] initWithIdentifier:kCellId] autorelease];
// Background View
UACellBackgroundView *selectedBackgroundView = [[[UACellBackgroundView alloc] initWithFrame:CGRectZero] autorelease];
cell.selectedBackgroundView = selectedBackgroundView;
[selectedBackgroundView setBackgroundColor:LINPHONE_TABLE_CELL_BACKGROUND_COLOR];
}
OrderedDictionary *subDic = [addressBookMap objectForKey: [addressBookMap keyAtIndex: [indexPath section]]];
NSString *key = [[subDic allKeys] objectAtIndex:[indexPath row]];
ABRecordRef contact = [subDic objectForKey:key];
// Cached avatar
UIImage *image = nil;
id data = [avatarMap objectForKey:[NSNumber numberWithInt: ABRecordGetRecordID(contact)]];
if(data == nil) {
image = [FastAddressBook getContactImage:contact thumbnail:true];
if(image != nil) {
[avatarMap setObject:image forKey:[NSNumber numberWithInt: ABRecordGetRecordID(contact)]];
} else {
[avatarMap setObject:[NSNull null] forKey:[NSNumber numberWithInt: ABRecordGetRecordID(contact)]];
}
} else if(data != [NSNull null]) {
image = data;
}
if(image == nil) {
image = [UIImage imageNamed:@"avatar_unknown_small.png"];
}
[[cell avatarImage] setImage:image];
[cell setContact: contact];
return cell;
static NSString *kCellId = @"UIContactCell";
UIContactCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId];
if (cell == nil) {
cell = [[[UIContactCell alloc] initWithIdentifier:kCellId] autorelease];
// Background View
UACellBackgroundView *selectedBackgroundView = [[[UACellBackgroundView alloc] initWithFrame:CGRectZero] autorelease];
cell.selectedBackgroundView = selectedBackgroundView;
[selectedBackgroundView setBackgroundColor:LINPHONE_TABLE_CELL_BACKGROUND_COLOR];
}
OrderedDictionary *subDic = [addressBookMap objectForKey: [addressBookMap keyAtIndex: [indexPath section]]];
NSString *key = [[subDic allKeys] objectAtIndex:[indexPath row]];
ABRecordRef contact = [subDic objectForKey:key];
// Cached avatar
UIImage *image = nil;
id data = [avatarMap objectForKey:[NSNumber numberWithInt: ABRecordGetRecordID(contact)]];
if(data == nil) {
image = [FastAddressBook getContactImage:contact thumbnail:true];
if(image != nil) {
[avatarMap setObject:image forKey:[NSNumber numberWithInt: ABRecordGetRecordID(contact)]];
} else {
[avatarMap setObject:[NSNull null] forKey:[NSNumber numberWithInt: ABRecordGetRecordID(contact)]];
}
} else if(data != [NSNull null]) {
image = data;
}
if(image == nil) {
image = [UIImage imageNamed:@"avatar_unknown_small.png"];
}
[[cell avatarImage] setImage:image];
[cell setContact: contact];
return cell;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
return [addressBookMap keyAtIndex: section];
return [addressBookMap keyAtIndex: section];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
OrderedDictionary *subDic = [addressBookMap objectForKey: [addressBookMap keyAtIndex: [indexPath section]]];
ABRecordRef lPerson = [subDic objectForKey: [subDic keyAtIndex:[indexPath row]]];
// Go to Contact details view
ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE], ContactDetailsViewController);
if(controller != nil) {
if([ContactSelection getSelectionMode] != ContactSelectionModeEdit) {
[controller setContact:lPerson];
} else {
[controller editContact:lPerson address:[ContactSelection getAddAddress]];
}
}
OrderedDictionary *subDic = [addressBookMap objectForKey: [addressBookMap keyAtIndex: [indexPath section]]];
ABRecordRef lPerson = [subDic objectForKey: [subDic keyAtIndex:[indexPath row]]];
// Go to Contact details view
ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE], ContactDetailsViewController);
if(controller != nil) {
if([ContactSelection getSelectionMode] != ContactSelectionModeEdit) {
[controller setContact:lPerson];
} else {
[controller editContact:lPerson address:[ContactSelection getAddAddress]];
}
}
}
#pragma mark - UITableViewDelegate Functions
- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
// Detemine if it's in editing mode
if (self.editing) {
return UITableViewCellEditingStyleDelete;
}
return UITableViewCellEditingStyleNone;
// Detemine if it's in editing mode
if (self.editing) {
return UITableViewCellEditingStyleDelete;
}
return UITableViewCellEditingStyleNone;
}
@end

View file

@ -4,18 +4,18 @@
*
* 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
* 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 <UIKit/UIKit.h>
#import <AddressBookUI/ABPeoplePickerNavigationController.h>
@ -30,18 +30,48 @@ typedef enum _ContactSelectionMode {
ContactSelectionModeMessage
} ContactSelectionMode;
@interface ContactSelection : NSObject {
@interface ContactSelection : NSObject <UISearchBarDelegate> {
}
+ (void)setSelectionMode:(ContactSelectionMode)selectionMode;
+ (ContactSelectionMode)getSelectionMode;
+ (void)setAddAddress:(NSString*)address;
+ (NSString*)getAddAddress;
/* define sip filter, can be * or sip domain*/
/*!
* Filters contacts by SIP domain.
* @param domain SIP domain to filter. Use @"*" or nil to disable it.
*/
+ (void)setSipFilter:(NSString*) domain;
/*!
* Weither contacts are filtered by SIP domain or not.
* @return the filter used, or nil if none.
*/
+ (NSString*)getSipFilter;
+ (void)setEmailFilter:(BOOL)enable;
+ (BOOL)getEmailFilter;
/*!
* Weither always keep contacts with an email address or not.
* @param enable TRUE if you want to always keep contacts with an email.
*/
+ (void)enableEmailFilter:(BOOL)enable;
/*!
* Weither always keep contacts with an email address or not.
* @return TRUE if this behaviour is enabled.
*/
+ (BOOL)emailFilterEnabled;
/*!
* Filters contacts by name and/or email fuzzy matching pattern.
* @param fuzzyName fuzzy word to match. Use nil to disable it.
*/
+ (void)setNameOrEmailFilter:(NSString*)fuzzyName;
/*!
* Weither contacts are filtered by name and/or email.
* @return the filter used, or nil if none.
*/
+ (NSString*)getNameOrEmailFilter;
@end
@ -57,10 +87,12 @@ typedef enum _ContactSelectionMode {
@property (nonatomic, retain) IBOutlet UIButton* linphoneButton;
@property (nonatomic, retain) IBOutlet UIButton *backButton;
@property (nonatomic, retain) IBOutlet UIButton *addButton;
@property (retain, nonatomic) IBOutlet UISearchBar *searchBar;
- (IBAction)onAllClick:(id)event;
- (IBAction)onLinphoneClick:(id)event;
- (IBAction)onAddContactClick:(id)event;
- (IBAction)onBackClick:(id)event;
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText;
@end

View file

@ -4,18 +4,18 @@
*
* 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
* 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 "ContactsViewController.h"
#import "PhoneMainView.h"
@ -28,47 +28,58 @@
static ContactSelectionMode sSelectionMode = ContactSelectionModeNone;
static NSString* sAddAddress = nil;
static NSString* sSipFilter = nil;
static BOOL sEmailFilter = FALSE;
static BOOL sEnableEmailFilter = FALSE;
static NSString* sNameOrEmailFilter;
+ (void)setSelectionMode:(ContactSelectionMode)selectionMode {
sSelectionMode = selectionMode;
sSelectionMode = selectionMode;
}
+ (ContactSelectionMode)getSelectionMode {
return sSelectionMode;
return sSelectionMode;
}
+ (void)setAddAddress:(NSString*)address {
if(sAddAddress != nil) {
[sAddAddress release];
sAddAddress= nil;
}
if(address != nil) {
sAddAddress = [address retain];
}
if(sAddAddress != nil) {
[sAddAddress release];
sAddAddress= nil;
}
if(address != nil) {
sAddAddress = [address retain];
}
}
+ (NSString*)getAddAddress {
return sAddAddress;
return sAddAddress;
}
+ (void)setSipFilter:(NSString*)domain {
[sSipFilter release];
[sSipFilter release];
sSipFilter = [domain retain];
}
+ (NSString*)getSipFilter {
return sSipFilter;
return sSipFilter;
}
+ (void)setEmailFilter:(BOOL)enable {
sEmailFilter = enable;
+ (void)enableEmailFilter:(BOOL)enable {
sEnableEmailFilter = enable;
}
+ (BOOL)getEmailFilter {
return sEmailFilter;
+ (BOOL)emailFilterEnabled {
return sEnableEmailFilter;
}
+ (void)setNameOrEmailFilter:(NSString*)fuzzyName {
[sNameOrEmailFilter release];
sNameOrEmailFilter = [fuzzyName retain];
}
+ (NSString*)getNameOrEmailFilter {
return sNameOrEmailFilter;
}
@end
@implementation ContactsViewController
@ -85,28 +96,30 @@ static BOOL sEmailFilter = FALSE;
@synthesize toolBar;
typedef enum _HistoryView {
History_All,
History_Linphone,
History_MAX
History_All,
History_Linphone,
History_Search,
History_MAX
} HistoryView;
#pragma mark - Lifecycle Functions
- (id)init {
return [super initWithNibName:@"ContactsViewController" bundle:[NSBundle mainBundle]];
return [super initWithNibName:@"ContactsViewController" bundle:[NSBundle mainBundle]];
}
- (void)dealloc {
[tableController release];
[tableView release];
[allButton release];
[linphoneButton release];
[backButton release];
[addButton release];
[super dealloc];
[tableController release];
[tableView release];
[allButton release];
[linphoneButton release];
[backButton release];
[addButton release];
[_searchBar release];
[super dealloc];
}
#pragma mark - UICompositeViewDelegate Functions
@ -114,181 +127,181 @@ typedef enum _HistoryView {
static UICompositeViewDescription *compositeDescription = nil;
+ (UICompositeViewDescription *)compositeViewDescription {
if(compositeDescription == nil) {
compositeDescription = [[UICompositeViewDescription alloc] init:@"Contacts"
content:@"ContactsViewController"
stateBar:nil
stateBarEnabled:false
tabBar:@"UIMainBar"
tabBarEnabled:true
fullscreen:false
landscapeMode:[LinphoneManager runningOnIpad]
portraitMode:true];
}
return compositeDescription;
if(compositeDescription == nil) {
compositeDescription = [[UICompositeViewDescription alloc] init:@"Contacts"
content:@"ContactsViewController"
stateBar:nil
stateBarEnabled:false
tabBar:@"UIMainBar"
tabBarEnabled:true
fullscreen:false
landscapeMode:[LinphoneManager runningOnIpad]
portraitMode:true];
}
return compositeDescription;
}
#pragma mark - ViewController Functions
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[super viewWillDisappear:animated];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
BOOL use_system = [[LinphoneManager instance] lpConfigBoolForKey:@"use_system_contacts"];
if( use_system && !self.sysViewController){// use system contacts
ABPeoplePickerNavigationController* picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
picker.view.frame = self.view.frame;
[super viewWillAppear:animated];
[self.view addSubview:picker.view];
BOOL use_system = [[LinphoneManager instance] lpConfigBoolForKey:@"use_system_contacts"];
if( use_system && !self.sysViewController){// use system contacts
ABPeoplePickerNavigationController* picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
picker.view.frame = self.view.frame;
self.sysViewController = picker;
[self.view addSubview:picker.view];
} else if( !use_system && !self.tableController ){
self.sysViewController = picker;
CGRect subViewFrame= self.view.frame;
// let the toolBar be visible
subViewFrame.origin.y += self.toolBar.frame.size.height;
subViewFrame.size.height -= self.toolBar.frame.size.height;
} else if( !use_system && !self.tableController ){
self.tableController = [[[ContactsTableViewController alloc] init] autorelease];
self.tableView = [[[UITableView alloc] init] autorelease];
CGRect subViewFrame= self.view.frame;
// let the toolBar be visible
subViewFrame.origin.y += self.toolBar.frame.size.height;
subViewFrame.size.height -= self.toolBar.frame.size.height;
self.tableController.view = self.tableView;
self.tableView.frame = subViewFrame;
self.tableController = [[[ContactsTableViewController alloc] init] autorelease];
self.tableView = [[[UITableView alloc] init] autorelease];
self.tableView.dataSource = self.tableController;
self.tableView.delegate = self.tableController;
self.tableController.view = self.tableView;
self.tableView.frame = subViewFrame;
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight |
UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleBottomMargin |
UIViewAutoresizingFlexibleLeftMargin |
UIViewAutoresizingFlexibleRightMargin;
self.tableView.dataSource = self.tableController;
self.tableView.delegate = self.tableController;
[self.view addSubview:tableView];
[self update];
}
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight |
UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleBottomMargin |
UIViewAutoresizingFlexibleLeftMargin |
UIViewAutoresizingFlexibleRightMargin;
[self.view addSubview:tableView];
[self update];
}
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if(![FastAddressBook isAuthorized]) {
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Address book",nil)
[super viewDidAppear:animated];
if(![FastAddressBook isAuthorized]) {
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Address book",nil)
message:NSLocalizedString(@"You must authorize the application to have access to address book.\n"
"Toggle the application in Settings > Privacy > Contacts",nil)
"Toggle the application in Settings > Privacy > Contacts",nil)
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil];
[error show];
[error release];
[[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]];
}
[[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]];
}
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[super viewDidDisappear:animated];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self changeView:History_All];
// Set selected+over background: IB lack !
[linphoneButton setBackgroundImage:[UIImage imageNamed:@"contacts_linphone_selected.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
[linphoneButton setTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]
[super viewDidLoad];
[self changeView:History_All];
// Set selected+over background: IB lack !
[linphoneButton setBackgroundImage:[UIImage imageNamed:@"contacts_linphone_selected.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
[linphoneButton setTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]
forState:UIControlStateNormal];
[LinphoneUtils buttonFixStates:linphoneButton];
// Set selected+over background: IB lack !
[allButton setBackgroundImage:[UIImage imageNamed:@"contacts_all_selected.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
[LinphoneUtils buttonFixStates:allButton];
[tableController.tableView setBackgroundColor:[UIColor clearColor]]; // Can't do it in Xib: issue with ios4
[tableController.tableView setBackgroundView:nil]; // Can't do it in Xib: issue with ios4
// Set selected+over background: IB lack !
[allButton setBackgroundImage:[UIImage imageNamed:@"contacts_all_selected.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
[LinphoneUtils buttonFixStates:allButton];
[tableController.tableView setBackgroundColor:[UIColor clearColor]]; // Can't do it in Xib: issue with ios4
[tableController.tableView setBackgroundView:nil]; // Can't do it in Xib: issue with ios4
}
#pragma mark -
- (void)changeView:(HistoryView)view {
if(view == History_All) {
[ContactSelection setSipFilter:nil];
[ContactSelection setEmailFilter:FALSE];
[tableController loadData];
allButton.selected = TRUE;
} else {
allButton.selected = FALSE;
}
if(view == History_All) {
[ContactSelection setSipFilter:nil];
[ContactSelection enableEmailFilter:FALSE];
[tableController loadData];
allButton.selected = TRUE;
} else {
allButton.selected = FALSE;
}
if(view == History_Linphone) {
[ContactSelection setSipFilter:[LinphoneManager instance].contactFilter];
[ContactSelection setEmailFilter:FALSE];
[tableController loadData];
linphoneButton.selected = TRUE;
} else {
linphoneButton.selected = FALSE;
}
if(view == History_Linphone) {
[ContactSelection setSipFilter:[LinphoneManager instance].contactFilter];
[ContactSelection enableEmailFilter:FALSE];
[tableController loadData];
linphoneButton.selected = TRUE;
} else {
linphoneButton.selected = FALSE;
}
}
- (void)update {
switch ([ContactSelection getSelectionMode]) {
case ContactSelectionModePhone:
case ContactSelectionModeMessage:
[addButton setHidden:TRUE];
[backButton setHidden:FALSE];
break;
default:
[addButton setHidden:FALSE];
[backButton setHidden:TRUE];
break;
}
if([ContactSelection getSipFilter]) {
allButton.selected = FALSE;
linphoneButton.selected = TRUE;
} else {
allButton.selected = TRUE;
linphoneButton.selected = FALSE;
}
[tableController loadData];
switch ([ContactSelection getSelectionMode]) {
case ContactSelectionModePhone:
case ContactSelectionModeMessage:
[addButton setHidden:TRUE];
[backButton setHidden:FALSE];
break;
default:
[addButton setHidden:FALSE];
[backButton setHidden:TRUE];
break;
}
if([ContactSelection getSipFilter]) {
allButton.selected = FALSE;
linphoneButton.selected = TRUE;
} else {
allButton.selected = TRUE;
linphoneButton.selected = FALSE;
}
[tableController loadData];
}
#pragma mark - Action Functions
- (IBAction)onAllClick:(id)event {
[self changeView: History_All];
[self changeView: History_All];
}
- (IBAction)onLinphoneClick:(id)event {
[self changeView: History_Linphone];
[self changeView: History_Linphone];
}
- (IBAction)onAddContactClick:(id)event {
// Go to Contact details view
ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE], ContactDetailsViewController);
if(controller != nil) {
if([ContactSelection getAddAddress] == nil) {
[controller newContact];
} else {
[controller newContact:[ContactSelection getAddAddress]];
}
}
// Go to Contact details view
ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE], ContactDetailsViewController);
if(controller != nil) {
if([ContactSelection getAddAddress] == nil) {
[controller newContact];
} else {
[controller newContact:[ContactSelection getAddAddress]];
}
}
}
- (IBAction)onBackClick:(id)event {
[[PhoneMainView instance] popCurrentView];
[[PhoneMainView instance] popCurrentView];
}
@ -296,8 +309,8 @@ static UICompositeViewDescription *compositeDescription = nil;
-(void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker
{
[[PhoneMainView instance] popCurrentView];
return;
[[PhoneMainView instance] popCurrentView];
return;
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
@ -314,19 +327,23 @@ static UICompositeViewDescription *compositeDescription = nil;
CFTypeRef multiValue = ABRecordCopyValue(person, property);
CFIndex valueIdx = ABMultiValueGetIndexForIdentifier(multiValue,identifier);
NSString *phoneNumber = (NSString *)ABMultiValueCopyValueAtIndex(multiValue, valueIdx);
// Go to dialer view
DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController);
if(controller != nil) {
[controller call:phoneNumber displayName:[(NSString*)ABRecordCopyCompositeName(person) autorelease]];
}
[phoneNumber release];
CFRelease(multiValue);
// Go to dialer view
DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController);
if(controller != nil) {
[controller call:phoneNumber displayName:[(NSString*)ABRecordCopyCompositeName(person) autorelease]];
}
[phoneNumber release];
CFRelease(multiValue);
return false;
}
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
[ContactSelection setNameOrEmailFilter:searchText];
[tableController loadData];
}
- (void)viewDidUnload {
[self setToolBar:nil];
[super viewDidUnload];
[self setToolBar:nil];
[super viewDidUnload];
}
@end

View file

@ -4,18 +4,18 @@
*
* 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
* 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 <AVFoundation/AVAudioSession.h>
#import <AudioToolbox/AudioToolbox.h>
@ -76,7 +76,7 @@
[callButton release];
[addCallButton release];
[transferButton release];
[oneButton release];
[twoButton release];
[threeButton release];
@ -89,13 +89,13 @@
[starButton release];
[zeroButton release];
[sharpButton release];
[videoPreview release];
[videoCameraSwitch release];
// Remove all observers
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
@ -106,15 +106,16 @@ static UICompositeViewDescription *compositeDescription = nil;
+ (UICompositeViewDescription *)compositeViewDescription {
if(compositeDescription == nil) {
compositeDescription = [[UICompositeViewDescription alloc] init:@"Dialer"
content:@"DialerViewController"
stateBar:@"UIStateBar"
stateBarEnabled:true
tabBar:@"UIMainBar"
tabBarEnabled:true
compositeDescription = [[UICompositeViewDescription alloc] init:@"Dialer"
content:@"DialerViewController"
stateBar:@"UIStateBar"
stateBarEnabled:true
tabBar:@"UIMainBar"
tabBarEnabled:true
fullscreen:false
landscapeMode:[LinphoneManager runningOnIpad]
portraitMode:true];
compositeDescription.darkBackground = true;
}
return compositeDescription;
}
@ -124,13 +125,13 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(coreUpdateEvent:)
name:kLinphoneCoreUpdate
@ -178,16 +179,16 @@ static UICompositeViewDescription *compositeDescription = nil;
#endif
}
}
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
// Remove observer
[[NSNotificationCenter defaultCenter] removeObserver:self
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneCallUpdate
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneCoreUpdate
object:nil];
@ -195,7 +196,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewDidLoad {
[super viewDidLoad];
[zeroButton setDigit:'0'];
[oneButton setDigit:'1'];
[twoButton setDigit:'2'];
@ -208,9 +209,9 @@ static UICompositeViewDescription *compositeDescription = nil;
[nineButton setDigit:'9'];
[starButton setDigit:'*'];
[sharpButton setDigit:'#'];
[addressField setAdjustsFontSizeToFitWidth:TRUE]; // Not put it in IB: issue with placeholder size
if([LinphoneManager runningOnIpad]) {
if ([LinphoneManager instance].frontCamId != nil) {
// only show camera switch button if we have more than 1 camera
@ -248,7 +249,7 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark - Event Functions
- (void)callUpdateEvent:(NSNotification*)notif {
- (void)callUpdateEvent:(NSNotification*)notif {
LinphoneCall *call = [[notif.userInfo objectForKey: @"call"] pointerValue];
LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue];
[self callUpdate:call state:state];
@ -283,7 +284,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[transferButton setHidden:true];
}
[callButton setHidden:true];
[backButton setHidden:false];
[backButton setHidden:false];
[addContactButton setHidden:true];
} else {
[addCallButton setHidden:true];
@ -330,7 +331,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
if (textField == addressField) {
[addressField resignFirstResponder];
}
}
return YES;
}
@ -341,10 +342,11 @@ static UICompositeViewDescription *compositeDescription = nil;
[ContactSelection setSelectionMode:ContactSelectionModeEdit];
[ContactSelection setAddAddress:[addressField text]];
[ContactSelection setSipFilter:nil];
[ContactSelection setEmailFilter:FALSE];
[ContactSelection setNameOrEmailFilter:nil];
[ContactSelection enableEmailFilter:FALSE];
ContactsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE], ContactsViewController);
if(controller != nil) {
}
}

View file

@ -4,18 +4,18 @@
*
* 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
* 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 "HistoryDetailsViewController.h"
#import "PhoneMainView.h"
@ -55,10 +55,10 @@
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[dateFormatter release];
[callLogId release];
[avatarImage release];
[addressLabel release];
[dateLabel release];
@ -72,7 +72,7 @@
[callButton release];
[messageButton release];
[addContactButton release];
[super dealloc];
}
@ -83,12 +83,12 @@ static UICompositeViewDescription *compositeDescription = nil;
+ (UICompositeViewDescription *)compositeViewDescription {
if(compositeDescription == nil) {
compositeDescription = [[UICompositeViewDescription alloc] init:@"HistoryDetails"
content:@"HistoryDetailsViewController"
stateBar:nil
stateBarEnabled:false
tabBar:@"UIMainBar"
tabBarEnabled:true
compositeDescription = [[UICompositeViewDescription alloc] init:@"HistoryDetails"
content:@"HistoryDetailsViewController"
stateBar:nil
stateBarEnabled:false
tabBar:@"UIMainBar"
tabBarEnabled:true
fullscreen:false
landscapeMode:[LinphoneManager runningOnIpad]
portraitMode:true];
@ -124,12 +124,12 @@ static UICompositeViewDescription *compositeDescription = nil;
if( use_system ){
[addContactButton setHidden:TRUE];
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(update)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(update)
name:kLinphoneAddressBookUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(coreUpdateEvent:)
name:kLinphoneCoreUpdate
@ -138,11 +138,11 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneAddressBookUpdate
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneCoreUpdate
object:nil];
@ -156,7 +156,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
#pragma mark -
#pragma mark -
+ (void)adaptSize:(UILabel*)label field:(UIView*)field {
//
@ -164,20 +164,20 @@ static UICompositeViewDescription *compositeDescription = nil;
//
CGRect labelFrame = [label frame];
CGRect fieldFrame = [field frame];
fieldFrame.origin.x -= labelFrame.size.width;
// Compute firstName size
CGSize contraints;
contraints.height = [label frame].size.height;
contraints.width = ([field frame].size.width + [field frame].origin.x) - [label frame].origin.x;
CGSize firstNameSize = [[label text] sizeWithFont:[label font] constrainedToSize: contraints];
labelFrame.size.width = firstNameSize.width;
// Compute lastName size & position
fieldFrame.origin.x += labelFrame.size.width;
fieldFrame.size.width = (contraints.width + [label frame].origin.x) - fieldFrame.origin.x;
[label setFrame: labelFrame];
[field setFrame: fieldFrame];
}
@ -186,7 +186,7 @@ static UICompositeViewDescription *compositeDescription = nil;
if(![LinphoneManager isLcReady]) {
return;
}
// Look for the call log
callLog = NULL;
const MSList *list = linphone_core_get_call_logs([LinphoneManager getLc]);
@ -199,20 +199,20 @@ static UICompositeViewDescription *compositeDescription = nil;
}
list = list->next;
}
// Pop if callLog is null
if(callLog == NULL) {
[[PhoneMainView instance] popCurrentView];
return;
}
LinphoneAddress* addr =linphone_call_log_get_remote_address(callLog);
UIImage *image = nil;
NSString* address = nil;
if(addr != NULL) {
BOOL useLinphoneAddress = true;
// contact name
// contact name
char* lAddress = linphone_address_as_string_uri_only(addr);
if(lAddress) {
NSString *normalizedSipAddress = [FastAddressBook normalizeSipURI:[NSString stringWithUTF8String:lAddress]];
@ -227,25 +227,25 @@ static UICompositeViewDescription *compositeDescription = nil;
if(useLinphoneAddress) {
const char* lDisplayName = linphone_address_get_display_name(addr);
const char* lUserName = linphone_address_get_username(addr);
if (lDisplayName)
if (lDisplayName)
address = [NSString stringWithUTF8String:lDisplayName];
else if(lUserName)
else if(lUserName)
address = [NSString stringWithUTF8String:lUserName];
}
}
// Set Image
if(image == nil) {
image = [UIImage imageNamed:@"avatar_unknown.png"];
}
[avatarImage setImage:image];
// Set Address
if(address == nil) {
address = NSLocalizedString(@"Unknown", nil);
}
[addressLabel setText:address];
// Hide/Show add button
BOOL use_system = [[LinphoneManager instance] lpConfigBoolForKey:@"use_system_contacts"];
if(contact) {
@ -253,7 +253,7 @@ static UICompositeViewDescription *compositeDescription = nil;
} else if (!use_system) {
[addContactButton setHidden:FALSE];
}
// State
NSMutableString *state = [NSMutableString string];
if (linphone_call_log_get_dir(callLog) == LinphoneCallIncoming) {
@ -283,7 +283,7 @@ static UICompositeViewDescription *compositeDescription = nil;
// Duration
int duration = linphone_call_log_get_duration(callLog);
[durationLabel setText:[NSString stringWithFormat:@"%02i:%02i", (duration/60), duration - 60 * (duration / 60), nil]];
// contact name
[plainAddressLabel setText:@""];
if (addr != NULL) {
@ -297,7 +297,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
}
}
if (addr != NULL) {
[callButton setHidden:FALSE];
[messageButton setHidden:FALSE];
@ -305,7 +305,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[callButton setHidden:TRUE];
[messageButton setHidden:TRUE];
}
}
@ -327,16 +327,17 @@ static UICompositeViewDescription *compositeDescription = nil;
- (IBAction)onAddContactClick:(id)event {
LinphoneAddress* addr;
addr=linphone_call_log_get_remote_address(callLog);
if (addr != NULL) {
char* lAddress = linphone_address_as_string_uri_only(addr);
if(lAddress != NULL) {
[ContactSelection setAddAddress:[NSString stringWithUTF8String:lAddress]];
[ContactSelection setSelectionMode:ContactSelectionModeEdit];
[ContactSelection setSipFilter:nil];
[ContactSelection setEmailFilter:FALSE];
[ContactSelection enableEmailFilter:FALSE];
[ContactSelection setNameOrEmailFilter:nil];
ContactsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE], ContactsViewController);
if(controller != nil) {
}
@ -346,26 +347,26 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (IBAction)onCallClick:(id)event {
LinphoneAddress* addr;
LinphoneAddress* addr;
addr=linphone_call_log_get_remote_address(callLog);
char* lAddress = linphone_address_as_string_uri_only(addr);
if(lAddress == NULL)
if(lAddress == NULL)
return;
NSString *displayName = nil;
if(contact != nil) {
displayName = [FastAddressBook getContactDisplayName:contact];
displayName = [FastAddressBook getContactDisplayName:contact];
} else {
const char* lDisplayName = linphone_address_get_display_name(addr);
const char* lUserName = linphone_address_get_username(addr);
if (lDisplayName)
if (lDisplayName)
displayName = [NSString stringWithUTF8String:lDisplayName];
else if(lUserName)
else if(lUserName)
displayName = [NSString stringWithUTF8String:lUserName];
}
DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController);
if(controller != nil) {
if(displayName != nil) {
@ -380,11 +381,11 @@ static UICompositeViewDescription *compositeDescription = nil;
- (IBAction)onMessageClick:(id)event {
LinphoneAddress* addr;
addr=linphone_call_log_get_remote_address(callLog);
char* lAddress = linphone_address_as_string_uri_only(addr);
if(lAddress == NULL)
return;
NSString *displayName = nil;
if(contact != nil) {
displayName = [FastAddressBook getContactDisplayName:contact];
@ -396,7 +397,7 @@ static UICompositeViewDescription *compositeDescription = nil;
else if(lUserName)
displayName = [NSString stringWithUTF8String:lUserName];
}
// Go to ChatRoom view
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController);

View file

@ -105,6 +105,7 @@ static UICompositeViewDescription *compositeDescription = nil;
fullscreen:false
landscapeMode:true
portraitMode:true];
compositeDescription.darkBackground = true;
}
return compositeDescription;
}
@ -129,9 +130,6 @@ static UICompositeViewDescription *compositeDescription = nil;
[hideControlsTimer invalidate];
hideControlsTimer = nil;
}
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[callTableController viewWillDisappear:animated];
}
if( hiddenVolume ) {
[[PhoneMainView instance] setVolumeHidden:FALSE];
@ -146,10 +144,6 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[callTableController viewWillAppear:animated];
}
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
@ -160,11 +154,7 @@ static UICompositeViewDescription *compositeDescription = nil;
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCallState state = (call != NULL)?linphone_call_get_state(call): 0;
[self callUpdate:call state:state animated:FALSE];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[callTableController viewDidAppear:animated];
}
// Set windows (warn memory leaks)
linphone_core_set_native_video_window_id([LinphoneManager getLc], (unsigned long)videoView);
linphone_core_set_native_preview_window_id([LinphoneManager getLc], (unsigned long)videoPreview);
@ -179,11 +169,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[[UIApplication sharedApplication] setIdleTimerDisabled:false];
UIDevice *device = [UIDevice currentDevice];
device.proximityMonitoringEnabled = NO;
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[callTableController viewDidDisappear:animated];
}
[[PhoneMainView instance] fullScreen:false];
// Disable tap
[singleFingerTap setEnabled:FALSE];

View file

@ -81,6 +81,7 @@ static UICompositeViewDescription *compositeDescription = nil;
fullscreen:false
landscapeMode:[LinphoneManager runningOnIpad]
portraitMode:true];
compositeDescription.darkBackground = true;
}
return compositeDescription;
}

View file

@ -23,13 +23,8 @@
#import "LinphoneCoreSettingsStore.h"
@interface UILinphoneWindow : UIWindow
@end
@interface LinphoneAppDelegate : NSObject <UIApplicationDelegate,UIAlertViewDelegate> {
@private
UIWindow *window;
UIBackgroundTaskIdentifier bgStartId;
BOOL started;
int savedMaxCall;
@ -40,6 +35,7 @@
@property (assign) BOOL started;
@property (nonatomic, retain) UIAlertView *waitingIndicator;
@property (nonatomic, retain) NSString *configURL;
@property (nonatomic, strong) UIWindow* window;
@end

View file

@ -30,14 +30,10 @@
#include "LinphoneManager.h"
#include "linphone/linphonecore.h"
@implementation UILinphoneWindow
@end
@implementation LinphoneAppDelegate
@synthesize started,configURL;
@synthesize window;
#pragma mark - Lifecycle Functions
@ -118,10 +114,77 @@
}
}
- (UIUserNotificationCategory*)newMessageNotificationCategory {
UIMutableUserNotificationAction* reply = [[UIMutableUserNotificationAction alloc] init];
reply.identifier = @"reply";
reply.title = NSLocalizedString(@"Reply", nil);
reply.activationMode = UIUserNotificationActivationModeForeground;
reply.destructive = NO;
reply.authenticationRequired = YES;
UIMutableUserNotificationAction* mark_read = [[UIMutableUserNotificationAction alloc] init];
mark_read.identifier = @"mark_read";
mark_read.title = NSLocalizedString(@"Mark Read", nil);
mark_read.activationMode = UIUserNotificationActivationModeBackground;
mark_read.destructive = NO;
mark_read.authenticationRequired = NO;
NSArray* localRingActions = @[mark_read, reply];
UIMutableUserNotificationCategory* localRingNotifAction = [[UIMutableUserNotificationCategory alloc] init];
localRingNotifAction.identifier = @"incoming_msg";
[localRingNotifAction setActions:localRingActions forContext:UIUserNotificationActionContextDefault];
[localRingNotifAction setActions:localRingActions forContext:UIUserNotificationActionContextMinimal];
return localRingNotifAction;
}
- (UIUserNotificationCategory*)newCallNotificationCategory {
UIMutableUserNotificationAction* Answer = [[UIMutableUserNotificationAction alloc] init];
Answer.identifier = @"answer";
Answer.title = NSLocalizedString(@"Answer", nil);
Answer.activationMode = UIUserNotificationActivationModeForeground;
Answer.destructive = NO;
Answer.authenticationRequired = YES;
UIMutableUserNotificationAction* Decline = [[UIMutableUserNotificationAction alloc] init];
Decline.identifier = @"decline";
Decline.title = NSLocalizedString(@"Decline", nil);
Decline.activationMode = UIUserNotificationActivationModeBackground;
Decline.destructive = YES;
Decline.authenticationRequired = NO;
NSArray* localRingActions = @[Decline, Answer];
UIMutableUserNotificationCategory* localRingNotifAction = [[UIMutableUserNotificationCategory alloc] init];
localRingNotifAction.identifier = @"incoming_call";
[localRingNotifAction setActions:localRingActions forContext:UIUserNotificationActionContextDefault];
[localRingNotifAction setActions:localRingActions forContext:UIUserNotificationActionContextMinimal];
return localRingNotifAction;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeNewsstandContentAvailability];
UIApplication* app= [UIApplication sharedApplication];
if( [app respondsToSelector:@selector(registerUserNotificationSettings:)] ){
/* iOS8 notifications can be actioned! Awesome: */
UIUserNotificationType notifTypes = UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert;
NSSet* categories = [NSSet setWithObjects:[self newCallNotificationCategory], [self newMessageNotificationCategory], nil];
UIUserNotificationSettings* userSettings = [UIUserNotificationSettings settingsForTypes:notifTypes categories:categories];
[app registerUserNotificationSettings:userSettings];
[app registerForRemoteNotifications];
} else {
NSUInteger notifTypes = UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeNewsstandContentAvailability;
[app registerForRemoteNotificationTypes:notifTypes];
}
LinphoneManager* instance = [LinphoneManager instance];
@ -167,6 +230,8 @@
// Only execute one time at application start
if(!started) {
started = TRUE;
[self.window makeKeyAndVisible];
[RootViewManager setupWithPortrait:(PhoneMainView*)self.window.rootViewController];
[[PhoneMainView instance] startUp];
}
}
@ -353,6 +418,43 @@
[[LinphoneManager instance] setPushNotificationToken:nil];
}
#pragma mark - User notifications
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
[LinphoneLogger log:LinphoneLoggerLog format:@"%@", NSStringFromSelector(_cmd)];
}
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void (^)())completionHandler {
LinphoneCore* lc = [LinphoneManager getLc];
[LinphoneLogger log:LinphoneLoggerLog format:@"%@", NSStringFromSelector(_cmd)];
if( [notification.category isEqualToString:@"incoming_call"]) {
if( [identifier isEqualToString:@"answer"] ){
// use the standard handler
[self application:application didReceiveLocalNotification:notification];
} else if( [identifier isEqualToString:@"decline"] ){
LinphoneCall* call = linphone_core_get_current_call(lc);
if( call ) linphone_core_decline_call(lc, call, LinphoneReasonDeclined);
}
} else if( [notification.category isEqualToString:@"incoming_msg"] ){
if( [identifier isEqualToString:@"reply"] ){
// use the standard handler
[self application:application didReceiveLocalNotification:notification];
} else if( [identifier isEqualToString:@"mark_read"] ){
NSString* from = [notification.userInfo objectForKey:@"from"];
LinphoneChatRoom* room = linphone_core_get_or_create_chat_room(lc, [from UTF8String]);
if( room ){
linphone_chat_room_mark_as_read(room);
[[PhoneMainView instance] updateApplicationBadgeNumber];
}
}
}
completionHandler();
}
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler {
completionHandler();
}
#pragma mark - Remote configuration Functions (URL Handler)

File diff suppressed because it is too large Load diff

View file

@ -4,18 +4,18 @@
*
* 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
* 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 <Foundation/Foundation.h>
#import <AVFoundation/AVAudioSession.h>
@ -50,6 +50,7 @@ extern NSString *const kLinphoneSettingsUpdate;
extern NSString *const kLinphoneBluetoothAvailabilityUpdate;
extern NSString *const kLinphoneConfiguringStateUpdate;
extern NSString *const kLinphoneGlobalStateUpdate;
extern NSString *const kLinphoneNotifyReceived;
typedef enum _NetworkType {
network_none = 0,
@ -105,7 +106,7 @@ typedef struct _LinphoneManagerSounds {
@interface LinphoneManager : NSObject {
@protected
SCNetworkReachabilityRef proxyReachability;
@private
NSTimer* mIterateTimer;
NSMutableArray* pendindCallIdFromRemoteNotif;
@ -174,7 +175,7 @@ typedef struct _LinphoneManagerSounds {
- (NSInteger)lpConfigIntForKey:(NSString*)key;
- (void)lpConfigSetInt:(NSInteger)value forKey:(NSString*)key forSection:(NSString*)section;
- (NSInteger)lpConfigIntForKey:(NSString*)key forSection:(NSString*)section;
- (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key;
- (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key;
- (BOOL)lpConfigBoolForKey:(NSString*)key;
- (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key forSection:(NSString*)section;
- (BOOL)lpConfigBoolForKey:(NSString*)key forSection:(NSString*)section;

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="13C1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UICallBar">
@ -160,7 +160,7 @@
</state>
<state key="highlighted" image="numpad_star_over.png"/>
</button>
<button opaque="NO" clearsContextBeforeDrawing="NO" tag="13" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="64" userLabel="0" customClass="UIDigitButton">
<button opaque="NO" clearsContextBeforeDrawing="NO" tag="13" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="64" userLabel="0" customClass="UIDigitButtonLongPlus">
<rect key="frame" x="87" y="196" width="106" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="0"/>
@ -481,6 +481,8 @@
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
<view contentMode="scaleToFill" id="100" userLabel="Landscape View" customClass="UITransparentView">
<rect key="frame" x="0.0" y="0.0" width="480" height="320"/>
@ -590,7 +592,7 @@
</state>
<state key="highlighted" image="numpad_star_over.png"/>
</button>
<button opaque="NO" clearsContextBeforeDrawing="NO" tag="13" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="125" userLabel="0" customClass="UIDigitButton">
<button opaque="NO" clearsContextBeforeDrawing="NO" tag="13" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="125" userLabel="0" customClass="UIDigitButtonLongPlus">
<rect key="frame" x="87" y="196" width="106" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="Helvetica-Bold" family="Helvetica" pointSize="15"/>
@ -897,7 +899,9 @@
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
</objects>
<resources>
@ -1026,4 +1030,9 @@
<image name="video_on_default.png" width="160" height="134"/>
<image name="video_on_default_landscape.png" width="130" height="163"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="5056" systemVersion="13C1021" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UICallBar">
@ -145,7 +145,7 @@
</state>
<state key="highlighted" image="numpad_star_over.png"/>
</button>
<button opaque="NO" clearsContextBeforeDrawing="NO" tag="13" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="48" userLabel="0" customClass="UIDigitButton">
<button opaque="NO" clearsContextBeforeDrawing="NO" tag="13" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="48" userLabel="0" customClass="UIDigitButtonLongPlus">
<rect key="frame" x="87" y="196" width="106" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="Helvetica-Bold" family="Helvetica" pointSize="15"/>
@ -352,7 +352,9 @@
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
<view autoresizesSubviews="NO" contentMode="scaleToFill" id="3" userLabel="Portrait View" customClass="UITransparentView">
<rect key="frame" x="0.0" y="0.0" width="768" height="1004"/>
@ -472,7 +474,7 @@
</state>
<state key="highlighted" image="numpad_star_over.png"/>
</button>
<button opaque="NO" clearsContextBeforeDrawing="NO" tag="13" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="29" userLabel="0" customClass="UIDigitButton">
<button opaque="NO" clearsContextBeforeDrawing="NO" tag="13" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="29" userLabel="0" customClass="UIDigitButtonLongPlus">
<rect key="frame" x="87" y="196" width="106" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="0"/>
@ -696,6 +698,8 @@
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
</objects>
<resources>
@ -787,4 +791,9 @@
<image name="video_on_default.png" width="162" height="170"/>
<image name="video_on_default_landscape.png" width="162" height="170"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

View file

@ -35,6 +35,7 @@
@property (assign) BOOL fullscreen;
@property (assign) BOOL landscapeMode;
@property (assign) BOOL portraitMode;
@property (assign) BOOL darkBackground;
- (id)copy;
- (BOOL)equal:(UICompositeViewDescription*) description;
@ -71,6 +72,7 @@
- (void)setFullScreen:(BOOL) enabled;
- (void)setStateBarHidden:(BOOL) hidden;
- (void)setToolBarHidden:(BOOL) hidden;
- (BOOL)currentViewSupportsLandscape;
- (UIViewController *)getCachedController:(NSString*)name;
- (UIViewController *)getCurrentViewController;
- (UIInterfaceOrientation)currentOrientation;

View file

@ -33,6 +33,7 @@
@synthesize landscapeMode;
@synthesize portraitMode;
- (id)copy {
UICompositeViewDescription *copy = [UICompositeViewDescription alloc];
copy.content = self.content;
@ -43,6 +44,7 @@
copy.fullscreen = self.fullscreen;
copy.landscapeMode = self.landscapeMode;
copy.portraitMode = self.portraitMode;
copy.darkBackground = self.darkBackground;
return copy;
}
@ -56,7 +58,7 @@
tabBarEnabled:(BOOL) atabBarEnabled
fullscreen:(BOOL) afullscreen
landscapeMode:(BOOL) alandscapeMode
portraitMode:(BOOL) aportraitMode {
portraitMode:(BOOL) aportraitMode{
self.name = aname;
self.content = acontent;
self.stateBar = astateBar;
@ -66,6 +68,7 @@
self.fullscreen = afullscreen;
self.landscapeMode = alandscapeMode;
self.portraitMode = aportraitMode;
self.darkBackground = false;
return self;
}
@ -165,13 +168,31 @@
#pragma mark - ViewController Functions
- (void)updateViewsFramesAccordingToLaunchOrientation {
CGRect frame = [self.view frame]; // this view has the correct size at launch (1024/768 for iPad, 320*{568,480} for iPhone)
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
BOOL portrait = UIInterfaceOrientationIsPortrait(orientation);
CGRect oppositeFrame = frame;
oppositeFrame.size.height = frame.size.width;
oppositeFrame.size.width = frame.size.height;
// if we start in portrait, the landscape view must get the opposite height and width
if( portrait || [[UIDevice currentDevice].systemName floatValue] < 8 ){
Linphone_log(@"landscape get opposite: %@", NSStringFromCGSize(oppositeFrame.size));
[landscapeView setFrame:oppositeFrame];
} else {
// if we start in landscape, the landscape view has to get the current size,
// whereas the portrait has to get the opposite
Linphone_log(@"landscape get frame: %@ and portrait gets opposite: %@", NSStringFromCGSize(frame.size), NSStringFromCGSize(oppositeFrame.size));
[landscapeView setFrame:frame];
[portraitView setFrame:oppositeFrame];
}
}
- (void)viewDidLoad {
/* Force landscape view to match portrait view */
CGRect frame = [portraitView frame];
int height = frame.size.width;
frame.size.width = frame.size.height;
frame.size.height = height;
[landscapeView setFrame:frame];
/* Force landscape view to match portrait view, because portrait view inherits
the device screen size at load */
[self updateViewsFramesAccordingToLaunchOrientation];
[super viewDidLoad];
}
@ -215,6 +236,8 @@
[self.stateBarViewController viewDidDisappear:animated];
}
#pragma mark - Rotation messages
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
currentOrientation = toInterfaceOrientation;
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
@ -224,7 +247,7 @@
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; // Will invoke TPMultiLayout
[self.contentViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
[self.tabBarViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
[self.stateBarViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
@ -265,57 +288,26 @@
*/
+ (void)setOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
UIView *firstResponder = nil;
for(UIWindow *window in [[UIApplication sharedApplication] windows]) {
if([NSStringFromClass(window.class) isEqualToString:@"UITextEffectsWindow"] ||
[NSStringFromClass(window.class) isEqualToString:@"_UIAlertOverlayWindow"] ) {
continue;
}
UIView *view = window;
UIViewController *controller = nil;
CGRect frame = [view frame];
if([window isKindOfClass:[UILinphoneWindow class]]) {
controller = window.rootViewController;
view = controller.view;
}
UIInterfaceOrientation oldOrientation = controller.interfaceOrientation;
NSTimeInterval animationDuration = 0.0;
if(animated) {
animationDuration = 0.3f;
}
[controller willRotateToInterfaceOrientation:orientation duration:animationDuration];
if(animated) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:animationDuration];
}
switch (orientation) {
case UIInterfaceOrientationPortrait:
[view setTransform: CGAffineTransformMakeRotation(0)];
break;
case UIInterfaceOrientationPortraitUpsideDown:
[view setTransform: CGAffineTransformMakeRotation(M_PI)];
break;
case UIInterfaceOrientationLandscapeLeft:
[view setTransform: CGAffineTransformMakeRotation(-M_PI / 2)];
break;
case UIInterfaceOrientationLandscapeRight:
[view setTransform: CGAffineTransformMakeRotation(M_PI / 2)];
break;
default:
break;
}
if([window isKindOfClass:[UILinphoneWindow class]]) {
[view setFrame:frame];
}
[controller willAnimateRotationToInterfaceOrientation:orientation duration:animationDuration];
if(animated) {
[UIView commitAnimations];
}
[controller didRotateFromInterfaceOrientation:oldOrientation];
if(firstResponder == nil) {
firstResponder = [UICompositeViewController findFirstResponder:view];
}
UIViewController *controller = nil;
controller = [[UIApplication sharedApplication] keyWindow].rootViewController;
CGRect frame = [[UIScreen mainScreen] bounds];
UIInterfaceOrientation oldOrientation = controller.interfaceOrientation;
NSTimeInterval animationDuration = animated? 0.3f : 0.0;
[controller willRotateToInterfaceOrientation:orientation duration:animationDuration];
[controller willAnimateRotationToInterfaceOrientation:orientation duration:animationDuration];
[controller didRotateFromInterfaceOrientation:oldOrientation];
[UIView animateWithDuration:animationDuration animations:^{
[controller.view setFrame:frame];
}];
if(firstResponder == nil) {
firstResponder = [UICompositeViewController findFirstResponder:controller.view];
}
[[UIApplication sharedApplication] setStatusBarOrientation:orientation animated:animated];
if(firstResponder) {
[firstResponder resignFirstResponder];
@ -351,11 +343,6 @@
}
if(remove) {
[LinphoneLogger log:LinphoneLoggerLog format:@"Free cached view: %@", key];
UIViewController *vc = [viewControllerCache objectForKey:key];
if ([[UIDevice currentDevice].systemVersion doubleValue] >= 5.0) {
[vc viewWillUnload];
}
[vc viewDidUnload];
[viewControllerCache removeObjectForKey:key];
}
}
@ -499,8 +486,8 @@
UIViewController *newContentViewController = [self getCachedController:description.content];
UIViewController *newStateBarViewController = [self getCachedController:description.stateBar];
UIViewController *newTabBarViewController = [self getCachedController:description.tabBar];
UIViewController *newTabBarViewController = [self getCachedController:description.tabBar];
[UICompositeViewController removeSubView: oldContentViewController];
if(oldTabBarViewController != nil && oldTabBarViewController != newTabBarViewController) {
[UICompositeViewController removeSubView:oldTabBarViewController];
@ -508,15 +495,20 @@
if(oldStateBarViewController != nil && oldStateBarViewController != newStateBarViewController) {
[UICompositeViewController removeSubView:oldStateBarViewController];
}
self.stateBarViewController = newStateBarViewController;
self.contentViewController = newContentViewController;
self.tabBarViewController = newTabBarViewController;
// Update rotation
UIInterfaceOrientation correctOrientation = [self getCorrectInterfaceOrientation:[[UIDevice currentDevice] orientation]];
UIInterfaceOrientation correctOrientation = [self getCorrectInterfaceOrientation:(UIDeviceOrientation)[UIApplication sharedApplication].statusBarOrientation];
if(currentOrientation != correctOrientation) {
[UICompositeViewController setOrientation:correctOrientation animated:currentOrientation!=UIDeviceOrientationUnknown];
if( UIInterfaceOrientationIsLandscape(correctOrientation) ){
[self.contentViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
[self.tabBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
[self.stateBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
}
} else {
if(oldContentViewController != newContentViewController) {
UIInterfaceOrientation oldOrientation = self.contentViewController.interfaceOrientation;
@ -536,7 +528,7 @@
[self.stateBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
[self.stateBarViewController didRotateFromInterfaceOrientation:oldOrientation];
}
}
}
} else {
oldViewDescription = (currentViewDescription != nil)? [currentViewDescription copy]: nil;
}
@ -681,4 +673,8 @@
return [[self.contentViewController retain] autorelease];
}
- (BOOL)currentViewSupportsLandscape {
return currentViewDescription ? currentViewDescription.landscapeMode : FALSE;
}
@end

View file

@ -22,7 +22,7 @@
#import "UILongTouchButton.h"
@interface UIDigitButton : UILongTouchButton<UILongTouchButtonDelegate> {
@interface UIDigitButton : UILongTouchButton {
}
@property (nonatomic, retain) IBOutlet UITextField* addressField;

View file

@ -91,17 +91,4 @@
linphone_core_stop_dtmf([LinphoneManager getLc]);
}
#pragma mark - UILongTouchButtonDelegate Functions
- (void)onRepeatTouch {
}
- (void)onLongTouch {
if (digit == '0') {
NSString* newAddress = [[addressField.text substringToIndex: [addressField.text length]-1] stringByAppendingString:@"+"];
[addressField setText:newAddress];
}
}
@end

View file

@ -0,0 +1,29 @@
/* UIDigitButton.h
*
* 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 <UIKit/UIKit.h>
#import "UIDigitButton.h"
@interface UIDigitButtonLongPlus : UIDigitButton {
}
@end

View file

@ -0,0 +1,34 @@
/* UIDigitButton.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 "UIDigitButtonLongPlus.h"
@implementation UIDigitButtonLongPlus
#pragma mark - UILongTouchButtonDelegate Functions
- (void)onRepeatTouch {
}
- (void)onLongTouch {
NSString* newAddress = [[self.addressField.text substringToIndex: [self.addressField.text length]-1] stringByAppendingString:@"+"];
[self.addressField setText:newAddress];
}
@end

View file

@ -0,0 +1,29 @@
/* UIDigitButton.h
*
* 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 <UIKit/UIKit.h>
#import "UIDigitButton.h"
@interface UIDigitButtonLongVoiceMail : UIDigitButton {
}
@end

View file

@ -0,0 +1,45 @@
/* UIDigitButton.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 "UIDigitButtonLongVoiceMail.h"
#import "Utils.h"
#include "LinphoneManager.h"
@implementation UIDigitButtonLongVoiceMail
#pragma mark - UILongTouchButtonDelegate Functions
- (void)onRepeatTouch {
}
- (void)onLongTouch {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger log:LinphoneLoggerWarning format:@"Cannot call voice mail: Linphone core not ready"];
return;
}
LinphoneManager* lm = [LinphoneManager instance];
NSString * voiceMailUri = [lm lpConfigStringForKey:@"voice_mail_uri" withDefault:NULL];
if (voiceMailUri != NULL) {
[lm call:voiceMailUri displayName:NSLocalizedString(@"Voice mail",nil) transfer:FALSE];
}
}
@end

View file

@ -4,16 +4,16 @@
*
* 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
* 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.
*/
@ -46,7 +46,7 @@ static NSString * const kDisappearAnimation = @"disappear";
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[historyButton release];
[contactsButton release];
[dialerButton release];
@ -56,7 +56,7 @@ static NSString * const kDisappearAnimation = @"disappear";
[historyNotificationLabel release];
[chatNotificationView release];
[chatNotificationLabel release];
[super dealloc];
}
@ -65,17 +65,17 @@ static NSString * const kDisappearAnimation = @"disappear";
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(changeViewEvent:)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(changeViewEvent:)
name:kLinphoneMainViewChange
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdate:)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdate:)
name:kLinphoneCallUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(textReceived:)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(textReceived:)
name:kLinphoneTextReceived
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
@ -87,14 +87,14 @@ static NSString * const kDisappearAnimation = @"disappear";
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneMainViewChange
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneCallUpdate
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneTextReceived
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
@ -103,35 +103,35 @@ static NSString * const kDisappearAnimation = @"disappear";
}
- (void)viewDidLoad {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillEnterForeground:)
name:UIApplicationWillEnterForegroundNotification
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillEnterForeground:)
name:UIApplicationWillEnterForegroundNotification
object:nil];
{
UIButton *historyButtonLandscape = (UIButton*) [landscapeView viewWithTag:[historyButton tag]];
// Set selected+over background: IB lack !
[historyButton setBackgroundImage:[UIImage imageNamed:@"history_selected.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
// Set selected+over background: IB lack !
[historyButtonLandscape setBackgroundImage:[UIImage imageNamed:@"history_selected_landscape.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
[LinphoneUtils buttonFixStatesForTabs:historyButton];
[LinphoneUtils buttonFixStatesForTabs:historyButtonLandscape];
}
{
UIButton *contactsButtonLandscape = (UIButton*) [landscapeView viewWithTag:[contactsButton tag]];
// Set selected+over background: IB lack !
[contactsButton setBackgroundImage:[UIImage imageNamed:@"contacts_selected.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
// Set selected+over background: IB lack !
[contactsButtonLandscape setBackgroundImage:[UIImage imageNamed:@"contacts_selected_landscape.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
[LinphoneUtils buttonFixStatesForTabs:contactsButton];
[LinphoneUtils buttonFixStatesForTabs:contactsButtonLandscape];
}
@ -140,11 +140,11 @@ static NSString * const kDisappearAnimation = @"disappear";
// Set selected+over background: IB lack !
[dialerButton setBackgroundImage:[UIImage imageNamed:@"dialer_selected.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
// Set selected+over background: IB lack !
[dialerButtonLandscape setBackgroundImage:[UIImage imageNamed:@"dialer_selected_landscape.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
[LinphoneUtils buttonFixStatesForTabs:dialerButton];
[LinphoneUtils buttonFixStatesForTabs:dialerButtonLandscape];
}
@ -153,37 +153,37 @@ static NSString * const kDisappearAnimation = @"disappear";
// Set selected+over background: IB lack !
[settingsButton setBackgroundImage:[UIImage imageNamed:@"settings_selected.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
// Set selected+over background: IB lack !
[settingsButtonLandscape setBackgroundImage:[UIImage imageNamed:@"settings_selected_landscape.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
[LinphoneUtils buttonFixStatesForTabs:settingsButton];
[LinphoneUtils buttonFixStatesForTabs:settingsButtonLandscape];
}
{
UIButton *chatButtonLandscape = (UIButton*) [landscapeView viewWithTag:[chatButton tag]];
// Set selected+over background: IB lack !
[chatButton setBackgroundImage:[UIImage imageNamed:@"chat_selected.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
// Set selected+over background: IB lack !
[chatButtonLandscape setBackgroundImage:[UIImage imageNamed:@"chat_selected_landscape.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
[LinphoneUtils buttonFixStatesForTabs:chatButton];
[LinphoneUtils buttonFixStatesForTabs:chatButtonLandscape];
}
[super viewDidLoad]; // Have to be after due to TPMultiLayoutViewController
}
- (void)viewDidUnload {
[super viewDidUnload];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIApplicationWillEnterForegroundNotification
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIApplicationWillEnterForegroundNotification
object:nil];
}
@ -203,8 +203,8 @@ static NSString * const kDisappearAnimation = @"disappear";
#pragma mark - Event Functions
- (void)applicationWillEnterForeground:(NSNotification*)notif {
// Force the animations
- (void)applicationWillEnterForeground:(NSNotification*)notif {
// Force the animations
[[self.view layer] removeAllAnimations];
[historyNotificationView.layer setTransform:CATransform3DIdentity];
[chatNotificationView.layer setTransform:CATransform3DIdentity];
@ -219,7 +219,7 @@ static NSString * const kDisappearAnimation = @"disappear";
[self updateMissedCall:linphone_core_get_missed_calls_count([LinphoneManager getLc]) appear:TRUE];
}
- (void)changeViewEvent:(NSNotification*)notif {
- (void)changeViewEvent:(NSNotification*)notif {
//UICompositeViewDescription *view = [notif.userInfo objectForKey: @"view"];
//if(view != nil)
[self updateView:[[PhoneMainView instance] firstView]];
@ -246,7 +246,7 @@ static NSString * const kDisappearAnimation = @"disappear";
}
#pragma mark -
#pragma mark -
- (void)update:(BOOL)appear{
[self updateView:[[PhoneMainView instance] firstView]];
@ -354,14 +354,14 @@ static NSString * const kDisappearAnimation = @"disappear";
bounce.autoreverses = TRUE;
bounce.repeatCount = HUGE_VALF;
[target.layer addAnimation:bounce forKey:animationID];
}
- (void)stopBounceAnimation:(NSString *)animationID target:(UIView *)target {
[target.layer removeAnimationForKey:animationID];
}
- (void)updateView:(UICompositeViewDescription*) view {
- (void)updateView:(UICompositeViewDescription*) view {
// Update buttons
if([view equal:[HistoryViewController compositeViewDescription]]) {
historyButton.selected = TRUE;
@ -401,7 +401,8 @@ static NSString * const kDisappearAnimation = @"disappear";
[ContactSelection setSelectionMode:ContactSelectionModeNone];
[ContactSelection setAddAddress:nil];
[ContactSelection setSipFilter:nil];
[ContactSelection setEmailFilter:FALSE];
[ContactSelection enableEmailFilter:FALSE];
[ContactSelection setNameOrEmailFilter:nil];
[[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription]];
}
@ -422,7 +423,7 @@ static NSString * const kDisappearAnimation = @"disappear";
- (NSDictionary*)attributesForView:(UIView*)view {
NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
[attributes setObject:[NSValue valueWithCGRect:view.frame] forKey:@"frame"];
[attributes setObject:[NSValue valueWithCGRect:view.bounds] forKey:@"bounds"];
if([view isKindOfClass:[UIButton class]]) {
@ -430,7 +431,7 @@ static NSString * const kDisappearAnimation = @"disappear";
[LinphoneUtils buttonMultiViewAddAttributes:attributes button:button];
}
[attributes setObject:[NSNumber numberWithInteger:view.autoresizingMask] forKey:@"autoresizingMask"];
return attributes;
}

View file

@ -0,0 +1,12 @@
//
// UIPlusDigitButton.m
// linphone
//
// Created by Gautier Pelloux-Prayer on 24/09/14.
//
//
#import <Foundation/Foundation.h>
@interface UIDigitButton : UILongTouchButton {
}

View file

@ -4,18 +4,18 @@
*
* 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
* 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 <UIKit/UIKit.h>
#import "TPMultiLayoutViewController.h"
@ -30,7 +30,9 @@
@property (nonatomic, retain) IBOutlet UIImageView* callQualityImage;
@property (nonatomic, retain) IBOutlet UIImageView* callSecurityImage;
@property (nonatomic, retain) IBOutlet UIButton* callSecurityButton;
@property (retain, nonatomic) IBOutlet UILabel *voicemailCount;
- (IBAction)doSecurityClick:(id)sender;
@end

View file

@ -4,18 +4,18 @@
*
* 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
* 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 "UIStateBar.h"
#import "LinphoneManager.h"
@ -36,290 +36,330 @@ NSTimer *callSecurityTimer;
#pragma mark - Lifecycle Functions
- (id)init {
self = [super initWithNibName:@"UIStateBar" bundle:[NSBundle mainBundle]];
if(self != nil) {
self->callSecurityImage = nil;
self->callQualityImage = nil;
self->securitySheet = nil;
}
return self;
self = [super initWithNibName:@"UIStateBar" bundle:[NSBundle mainBundle]];
if(self != nil) {
self->callSecurityImage = nil;
self->callQualityImage = nil;
self->securitySheet = nil;
}
return self;
}
- (void) dealloc {
if(securitySheet) {
[securitySheet release];
}
[registrationStateImage release];
[registrationStateLabel release];
[callQualityImage release];
[callSecurityImage release];
[callSecurityButton release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[callQualityTimer invalidate];
[callQualityTimer release];
[super dealloc];
if(securitySheet) {
[securitySheet release];
}
[registrationStateImage release];
[registrationStateLabel release];
[callQualityImage release];
[callSecurityImage release];
[callSecurityButton release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[callQualityTimer invalidate];
[callQualityTimer release];
[_voicemailCount release];
[super dealloc];
}
#pragma mark - ViewController Functions
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// Set callQualityTimer
callQualityTimer = [NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(callQualityUpdate)
userInfo:nil
repeats:YES];
// Set callQualityTimer
callSecurityTimer = [NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(callSecurityUpdate)
userInfo:nil
repeats:YES];
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationUpdate:)
name:kLinphoneRegistrationUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(globalStateUpdate:)
name:kLinphoneGlobalStateUpdate
object:nil];
[callQualityImage setHidden: true];
[callSecurityImage setHidden: true];
// Update to default state
LinphoneProxyConfig* config = NULL;
if([LinphoneManager isLcReady])
linphone_core_get_default_proxy([LinphoneManager getLc], &config);
[self proxyConfigUpdate: config];
[super viewWillAppear:animated];
// Set callQualityTimer
callQualityTimer = [NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(callQualityUpdate)
userInfo:nil
repeats:YES];
// Set callQualityTimer
callSecurityTimer = [NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(callSecurityUpdate)
userInfo:nil
repeats:YES];
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationUpdate:)
name:kLinphoneRegistrationUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(globalStateUpdate:)
name:kLinphoneGlobalStateUpdate
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(notifyReceived:)
name:kLinphoneNotifyReceived
object:nil];
[callQualityImage setHidden: true];
[callSecurityImage setHidden: true];
self.voicemailCount.hidden = true;
// Update to default state
LinphoneProxyConfig* config = NULL;
if([LinphoneManager isLcReady])
linphone_core_get_default_proxy([LinphoneManager getLc], &config);
[self proxyConfigUpdate: config];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
// Remove observer
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneRegistrationUpdate
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneGlobalStateUpdate
object:nil];
if(callQualityTimer != nil) {
[callQualityTimer invalidate];
callQualityTimer = nil;
}
if(callSecurityTimer != nil) {
[callSecurityTimer invalidate];
callSecurityTimer = nil;
}
[super viewWillDisappear:animated];
// Remove observer
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneRegistrationUpdate
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneGlobalStateUpdate
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneNotifyReceived
object:nil];
if(callQualityTimer != nil) {
[callQualityTimer invalidate];
callQualityTimer = nil;
}
if(callSecurityTimer != nil) {
[callSecurityTimer invalidate];
callSecurityTimer = nil;
}
}
#pragma mark - Event Functions
- (void)registrationUpdate: (NSNotification*) notif {
LinphoneProxyConfig* config = NULL;
linphone_core_get_default_proxy([LinphoneManager getLc], &config);
[self proxyConfigUpdate:config];
- (void)registrationUpdate: (NSNotification*) notif {
LinphoneProxyConfig* config = NULL;
linphone_core_get_default_proxy([LinphoneManager getLc], &config);
[self proxyConfigUpdate:config];
}
- (void) globalStateUpdate:(NSNotification*) notif {
if ([LinphoneManager isLcReady]) [self registrationUpdate:notif];
if ([LinphoneManager isLcReady]) [self registrationUpdate:notif];
}
- (void) notifyReceived:(NSNotification*) notif {
const LinphoneContent * content = [[notif.userInfo objectForKey: @"content"] pointerValue];
#pragma mark -
if ((content == NULL)
|| (strcmp("application", content->type) != 0)
|| (strcmp("simple-message-summary", content->subtype) != 0)
|| (content->data == NULL)) {
return;
}
const char * body = (const char*) content->data;
if ((body = strstr(body, "voice-message: ")) == NULL) {
[LinphoneLogger log:LinphoneLoggerWarning format:@"Received new NOTIFY from voice mail but could not find 'voice-message' in BODY. Ignoring it."];
return;
}
int unreadCount = 0;
sscanf(body, "voice-message: %d", &unreadCount);
[LinphoneLogger log:LinphoneLoggerLog format:@"Received new NOTIFY from voice mail: there is/are now %d message(s) unread", unreadCount];
if (unreadCount > 0) {
self.voicemailCount.hidden = FALSE;
self.voicemailCount.text = [NSString stringWithFormat:NSLocalizedString(@"%d unread messages", @"%d"), unreadCount];
} else {
self.voicemailCount.hidden = TRUE;
}
}
#pragma mark -
- (void)proxyConfigUpdate: (LinphoneProxyConfig*) config {
LinphoneRegistrationState state = LinphoneRegistrationNone;
NSString* message = nil;
UIImage* image = nil;
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneGlobalState gstate = linphone_core_get_global_state(lc);
LinphoneRegistrationState state = LinphoneRegistrationNone;
NSString* message = nil;
UIImage* image = nil;
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneGlobalState gstate = linphone_core_get_global_state(lc);
if( gstate == LinphoneGlobalConfiguring ){
message = NSLocalizedString(@"Fetching remote configuration", nil);
} else if (config == NULL) {
state = LinphoneRegistrationNone;
if(![LinphoneManager isLcReady] || linphone_core_is_network_reachable([LinphoneManager getLc]))
message = NSLocalizedString(@"No SIP account configured", nil);
else
message = NSLocalizedString(@"Network down", nil);
} else {
state = linphone_proxy_config_get_state(config);
switch (state) {
case LinphoneRegistrationOk:
message = NSLocalizedString(@"Registered", nil); break;
case LinphoneRegistrationNone:
case LinphoneRegistrationCleared:
message = NSLocalizedString(@"Not registered", nil); break;
case LinphoneRegistrationFailed:
message = NSLocalizedString(@"Registration failed", nil); break;
case LinphoneRegistrationProgress:
message = NSLocalizedString(@"Registration in progress", nil); break;
default: break;
}
}
if( gstate == LinphoneGlobalConfiguring ){
message = NSLocalizedString(@"Fetching remote configuration", nil);
} else if (config == NULL) {
state = LinphoneRegistrationNone;
if(![LinphoneManager isLcReady] || linphone_core_is_network_reachable([LinphoneManager getLc]))
message = NSLocalizedString(@"No SIP account configured", nil);
else
message = NSLocalizedString(@"Network down", nil);
} else {
state = linphone_proxy_config_get_state(config);
registrationStateLabel.hidden = NO;
switch(state) {
case LinphoneRegistrationFailed:
registrationStateImage.hidden = NO;
image = [UIImage imageNamed:@"led_error.png"];
break;
case LinphoneRegistrationCleared:
case LinphoneRegistrationNone:
registrationStateImage.hidden = NO;
image = [UIImage imageNamed:@"led_disconnected.png"];
break;
case LinphoneRegistrationProgress:
registrationStateImage.hidden = NO;
image = [UIImage imageNamed:@"led_inprogress.png"];
break;
case LinphoneRegistrationOk:
registrationStateImage.hidden = NO;
image = [UIImage imageNamed:@"led_connected.png"];
break;
}
[registrationStateLabel setText:message];
[registrationStateImage setImage:image];
switch (state) {
case LinphoneRegistrationOk:
message = NSLocalizedString(@"Registered", nil); break;
case LinphoneRegistrationNone:
case LinphoneRegistrationCleared:
message = NSLocalizedString(@"Not registered", nil); break;
case LinphoneRegistrationFailed:
message = NSLocalizedString(@"Registration failed", nil); break;
case LinphoneRegistrationProgress:
message = NSLocalizedString(@"Registration in progress", nil); break;
default: break;
}
}
registrationStateLabel.hidden = NO;
switch(state) {
case LinphoneRegistrationFailed:
registrationStateImage.hidden = NO;
image = [UIImage imageNamed:@"led_error.png"];
break;
case LinphoneRegistrationCleared:
case LinphoneRegistrationNone:
registrationStateImage.hidden = NO;
image = [UIImage imageNamed:@"led_disconnected.png"];
break;
case LinphoneRegistrationProgress:
registrationStateImage.hidden = NO;
image = [UIImage imageNamed:@"led_inprogress.png"];
break;
case LinphoneRegistrationOk:
registrationStateImage.hidden = NO;
image = [UIImage imageNamed:@"led_connected.png"];
break;
}
[registrationStateLabel setText:message];
[registrationStateImage setImage:image];
}
#pragma mark -
#pragma mark -
- (void)callSecurityUpdate {
BOOL pending = false;
BOOL security = true;
if(![LinphoneManager isLcReady]) {
[callSecurityImage setHidden:true];
return;
}
const MSList *list = linphone_core_get_calls([LinphoneManager getLc]);
if(list == NULL) {
if(securitySheet) {
[securitySheet dismissWithClickedButtonIndex:securitySheet.destructiveButtonIndex animated:TRUE];
}
[callSecurityImage setHidden:true];
return;
}
while(list != NULL) {
LinphoneCall *call = (LinphoneCall*) list->data;
LinphoneMediaEncryption enc = linphone_call_params_get_media_encryption(linphone_call_get_current_params(call));
if(enc == LinphoneMediaEncryptionNone)
security = false;
else if(enc == LinphoneMediaEncryptionZRTP) {
if(!linphone_call_get_authentication_token_verified(call)) {
pending = true;
}
}
list = list->next;
}
if(security) {
if(pending) {
[callSecurityImage setImage:[UIImage imageNamed:@"security_pending.png"]];
} else {
[callSecurityImage setImage:[UIImage imageNamed:@"security_ok.png"]];
}
} else {
[callSecurityImage setImage:[UIImage imageNamed:@"security_ko.png"]];
}
[callSecurityImage setHidden: false];
BOOL pending = false;
BOOL security = true;
if(![LinphoneManager isLcReady]) {
[callSecurityImage setHidden:true];
return;
}
const MSList *list = linphone_core_get_calls([LinphoneManager getLc]);
if(list == NULL) {
if(securitySheet) {
[securitySheet dismissWithClickedButtonIndex:securitySheet.destructiveButtonIndex animated:TRUE];
}
[callSecurityImage setHidden:true];
return;
}
while(list != NULL) {
LinphoneCall *call = (LinphoneCall*) list->data;
LinphoneMediaEncryption enc = linphone_call_params_get_media_encryption(linphone_call_get_current_params(call));
if(enc == LinphoneMediaEncryptionNone)
security = false;
else if(enc == LinphoneMediaEncryptionZRTP) {
if(!linphone_call_get_authentication_token_verified(call)) {
pending = true;
}
}
list = list->next;
}
if(security) {
if(pending) {
[callSecurityImage setImage:[UIImage imageNamed:@"security_pending.png"]];
} else {
[callSecurityImage setImage:[UIImage imageNamed:@"security_ok.png"]];
}
} else {
[callSecurityImage setImage:[UIImage imageNamed:@"security_ko.png"]];
}
[callSecurityImage setHidden: false];
}
- (void)callQualityUpdate {
UIImage *image = nil;
if([LinphoneManager isLcReady]) {
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
if(call != NULL) {
//FIXME double check call state before computing, may cause core dump
- (void)callQualityUpdate {
UIImage *image = nil;
if([LinphoneManager isLcReady]) {
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
if(call != NULL) {
//FIXME double check call state before computing, may cause core dump
float quality = linphone_call_get_average_quality(call);
if(quality < 1) {
image = [UIImage imageNamed:@"call_quality_indicator_0.png"];
} else if (quality < 2) {
image = [UIImage imageNamed:@"call_quality_indicator_1.png"];
} else if (quality < 3) {
image = [UIImage imageNamed:@"call_quality_indicator_2.png"];
} else {
image = [UIImage imageNamed:@"call_quality_indicator_3.png"];
}
}
}
if(image != nil) {
[callQualityImage setHidden:false];
[callQualityImage setImage:image];
} else {
[callQualityImage setHidden:true];
}
if(quality < 1) {
image = [UIImage imageNamed:@"call_quality_indicator_0.png"];
} else if (quality < 2) {
image = [UIImage imageNamed:@"call_quality_indicator_1.png"];
} else if (quality < 3) {
image = [UIImage imageNamed:@"call_quality_indicator_2.png"];
} else {
image = [UIImage imageNamed:@"call_quality_indicator_3.png"];
}
}
}
if(image != nil) {
[callQualityImage setHidden:false];
[callQualityImage setImage:image];
} else {
[callQualityImage setHidden:true];
}
}
#pragma mark - Action Functions
- (IBAction)doSecurityClick:(id)sender {
if([LinphoneManager isLcReady] && linphone_core_get_calls_nb([LinphoneManager getLc])) {
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
if(call != NULL) {
LinphoneMediaEncryption enc = linphone_call_params_get_media_encryption(linphone_call_get_current_params(call));
if(enc == LinphoneMediaEncryptionZRTP) {
bool valid = linphone_call_get_authentication_token_verified(call);
NSString *message = nil;
if(valid) {
message = NSLocalizedString(@"Remove trust in the peer?",nil);
} else {
message = [NSString stringWithFormat:NSLocalizedString(@"Confirm the following SAS with the peer:\n%s",nil),
linphone_call_get_authentication_token(call)];
}
if( securitySheet == nil ){
securitySheet = [[DTActionSheet alloc] initWithTitle:message];
[securitySheet setDelegate:self];
[securitySheet addButtonWithTitle:NSLocalizedString(@"Ok",nil) block:^(){
linphone_call_set_authentication_token_verified(call, !valid);
[securitySheet release];
securitySheet = nil;
}];
if([LinphoneManager isLcReady] && linphone_core_get_calls_nb([LinphoneManager getLc])) {
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
if(call != NULL) {
LinphoneMediaEncryption enc = linphone_call_params_get_media_encryption(linphone_call_get_current_params(call));
if(enc == LinphoneMediaEncryptionZRTP) {
bool valid = linphone_call_get_authentication_token_verified(call);
NSString *message = nil;
if(valid) {
message = NSLocalizedString(@"Remove trust in the peer?",nil);
} else {
message = [NSString stringWithFormat:NSLocalizedString(@"Confirm the following SAS with the peer:\n%s",nil),
linphone_call_get_authentication_token(call)];
}
if( securitySheet == nil ){
securitySheet = [[DTActionSheet alloc] initWithTitle:message];
[securitySheet setDelegate:self];
[securitySheet addButtonWithTitle:NSLocalizedString(@"Ok",nil) block:^(){
linphone_call_set_authentication_token_verified(call, !valid);
[securitySheet release];
securitySheet = nil;
}];
[securitySheet addDestructiveButtonWithTitle:NSLocalizedString(@"Cancel",nil) block:^(){
[securitySheet release];
securitySheet = nil;
}];
[securitySheet showInView:[PhoneMainView instance].view];
}
}
}
}
[securitySheet addDestructiveButtonWithTitle:NSLocalizedString(@"Cancel",nil) block:^(){
[securitySheet release];
securitySheet = nil;
}];
[securitySheet showInView:[PhoneMainView instance].view];
}
}
}
}
}
-(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{
[securitySheet release];
securitySheet = nil;
[securitySheet release];
securitySheet = nil;
}
#pragma mark - TPMultiLayoutViewController Functions
- (NSDictionary*)attributesForView:(UIView*)view {
NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
[attributes setObject:[NSValue valueWithCGRect:view.frame] forKey:@"frame"];
[attributes setObject:[NSValue valueWithCGRect:view.bounds] forKey:@"bounds"];
[attributes setObject:[NSNumber numberWithInteger:view.autoresizingMask] forKey:@"autoresizingMask"];
return attributes;
NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
[attributes setObject:[NSValue valueWithCGRect:view.frame] forKey:@"frame"];
[attributes setObject:[NSValue valueWithCGRect:view.bounds] forKey:@"bounds"];
[attributes setObject:[NSNumber numberWithInteger:view.autoresizingMask] forKey:@"autoresizingMask"];
return attributes;
}
- (void)applyAttributes:(NSDictionary*)attributes toView:(UIView*)view {
view.frame = [[attributes objectForKey:@"frame"] CGRectValue];
view.bounds = [[attributes objectForKey:@"bounds"] CGRectValue];
view.autoresizingMask = [[attributes objectForKey:@"autoresizingMask"] integerValue];
view.frame = [[attributes objectForKey:@"frame"] CGRectValue];
view.bounds = [[attributes objectForKey:@"bounds"] CGRectValue];
view.autoresizingMask = [[attributes objectForKey:@"autoresizingMask"] integerValue];
}
@end

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1280" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIStateBar">
@ -15,6 +15,7 @@
<outlet property="registrationStateImage" destination="5" id="14"/>
<outlet property="registrationStateLabel" destination="6" id="15"/>
<outlet property="view" destination="4" id="11"/>
<outlet property="voicemailCount" destination="jEB-96-YxX" id="hV2-9Z-i8b"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
@ -69,8 +70,17 @@
<action selector="doSecurityClick:" destination="-1" eventType="touchUpInside" id="30"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" tag="7" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="VOICEMAIL MSGS" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="jEB-96-YxX" userLabel="voicemailCount">
<rect key="frame" x="156" y="1" width="88" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
<view contentMode="scaleToFill" id="19" userLabel="Landscape View">
<rect key="frame" x="0.0" y="0.0" width="480" height="23"/>
@ -114,12 +124,26 @@
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
<label opaque="NO" userInteractionEnabled="NO" tag="7" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="VOICEMAIL MSGS" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="P9M-sM-t2B" userLabel="voicemailCount">
<rect key="frame" x="244" y="1" width="165" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
</objects>
<resources>
<image name="led_disconnected.png" width="18" height="17"/>
<image name="statebar_background.png" width="640" height="46"/>
</resources>
</document>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13E28" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="eUP-Pz-8te">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<scenes>
<!--Phone Main View-->
<scene sceneID="qBS-cv-8Um">
<objects>
<viewController storyboardIdentifier="PhoneMainView" wantsFullScreenLayout="YES" id="eUP-Pz-8te" customClass="PhoneMainView" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="6Tz-cV-9RM">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="1" contentMode="scaleToFill" image="background.png" id="aXd-fi-pw6" userLabel="background">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
</imageView>
<view contentMode="scaleToFill" id="rlH-Ra-JOu" userLabel="statusBarBG">
<rect key="frame" x="0.0" y="0.0" width="768" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<connections>
<outlet property="mainViewController" destination="emC-P9-oZj" id="goX-7a-wOn"/>
<outlet property="statusBarBG" destination="rlH-Ra-JOu" id="gTV-n5-AgJ"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="qO2-xf-enZ" userLabel="First Responder" sceneMemberID="firstResponder"/>
<viewController storyboardIdentifier="uicompositevc" nibName="UICompositeViewController" wantsFullScreenLayout="YES" id="emC-P9-oZj" userLabel="mainViewController" customClass="UICompositeViewController">
<extendedEdge key="edgesForExtendedLayout"/>
<nil key="simulatedStatusBarMetrics"/>
</viewController>
</objects>
<point key="canvasLocation" x="342" y="73"/>
</scene>
</scenes>
<resources>
<image name="background.png" width="640" height="523"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

View file

@ -23,6 +23,7 @@
#import "LinphoneManager.h"
#import "UICompositeViewController.h"
/* These imports are here so that we can import PhoneMainView.h without bothering to import all the rest of the view headers */
#import "AboutViewController.h"
#import "FirstLoginViewController.h"
#import "IncomingCallViewController.h"
@ -43,10 +44,23 @@
#import "ConsoleViewController.h"
#import "ImageViewController.h"
@class PhoneMainView;
@interface RootViewManager : NSObject
@property (nonatomic, retain) PhoneMainView* portraitViewController;
@property (nonatomic, retain) PhoneMainView* rotatingViewController;
@property (nonatomic, retain) NSMutableArray* viewDescriptionStack;
+(RootViewManager*)instance;
+ (void)setupWithPortrait:(PhoneMainView*)portrait;
- (PhoneMainView*)currentView;
@end
@interface PhoneMainView : UIViewController<IncomingCallViewDelegate> {
@private
int loadCount;
NSMutableArray *viewStack;
NSMutableArray *inhibitedEvents;
NSTimer *batteryTimer;
}
@ -54,6 +68,7 @@
@property (nonatomic, retain) IBOutlet UIView *statusBarBG;
@property (nonatomic, retain) IBOutlet UICompositeViewController *mainViewController;
@property (nonatomic, retain) NSString* name;
@property (readonly) UICompositeViewDescription *currentView;
@property (readonly, retain) MPVolumeView* volumeView;
@ -73,6 +88,7 @@
- (void)addInhibitedEvent:(id)event;
- (BOOL)removeInhibitedEvent:(id)event;
- (void)updateApplicationBadgeNumber;
+ (PhoneMainView*) instance;
@end

View file

@ -25,7 +25,83 @@
#import "Utils.h"
#import "DTActionSheet.h"
static PhoneMainView* phoneMainViewInstance=nil;
static RootViewManager* rootViewManagerInstance = nil;
@implementation RootViewManager {
PhoneMainView* currentViewController;
}
+ (void)setupWithPortrait:(PhoneMainView*)portrait {
assert(rootViewManagerInstance == nil);
rootViewManagerInstance = [[RootViewManager alloc]initWithPortrait:portrait];
}
- (instancetype)initWithPortrait:(PhoneMainView*)portrait {
self = [super init];
if ( self ){
self.portraitViewController = portrait;
self.rotatingViewController = [[[PhoneMainView alloc] init] autorelease];
self.portraitViewController.name = @"Portrait";
self.rotatingViewController.name = @"Rotating";
currentViewController = portrait;
self.viewDescriptionStack = [NSMutableArray array];
}
return self;
}
+ (RootViewManager *)instance {
if( !rootViewManagerInstance ){
@throw [NSException exceptionWithName:@"RootViewManager" reason:@"nil instance" userInfo:nil];
}
return rootViewManagerInstance;
}
- (PhoneMainView*)currentView {
return currentViewController;
}
- (PhoneMainView*)setViewControllerForDescription:(UICompositeViewDescription*)description {
PhoneMainView* newMainView = description.landscapeMode ? self.rotatingViewController : self.portraitViewController;
if( [LinphoneManager runningOnIpad] ) return currentViewController;
if( newMainView != currentViewController )
{
PhoneMainView* previousMainView = currentViewController;
UIInterfaceOrientation nextViewOrientation = newMainView.interfaceOrientation;
UIInterfaceOrientation previousOrientation = currentViewController.interfaceOrientation;
Linphone_err(@"Changing rootViewController: %@ -> %@", currentViewController.name, newMainView.name);
currentViewController = newMainView;
LinphoneAppDelegate* delegate = (LinphoneAppDelegate*)[UIApplication sharedApplication].delegate;
[UIView transitionWithView:delegate.window
duration:0.3
options:UIViewAnimationOptionTransitionFlipFromLeft|UIViewAnimationOptionAllowAnimatedContent
animations:^{
delegate.window.rootViewController = newMainView;
// when going to landscape-enabled view, we have to get the current portrait frame and orientation,
// because it could still have landscape-based size
if( nextViewOrientation != previousOrientation && newMainView == self.rotatingViewController ){
newMainView.view.frame = previousMainView.view.frame;
[newMainView.mainViewController.view setFrame:previousMainView.mainViewController.view.frame];
[newMainView willRotateToInterfaceOrientation:previousOrientation duration:0.3];
[newMainView willAnimateRotationToInterfaceOrientation:previousOrientation duration:0.3];
[newMainView didRotateFromInterfaceOrientation:nextViewOrientation];
}
}
completion:^(BOOL finished) {
}];
}
return currentViewController;
}
@end
@implementation PhoneMainView
@ -38,11 +114,7 @@ static PhoneMainView* phoneMainViewInstance=nil;
#pragma mark - Lifecycle Functions
- (void)initPhoneMainView {
assert (!phoneMainViewInstance);
phoneMainViewInstance = self;
currentView = nil;
viewStack = [[NSMutableArray alloc] init];
loadCount = 0; // For avoiding IOS 4 bug
inhibitedEvents = [[NSMutableArray alloc] init];
}
@ -75,7 +147,6 @@ static PhoneMainView* phoneMainViewInstance=nil;
[mainViewController release];
[inhibitedEvents release];
[viewStack release];
[super dealloc];
}
@ -84,26 +155,21 @@ static PhoneMainView* phoneMainViewInstance=nil;
#pragma mark - ViewController Functions
- (void)viewDidLoad {
// Avoid IOS 4 bug
if(loadCount++ > 0)
return;
[super viewDidLoad];
volumeView = [[MPVolumeView alloc] initWithFrame: CGRectMake(-100,-100,16,16)];
volumeView.showsRouteButton = false;
volumeView.userInteractionEnabled = false;
[self.view addSubview: mainViewController.view];
[self.view addSubview:mainViewController.view];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[mainViewController viewWillAppear:animated];
}
}
// Set observers
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdate:)
@ -132,7 +198,7 @@ static PhoneMainView* phoneMainViewInstance=nil;
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[mainViewController viewWillDisappear:animated];
}
@ -174,9 +240,6 @@ static PhoneMainView* phoneMainViewInstance=nil;
- (void)viewDidUnload {
[super viewDidUnload];
// Avoid IOS 4 bug
loadCount--;
}
- (void)setVolumeHidden:(BOOL)hidden {
@ -193,14 +256,13 @@ static PhoneMainView* phoneMainViewInstance=nil;
}
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if(interfaceOrientation == self.interfaceOrientation)
return YES;
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return 0;
if( [LinphoneManager runningOnIpad ] || [mainViewController currentViewSupportsLandscape] )
return UIInterfaceOrientationMaskAll;
else {
return UIInterfaceOrientationMaskPortrait;
}
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
@ -225,7 +287,7 @@ static PhoneMainView* phoneMainViewInstance=nil;
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
[mainViewController clearCache:viewStack];
[mainViewController clearCache:[RootViewManager instance].viewDescriptionStack];
}
#pragma mark - Event Functions
@ -449,7 +511,7 @@ static PhoneMainView* phoneMainViewInstance=nil;
}
+ (PhoneMainView *) instance {
return phoneMainViewInstance;
return [[RootViewManager instance] currentView];
}
- (void) showTabBar:(BOOL)show {
@ -460,18 +522,11 @@ static PhoneMainView* phoneMainViewInstance=nil;
[mainViewController setStateBarHidden:!show];
}
+ (BOOL)isDarkBackgroundView:(UICompositeViewDescription*)view {
return ( [view equal:[DialerViewController compositeViewDescription]] ||
[view equal:[IncomingCallViewController compositeViewDescription]] ||
[view equal:[InCallViewController compositeViewDescription]] ||
[view equal:[WizardViewController compositeViewDescription]]);
}
- (void)updateStatusBar:(UICompositeViewDescription*)to_view {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
// In iOS7, the app has a black background on dialer, incoming and incall, so we have to adjust the
// status bar style for each transition to/from these views
BOOL toLightStatus = (to_view != NULL) && ![PhoneMainView isDarkBackgroundView:to_view];
BOOL toLightStatus = (to_view != NULL) && ![to_view darkBackground];
if( !toLightStatus ) {
// black bg: white text on black background
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
@ -502,7 +557,8 @@ static PhoneMainView* phoneMainViewInstance=nil;
- (UIViewController*)changeCurrentView:(UICompositeViewDescription*)view push:(BOOL)push {
BOOL force = push;
if(!push) {
NSMutableArray* viewStack = [RootViewManager instance].viewDescriptionStack;
if(!push ) {
force = [viewStack count] > 1;
[viewStack removeAllObjects];
}
@ -512,27 +568,32 @@ static PhoneMainView* phoneMainViewInstance=nil;
- (UIViewController*)_changeCurrentView:(UICompositeViewDescription*)view transition:(CATransition*)transition force:(BOOL)force {
[LinphoneLogger logc:LinphoneLoggerLog format:"PhoneMainView: Change current view to %@", [view name]];
if(force || ![view equal: currentView]) {
PhoneMainView* vc = [[RootViewManager instance] setViewControllerForDescription:view];
if(force || ![view equal:vc.currentView] || vc != self) {
if(transition == nil)
transition = [PhoneMainView getTransition:currentView new:view];
transition = [PhoneMainView getTransition:vc.currentView new:view];
if ([[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference"] == true) {
[mainViewController setViewTransition:transition];
[vc.mainViewController setViewTransition:transition];
} else {
[mainViewController setViewTransition:nil];
[vc.mainViewController setViewTransition:nil];
}
[self updateStatusBar:view];
[mainViewController changeView:view];
currentView = view;
[vc updateStatusBar:view];
[vc.mainViewController changeView:view];
vc->currentView = view;
}
//[[RootViewManager instance] setViewControllerForDescription:view];
NSDictionary* mdict = [NSMutableDictionary dictionaryWithObject:currentView forKey:@"view"];
NSDictionary* mdict = [NSMutableDictionary dictionaryWithObject:vc->currentView forKey:@"view"];
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneMainViewChange object:self userInfo:mdict];
return [mainViewController getCurrentViewController];
return [vc->mainViewController getCurrentViewController];
}
- (void)popToView:(UICompositeViewDescription*)view {
NSMutableArray* viewStack = [RootViewManager instance].viewDescriptionStack;
while([viewStack count] > 1 && ![[viewStack lastObject] equal:view]) {
[viewStack removeLastObject];
}
@ -541,7 +602,8 @@ static PhoneMainView* phoneMainViewInstance=nil;
- (UICompositeViewDescription *)firstView {
UICompositeViewDescription *view = nil;
if([viewStack count]) {
NSArray* viewStack = [RootViewManager instance].viewDescriptionStack;
if([viewStack count]) {
view = [viewStack objectAtIndex:0];
}
return view;
@ -549,7 +611,8 @@ static PhoneMainView* phoneMainViewInstance=nil;
- (UIViewController*)popCurrentView {
[LinphoneLogger logc:LinphoneLoggerLog format:"PhoneMainView: Pop view"];
if([viewStack count] > 1) {
NSMutableArray* viewStack = [RootViewManager instance].viewDescriptionStack;
if([viewStack count] > 1) {
[viewStack removeLastObject];
[self _changeCurrentView:[viewStack lastObject] transition:[PhoneMainView getBackwardTransition] force:TRUE];
return [mainViewController getCurrentViewController];

View file

@ -630,7 +630,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (NSSet*)findHiddenKeys {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger log:LinphoneLoggerWarning format:@"Can't filter settings: Linphone core not read"];
[LinphoneLogger log:LinphoneLoggerWarning format:@"Can't filter settings: Linphone core not ready"];
}
LinphoneManager* lm = [LinphoneManager instance];
NSMutableSet *hiddenKeys = [NSMutableSet set];

View file

@ -6,45 +6,63 @@
// Copyright (c) 2012 Cocoanetics. All rights reserved.
//
#import "DTWeakSupport.h"
// the block to execute when an option button is tapped
typedef void (^DTActionSheetBlock)(void);
/**
Extends UIActionSheet with support for blocks
Extends UIActionSheet with support for blocks.
*/
@interface DTActionSheet : UIActionSheet
/**
Initializes the action sheet using the specified title.
Initializes the action sheet using the specified title.
@param title The title
*/
- (id)initWithTitle:(NSString *)title;
- (instancetype)initWithTitle:(NSString *)title;
/**
Adds a custom button to the action sheet.
@param title The title of the new button.
@param block The block to execute when the button is tapped.
@returns The index of the new button. Button indices start at 0 and increase in the order they are added.
*/
*/
- (NSInteger)addButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block;
/**
Adds a custom destructive button to the action sheet.
Since there can only be one destructive button a previously marked destructive button becomes a normal button.
@param title The title of the new button.
@param block The block to execute when the button is tapped.
@returns The index of the new button. Button indices start at 0 and increase in the order they are added.
*/
*/
- (NSInteger)addDestructiveButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block;
/**
Adds a custom cancel button to the action sheet.
Since there can only be one cancel button a previously marked cancel button becomes a normal button.
@param title The title of the new button.
@param block The block to execute when the button is tapped.
@returns The index of the new button. Button indices start at 0 and increase in the order they are added.
*/
*/
- (NSInteger)addCancelButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block;
@end
/**
Adds a custom cancel button to the action sheet.
Since there can only be one cancel button a previously marked cancel button becomes a normal button.
@param title The title of the new button.
@returns The index of the new button. Button indices start at 0 and increase in the order they are added.
*/
- (NSInteger)addCancelButtonWithTitle:(NSString *)title;
/**
* Use the actionSheetDelegate when you want to to receive UIActionSheetDelegate messages.
*/
@property (nonatomic, DT_WEAK_PROPERTY) id<UIActionSheetDelegate> actionSheetDelegate;
@end

View file

@ -7,6 +7,7 @@
//
#import "DTActionSheet.h"
#import "DTWeakSupport.h"
@interface DTActionSheet () <UIActionSheetDelegate>
@ -14,55 +15,74 @@
@implementation DTActionSheet
{
id <UIActionSheetDelegate> _externalDelegate;
NSMutableDictionary *_actionsPerIndex;
// lookup bitmask what delegate methods are implemented
struct
{
unsigned int delegateSupportsActionSheetCancel:1;
unsigned int delegateSupportsWillPresentActionSheet:1;
unsigned int delegateSupportsDidPresentActionSheet:1;
unsigned int delegateSupportsWillDismissWithButtonIndex:1;
unsigned int delegateSupportsDidDismissWithButtonIndex:1;
} _delegateFlags;
}
- (id)init
// designated initializer
- (instancetype)init
{
self = [super init];
if (self)
{
_actionsPerIndex = [[NSMutableDictionary alloc] init];
self.delegate = self;
[super setDelegate:self];
}
return self;
}
// designated initializer
- (id)initWithTitle:(NSString *)title
- (instancetype)initWithTitle:(NSString *)title
{
return [self initWithTitle:title delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
}
- (instancetype)initWithTitle:(NSString *)title delegate:(id<UIActionSheetDelegate>)delegate cancelButtonTitle:(NSString *)cancelButtonTitle destructiveButtonTitle:(NSString *)destructiveButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ...
{
self = [self init];
if (self)
if (self)
{
self.title = title;
if (otherButtonTitles != nil) {
[self addButtonWithTitle:otherButtonTitles];
va_list args;
va_start(args, otherButtonTitles);
NSString *title = nil;
while( (title = va_arg(args, NSString *)) ) {
[self addButtonWithTitle:title];
}
va_end(args);
}
if (destructiveButtonTitle) {
[self addDestructiveButtonWithTitle:destructiveButtonTitle block:nil];
}
if (cancelButtonTitle) {
[self addCancelButtonWithTitle:cancelButtonTitle block:nil];
}
self.actionSheetDelegate = delegate;
}
return self;
}
- (void)dealloc
{
[super setDelegate:nil];
self.actionSheetDelegate = nil;
}
- (NSInteger)addButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block
{
NSInteger retIndex = [self addButtonWithTitle:title];
if (block)
{
NSNumber *key = [NSNumber numberWithInt:retIndex];
[_actionsPerIndex setObject:[[block copy] autorelease] forKey:key];
NSNumber *key = [NSNumber numberWithInteger:retIndex];
[_actionsPerIndex setObject:[block copy] forKey:key];
}
return retIndex;
}
@ -70,122 +90,90 @@
{
NSInteger retIndex = [self addButtonWithTitle:title block:block];
[self setDestructiveButtonIndex:retIndex];
return retIndex;
}
- (NSInteger)addCancelButtonWithTitle:(NSString *)title
{
return [self addCancelButtonWithTitle:title block:nil];
}
- (NSInteger)addCancelButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block
{
NSInteger retIndex = [self addButtonWithTitle:title block:block];
[self setCancelButtonIndex:retIndex];
return retIndex;
}
#pragma UIActionSheetDelegate (forwarded)
#pragma mark - UIActionSheetDelegate (forwarded)
- (void)actionSheetCancel:(UIActionSheet *)actionSheet
{
if (_delegateFlags.delegateSupportsActionSheetCancel)
if ([self.actionSheetDelegate respondsToSelector:@selector(actionSheetCancel:)])
{
[_externalDelegate actionSheetCancel:actionSheet];
[self.actionSheetDelegate actionSheetCancel:actionSheet];
}
}
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet
{
if (_delegateFlags.delegateSupportsWillPresentActionSheet)
if ([self.actionSheetDelegate respondsToSelector:@selector(willPresentActionSheet:)])
{
[_externalDelegate willPresentActionSheet:actionSheet];
[self.actionSheetDelegate willPresentActionSheet:actionSheet];
}
}
- (void)didPresentActionSheet:(UIActionSheet *)actionSheet
{
if (_delegateFlags.delegateSupportsDidPresentActionSheet)
if ([self.actionSheetDelegate respondsToSelector:@selector(didPresentActionSheet:)])
{
[_externalDelegate didPresentActionSheet:actionSheet];
[self.actionSheetDelegate didPresentActionSheet:actionSheet];
}
}
- (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (_delegateFlags.delegateSupportsWillDismissWithButtonIndex)
if ([self.actionSheetDelegate respondsToSelector:@selector(actionSheet:willDismissWithButtonIndex:)])
{
[_externalDelegate actionSheet:actionSheet willDismissWithButtonIndex:buttonIndex];
[self.actionSheetDelegate actionSheet:actionSheet willDismissWithButtonIndex:buttonIndex];
}
}
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
{
NSNumber *key = [NSNumber numberWithInt:buttonIndex];
if ([self.actionSheetDelegate respondsToSelector:@selector(actionSheet:didDismissWithButtonIndex:)])
{
[self.actionSheetDelegate actionSheet:actionSheet didDismissWithButtonIndex:buttonIndex];
}
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSNumber *key = [NSNumber numberWithInteger:buttonIndex];
DTActionSheetBlock block = [_actionsPerIndex objectForKey:key];
if (block)
{
block();
}
if (_delegateFlags.delegateSupportsDidDismissWithButtonIndex)
if ([self.actionSheetDelegate respondsToSelector:@selector(actionSheet:clickedButtonAtIndex:)])
{
[_externalDelegate actionSheet:actionSheet didDismissWithButtonIndex:buttonIndex];
[self.actionSheetDelegate actionSheet:actionSheet clickedButtonAtIndex:buttonIndex];
}
}
#pragma mark Properties
- (id <UIActionSheetDelegate>)delegate
{
return _externalDelegate;
}
#pragma mark - Properties
- (void)setDelegate:(id <UIActionSheetDelegate>)delegate
{
if (delegate == self)
if (delegate)
{
[super setDelegate:self];
}
else if (delegate == nil)
{
[super setDelegate:nil];
_externalDelegate = nil;
}
else
{
_externalDelegate = delegate;
}
// wipe
memset(&_delegateFlags, 0, sizeof(_delegateFlags));
// set flags according to available methods in delegate
if ([_externalDelegate respondsToSelector:@selector(actionSheetCancel:)])
{
_delegateFlags.delegateSupportsActionSheetCancel = YES;
}
if ([_externalDelegate respondsToSelector:@selector(willPresentActionSheet:)])
{
_delegateFlags.delegateSupportsWillPresentActionSheet = YES;
}
if ([_externalDelegate respondsToSelector:@selector(didPresentActionSheet:)])
{
_delegateFlags.delegateSupportsDidPresentActionSheet = YES;
}
if ([_externalDelegate respondsToSelector:@selector(actionSheet:willDismissWithButtonIndex:)])
{
_delegateFlags.delegateSupportsWillDismissWithButtonIndex = YES;
}
if ([_externalDelegate respondsToSelector:@selector(actionSheet:didDismissWithButtonIndex:)])
{
_delegateFlags.delegateSupportsDidDismissWithButtonIndex = YES;
NSLog(@"Calling setDelegate is not supported! Use setActionSheetDelegate instead");
}
}
@end
@end

View file

@ -0,0 +1,33 @@
//
// DTWeakSupport.h
// DTFoundation
//
// Created by Oliver Drobnik on 6/3/13.
// Copyright (c) 2013 Cocoanetics. All rights reserved.
//
/**
Useful defines for building code the compiles with zeroing weak references if the deployment target allows it. This is possible from minimum supported iOS 5.0 and OS X 10.7 and above. Note that on OS X 10.7 some AppKit classes do not support having a weak ref, e.g. NSWindowController or NSViewController.
*/
#import <Availability.h>
#if __has_feature(objc_arc_weak)
// zeroing weak refs are supported for ivars and properties
#define DT_WEAK_VARIABLE __weak
#define DT_WEAK_PROPERTY weak
#elif __has_feature(objc_arc)
/// zeroing weak refs not supported, fall back to unsafe unretained and assigning
#define DT_WEAK_VARIABLE __unsafe_unretained
#define DT_WEAK_PROPERTY assign
#else
// define something, as this header might be included in a non-ARC project for using compiled code from an ARC static lib
#define DT_WEAK_VARIABLE
#define DT_WEAK_PROPERTY assign
#endif

View file

@ -27,8 +27,8 @@
})
typedef enum _LinphoneLoggerSeverity {
LinphoneLoggerLog = 0,
LinphoneLoggerDebug,
LinphoneLoggerDebug = 0,
LinphoneLoggerLog,
LinphoneLoggerWarning,
LinphoneLoggerError,
LinphoneLoggerFatal

View file

@ -129,6 +129,7 @@ static UICompositeViewDescription *compositeDescription = nil;
fullscreen:false
landscapeMode:[LinphoneManager runningOnIpad]
portraitMode:true];
compositeDescription.darkBackground = true;
}
return compositeDescription;
}
@ -917,7 +918,8 @@ static UICompositeViewDescription *compositeDescription = nil;
[UIView setAnimationCurve:curve];
[UIView setAnimationBeginsFromCurrentState:TRUE];
if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
if(([[UIDevice currentDevice].systemVersion floatValue] < 8) &&
UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
int width = endFrame.size.height;
endFrame.size.height = endFrame.size.width;
endFrame.size.width = width;

View file

@ -0,0 +1,26 @@
//
// DTObjectBlockExecutor.h
// DTFoundation
//
// Created by Oliver Drobnik on 12.02.13.
// Copyright (c) 2013 Cocoanetics. All rights reserved.
//
/**
This class is used by [NSObject addDeallocBlock:] to execute blocks on dealloc
*/
@interface DTObjectBlockExecutor : NSObject
/**
Convenience method to create a block executor with a deallocation block
@param block The block to execute when the created receiver is being deallocated
*/
+ (id)blockExecutorWithDeallocBlock:(void(^)())block;
/**
Block to execute when dealloc of the receiver is called
*/
@property (nonatomic, copy) void (^deallocBlock)();
@end

View file

@ -0,0 +1,30 @@
//
// DTObjectBlockExecutor.m
// DTFoundation
//
// Created by Oliver Drobnik on 12.02.13.
// Copyright (c) 2013 Cocoanetics. All rights reserved.
//
#import "DTObjectBlockExecutor.h"
@implementation DTObjectBlockExecutor
+ (id)blockExecutorWithDeallocBlock:(void(^)())block
{
DTObjectBlockExecutor *executor = [[DTObjectBlockExecutor alloc] init];
executor.deallocBlock = block; // copy
return executor;
}
- (void)dealloc
{
if (_deallocBlock)
{
_deallocBlock();
_deallocBlock = nil;
}
}
@end

View file

@ -0,0 +1,10 @@
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif

View file

@ -0,0 +1,106 @@
//
// LinphoneTester_Tests.m
// LinphoneTester Tests
//
// Created by guillaume on 10/09/2014.
//
//
#import <XCTest/XCTest.h>
#include "linphone/linphonecore.h"
#include "linphone/liblinphone_tester.h"
#import "NSObject+DTRuntime.h"
@interface LinphoneTester_Tests : XCTestCase
@end
@implementation LinphoneTester_Tests {
NSString* bundlePath;
NSString* documentPath;
}
static void linphone_log_function(OrtpLogLevel lev, const char *fmt, va_list args) {
NSString* log = [[NSString alloc] initWithFormat:[NSString stringWithUTF8String:fmt] arguments:args];
NSLog(@"%@",log);
}
void LSLog(NSString* fmt, ...){
va_list args;
va_start(args, fmt);
linphone_log_function(ORTP_MESSAGE, [fmt UTF8String], args);
va_end(args);
}
- (id)init {
self = [super init];
if( self ){
bundlePath = [[NSBundle mainBundle] bundlePath];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
documentPath = [paths objectAtIndex:0];
LSLog(@"Bundle path: %@", bundlePath);
LSLog(@"Document path: %@", documentPath);
liblinphone_tester_set_fileprefix([bundlePath UTF8String]);
liblinphone_tester_set_writable_dir_prefix( ms_strdup([documentPath UTF8String]) );
}
return self;
}
+ (NSArray*)skippedSuites {
NSArray* skipped_suites = @[@"Flexisip"];
return skipped_suites;
}
+ (void)initialize {
liblinphone_tester_init();
int count = liblinphone_tester_nb_test_suites();
for (int i=0; i<count; i++) {
const char* suite = liblinphone_tester_test_suite_name(i);
int test_count = liblinphone_tester_nb_tests(suite);
for( int k = 0; k<test_count; k++){
const char* test =liblinphone_tester_test_name(suite, k);
NSString* sSuite = [NSString stringWithUTF8String:suite];
NSString* sTest = [NSString stringWithUTF8String:test];
if( [[LinphoneTester_Tests skippedSuites] containsObject:sSuite] ) continue;
// prepend test_ so that it gets found by introspection
NSString* safesTest = [sTest stringByReplacingOccurrencesOfString:@" " withString:@"_"];
NSString* safesSuite = [sSuite stringByReplacingOccurrencesOfString:@" " withString:@"_"];
NSString *selectorName = [NSString stringWithFormat:@"test_%@__%@", safesSuite, safesTest];
[LinphoneTester_Tests addInstanceMethodWithSelectorName:selectorName block:^(LinphoneTester_Tests* myself) {
[myself testForSuite:sSuite andTest:sTest];
}];
}
}
}
- (void)setUp
{
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown
{
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testForSuite:(NSString*)suite andTest:(NSString*)test
{
LSLog(@"Launching test %@ from suite %@", test, suite);
XCTAssertFalse(liblinphone_tester_run_tests([suite UTF8String], [test UTF8String]), @"Suite '%@' / Test '%@' failed", suite, test);
}
@end

View file

@ -0,0 +1,56 @@
//
// NSObject+DTRuntime.h
// DTFoundation
//
// Created by Oliver Drobnik on 4/25/12.
// Copyright (c) 2012 Cocoanetics. All rights reserved.
//
/**
Methods to dynamically modify objects at runtime
*/
@interface NSObject (DTRuntime)
/**-------------------------------------------------------------------------------------
@name Blocks
---------------------------------------------------------------------------------------
*/
/**
Adds a block to be executed as soon as the receiver's memory is deallocated
@param block The block to execute when the receiver is being deallocated
*/
- (void)addDeallocBlock:(void(^)())block;
/**
Adds a new instance method to a class. All instances of this class will have this method.
The block captures `self` in the calling context. To allow access to the instance from within the block it is passed as parameter to the block.
@param selectorName The name of the method.
@param block The block to execute for the instance method, a pointer to the instance is passed as the only parameter.
@returns `YES` if the operation was successful
*/
+ (BOOL)addInstanceMethodWithSelectorName:(NSString *)selectorName block:(void(^)(id))block;
/**-------------------------------------------------------------------------------------
@name Method Swizzling
---------------------------------------------------------------------------------------
*/
/**
Exchanges two method implementations. After the call methods to the first selector will now go to the second one and vice versa.
@param selector The first method
@param otherSelector The second method
*/
+ (void)swizzleMethod:(SEL)selector withMethod:(SEL)otherSelector;
/**
Exchanges two class method implementations. After the call methods to the first selector will now go to the second one and vice versa.
@param selector The first method
@param otherSelector The second method
*/
+ (void)swizzleClassMethod:(SEL)selector withMethod:(SEL)otherSelector;
@end

View file

@ -0,0 +1,101 @@
//
// NSObject_DTRuntime.h
// DTFoundation
//
// Created by Oliver Drobnik on 4/25/12.
// Copyright (c) 2012 Cocoanetics. All rights reserved.
//
#import <objc/runtime.h>
#import "DTObjectBlockExecutor.h"
@implementation NSObject (DTRuntime)
static char DTRuntimeDeallocBlocks;
#pragma mark - Blocks
- (void)addDeallocBlock:(void(^)())block
{
// don't accept NULL block
NSParameterAssert(block);
NSMutableArray *deallocBlocks = objc_getAssociatedObject(self, &DTRuntimeDeallocBlocks);
// add array of dealloc blocks if not existing yet
if (!deallocBlocks)
{
deallocBlocks = [[NSMutableArray alloc] init];
objc_setAssociatedObject(self, &DTRuntimeDeallocBlocks, deallocBlocks, OBJC_ASSOCIATION_RETAIN);
}
DTObjectBlockExecutor *executor = [DTObjectBlockExecutor blockExecutorWithDeallocBlock:block];
[deallocBlocks addObject:executor];
}
+ (BOOL)addInstanceMethodWithSelectorName:(NSString *)selectorName block:(void(^)(id))block
{
// don't accept nil name
NSParameterAssert(selectorName);
// don't accept NULL block
NSParameterAssert(block);
// See http://stackoverflow.com/questions/6357663/casting-a-block-to-a-void-for-dynamic-class-method-resolution
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_7
void *impBlockForIMP = (void *)objc_unretainedPointer(block);
#else
id impBlockForIMP = (__bridge id)objc_unretainedPointer(block);
#endif
IMP myIMP = imp_implementationWithBlock(impBlockForIMP);
SEL selector = NSSelectorFromString(selectorName);
return class_addMethod(self, selector, myIMP, "v@:");
}
#pragma mark - Method Swizzling
+ (void)swizzleMethod:(SEL)selector withMethod:(SEL)otherSelector
{
// my own class is being targetted
Class c = [self class];
// get the methods from the selectors
Method originalMethod = class_getInstanceMethod(c, selector);
Method otherMethod = class_getInstanceMethod(c, otherSelector);
if (class_addMethod(c, selector, method_getImplementation(otherMethod), method_getTypeEncoding(otherMethod)))
{
class_replaceMethod(c, otherSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));
}
else
{
method_exchangeImplementations(originalMethod, otherMethod);
}
}
+ (void)swizzleClassMethod:(SEL)selector withMethod:(SEL)otherSelector
{
// my own class is being targetted
Class c = [self class];
// get the methods from the selectors
Method originalMethod = class_getClassMethod(c, selector);
Method otherMethod = class_getClassMethod(c, otherSelector);
// if (class_addMethod(c, selector, method_getImplementation(otherMethod), method_getTypeEncoding(otherMethod)))
// {
// class_replaceMethod(c, otherSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));
// }
// else
// {
method_exchangeImplementations(originalMethod, otherMethod);
// }
}
@end

View file

@ -47,20 +47,20 @@ static void linphone_log_function(OrtpLogLevel lev, const char *fmt, va_list arg
NSString* log = [[NSString alloc] initWithFormat:[NSString stringWithUTF8String:fmt] arguments:args];
NSLog(@"%@",log);
[logsBuffer addObject:log];
if (logsBuffer.count >= kLogsBufferCapacity ) {
[lastLogs addObjectsFromArray:logsBuffer];
if( lastLogs.count >= kLastLogsCapacity - kLogsBufferCapacity ){
[lastLogs removeObjectsInRange:NSMakeRange(0, kLogsBufferCapacity)];
}
[[NSNotificationCenter defaultCenter] postNotificationName:kLogsUpdateNotification
object:nil
userInfo:@{@"newlogs": [logsBuffer copy]}];
[logsBuffer removeAllObjects];
}
// [logsBuffer addObject:log];
//
// if (logsBuffer.count >= kLogsBufferCapacity ) {
// [lastLogs addObjectsFromArray:logsBuffer];
//
// if( lastLogs.count >= kLastLogsCapacity - kLogsBufferCapacity ){
// [lastLogs removeObjectsInRange:NSMakeRange(0, kLogsBufferCapacity)];
// }
// [[NSNotificationCenter defaultCenter] postNotificationName:kLogsUpdateNotification
// object:nil
// userInfo:@{@"newlogs": [logsBuffer copy]}];
// [logsBuffer removeAllObjects];
// }
}

View file

@ -9,9 +9,96 @@
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#include <execinfo.h>
#include <signal.h>
static NSString * const kKEY_CRASH_REPORT = @"CRASH_REPORT";
static NSString * const kKEY_ExceptionName = @"UnhandledExceptionName";
static NSString * const kKEY_ExceptionReason = @"UnhandledExceptionReason";
static NSString * const kKEY_ExceptionUserInfo = @"UnhandledExceptionUserInfo";
static NSString * const kKEY_ExceptionCallStack = @"UnhandledExceptionCallStack";
static NSString * const kKEY_ExceptionScreenshot = @"UnhandledExceptionScreenshot";
static NSString * const kKEY_ExceptionTimestamp = @"UnhandledExceptionTimestamp";
__unused void unhandledExceptionHandler(NSException *exception) {
NSMutableDictionary *crashReport = [NSMutableDictionary dictionary];
crashReport[kKEY_ExceptionName] = exception.name;
crashReport[kKEY_ExceptionReason] = exception.reason;
crashReport[kKEY_ExceptionUserInfo] = exception.userInfo ?: [NSNull null].debugDescription;
crashReport[kKEY_ExceptionCallStack] = exception.callStackSymbols.debugDescription;
NSLog(@"CRASH: %@ - %@", exception.name, exception.callStackSymbols.debugDescription);
[[NSUserDefaults standardUserDefaults] setObject:[NSDictionary dictionaryWithDictionary:crashReport] forKey:kKEY_CRASH_REPORT];
[[NSUserDefaults standardUserDefaults] synchronize];
exit(1);
}
/* SignalHandler
*
* Handle uncaught signals
*/
void SignalHandler(int sig, siginfo_t *info, void *context)
{
void *frames[128];
int i,len = backtrace(frames, 128);
char **symbols = backtrace_symbols(frames,len);
/*
* Now format into a message for sending to the user
*/
NSMutableString *buffer = [[NSMutableString alloc] initWithCapacity:4096];
NSBundle *bundle = [NSBundle mainBundle];
[buffer appendFormat:@"PComp version %@ build %@\n\n",
[bundle objectForInfoDictionaryKey:@"CFBundleVersion"],
[bundle objectForInfoDictionaryKey:@"CIMBuildNumber"]];
[buffer appendString:@"Uncaught Signal\n"];
[buffer appendFormat:@"si_signo %d\n",info->si_signo];
[buffer appendFormat:@"si_code %d\n",info->si_code];
[buffer appendFormat:@"si_value %d\n",info->si_value.sival_int];
[buffer appendFormat:@"si_errno %d\n",info->si_errno];
[buffer appendFormat:@"si_addr %p\n",info->si_addr];
[buffer appendFormat:@"si_status %d\n",info->si_status];
[buffer appendString:@"Stack trace:\n\n"];
for (i = 0; i < len; ++i) {
[buffer appendFormat:@"%4d - %s\n",i,symbols[i]];
}
/*
* Get the error file to write this to
*/
NSLog(@"Error %@",buffer);
exit(1);
}
void InstallUncaughtExceptionHandler()
{
NSSetUncaughtExceptionHandler(&unhandledExceptionHandler);
struct sigaction mySigAction;
mySigAction.sa_sigaction = SignalHandler;
mySigAction.sa_flags = SA_SIGINFO;
sigemptyset(&mySigAction.sa_mask);
sigaction(SIGQUIT, &mySigAction, NULL);
sigaction(SIGILL, &mySigAction, NULL);
sigaction(SIGTRAP, &mySigAction, NULL);
sigaction(SIGABRT, &mySigAction, NULL);
sigaction(SIGEMT, &mySigAction, NULL);
sigaction(SIGFPE, &mySigAction, NULL);
sigaction(SIGBUS, &mySigAction, NULL);
sigaction(SIGSEGV, &mySigAction, NULL);
sigaction(SIGSYS, &mySigAction, NULL);
}
int main(int argc, char * argv[])
{
InstallUncaughtExceptionHandler();
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}

View file

@ -1,34 +0,0 @@
//
// LinphoneTesterTests.m
// LinphoneTesterTests
//
// Created by guillaume on 28/05/2014.
//
//
#import <XCTest/XCTest.h>
@interface LinphoneTesterTests : XCTestCase
@end
@implementation LinphoneTesterTests
- (void)setUp
{
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown
{
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample
{
XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}
@end

View file

@ -2,6 +2,8 @@
contact="Linphone iPhone" <sip:linphone.iphone@unknown-host>
keepalive_period=30000
default_proxy=0
sip_port=-1
sip_tcp_port=-1
[rtp]
audio_rtp_port=7076
@ -21,6 +23,11 @@ firewall_policy=0
download_bw=380
upload_bw=380
[sound]
playback_dev_id=AU: Audio Unit Receiver
capture_dev_id=AU: Audio Unit Receiver
eq_active=0
[app]
rotation_preference=auto
animations_preference=1
@ -29,7 +36,7 @@ use_system_contacts=0
start_at_boot_preference=1
backgroundmode_preference=1
autoanswer_notif_preference=1
voiceproc_preference=1
[default_values]
reg_expires=600

View file

@ -26,11 +26,11 @@ video_jitt_comp=60
nortp_timeout=30
[sound]
playback_dev_id=AU: Audio Unit Receiver
ringer_dev_id=AQ: Audio Queue Device
capture_dev_id=AU: Audio Unit Receiver
echocancellation=0
dtmf_player_amp=0.007
eq_location=mic
eq_gains=50:2:50 100:2:50
[misc]
history_max_size=30
@ -42,7 +42,7 @@ domain=sip.linphone.org
proxy=sip.linphone.org:5223
password_length=6
username_length=4
expires=604800
expires=1314000
push_notification=1
transport=tls
sharing_server=https://www.linphone.org:444/upload.php

View file

@ -26,11 +26,11 @@ video_jitt_comp=60
nortp_timeout=30
[sound]
playback_dev_id=AU: Audio Unit Receiver
ringer_dev_id=AQ: Audio Queue Device
capture_dev_id=AU: Audio Unit Receiver
echocancellation=0
dtmf_player_amp=0.007
eq_location=mic
eq_gains=50:2:50 100:2:50
[misc]
history_max_size=30
@ -42,7 +42,7 @@ domain=sip.linphone.org
proxy=sip.linphone.org:5223
password_length=6
username_length=4
expires=604800
expires=1314000
push_notification=1
transport=tls
sharing_server=https://www.linphone.org:444/upload.php

View file

@ -2,6 +2,8 @@
contact="Linphone iPhone" <sip:linphone.iphone@unknown-host>
keepalive_period=30000
default_proxy=0
sip_port=-1
sip_tcp_port=-1
[rtp]
audio_rtp_port=7076
@ -21,6 +23,11 @@ firewall_policy=0
download_bw=512
upload_bw=512
[sound]
playback_dev_id=AU: Audio Unit Receiver
capture_dev_id=AU: Audio Unit Receiver
eq_active=0
[app]
rotation_preference=auto
animations_preference=1
@ -29,6 +36,7 @@ use_system_contacts=0
start_at_boot_preference=1
backgroundmode_preference=1
autoanswer_notif_preference=1
voiceproc_preference=1
[default_values]
reg_expires=600

View file

@ -5,7 +5,7 @@
<entry name="reg_proxy" overwrite="true">&lt;sip:sip.linphone.org:5223;transport=tls&gt;</entry>
<entry name="reg_route" overwrite="true">&lt;sip:sip.linphone.org:5223;transport=tls&gt;</entry>
<entry name="reg_identity" overwrite="true">sip:?@sip.linphone.org</entry>
<entry name="reg_expires" overwrite="true">604800</entry>
<entry name="reg_expires" overwrite="true">1314000</entry>
<entry name="reg_sendregister" overwrite="true">1</entry>
<entry name="publish" overwrite="true">0</entry>
<entry name="dial_escape_plus" overwrite="true">0</entry>

View file

@ -5,7 +5,7 @@
<entry name="reg_proxy" overwrite="true">&lt;sip:sip.linphone.org:5223;transport=tls&gt;</entry>
<entry name="reg_route" overwrite="true">&lt;sip:sip.linphone.org:5223;transport=tls&gt;</entry>
<entry name="reg_identity" overwrite="true">sip:?@sip.linphone.org</entry>
<entry name="reg_expires" overwrite="true">604800</entry>
<entry name="reg_expires" overwrite="true">1314000</entry>
<entry name="reg_sendregister" overwrite="true">1</entry>
<entry name="publish" overwrite="true">0</entry>
<entry name="dial_escape_plus" overwrite="true">0</entry>

View file

@ -198,6 +198,26 @@
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<string>Simple</string>
<key>Key</key>
<string>adaptive_rate_algorithm_preference</string>
<key>Title</key>
<string>Adaptive rate algorithm</string>
<key>Titles</key>
<array>
<string>Simple</string>
<string>Stateful</string>
</array>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Values</key>
<array>
<string>Simple</string>
<string>Stateful</string>
</array>
</dict>
<dict>
<key>DefaultValue</key>
<integer>36</integer>
@ -226,6 +246,26 @@
<integer>128</integer>
</array>
</dict>
<dict>
<key>DefaultValue</key>
<true/>
<key>Key</key>
<string>voiceproc_preference</string>
<key>Title</key>
<string>Enable Voice Processing</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>
<key>Key</key>
<string>eq_active</string>
<key>Title</key>
<string>Enable Bass Boost</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
</array>
</dict>
</plist>

View file

@ -88,6 +88,24 @@
<key>IASKTextAlignment</key>
<string>IASKUITextAlignmentRight</string>
</dict>
<dict>
<key>Key</key>
<string>voice_mail_uri_preference</string>
<key>Title</key>
<string>Voice mail URI</string>
<key>AutocapitalizationType</key>
<string>None</string>
<key>AutocorrectionType</key>
<string>No</string>
<key>DefaultValue</key>
<string></string>
<key>IsSecure</key>
<false/>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
<key>IASKTextAlignment</key>
<string>IASKUITextAlignmentRight</string>
</dict>
</array>
</dict>
</plist>

View file

@ -48,3 +48,9 @@
/* Codec bitrate limit */
"Codec bitrate limit" = "Codec bitrate limit";
/* Voice processing */
"Enable Voice Processing"="Enable Voice Processing";
/* Bass Boost / equalizer */
"Enable Bass Boost"="Enable Bass Boost";

View file

@ -48,3 +48,16 @@
/* Codec bitrate limit */
"Codec bitrate limit" = "Limite de débit du codec";
/* Voice processing */
"Enable Voice Processing"="Optimiser le son pour la VoIP";
/* Bass Boost / equalizer */
"Enable Bass Boost"="Activer Bass Boost";
/* Adaptative */
"Adaptive rate algorithm"="Adaptation du débit";
"Simple"="Simple";
"Stateful"="Stateful";

View file

@ -48,3 +48,9 @@
/* Codec bitrate limit */
"Codec bitrate limit" = "Codec bitrate limit";
/* Voice processing */
"Enable Voice Processing"="Enable Voice Processing";
/* Bass Boost / equalizer */
"Enable Bass Boost"="Enable Bass Boost";

34
UI.md Normal file
View file

@ -0,0 +1,34 @@
Quick UI reference for Linphone iOS:
- The app is contained in a window, which resides in the MainStoryboard file.
- The delegate is set to LinphoneAppDelegate in main.m, in the UIApplicationMain() by passing its class
- Basic layout:
MainStoryboard
|
| (rootViewController)
|
PhoneMainView ---> view #--> app background
| |
| #--> statusbar background
|
| (mainViewController)
|
UICompositeViewController : TPMultilayout
|
#---> view #--> stateBar
|
#--> contentView
|
#--> tabBar
When the app is started, the phoneMainView gets asked to transition to the Dialer view or the Wizard view.
PhoneMainView exposes the -changeCurrentView: method, which will setup its
Any Linphone view is actually presented in the UICompositeViewController, with or without a stateBar and tabBar.
The UICompositeViewController consists of 3 areas laid out vertically. From top to bottom: StateBar, Content and TabBar.
The TabBar is usually the UIMainBar, which is used as a navigation controller: clicking on each of the buttons will trigger
a transition to another "view".

View file

@ -59,7 +59,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.7.2</string>
<string>3.7.3</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
@ -100,11 +100,9 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>2.2.2</string>
<key>NSMainNibFile</key>
<string>LinphoneApp</string>
<key>NSMainNibFile~ipad</key>
<string>LinphoneApp</string>
<string>2.2.3</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationExitsOnSuspend</key>
<false/>
<key>UIBackgroundModes</key>
@ -117,6 +115,8 @@
<string>linphone_splashscreen</string>
<key>UILaunchImageFile~iphone</key>
<string>linphone_splashscreen</string>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>wifi</string>

View file

@ -203,6 +203,10 @@
57F005C915EE2D9200914747 /* linphonerc-factory in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C615EE2D9200914747 /* linphonerc-factory */; };
57F005CA15EE2D9200914747 /* linphonerc-factory~ipad in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C715EE2D9200914747 /* linphonerc-factory~ipad */; };
57F005CB15EE2D9200914747 /* linphonerc-factory~ipad in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C715EE2D9200914747 /* linphonerc-factory~ipad */; };
631C4FB119D2A8F2004BFE77 /* UIDigitButtonLongPlus.m in Sources */ = {isa = PBXBuildFile; fileRef = 631C4FB019D2A8F2004BFE77 /* UIDigitButtonLongPlus.m */; };
631C4FB219D2A8F2004BFE77 /* UIDigitButtonLongPlus.m in Sources */ = {isa = PBXBuildFile; fileRef = 631C4FB019D2A8F2004BFE77 /* UIDigitButtonLongPlus.m */; };
631C4FB719D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m in Sources */ = {isa = PBXBuildFile; fileRef = 631C4FB619D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m */; };
631C4FB819D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m in Sources */ = {isa = PBXBuildFile; fileRef = 631C4FB619D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m */; };
70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */ = {isa = PBXBuildFile; fileRef = 70571E1913FABCB000CDD3C2 /* rootca.pem */; };
7066FC0C13E830E400EFC6DC /* libvpx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7066FC0B13E830E400EFC6DC /* libvpx.a */; };
70E542F313E147E3002BA2C0 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F213E147E3002BA2C0 /* OpenGLES.framework */; };
@ -1349,12 +1353,23 @@
F04892FF180C3296002FED35 /* ImageOptim.sh in Resources */ = {isa = PBXBuildFile; fileRef = F04892FE180C3296002FED35 /* ImageOptim.sh */; };
F0489300180C3296002FED35 /* ImageOptim.sh in Resources */ = {isa = PBXBuildFile; fileRef = F04892FE180C3296002FED35 /* ImageOptim.sh */; };
F04F1E9D1806A41800D080F2 /* libpolarssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 57B0E35F173C010400A476B8 /* libpolarssl.a */; };
F0642EF119DAC891009DB336 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F0642EF019DAC891009DB336 /* MainStoryboard.storyboard */; };
F0642EF219DAC891009DB336 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F0642EF019DAC891009DB336 /* MainStoryboard.storyboard */; };
F066515517F9A02E0064280C /* UITransparentTVCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F066515417F9A02E0064280C /* UITransparentTVCell.m */; };
F066515617F9A02E0064280C /* UITransparentTVCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F066515417F9A02E0064280C /* UITransparentTVCell.m */; };
F0818E7E17FC51D8005A3330 /* linphone_icon_76.png in Resources */ = {isa = PBXBuildFile; fileRef = F0818E7C17FC51D8005A3330 /* linphone_icon_76.png */; };
F0818E7F17FC51D8005A3330 /* linphone_icon_76.png in Resources */ = {isa = PBXBuildFile; fileRef = F0818E7C17FC51D8005A3330 /* linphone_icon_76.png */; };
F0818E8017FC51D8005A3330 /* linphone_icon_152.png in Resources */ = {isa = PBXBuildFile; fileRef = F0818E7D17FC51D8005A3330 /* linphone_icon_152.png */; };
F0818E8117FC51D8005A3330 /* linphone_icon_152.png in Resources */ = {isa = PBXBuildFile; fileRef = F0818E7D17FC51D8005A3330 /* linphone_icon_152.png */; };
F08F118519C09C6B007D70C2 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F03A9B3318C0CF7000C4D7FE /* XCTest.framework */; };
F08F118619C09C6B007D70C2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
F08F118719C09C6B007D70C2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
F08F118D19C09C6B007D70C2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F08F118B19C09C6B007D70C2 /* InfoPlist.strings */; };
F08F118F19C09C6B007D70C2 /* LinphoneTester_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = F08F118E19C09C6B007D70C2 /* LinphoneTester_Tests.m */; };
F08F119919C09D88007D70C2 /* flexisip in Resources */ = {isa = PBXBuildFile; fileRef = F08F119819C09D88007D70C2 /* flexisip */; };
F08F119A19C09D88007D70C2 /* flexisip in Resources */ = {isa = PBXBuildFile; fileRef = F08F119819C09D88007D70C2 /* flexisip */; };
F08F119D19C0A65B007D70C2 /* NSObject+DTRuntime.m in Sources */ = {isa = PBXBuildFile; fileRef = F08F119C19C0A65B007D70C2 /* NSObject+DTRuntime.m */; };
F08F11A019C0A6CB007D70C2 /* DTObjectBlockExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = F08F119F19C0A6CB007D70C2 /* DTObjectBlockExecutor.m */; };
F0938159188E629800A55DFA /* iTunesArtwork in Resources */ = {isa = PBXBuildFile; fileRef = F0938158188E629800A55DFA /* iTunesArtwork */; };
F093815A188E629800A55DFA /* iTunesArtwork in Resources */ = {isa = PBXBuildFile; fileRef = F0938158188E629800A55DFA /* iTunesArtwork */; };
F0A2759C18157A6000B6D61A /* linphone_icon_120.png in Resources */ = {isa = PBXBuildFile; fileRef = F0818E7B17FC5160005A3330 /* linphone_icon_120.png */; };
@ -1417,11 +1432,9 @@
F0BB8C3C19362C2200974404 /* certificates in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C3919362C2200974404 /* certificates */; };
F0BB8C3D19362C2200974404 /* images in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C3A19362C2200974404 /* images */; };
F0BB8C3E19362C2200974404 /* sounds in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C3B19362C2200974404 /* sounds */; };
F0BB8C44193630CA00974404 /* flexisip.conf in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C3F193630CA00974404 /* flexisip.conf */; };
F0BB8C45193630CA00974404 /* local_tester_hosts in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C40193630CA00974404 /* local_tester_hosts */; };
F0BB8C46193630CA00974404 /* marie_xml in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C41193630CA00974404 /* marie_xml */; };
F0BB8C47193630CA00974404 /* tester_hosts in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C42193630CA00974404 /* tester_hosts */; };
F0BB8C48193630CA00974404 /* userdb.conf in Resources */ = {isa = PBXBuildFile; fileRef = F0BB8C43193630CA00974404 /* userdb.conf */; };
F0BB8C4C193631D200974404 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22276E8813C73DC000210156 /* CoreMedia.framework */; };
F0BB8C4D193631DF00974404 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 224567C1107B968500F10948 /* AVFoundation.framework */; };
F476004B147AAF2800FFF19B /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB911475562600DEE054 /* liblinphone.a */; };
@ -1474,6 +1487,13 @@
remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = NinePatch;
};
F08F119119C09C6B007D70C2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = F0BB8BD41936208100974404;
remoteInfo = LinphoneTester;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@ -1631,6 +1651,10 @@
57F005C315EE2CCF00914747 /* linphonerc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = linphonerc; path = Resources/linphonerc; sourceTree = "<group>"; };
57F005C615EE2D9200914747 /* linphonerc-factory */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "linphonerc-factory"; path = "Resources/linphonerc-factory"; sourceTree = "<group>"; };
57F005C715EE2D9200914747 /* linphonerc-factory~ipad */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "linphonerc-factory~ipad"; path = "Resources/linphonerc-factory~ipad"; sourceTree = "<group>"; };
631C4FAF19D2A8F2004BFE77 /* UIDigitButtonLongPlus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDigitButtonLongPlus.h; sourceTree = "<group>"; };
631C4FB019D2A8F2004BFE77 /* UIDigitButtonLongPlus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIDigitButtonLongPlus.m; sourceTree = "<group>"; };
631C4FB519D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDigitButtonLongVoiceMail.h; sourceTree = "<group>"; };
631C4FB619D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIDigitButtonLongVoiceMail.m; sourceTree = "<group>"; };
70571E1913FABCB000CDD3C2 /* rootca.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = rootca.pem; path = "liblinphone-sdk/apple-darwin/share/linphone/rootca.pem"; sourceTree = "<group>"; };
7066FC0B13E830E400EFC6DC /* libvpx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvpx.a; path = "liblinphone-sdk/apple-darwin/lib/libvpx.a"; sourceTree = "<group>"; };
70E542F213E147E3002BA2C0 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
@ -2260,11 +2284,23 @@
F03CA84118C72F1A0008889D /* UITextViewNoDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextViewNoDefine.h; sourceTree = "<group>"; };
F03CA84218C72F1A0008889D /* UITextViewNoDefine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UITextViewNoDefine.m; sourceTree = "<group>"; };
F04892FE180C3296002FED35 /* ImageOptim.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ImageOptim.sh; sourceTree = "<group>"; };
F0642EF019DAC891009DB336 /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard.storyboard; sourceTree = "<group>"; };
F0642EF719DAF32E009DB336 /* DTWeakSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DTWeakSupport.h; sourceTree = "<group>"; };
F066515317F9A02E0064280C /* UITransparentTVCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITransparentTVCell.h; sourceTree = "<group>"; };
F066515417F9A02E0064280C /* UITransparentTVCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UITransparentTVCell.m; sourceTree = "<group>"; };
F0818E7B17FC5160005A3330 /* linphone_icon_120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = linphone_icon_120.png; path = Resources/linphone_icon_120.png; sourceTree = "<group>"; };
F0818E7C17FC51D8005A3330 /* linphone_icon_76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = linphone_icon_76.png; path = Resources/linphone_icon_76.png; sourceTree = "<group>"; };
F0818E7D17FC51D8005A3330 /* linphone_icon_152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = linphone_icon_152.png; path = Resources/linphone_icon_152.png; sourceTree = "<group>"; };
F08F118419C09C6A007D70C2 /* LinphoneTester Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "LinphoneTester Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
F08F118A19C09C6B007D70C2 /* LinphoneTester Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LinphoneTester Tests-Info.plist"; sourceTree = "<group>"; };
F08F118C19C09C6B007D70C2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
F08F118E19C09C6B007D70C2 /* LinphoneTester_Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LinphoneTester_Tests.m; sourceTree = "<group>"; };
F08F119019C09C6B007D70C2 /* LinphoneTester Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LinphoneTester Tests-Prefix.pch"; sourceTree = "<group>"; };
F08F119819C09D88007D70C2 /* flexisip */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flexisip; path = submodules/linphone/tester/flexisip; sourceTree = SOURCE_ROOT; };
F08F119B19C0A65A007D70C2 /* NSObject+DTRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+DTRuntime.h"; sourceTree = "<group>"; };
F08F119C19C0A65B007D70C2 /* NSObject+DTRuntime.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+DTRuntime.m"; sourceTree = "<group>"; };
F08F119E19C0A6CB007D70C2 /* DTObjectBlockExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTObjectBlockExecutor.h; sourceTree = "<group>"; };
F08F119F19C0A6CB007D70C2 /* DTObjectBlockExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTObjectBlockExecutor.m; sourceTree = "<group>"; };
F0938158188E629800A55DFA /* iTunesArtwork */ = {isa = PBXFileReference; lastKnownFileType = file; path = iTunesArtwork; sourceTree = "<group>"; };
F09548181883F15300E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ChatRoomViewController.xib; sourceTree = "<group>"; };
F09548191883F15300E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ChatViewController.xib; sourceTree = "<group>"; };
@ -2356,9 +2392,6 @@
F0BB8BEE1936208200974404 /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = "<group>"; };
F0BB8BEF1936208200974404 /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = "<group>"; };
F0BB8BF11936208200974404 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
F0BB8BFF1936208200974404 /* LinphoneTesterTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LinphoneTesterTests-Info.plist"; sourceTree = "<group>"; };
F0BB8C011936208200974404 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
F0BB8C031936208200974404 /* LinphoneTesterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LinphoneTesterTests.m; sourceTree = "<group>"; };
F0BB8C0F193623F200974404 /* liblinphonetester.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblinphonetester.a; path = "liblinphone-sdk/apple-darwin/lib/liblinphonetester.a"; sourceTree = "<group>"; };
F0BB8C111936240300974404 /* libcunit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcunit.a; path = "liblinphone-sdk/apple-darwin/lib/libcunit.a"; sourceTree = "<group>"; };
F0BB8C311936246600974404 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; };
@ -2367,11 +2400,9 @@
F0BB8C3919362C2200974404 /* certificates */ = {isa = PBXFileReference; lastKnownFileType = folder; name = certificates; path = submodules/linphone/tester/certificates; sourceTree = SOURCE_ROOT; };
F0BB8C3A19362C2200974404 /* images */ = {isa = PBXFileReference; lastKnownFileType = folder; name = images; path = submodules/linphone/tester/images; sourceTree = SOURCE_ROOT; };
F0BB8C3B19362C2200974404 /* sounds */ = {isa = PBXFileReference; lastKnownFileType = folder; name = sounds; path = submodules/linphone/tester/sounds; sourceTree = SOURCE_ROOT; };
F0BB8C3F193630CA00974404 /* flexisip.conf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = flexisip.conf; path = submodules/linphone/tester/flexisip.conf; sourceTree = SOURCE_ROOT; };
F0BB8C40193630CA00974404 /* local_tester_hosts */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = local_tester_hosts; path = submodules/linphone/tester/local_tester_hosts; sourceTree = SOURCE_ROOT; };
F0BB8C41193630CA00974404 /* marie_xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = marie_xml; path = submodules/linphone/tester/marie_xml; sourceTree = SOURCE_ROOT; };
F0BB8C42193630CA00974404 /* tester_hosts */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = tester_hosts; path = submodules/linphone/tester/tester_hosts; sourceTree = SOURCE_ROOT; };
F0BB8C43193630CA00974404 /* userdb.conf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = userdb.conf; path = submodules/linphone/tester/userdb.conf; sourceTree = SOURCE_ROOT; };
F0BB8C4A193631B300974404 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
F84015BC1939FE37006ABAB5 /* test_failed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = test_failed.png; path = Resources/test_failed.png; sourceTree = "<group>"; };
F84015BD1939FE37006ABAB5 /* test_inprogress.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = test_inprogress.png; path = Resources/test_inprogress.png; sourceTree = "<group>"; };
@ -2498,6 +2529,16 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F08F118119C09C6A007D70C2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F08F118519C09C6B007D70C2 /* XCTest.framework in Frameworks */,
F08F118719C09C6B007D70C2 /* UIKit.framework in Frameworks */,
F08F118619C09C6B007D70C2 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F0BB8BD21936208100974404 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@ -2633,6 +2674,7 @@
D38187E015FE348A00C3EDCA /* WizardViewController.xib */,
D3D5126E160B3AD400946DF8 /* WizardViewController~ipad.xib */,
D3D5126A160B3A8E00946DF8 /* WizardViews.xib */,
F0642EF019DAC891009DB336 /* MainStoryboard.storyboard */,
);
path = Classes;
sourceTree = "<group>";
@ -2643,6 +2685,7 @@
1D6058910D05DD3D006BFB54 /* linphone.app */,
22D8F187147548E2008C97DB /* linphone-no-gpl-thirdparties.app */,
F0BB8BD51936208100974404 /* LinphoneTester.app */,
F08F118419C09C6A007D70C2 /* LinphoneTester Tests.xctest */,
);
name = Products;
sourceTree = "<group>";
@ -2688,6 +2731,10 @@
D381881815FE3F7F00C3EDCA /* UIContactDetailsHeader.xib */,
2248E90C12F7E4CF00220D9C /* UIDigitButton.h */,
2248E90D12F7E4CF00220D9C /* UIDigitButton.m */,
631C4FAF19D2A8F2004BFE77 /* UIDigitButtonLongPlus.h */,
631C4FB019D2A8F2004BFE77 /* UIDigitButtonLongPlus.m */,
631C4FB519D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.h */,
631C4FB619D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m */,
D3C6526515AC1A8F0092A874 /* UIEditableTableViewCell.h */,
D3C6526615AC1A8F0092A874 /* UIEditableTableViewCell.m */,
22BB1A67132FF16A005CD7AA /* UIEraseButton.h */,
@ -2720,18 +2767,18 @@
D354981E1587716B000081D8 /* UIStateBar.h */,
D354981F1587716B000081D8 /* UIStateBar.m */,
D35498201587716B000081D8 /* UIStateBar.xib */,
F03CA84118C72F1A0008889D /* UITextViewNoDefine.h */,
F03CA84218C72F1A0008889D /* UITextViewNoDefine.m */,
D32648421588F6FA00930C67 /* UIToggleButton.h */,
D32648431588F6FB00930C67 /* UIToggleButton.m */,
D3196D3C15A32BD7007FEEBA /* UITransferButton.h */,
D3196D3D15A32BD8007FEEBA /* UITransferButton.m */,
F066515317F9A02E0064280C /* UITransparentTVCell.h */,
F066515417F9A02E0064280C /* UITransparentTVCell.m */,
D32460E4159D9AAD00BA7F3A /* UITransparentView.h */,
D32460E5159D9AAD00BA7F3A /* UITransparentView.m */,
340751E5150F38FC00B89C47 /* UIVideoButton.h */,
340751E6150F38FD00B89C47 /* UIVideoButton.m */,
F066515317F9A02E0064280C /* UITransparentTVCell.h */,
F066515417F9A02E0064280C /* UITransparentTVCell.m */,
F03CA84118C72F1A0008889D /* UITextViewNoDefine.h */,
F03CA84218C72F1A0008889D /* UITextViewNoDefine.m */,
);
path = LinphoneUI;
sourceTree = "<group>";
@ -2739,15 +2786,15 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
F0938158188E629800A55DFA /* iTunesArtwork */,
2258633C11410BAC00C5A737 /* README */,
F04892FE180C3296002FED35 /* ImageOptim.sh */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
F04892FE180C3296002FED35 /* ImageOptim.sh */,
F0938158188E629800A55DFA /* iTunesArtwork */,
F0BB8BD91936208100974404 /* LinphoneTester */,
F0BB8BFD1936208200974404 /* LinphoneTesterTests */,
F08F118819C09C6B007D70C2 /* LinphoneTester Tests */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
19C28FACFE9D520D11CA2CBB /* Products */,
2258633C11410BAC00C5A737 /* README */,
29B97317FDCFA39411CA2CEA /* Resources */,
D398D3031594B0FB00FD553C /* Settings */,
);
@ -2910,6 +2957,7 @@
children = (
D37EE160160377D7003608A6 /* DTActionSheet.h */,
D37EE161160377D7003608A6 /* DTActionSheet.m */,
F0642EF719DAF32E009DB336 /* DTWeakSupport.h */,
);
name = DTFoundation;
path = Utils/DTFoundation;
@ -3038,6 +3086,29 @@
name = UACellBackgroundView;
sourceTree = "<group>";
};
F08F118819C09C6B007D70C2 /* LinphoneTester Tests */ = {
isa = PBXGroup;
children = (
F08F118E19C09C6B007D70C2 /* LinphoneTester_Tests.m */,
F08F119E19C0A6CB007D70C2 /* DTObjectBlockExecutor.h */,
F08F119F19C0A6CB007D70C2 /* DTObjectBlockExecutor.m */,
F08F119B19C0A65A007D70C2 /* NSObject+DTRuntime.h */,
F08F119C19C0A65B007D70C2 /* NSObject+DTRuntime.m */,
F08F118919C09C6B007D70C2 /* Supporting Files */,
);
path = "LinphoneTester Tests";
sourceTree = "<group>";
};
F08F118919C09C6B007D70C2 /* Supporting Files */ = {
isa = PBXGroup;
children = (
F08F118A19C09C6B007D70C2 /* LinphoneTester Tests-Info.plist */,
F08F118B19C09C6B007D70C2 /* InfoPlist.strings */,
F08F119019C09C6B007D70C2 /* LinphoneTester Tests-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
F0B89C2318DC90850050B60E /* images */ = {
isa = PBXGroup;
children = (
@ -3555,11 +3626,10 @@
F0BB8BDA1936208100974404 /* Supporting Files */ = {
isa = PBXGroup;
children = (
F0BB8C3F193630CA00974404 /* flexisip.conf */,
F08F119819C09D88007D70C2 /* flexisip */,
F0BB8C40193630CA00974404 /* local_tester_hosts */,
F0BB8C41193630CA00974404 /* marie_xml */,
F0BB8C42193630CA00974404 /* tester_hosts */,
F0BB8C43193630CA00974404 /* userdb.conf */,
F0BB8C3919362C2200974404 /* certificates */,
F0BB8C3A19362C2200974404 /* images */,
F0BB8C3B19362C2200974404 /* sounds */,
@ -3572,24 +3642,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
F0BB8BFD1936208200974404 /* LinphoneTesterTests */ = {
isa = PBXGroup;
children = (
F0BB8C031936208200974404 /* LinphoneTesterTests.m */,
F0BB8BFE1936208200974404 /* Supporting Files */,
);
path = LinphoneTesterTests;
sourceTree = "<group>";
};
F0BB8BFE1936208200974404 /* Supporting Files */ = {
isa = PBXGroup;
children = (
F0BB8BFF1936208200974404 /* LinphoneTesterTests-Info.plist */,
F0BB8C001936208200974404 /* InfoPlist.strings */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -3635,6 +3687,24 @@
productReference = 22D8F187147548E2008C97DB /* linphone-no-gpl-thirdparties.app */;
productType = "com.apple.product-type.application";
};
F08F118319C09C6A007D70C2 /* LinphoneTester Tests */ = {
isa = PBXNativeTarget;
buildConfigurationList = F08F119319C09C6B007D70C2 /* Build configuration list for PBXNativeTarget "LinphoneTester Tests" */;
buildPhases = (
F08F118019C09C6A007D70C2 /* Sources */,
F08F118119C09C6A007D70C2 /* Frameworks */,
F08F118219C09C6A007D70C2 /* Resources */,
);
buildRules = (
);
dependencies = (
F08F119219C09C6B007D70C2 /* PBXTargetDependency */,
);
name = "LinphoneTester Tests";
productName = "LinphoneTester Tests";
productReference = F08F118419C09C6A007D70C2 /* LinphoneTester Tests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
F0BB8BD41936208100974404 /* LinphoneTester */ = {
isa = PBXNativeTarget;
buildConfigurationList = F0BB8C051936208200974404 /* Build configuration list for PBXNativeTarget "LinphoneTester" */;
@ -3642,6 +3712,7 @@
F0BB8BD11936208100974404 /* Sources */,
F0BB8BD21936208100974404 /* Frameworks */,
F0BB8BD31936208100974404 /* Resources */,
F08F11A219C0AC2F007D70C2 /* ShellScript */,
);
buildRules = (
);
@ -3666,6 +3737,10 @@
22D8F11D147548E2008C97DB = {
DevelopmentTeam = Z2V957B3D6;
};
F08F118319C09C6A007D70C2 = {
DevelopmentTeam = Z2V957B3D6;
TestTargetID = F0BB8BD41936208100974404;
};
F0BB8BD41936208100974404 = {
DevelopmentTeam = Z2V957B3D6;
};
@ -3702,6 +3777,7 @@
1D6058900D05DD3D006BFB54 /* linphone */,
22D8F11D147548E2008C97DB /* linphone-no-gpl-thirdparties */,
F0BB8BD41936208100974404 /* LinphoneTester */,
F08F118319C09C6A007D70C2 /* LinphoneTester Tests */,
);
};
/* End PBXProject section */
@ -4094,6 +4170,7 @@
D3A74F4215C69392001500B9 /* speaker_on_disabled~ipad.png in Resources */,
D3A74F4415C69392001500B9 /* speaker_on_over~ipad.png in Resources */,
D3A74F4615C69392001500B9 /* statebar_background_landscape~ipad.png in Resources */,
F0642EF119DAC891009DB336 /* MainStoryboard.storyboard in Resources */,
D3A74F4815C69392001500B9 /* statebar_background~ipad.png in Resources */,
D3A74F4A15C69392001500B9 /* transfer_call_default~ipad.png in Resources */,
D3A74F4C15C69392001500B9 /* transfer_call_over~ipad.png in Resources */,
@ -4640,6 +4717,7 @@
D3A74F4315C69392001500B9 /* speaker_on_disabled~ipad.png in Resources */,
D3A74F4515C69392001500B9 /* speaker_on_over~ipad.png in Resources */,
D3A74F4715C69392001500B9 /* statebar_background_landscape~ipad.png in Resources */,
F0642EF219DAC891009DB336 /* MainStoryboard.storyboard in Resources */,
D3A74F4915C69392001500B9 /* statebar_background~ipad.png in Resources */,
D3A74F4B15C69392001500B9 /* transfer_call_default~ipad.png in Resources */,
D3A74F4D15C69392001500B9 /* transfer_call_over~ipad.png in Resources */,
@ -4816,16 +4894,24 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F08F118219C09C6A007D70C2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F08F119A19C09D88007D70C2 /* flexisip in Resources */,
F08F118D19C09C6B007D70C2 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F0BB8BD31936208100974404 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F0BB8C3819362C1500974404 /* rcfiles in Resources */,
F84015C11939FE37006ABAB5 /* test_passed.png in Resources */,
F0BB8C44193630CA00974404 /* flexisip.conf in Resources */,
F08F119919C09D88007D70C2 /* flexisip in Resources */,
F0BB8C46193630CA00974404 /* marie_xml in Resources */,
F0BB8BEA1936208200974404 /* Main_iPad.storyboard in Resources */,
F0BB8C48193630CA00974404 /* userdb.conf in Resources */,
F0BB8C3E19362C2200974404 /* sounds in Resources */,
F84015BF1939FE37006ABAB5 /* test_failed.png in Resources */,
F0BB8BF21936208200974404 /* Images.xcassets in Resources */,
@ -4868,6 +4954,19 @@
shellPath = /bin/sh;
shellScript = $SRCROOT/ImageOptim.sh;
};
F08F11A219C0AC2F007D70C2 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 12;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ \"$RUN_UNIT_TEST_WITH_IOS_SIM\" = \"YES\" ]; then\ntest_bundle_path=\"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.$WRAPPER_EXTENSION\"\nios-sim launch \"$(dirname \"$TEST_HOST\")\" --setenv DYLD_INSERT_LIBRARIES=/../../Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection --setenv XCInjectBundle=\"$test_bundle_path\" --setenv XCInjectBundleInto=\"$TEST_HOST\" --args -SenTest All \"$test_bundle_path\"\necho \"Finished running tests with ios-sim\"\nelse\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\nfi";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@ -4879,6 +4978,7 @@
1D3623260D0F684500981E51 /* LinphoneAppDelegate.m in Sources */,
22F2508E107141E100AC9B3F /* DialerViewController.m in Sources */,
22E0A822111C44E100B04932 /* AboutViewController.m in Sources */,
631C4FB119D2A8F2004BFE77 /* UIDigitButtonLongPlus.m in Sources */,
22E0A824111C44E100B04932 /* ConsoleViewController.m in Sources */,
2248E90E12F7E4CF00220D9C /* UIDigitButton.m in Sources */,
2214EB7A12F846B1002A5394 /* UICallButton.m in Sources */,
@ -4951,6 +5051,7 @@
D3807FF615C2894A005BE9BC /* IASKSpecifier.m in Sources */,
D3807FF815C2894A005BE9BC /* IASKPSSliderSpecifierViewCell.m in Sources */,
D3807FFA15C2894A005BE9BC /* IASKPSTextFieldSpecifierViewCell.m in Sources */,
631C4FB719D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m in Sources */,
D3807FFC15C2894A005BE9BC /* IASKPSTitleValueSpecifierViewCell.m in Sources */,
D3807FFE15C2894A005BE9BC /* IASKSlider.m in Sources */,
D380800015C2894A005BE9BC /* IASKSwitch.m in Sources */,
@ -4978,6 +5079,7 @@
22D8F145147548E2008C97DB /* LinphoneAppDelegate.m in Sources */,
22D8F146147548E2008C97DB /* DialerViewController.m in Sources */,
22D8F14A147548E2008C97DB /* AboutViewController.m in Sources */,
631C4FB219D2A8F2004BFE77 /* UIDigitButtonLongPlus.m in Sources */,
22D8F14B147548E2008C97DB /* ConsoleViewController.m in Sources */,
22D8F14C147548E2008C97DB /* UIDigitButton.m in Sources */,
22D8F14E147548E2008C97DB /* UICallButton.m in Sources */,
@ -5050,6 +5152,7 @@
D3807FF715C2894A005BE9BC /* IASKSpecifier.m in Sources */,
D3807FF915C2894A005BE9BC /* IASKPSSliderSpecifierViewCell.m in Sources */,
D3807FFB15C2894A005BE9BC /* IASKPSTextFieldSpecifierViewCell.m in Sources */,
631C4FB819D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m in Sources */,
D3807FFD15C2894A005BE9BC /* IASKPSTitleValueSpecifierViewCell.m in Sources */,
D3807FFF15C2894A005BE9BC /* IASKSlider.m in Sources */,
D380800115C2894A005BE9BC /* IASKSwitch.m in Sources */,
@ -5069,6 +5172,16 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F08F118019C09C6A007D70C2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F08F119D19C0A65B007D70C2 /* NSObject+DTRuntime.m in Sources */,
F08F118F19C09C6B007D70C2 /* LinphoneTester_Tests.m in Sources */,
F08F11A019C0A6CB007D70C2 /* DTObjectBlockExecutor.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F0BB8BD11936208100974404 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@ -5104,6 +5217,11 @@
name = NinePatch;
targetProxy = D3B90E1C15C2CBCD00F64F8C /* PBXContainerItemProxy */;
};
F08F119219C09C6B007D70C2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = F0BB8BD41936208100974404 /* LinphoneTester */;
targetProxy = F08F119119C09C6B007D70C2 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@ -5367,6 +5485,14 @@
name = "IncomingCallViewController~ipad.xib";
sourceTree = "<group>";
};
F08F118B19C09C6B007D70C2 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
F08F118C19C09C6B007D70C2 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
F0BB8BDC1936208100974404 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
@ -5391,14 +5517,6 @@
name = Main_iPad.storyboard;
sourceTree = "<group>";
};
F0BB8C001936208200974404 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
F0BB8C011936208200974404 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
@ -5442,9 +5560,10 @@
ORDER_FILE = "";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = linphone;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "384d6da1-05db-4d21-ba10-ec946478a862";
SKIP_INSTALL = NO;
TARGETED_DEVICE_FAMILY = "1,2";
WARNING_CFLAGS = "-Werror=objc-method-access";
};
name = Debug;
};
@ -5510,9 +5629,10 @@
ORDER_FILE = "";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = linphone;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "3732314a-627f-40fe-a089-235a74464861";
SKIP_INSTALL = NO;
TARGETED_DEVICE_FAMILY = "1,2";
WARNING_CFLAGS = "-Werror=objc-method-access";
};
name = DistributionAdhoc;
};
@ -5735,9 +5855,10 @@
ORDER_FILE = "";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = linphone;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "b9cdf249-07ad-4301-af2d-b3867137d57b";
SKIP_INSTALL = NO;
TARGETED_DEVICE_FAMILY = "1,2";
WARNING_CFLAGS = "-Werror=objc-method-access";
};
name = Release;
};
@ -5803,9 +5924,10 @@
ORDER_FILE = "";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = linphone;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "b9cdf249-07ad-4301-af2d-b3867137d57b";
SKIP_INSTALL = NO;
TARGETED_DEVICE_FAMILY = "1,2";
WARNING_CFLAGS = "-Werror=objc-method-access";
};
name = Distribution;
};
@ -5833,6 +5955,212 @@
};
name = Debug;
};
F08F119419C09C6B007D70C2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LinphoneTester.app/LinphoneTester";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "LinphoneTester Tests/LinphoneTester Tests-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
HEADER_SEARCH_PATHS = (
"liblinphone-sdk/apple-darwin/include",
Classes/Utils/NinePatch/,
Classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "LinphoneTester Tests/LinphoneTester Tests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins",
);
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
};
name = Debug;
};
F08F119519C09C6B007D70C2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LinphoneTester.app/LinphoneTester";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "LinphoneTester Tests/LinphoneTester Tests-Prefix.pch";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
HEADER_SEARCH_PATHS = (
"liblinphone-sdk/apple-darwin/include",
Classes/Utils/NinePatch/,
Classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "LinphoneTester Tests/LinphoneTester Tests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins",
);
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
TEST_HOST = "$(BUNDLE_LOADER)";
VALIDATE_PRODUCT = YES;
WRAPPER_EXTENSION = xctest;
};
name = Release;
};
F08F119619C09C6B007D70C2 /* Distribution */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LinphoneTester.app/LinphoneTester";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "LinphoneTester Tests/LinphoneTester Tests-Prefix.pch";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
HEADER_SEARCH_PATHS = (
"liblinphone-sdk/apple-darwin/include",
Classes/Utils/NinePatch/,
Classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "LinphoneTester Tests/LinphoneTester Tests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins",
);
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
TEST_HOST = "$(BUNDLE_LOADER)";
VALIDATE_PRODUCT = YES;
WRAPPER_EXTENSION = xctest;
};
name = Distribution;
};
F08F119719C09C6B007D70C2 /* DistributionAdhoc */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LinphoneTester.app/LinphoneTester";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "LinphoneTester Tests/LinphoneTester Tests-Prefix.pch";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
HEADER_SEARCH_PATHS = (
"liblinphone-sdk/apple-darwin/include",
Classes/Utils/NinePatch/,
Classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "LinphoneTester Tests/LinphoneTester Tests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins",
);
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
TEST_HOST = "$(BUNDLE_LOADER)";
VALIDATE_PRODUCT = YES;
WRAPPER_EXTENSION = xctest;
};
name = DistributionAdhoc;
};
F0BB8C061936208200974404 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -5850,6 +6178,10 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@ -5871,7 +6203,7 @@
Classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "LinphoneTester/LinphoneTester-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib",
@ -5879,7 +6211,7 @@
);
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "72278EC2-F54D-4717-86AD-08D6E2AEC22B";
PROVISIONING_PROFILE = "b16cf102-d1d6-44ea-80ce-ef7337931580";
WRAPPER_EXTENSION = app;
};
name = Debug;
@ -5902,6 +6234,10 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "LinphoneTester/LinphoneTester-Prefix.pch";
@ -5916,14 +6252,14 @@
Classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "LinphoneTester/LinphoneTester-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins",
);
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "72278EC2-F54D-4717-86AD-08D6E2AEC22B";
PROVISIONING_PROFILE = "b16cf102-d1d6-44ea-80ce-ef7337931580";
VALIDATE_PRODUCT = YES;
WRAPPER_EXTENSION = app;
};
@ -5947,6 +6283,10 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "LinphoneTester/LinphoneTester-Prefix.pch";
@ -5961,14 +6301,14 @@
Classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "LinphoneTester/LinphoneTester-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins",
);
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "72278EC2-F54D-4717-86AD-08D6E2AEC22B";
PROVISIONING_PROFILE = "b16cf102-d1d6-44ea-80ce-ef7337931580";
VALIDATE_PRODUCT = YES;
WRAPPER_EXTENSION = app;
};
@ -5992,6 +6332,10 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "LinphoneTester/LinphoneTester-Prefix.pch";
@ -6006,14 +6350,14 @@
Classes/Utils/XMLRPC/,
);
INFOPLIST_FILE = "LinphoneTester/LinphoneTester-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib",
"$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins",
);
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "72278EC2-F54D-4717-86AD-08D6E2AEC22B";
PROVISIONING_PROFILE = "b16cf102-d1d6-44ea-80ce-ef7337931580";
VALIDATE_PRODUCT = YES;
WRAPPER_EXTENSION = app;
};
@ -6055,6 +6399,17 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
F08F119319C09C6B007D70C2 /* Build configuration list for PBXNativeTarget "LinphoneTester Tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F08F119419C09C6B007D70C2 /* Debug */,
F08F119519C09C6B007D70C2 /* Release */,
F08F119619C09C6B007D70C2 /* Distribution */,
F08F119719C09C6B007D70C2 /* DistributionAdhoc */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
F0BB8C051936208200974404 /* Build configuration list for PBXNativeTarget "LinphoneTester" */ = {
isa = XCConfigurationList;
buildConfigurations = (

View file

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F0BB8BD41936208100974404"
BuildableName = "LinphoneTester.app"
BlueprintName = "LinphoneTester"
ReferencedContainer = "container:linphone.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F08F118319C09C6A007D70C2"
BuildableName = "LinphoneTester Tests.xctest"
BlueprintName = "LinphoneTester Tests"
ReferencedContainer = "container:linphone.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F0BB8BD41936208100974404"
BuildableName = "LinphoneTester.app"
BlueprintName = "LinphoneTester"
ReferencedContainer = "container:linphone.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F0BB8BD41936208100974404"
BuildableName = "LinphoneTester.app"
BlueprintName = "LinphoneTester"
ReferencedContainer = "container:linphone.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F0BB8BD41936208100974404"
BuildableName = "LinphoneTester.app"
BlueprintName = "LinphoneTester"
ReferencedContainer = "container:linphone.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "linphone.app"
BlueprintName = "linphone"
ReferencedContainer = "container:linphone.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "linphone.app"
BlueprintName = "linphone"
ReferencedContainer = "container:linphone.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "linphone.app"
BlueprintName = "linphone"
ReferencedContainer = "container:linphone.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
<AdditionalOption
key = "NSZombieEnabled"
value = "YES"
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "linphone.app"
BlueprintName = "linphone"
ReferencedContainer = "container:linphone.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

3
main.m
View file

@ -18,6 +18,7 @@
*/
#import <UIKit/UIKit.h>
#import "LinphoneAppDelegate.h"
#ifdef DEBUG
@ -35,7 +36,7 @@ int main(int argc, char *argv[]) {
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
#endif
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([LinphoneAppDelegate class]));
[pool release];
return retVal;
}

@ -1 +1 @@
Subproject commit ee99cb136b23558faadab3b0c654561f4a92e371
Subproject commit eee5149dde1ab04249e8d3d83676fa15d0ef78b6

View file

@ -1,5 +1,5 @@
############################################################################
# Makefile
# Makefile
# Copyright (C) 2009 Belledonne Communications,Grenoble France
#
############################################################################
@ -56,7 +56,7 @@ endif
ifeq ($(enable_gpl_third_parties),yes)
warning:
@echo
@echo
@echo "***************************************************************************"
@echo "***************************************************************************"
@echo "*****CAUTION, this liblinphone SDK is built using 3rd party GPL code ******"
@ -68,7 +68,7 @@ warning:
@echo "***************************************************************************"
else
warning:
@echo
@echo
@echo "*****************************************************************"
@echo "*****************************************************************"
@echo "*****Linphone SDK without 3rd party GPL software ******"
@ -84,17 +84,17 @@ LINPHONE_OPTIONS=enable_gpl_third_parties=$(enable_gpl_third_parties) \
enable_debug=$(enable_debug) enable_ffmpeg=$(enable_ffmpeg) enable_tunnel=$(enable_tunnel)
armv7-%:
armv7-%:
make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) $*
armv7s-%:
armv7s-%:
make -f builder-iphone-os.mk host=armv7s-apple-darwin $(LINPHONE_OPTIONS) $*
simu-%:
simu-%:
make -f builder-iphone-simulator.mk $(LINPHONE_OPTIONS) $*
build-% clean-% veryclean-%:
build-% clean-% veryclean-%:
make -f builder-iphone-simulator.mk $(LINPHONE_OPTIONS) $@ \
&& make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) $@ \
&& make -f builder-iphone-os.mk host=armv7s-apple-darwin $(LINPHONE_OPTIONS) $@
@ -106,8 +106,11 @@ broadcast_%:
&& make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) $* \
&& make -f builder-iphone-os.mk host=armv7s-apple-darwin $(LINPHONE_OPTIONS) $*
sdk:
make -f builder-iphone-os.mk delivery-sdk
sdk:
make -f builder-iphone-os.mk delivery-sdk
download-sdk:
make -f builder-iphone-os.mk download-sdk
build: broadcast_all sdk
@ -119,7 +122,7 @@ veryclean: broadcast_veryclean
zipres:
@tar -C ../.. -czf ../../ios_assets.tar.gz Resources iTunesArtwork
@tar -C ../.. -czf ../../ios_assets.tar.gz Resources iTunesArtwork
@echo Archive 'ios_assets.tar.gz' placed in root directory
help:

View file

@ -1,5 +1,5 @@
############################################################################
# builder-generic.mk
# builder-generic.mk
# Copyright (C) 2009 Belledonne Communications,Grenoble France
#
############################################################################
@ -19,7 +19,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
host?=armv7-apple-darwin
config_site:=iphone-config.site
library_mode:= --disable-shared --enable-static
@ -40,7 +40,7 @@ linphone_configure_controls = \
--disable-tools \
--enable-msg-storage=yes
#path
BUILDER_SRC_DIR?=$(shell pwd)/../
ifeq ($(enable_debug),yes)
@ -82,19 +82,19 @@ else
SWITCHES += disable_tunnel
endif
ifeq ($(enable_gpl_third_parties),yes)
ifeq ($(enable_gpl_third_parties),yes)
SWITCHES+= enable_gpl_third_parties
ifeq ($(enable_ffmpeg), yes)
linphone_configure_controls+= --enable-ffmpeg
linphone_configure_controls+= --enable-ffmpeg
SWITCHES += enable_ffmpeg
else
linphone_configure_controls+= --disable-ffmpeg
linphone_configure_controls+= --disable-ffmpeg
SWITCHES += disable_ffmpeg
endif
else # !enable gpl
linphone_configure_controls+= --disable-ffmpeg
linphone_configure_controls+= --disable-ffmpeg
SWITCHES += disable_gpl_third_parties disable_ffmpeg
endif
@ -107,12 +107,10 @@ $(LINPHONE_BUILD_DIR)/enable_% $(LINPHONE_BUILD_DIR)/disable_%:
mkdir -p $(LINPHONE_BUILD_DIR)
cd $(LINPHONE_BUILD_DIR) && rm -f *able_$*
touch $@
cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile
cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile
# end of switches parsing
osip_dir=externals/osip
eXosip_dir=externals/exosip
speex_dir=externals/speex
gsm_dir=externals/gsm
@ -124,12 +122,12 @@ LIBILBC_BUILD_DIR:=$(BUILDER_BUILD_DIR)/libilbc-rfc3951
ifneq (,$(findstring arm,$(host)))
#SPEEX_CONFIGURE_OPTION := --enable-fixed-point --disable-float-api
CFLAGS := $(CFLAGS) -marm
CFLAGS := $(CFLAGS) -marm
SPEEX_CONFIGURE_OPTION := --disable-float-api --enable-arm5e-asm --enable-fixed-point
endif
ifneq (,$(findstring armv7,$(host)))
SPEEX_CONFIGURE_OPTION += --enable-armv7neon-asm
SPEEX_CONFIGURE_OPTION += --enable-armv7neon-asm
endif
clean-makefile: clean-makefile-linphone clean-makefile-msbcg729
@ -143,7 +141,7 @@ veryclean: veryclean-linphone veryclean-msbcg729
# list of the submodules to build, the order is important
MS_MODULES := msilbc libilbc msamr mssilk msx264 mswebrtc msopenh264
SUBMODULES_LIST := polarssl
SUBMODULES_LIST := polarssl
ifeq ($(enable_tunnel),yes)
SUBMODULES_LIST += tunnel
@ -178,16 +176,16 @@ $(LINPHONE_BUILD_DIR)/Makefile: $(LINPHONE_SRC_DIR)/configure
PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \
$(LINPHONE_SRC_DIR)/configure -prefix=$(prefix) --host=$(host) ${library_mode} \
${linphone_configure_controls}
#libphone only (asume dependencies are met)
build-liblinphone: $(LINPHONE_BUILD_DIR)/Makefile
build-liblinphone: $(LINPHONE_BUILD_DIR)/Makefile
cd $(LINPHONE_BUILD_DIR) && export PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig export CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make newdate && make && make install
clean-makefile-liblinphone:
cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile
clean-liblinphone:
clean-makefile-liblinphone:
cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile
clean-liblinphone:
cd $(LINPHONE_BUILD_DIR) && make clean
#speex
@ -219,6 +217,7 @@ clean-makefile-speex:
build-libgsm:
cp -rf $(BUILDER_SRC_DIR)/$(gsm_dir) $(BUILDER_BUILD_DIR)/$(gsm_dir)
rm -rf $(BUILDER_BUILD_DIR)/$(gsm_dir)/.git
rm -f $(prefix)/lib/libgsm.a
rm -rf $(prefix)/include/gsm
cd $(BUILDER_BUILD_DIR)/$(gsm_dir)\
@ -230,7 +229,7 @@ clean-libgsm:
cd $(BUILDER_BUILD_DIR)/$(gsm_dir)\
&& make clean
veryclean-libgsm:
veryclean-libgsm:
-cd $(BUILDER_BUILD_DIR)/$(gsm_dir) \
&& make uninstall
@ -327,14 +326,22 @@ delivery-sdk: multi-arch
liblinphone-tutorials \
-x liblinphone-tutorials/hello-world/build\* \
-x liblinphone-tutorials/hello-world/hello-world.xcodeproj/*.pbxuser \
-x liblinphone-tutorials/hello-world/hello-world.xcodeproj/*.mode1v3
-x liblinphone-tutorials/hello-world/hello-world.xcodeproj/*.mode1v3
download-sdk:
cd $(BUILDER_SRC_DIR)/../
rm -fr liblinphone-iphone-sdk-latest*
wget http://linphone.org/snapshots/ios/liblinphone-iphone-sdk-latest.zip
unzip -o -q liblinphone-iphone-sdk-latest.zip
rm -fr ../../liblinphone-sdk/
mv liblinphone-sdk ../..
.PHONY delivery:
cd $(BUILDER_SRC_DIR)/../../ \
&& zip -r $(BUILDER_SRC_DIR)/linphone-iphone.zip \
linphone-iphone \
-x linphone-iphone/build\* \
--exclude linphone-iphone/.git\* --exclude \*.[od] --exclude \*.so.\* --exclude \*.a --exclude linphone-iphone/liblinphone-sdk/apple-darwin/\* --exclude \*.lo
--exclude linphone-iphone/.git\* --exclude \*.[od] --exclude \*.so.\* --exclude \*.a --exclude linphone-iphone/liblinphone-sdk/apple-darwin/\* --exclude \*.lo
ipa:
cd $(BUILDER_SRC_DIR)/../ \

View file

@ -24,10 +24,10 @@ enable_opus?=yes
libopus_configure_options=--disable-extra-programs --disable-doc
ifneq (,$(findstring armv7,$(host)))
libopus_configure_options+= --enable-fixed-point --disable-asm
libopus_configure_options+= --enable-fixed-point
endif
ifneq (,$(findstring armv7s,$(host)))
libopus_configure_options+= --enable-fixed-point --disable-asm
libopus_configure_options+= --enable-fixed-point
endif
$(BUILDER_SRC_DIR)/$(opus_dir)/configure:

View file

@ -134,3 +134,16 @@ index e851562..c159f9e 100644
movlt r0, #0
bx lr
.endfunc
diff --git a/configure b/configure
index 250b0ac..af69d44 100755
--- a/configure
+++ b/configure
@@ -456,7 +456,7 @@ case $host_os in
;;
darwin*)
SYS="MACOSX"
- CFLAGS="$CFLAGS -falign-loops=16"
+ CFLAGS="$CFLAGS"
libm="-lm"
if [ "$pic" = "no" ]; then
cc_check "" -mdynamic-no-pic && CFLAGS="$CFLAGS -mdynamic-no-pic"

View file

@ -1,7 +1,7 @@
# -*- shell-script -*-
SDK_VERSION_MAJOR=4
SDK_VERSION=4.0
SDK_VERSION_MAJOR=5
SDK_VERSION=5.0
MCPU=""
CLANG_TARGET_SPECIFIER=miphoneos-version-min
if test "${host_alias}" = "i386-apple-darwin" ; then

@ -1 +1 @@
Subproject commit 8ceda7ef0d35130057affc2e5a61c0667cde15aa
Subproject commit 0948658db85a7c9933ed2d39a159239d9ee5c734

@ -1 +1 @@
Subproject commit 20985f63cb691f7ea0bdf9ccf7d5cbfda055e060
Subproject commit 489f375fb391cb70d82b56f509c39cbf7fa0b706

@ -1 +1 @@
Subproject commit fcecd29abf32164326e568acdcdf7d8e877b33b1
Subproject commit da97db1ca1f92592af3534c9a2596da0e9a009ca

@ -1 +1 @@
Subproject commit e9f7b4487464909a786b156b149de7769d1df3a2
Subproject commit deb4df4789494ecbfd55926ec3e03e2f736899c5

@ -1 +1 @@
Subproject commit 3c32fd43972ad9560f33e1f056ad7be694d8e685
Subproject commit 2479a567a5a49a7a63406b3b1bf3f7a536a03d54

@ -1 +1 @@
Subproject commit 7a8738cd1f034222f83ffa3be8a411319b1a37fa
Subproject commit e60a95bfa38019635607b14964e2a3c1ee067248

@ -1 +1 @@
Subproject commit ee2a0f6f0904995177434292a7a0fb4c51632e4e
Subproject commit 05b55211c6fe7eebef485a00a60c66cbe1394907