Merge branch 'new_ui' into buschjaeger_new_ui

This commit is contained in:
Yann Diorcet 2012-08-20 09:16:06 +02:00
commit 0ad783a7cc
191 changed files with 5319 additions and 20054 deletions

View file

@ -13,11 +13,6 @@
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUICustomObject</string>
<string>IBUINavigationBar</string>
<string>IBUINavigationController</string>
<string>IBUINavigationItem</string>
<string>IBUIToolbar</string>
<string>IBUIViewController</string>
<string>IBUIWindow</string>
</array>
<array key="IBDocument.PluginDependencies">
@ -45,7 +40,6 @@
<string key="NSFrameSize">{320, 480}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
@ -57,66 +51,6 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIResizesToFullScreen">YES</bool>
</object>
<object class="IBUINavigationController" id="779589451">
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<bool key="IBUIDefinesPresentationContext">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
<object class="IBUINavigationBar" key="IBUINavigationBar" id="734288452">
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{0, 0}</string>
<string key="NSReuseIdentifierKey">_NS:15</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIToolbar" key="IBUIToolbar" id="747868920">
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{0, 416}, {320, 44}}</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<array key="IBUIViewControllers">
<object class="IBUIViewController" id="497256517">
<object class="IBUINavigationItem" key="IBUINavigationItem" id="293407448">
<string key="IBUITitle">Item</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIParentViewController" ref="779589451"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</array>
<bool key="IBUINavigationBarHidden">YES</bool>
</object>
<object class="IBUIViewController" id="101023265">
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="166021432">
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
@ -136,46 +70,6 @@
</object>
<int key="connectionID">6</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">buschJaegerCallView</string>
<reference key="source" ref="108347475"/>
<reference key="destination" ref="101023265"/>
</object>
<int key="connectionID">23</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">buschJaegerSettingsView</string>
<reference key="source" ref="108347475"/>
<reference key="destination" ref="166021432"/>
</object>
<int key="connectionID">25</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">navigationController</string>
<reference key="source" ref="108347475"/>
<reference key="destination" ref="779589451"/>
</object>
<int key="connectionID">26</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">buschJaegerMainView</string>
<reference key="source" ref="108347475"/>
<reference key="destination" ref="497256517"/>
</object>
<int key="connectionID">24</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">rootViewController</string>
<reference key="source" ref="85768899"/>
<reference key="destination" ref="779589451"/>
</object>
<int key="connectionID">19</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@ -207,49 +101,6 @@
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">14</int>
<reference key="object" ref="779589451"/>
<array class="NSMutableArray" key="children">
<reference ref="734288452"/>
<reference ref="497256517"/>
<reference ref="747868920"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="734288452"/>
<reference key="parent" ref="779589451"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="101023265"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="166021432"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="497256517"/>
<array class="NSMutableArray" key="children">
<reference ref="293407448"/>
</array>
<reference key="parent" ref="779589451"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="293407448"/>
<reference key="parent" ref="497256517"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">28</int>
<reference key="object" ref="747868920"/>
<reference key="parent" ref="779589451"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@ -257,17 +108,7 @@
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="14.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="15.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="20.CustomClassName">BuschJaegerMainView</string>
<string key="20.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="21.CustomClassName">BuschJaegerCallView</string>
<string key="21.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="22.CustomClassName">BuschJaegerSettingsView</string>
<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="27.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="28.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="3.CustomClassName">BuschJaegerAppDelegate</string>
<string key="3.CustomClassName">LinphoneAppDelegate</string>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
@ -280,196 +121,11 @@
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">BuschJaegerAppDelegate</string>
<string key="className">LinphoneAppDelegate</string>
<string key="superclassName">NSObject</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="buschJaegerCallView">BuschJaegerCallView</string>
<string key="buschJaegerMainView">BuschJaegerMainView</string>
<string key="buschJaegerSettingsView">BuschJaegerSettingsView</string>
<string key="navigationController">UINavigationController</string>
<string key="window">UIWindow</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="buschJaegerCallView">
<string key="name">buschJaegerCallView</string>
<string key="candidateClassName">BuschJaegerCallView</string>
</object>
<object class="IBToOneOutletInfo" key="buschJaegerMainView">
<string key="name">buschJaegerMainView</string>
<string key="candidateClassName">BuschJaegerMainView</string>
</object>
<object class="IBToOneOutletInfo" key="buschJaegerSettingsView">
<string key="name">buschJaegerSettingsView</string>
<string key="candidateClassName">BuschJaegerSettingsView</string>
</object>
<object class="IBToOneOutletInfo" key="navigationController">
<string key="name">navigationController</string>
<string key="candidateClassName">UINavigationController</string>
</object>
<object class="IBToOneOutletInfo" key="window">
<string key="name">window</string>
<string key="candidateClassName">UIWindow</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/BuschJaegerAppDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">BuschJaegerCallView</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="startCall:">id</string>
<string key="takeCall:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="startCall:">
<string key="name">startCall:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="takeCall:">
<string key="name">takeCall:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="decline">UIHangUpButton</string>
<string key="endOrRejectCall">UIHangUpButton</string>
<string key="lights">UIDigitButton</string>
<string key="mute">UIToggleButton</string>
<string key="openDoor">UIDigitButton</string>
<string key="startCall">UIButton</string>
<string key="takeCall">UIButton</string>
<string key="videoView">UIView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="decline">
<string key="name">decline</string>
<string key="candidateClassName">UIHangUpButton</string>
</object>
<object class="IBToOneOutletInfo" key="endOrRejectCall">
<string key="name">endOrRejectCall</string>
<string key="candidateClassName">UIHangUpButton</string>
</object>
<object class="IBToOneOutletInfo" key="lights">
<string key="name">lights</string>
<string key="candidateClassName">UIDigitButton</string>
</object>
<object class="IBToOneOutletInfo" key="mute">
<string key="name">mute</string>
<string key="candidateClassName">UIToggleButton</string>
</object>
<object class="IBToOneOutletInfo" key="openDoor">
<string key="name">openDoor</string>
<string key="candidateClassName">UIDigitButton</string>
</object>
<object class="IBToOneOutletInfo" key="startCall">
<string key="name">startCall</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="takeCall">
<string key="name">takeCall</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="videoView">
<string key="name">videoView</string>
<string key="candidateClassName">UIView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/BuschJaegerCallView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">BuschJaegerMainView</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">settingsClick:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">settingsClick:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">settingsClick:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">settingsButton</string>
<string key="NS.object.0">UIButton</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">settingsButton</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">settingsButton</string>
<string key="candidateClassName">UIButton</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/BuschJaegerMainView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">BuschJaegerSettingsView</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="onBackClick:">id</string>
<string key="onScanClick:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="onBackClick:">
<string key="name">onBackClick:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="onScanClick:">
<string key="name">onScanClick:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="backButton">UIView</string>
<string key="scanButton">UIView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="backButton">
<string key="name">backButton</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo" key="scanButton">
<string key="name">scanButton</string>
<string key="candidateClassName">UIView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/BuschJaegerSettingsView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIDigitButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIDigitButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIHangUpButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIHangUpButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIToggleButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIToggleButton.h</string>
<string key="minorKey">./Classes/LinphoneAppDelegate.h</string>
</object>
</object>
</array>

View file

@ -1,45 +0,0 @@
/* BuschJaegerAppDelegate.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 <Foundation/Foundation.h>
#import "BuschJaegerMainView.h"
#import "BuschJaegerCallView.h"
#import "BuschJaegerSettingsView.h"
#import "BuschJaegerConfigParser.h"
@interface BuschJaegerAppDelegate : NSObject<UIApplicationDelegate, LinphoneUICallDelegate> {
@private
UIWindow *window;
BuschJaegerMainView* buschJaegerMainView;
BuschJaegerCallView* buschJaegerCallView;
BuschJaegerSettingsView* buschJaegerSettingsView;
UINavigationController* navigationController;
BuschJaegerConfigParser* configuration;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet BuschJaegerMainView* buschJaegerMainView;
@property (nonatomic, retain) IBOutlet BuschJaegerCallView* buschJaegerCallView;
@property (nonatomic, retain) IBOutlet BuschJaegerSettingsView* buschJaegerSettingsView;
@property (nonatomic, retain) IBOutlet UINavigationController* navigationController;
@property (readonly) BuschJaegerConfigParser* configuration;
+ (BuschJaegerAppDelegate*)instance;
@end

View file

@ -1,148 +0,0 @@
/* BuschJaegerAppDelegate.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 "BuschJaegerAppDelegate.h"
@implementation BuschJaegerAppDelegate
@synthesize window;
@synthesize buschJaegerMainView;
@synthesize buschJaegerCallView;
@synthesize buschJaegerSettingsView;
@synthesize navigationController;
@synthesize configuration;
- (id)init {
self = [super init];
if (self != nil) {
configuration = [[BuschJaegerConfigParser alloc] init];
}
return self;
}
- (void)dealloc {
[configuration release];
[super dealloc];
}
- (void) loadDefaultSettings {
NSString *settingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
if(!settingsBundle) {
NSLog(@"Could not find Settings.bundle");
return;
}
NSMutableDictionary *rootSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Root.plist"]];
NSMutableArray *preferences = [rootSettings objectForKey:@"PreferenceSpecifiers"];
NSMutableDictionary *defaultsToRegister = [[NSMutableDictionary alloc] initWithCapacity:[preferences count]];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
@"YES", @"debugenable_preference",
@"YES", @"enable_video_preference",
@"YES", @"start_video_preference",
@"YES", @"h264_preference",
@"YES", @"vp8_preference",
@"NO", @"mpeg4_preference",
@"YES", @"pcmu_preference",
@"YES", @"pcma_preference",
@"tcp", @"transport_preference",
@"NO", @"enable_srtp_preference",
@"YES", @"backgroundmode_preference",
@"YES", @"outbound_proxy_preference",
nil];
[defaultsToRegister addEntriesFromDictionary:appDefaults];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsToRegister];
[defaultsToRegister release];
[[NSUserDefaults standardUserDefaults] synchronize];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[self loadDefaultSettings];
/* explicitely instanciate LinphoneManager */
LinphoneManager* lm = [[LinphoneManager alloc] init];
assert(lm == [LinphoneManager instance]);
[[LinphoneManager instance] startLibLinphone];
[[LinphoneManager instance] setCallDelegate:self];
[window addSubview:buschJaegerMainView.view];
[window makeKeyAndVisible];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound];
linphone_core_set_device_rotation([LinphoneManager getLc], 0);
linphone_core_set_video_device([LinphoneManager getLc], "DummyImage: Dummy (no) picture");
linphone_core_set_ring([LinphoneManager getLc], NULL ); //so that we don't attempt to play ring by the core
return YES;
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
[buschJaegerCallView activateVideoView:FALSE];
[[LinphoneManager instance] enterBackgroundMode];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[LinphoneManager instance] becomeActive];
[buschJaegerCallView activateVideoView:TRUE];
}
+ (BuschJaegerAppDelegate*)instance {
return (BuschJaegerAppDelegate *)[UIApplication sharedApplication].delegate;
}
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
}
// UI changes
-(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[buschJaegerCallView displayDialerFromUI:viewCtrl forUser:username withDisplayName:displayName];
}
-(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[buschJaegerCallView displayCall:call InProgressFromUI:viewCtrl forUser:username withDisplayName:displayName];
}
-(void) displayIncomingCall: (LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[buschJaegerCallView displayIncomingCall:call NotificationFromUI:viewCtrl forUser:username withDisplayName:displayName];
}
-(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[buschJaegerCallView displayInCall:call FromUI:viewCtrl forUser:username withDisplayName:displayName];
}
-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[buschJaegerCallView displayVideoCall:call FromUI:viewCtrl forUser:username withDisplayName:displayName];
}
//status reporting
-(void) displayStatus:(NSString*) message {
[buschJaegerCallView displayStatus:message];
}
-(void) displayAskToEnableVideoCall:(LinphoneCall*) call forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[buschJaegerCallView displayAskToEnableVideoCall:call forUser:username withDisplayName:displayName];
}
-(void) firstVideoFrameDecoded:(LinphoneCall*) call {
[buschJaegerCallView firstVideoFrameDecoded:call];
}
@end

View file

@ -21,14 +21,13 @@
#import "linphonecore.h"
#import "UILinphone.h"
#import "CallDelegate.h"
#import "UIDigitButton.h"
#import "UIHangUpButton.h"
#import "LinphoneManager.h"
#import "UILightButton.h"
#import "VideoZoomHandler.h"
#define BJ_RING_FILE "01"
@interface BuschJaegerCallView : UIViewController<LinphoneUICallDelegate, UIActionSheetCustomDelegate, LinphoneUIRegistrationDelegate> {
@interface BuschJaegerCallView : UIViewController {
@private
UIView* videoView;
UIButton* startCall;
@ -54,6 +53,5 @@
- (IBAction)takeCall:(id)sender;
- (IBAction)startCall:(id)sender;
- (void)activateVideoView:(BOOL) value;
@end

View file

@ -42,6 +42,22 @@
#pragma mark - View lifecycle
- (void)dealloc {
[videoView release];
[startCall release];
[takeCall release];
[decline release];
[endOrRejectCall release];
[mute release];
[lights release];
[openDoor release];
// Remove all observer
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
// 59x47
// 54
// 54 -> 67
@ -50,9 +66,9 @@
- (void)viewDidLoad {
[super viewDidLoad];
[openDoor initWithNumber:'1'];
[lights initWithNumber:'2'];
[mute initWithOnImage:[UIImage imageNamed:@"bj_mute_on.png"] offImage:[UIImage imageNamed:@"bj_mute_off.png"] debugName:"MUTE_BTN"];
[openDoor setDigit:'1'];
[lights setDigit:'2'];
[mute setImage:[UIImage imageNamed:@"bj_mute_on.png"] forState:UIControlStateHighlighted | UIControlStateSelected];
/* init gradients */
{
@ -78,167 +94,133 @@
[BuschJaegerUtils createGradientForView:takeCall withTopColor:col1 bottomColor:col2];
}
linphone_core_set_native_video_window_id([LinphoneManager getLc],(unsigned long)videoView);
linphone_core_set_native_preview_window_id([LinphoneManager getLc],0);
videoZoomHandler = [[VideoZoomHandler alloc] init];
[videoZoomHandler setup:videoView];
}
- (void)viewDidUnload
{
- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (void)viewDidAppear:(BOOL)animated {
[[LinphoneManager instance] setRegistrationDelegate:self];
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setIdleTimerDisabled:NO];
[LinphoneManager set:startCall hidden:NO withName:"START_CALL_BTN" andReason:__FUNCTION__];
[LinphoneManager set:takeCall hidden:YES withName:"TAKE_CALL_BTN" andReason:__FUNCTION__];
[LinphoneManager set:mute hidden:NO withName:"MUTE_BTN" andReason:__FUNCTION__];
[LinphoneManager set:decline hidden:YES withName:"DECLINE_BTN" andReason:__FUNCTION__];
[LinphoneManager set:endOrRejectCall hidden:YES withName:"END_BTN" andReason:__FUNCTION__];
[LinphoneManager set:videoView hidden:YES withName:"VIDEO_VIEW" andReason:__FUNCTION__];
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
[startCall setHidden:NO];
[takeCall setHidden:YES];
[mute setHidden:NO];
[decline setHidden:YES];
[endOrRejectCall setHidden:YES];
[videoView setHidden:YES];
if (!chatRoom) {
NSString* s = [NSString stringWithFormat:@"sip:100000001@%@", [[NSUserDefaults standardUserDefaults] stringForKey:@"adapter_ip_preference"]];
const char* adapter = [s cStringUsingEncoding:[NSString defaultCStringEncoding]];
chatRoom = linphone_core_create_chat_room([LinphoneManager getLc], adapter);
lights->chatRoom = chatRoom;
openDoor->chatRoom = chatRoom;
//lights->chatRoom = chatRoom;
//openDoor->chatRoom = chatRoom;
}
// Update on show
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];
}
- (void)activateVideoView:(BOOL)value{
if (value){
linphone_core_set_native_video_window_id([LinphoneManager getLc],(unsigned long)videoView);
}else{
linphone_core_set_native_video_window_id([LinphoneManager getLc],0);
linphone_core_set_native_preview_window_id([LinphoneManager getLc],0);
- (void)vieWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
// Remove observer
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneCallUpdate
object:nil];
}
#pragma mark - Event Functions
- (void)callUpdateEvent: (NSNotification*) notif {
LinphoneCall *call = [[notif.userInfo objectForKey: @"call"] pointerValue];
LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue];
[self callUpdate:call state:state animated:TRUE];
}
#pragma mark -
- (void)callUpdate:(LinphoneCall *)call state:(LinphoneCallState)state animated:(BOOL)animated {
// Fake call update
if(call == NULL) {
return;
}
}
- (void)viewDidDisappear:(BOOL)animated{
}
- (void)displayCall:(LinphoneCall *)call InProgressFromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName {
/* nothing */
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}
- (void)displayDialerFromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName {
[LinphoneManager set:startCall hidden:NO withName:"START_CALL_BTN" andReason:__FUNCTION__];
[LinphoneManager set:takeCall hidden:YES withName:"TAKE_CALL_BTN" andReason:__FUNCTION__];
[LinphoneManager set:mute hidden:NO withName:"MUTE_BTN" andReason:__FUNCTION__];
[LinphoneManager set:decline hidden:YES withName:"DECLINE_BTN" andReason:__FUNCTION__];
[LinphoneManager set:endOrRejectCall hidden:YES withName:"END_BTN" andReason:__FUNCTION__];
[LinphoneManager set:videoView hidden:YES withName:"VIDEO_VIEW" andReason:__FUNCTION__];
[[UIApplication sharedApplication] setIdleTimerDisabled:NO];
}
- (void)displayInCall:(LinphoneCall *)call FromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName {
[LinphoneManager set:startCall hidden:YES withName:"START_CALL_BTN" andReason:__FUNCTION__];
[LinphoneManager set:takeCall hidden:YES withName:"TAKE_CALL_BTN" andReason:__FUNCTION__];
[LinphoneManager set:mute hidden:NO withName:"MUTE_BTN" andReason:__FUNCTION__];
[LinphoneManager set:decline hidden:YES withName:"DECLINE_BTN" andReason:__FUNCTION__];
[LinphoneManager set:endOrRejectCall hidden:NO withName:"END_BTN" andReason:__FUNCTION__];
[LinphoneManager set:videoView hidden:NO withName:"VIDEO_VIEW" andReason:__FUNCTION__];
}
- (void)displayIncomingCall:(LinphoneCall *)call NotificationFromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName {
[LinphoneManager set:startCall hidden:YES withName:"START_CALL_BTN" andReason:__FUNCTION__];
[LinphoneManager set:takeCall hidden:NO withName:"TAKE_CALL_BTN" andReason:__FUNCTION__];
[LinphoneManager set:mute hidden:YES withName:"MUTE_BTN" andReason:__FUNCTION__];
[LinphoneManager set:decline hidden:NO withName:"DECLINE_BTN" andReason:__FUNCTION__];
[LinphoneManager set:endOrRejectCall hidden:YES withName:"END_BTN" andReason:__FUNCTION__];
[LinphoneManager set:videoView hidden:NO withName:"VIDEO_VIEW" andReason:__FUNCTION__];
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
// Create a new notification
UILocalNotification* notif = [[[UILocalNotification alloc] init] autorelease];
if (notif)
switch (state) {
case LinphoneCallIncomingReceived:
{
notif.repeatInterval = 0;
notif.alertBody = NSLocalizedString(@" Ding Dong !",nil);
notif.alertAction = @"See the answer";
notif.soundName = @BJ_RING_FILE ".wav";
NSData *callData = [NSData dataWithBytes:&call length:sizeof(call)];
notif.userInfo = [NSDictionary dictionaryWithObject:callData forKey:@"call"];
[[UIApplication sharedApplication] presentLocalNotificationNow:notif];
[self displayIncomingCall:call];
}
}else{
NSBundle* myBundle = [NSBundle mainBundle];
NSString* path = [myBundle pathForResource:@BJ_RING_FILE ofType:@"wav"];
if (path) {
const char* soundfile = [path cStringUsingEncoding:[NSString defaultCStringEncoding]];
ms_message("Using '%s' as ring file", soundfile);
SystemSoundID sid;
NSURL *pathURL = [NSURL fileURLWithPath : path];
NSError *setCategoryError = nil;
[[AVAudioSession sharedInstance]
setCategory: AVAudioSessionCategoryAmbient
error: &setCategoryError];
//redirect audio to speaker
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute
, sizeof (audioRouteOverride)
, &audioRouteOverride);
AudioServicesCreateSystemSoundID((CFURLRef) pathURL, &sid);
AudioServicesPlaySystemSound(sid);
case LinphoneCallOutgoingInit:
case LinphoneCallConnected:
case LinphoneCallStreamsRunning:
case LinphoneCallUpdated:
{
//check video
if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
[self displayVideoCall];
} else {
[self displayInCall];
}
break;
}
}
linphone_call_enable_camera(call, FALSE);
}
- (void)displayVideoCall:(LinphoneCall *)call FromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName {
[LinphoneManager set:startCall hidden:YES withName:"START_CALL_BTN" andReason:__FUNCTION__];
[LinphoneManager set:takeCall hidden:YES withName:"TAKE_CALL_BTN" andReason:__FUNCTION__];
[LinphoneManager set:mute hidden:NO withName:"MUTE_BTN" andReason:__FUNCTION__];
[LinphoneManager set:decline hidden:YES withName:"DECLINE_BTN" andReason:__FUNCTION__];
[LinphoneManager set:endOrRejectCall hidden:NO withName:"END_BTN" andReason:__FUNCTION__];
[LinphoneManager set:videoView hidden:NO withName:"VIDEO_VIEW" andReason:__FUNCTION__];
}
- (void)displayStatus:(NSString *)message {
default:
break;
}
}
- (void)displayNotRegisteredFromUI:(UIViewController *)viewCtrl {
- (void)displayIncomingCall:(LinphoneCall *)call {
[startCall setHidden:YES];
[takeCall setHidden:NO];
[mute setHidden:YES];
[decline setHidden:NO];
[endOrRejectCall setHidden:YES];
[videoView setHidden:NO];
}
- (void)displayRegisteredFromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName onDomain:(NSString *)domain {
- (void)displayInCall {
[startCall setHidden:YES];
[takeCall setHidden:YES];
[mute setHidden:NO];
[decline setHidden:YES];
[endOrRejectCall setHidden:NO];
[videoView setHidden:NO];
}
- (void)displayRegisteringFromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName onDomain:(NSString *)domain {
}
- (void)displayRegistrationFailedFromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName onDomain:(NSString *)domain forReason:(NSString *)reason {
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas {
- (void)displayVideoCall {
[startCall setHidden:YES];
[takeCall setHidden:YES];
[mute setHidden:NO];
[decline setHidden:YES];
[endOrRejectCall setHidden:NO];
[videoView setHidden:NO];
}
- (IBAction)takeCall:(id)sender {
@ -270,16 +252,4 @@
linphone_call_params_destroy(lcallParams);
}
-(void)displayAskToEnableVideoCall:(LinphoneCall*) call forUser:(NSString*) username withDisplayName:(NSString*) displayName {
}
-(void)firstVideoFrameDecoded:(LinphoneCall*) call {
}
- (void)actionSheet:(UIActionSheet *)actionSheet ofType:(enum CallDelegateType) type clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void*) datas {
}
@end

View file

@ -160,10 +160,14 @@
<reference key="IBUIHighlightedTitleColor" ref="684165454"/>
<reference key="IBUINormalTitleColor" ref="684165454"/>
<reference key="IBUINormalTitleShadowColor" ref="628689408"/>
<object class="NSCustomResource" key="IBUINormalImage">
<object class="NSCustomResource" key="IBUISelectedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">bj_mute_on.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">bj_mute_off.png</string>
</object>
<reference key="IBUIFontDescription" ref="488695651"/>
<reference key="IBUIFont" ref="1052967191"/>
</object>
@ -173,6 +177,7 @@
<string key="NSFrame">{{207, 0}, {73, 58}}</string>
<reference key="NSSuperview" ref="903884486"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<reference key="IBUIBackgroundColor" ref="666829842"/>
<bool key="IBUIOpaque">NO</bool>
@ -490,7 +495,7 @@
<string key="8.object.labelIdentifier">IBBuiltInLabel-Red</string>
<string key="9.CustomClassName">UIMuteButton</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="0.0" key="9.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<real value="2" key="9.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="9.object.labelIdentifier">IBBuiltInLabel-Red</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
@ -569,7 +574,18 @@
</object>
<object class="IBPartialClassDescription">
<string key="className">UIDigitButton</string>
<string key="superclassName">UIButton</string>
<string key="superclassName">UILongTouchButton</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">addressField</string>
<string key="NS.object.0">UITextField</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">addressField</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">addressField</string>
<string key="candidateClassName">UITextField</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIDigitButton.h</string>
@ -584,11 +600,11 @@
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIMuteButton</string>
<string key="superclassName">UIToggleButton</string>
<string key="className">UILongTouchButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIMuteButton.h</string>
<string key="minorKey">./Classes/UILongTouchButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
@ -616,6 +632,7 @@
<string key="bj_end_call.png">{160, 98}</string>
<string key="bj_light.png">{160, 98}</string>
<string key="bj_light_hl.png">{160, 98}</string>
<string key="bj_mute_off.png">{160, 98}</string>
<string key="bj_mute_on.png">{160, 98}</string>
<string key="bj_start_call.png">{160, 98}</string>
<string key="icon5.png">{16, 16}</string>

View file

@ -19,12 +19,19 @@
#import <UIKit/UIKit.h>
#import "BuschJaegerCallView.h"
#import "BuschJaegerSettingsView.h"
#import "BuschJaegerWelcomeView.h"
@interface BuschJaegerMainView : UIViewController {
UIButton* settingsButton;
}
@property (nonatomic, retain) IBOutlet UIButton* settingsButton;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
@property (nonatomic, retain) IBOutlet BuschJaegerCallView *callView;
@property (nonatomic, retain) IBOutlet BuschJaegerSettingsView *settingsView;
@property (nonatomic, retain) IBOutlet BuschJaegerWelcomeView *welcomeView;
- (IBAction)settingsClick:(id)sender;
+ (BuschJaegerMainView*) instance;
@end

View file

@ -18,15 +18,157 @@
*/
#import "BuschJaegerMainView.h"
#import "BuschJaegerAppDelegate.h"
@implementation BuschJaegerMainView
@synthesize settingsButton;
@synthesize navigationController;
@synthesize callView;
@synthesize settingsView;
@synthesize welcomeView;
- (IBAction)settingsClick:(id)sender {
BuschJaegerAppDelegate *delegate = [BuschJaegerAppDelegate instance];
[delegate.navigationController pushViewController:delegate.buschJaegerSettingsView animated:TRUE];
static BuschJaegerMainView* mainViewInstance=nil;
#pragma mark - Lifecycle Functions
- (void)initBuschJaegerMainView {
assert (!mainViewInstance);
mainViewInstance = self;
}
- (id)init {
self = [super init];
if (self) {
[self initBuschJaegerMainView];
}
return self;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
[self initBuschJaegerMainView];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self initBuschJaegerMainView];
}
return self;
}
- (void)dealloc {
[callView release];
[settingsView release];
[welcomeView release];
// Remove all observer
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
#pragma mark - ViewController Functions
- (void)viewDidLoad {
[super viewDidLoad];
UIView *view = navigationController.view;
[view setFrame:[self.view bounds]];
[self.view addSubview:view];
[navigationController pushViewController:welcomeView animated:FALSE];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
}
- (void)vieWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
// Remove observer
[[NSNotificationCenter defaultCenter] removeObserver:self
name:kLinphoneCallUpdate
object:nil];
}
#pragma mark - Event Functions
- (void)callUpdateEvent: (NSNotification*) notif {
LinphoneCall *call = [[notif.userInfo objectForKey: @"call"] pointerValue];
LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue];
[self callUpdate:call state:state animated:TRUE];
}
#pragma mark -
- (void)callUpdate:(LinphoneCall *)call state:(LinphoneCallState)state animated:(BOOL)animated {
// Fake call update
if(call == NULL) {
return;
}
switch (state) {
case LinphoneCallIncomingReceived:
{
[self displayIncomingCall:call];
}
default:
break;
}
}
- (void)displayIncomingCall:(LinphoneCall *)call {
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
// Create a new notification
UILocalNotification* notif = [[[UILocalNotification alloc] init] autorelease];
if (notif)
{
notif.repeatInterval = 0;
notif.alertBody = NSLocalizedString(@"Ding Dong !",nil);
notif.alertAction = @"See the answer";
notif.soundName = @"01.wav";
NSData *callData = [NSData dataWithBytes:&call length:sizeof(call)];
notif.userInfo = [NSDictionary dictionaryWithObject:callData forKey:@"call"];
[[UIApplication sharedApplication] presentLocalNotificationNow:notif];
}
}else{
NSError *setCategoryError = nil;
[[AVAudioSession sharedInstance]
setCategory: AVAudioSessionCategoryAmbient
error: &setCategoryError];
//redirect audio to speaker
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute
, sizeof (audioRouteOverride)
, &audioRouteOverride);
AudioServicesPlaySystemSound([LinphoneManager instance].sounds.call);
}
[navigationController popToRootViewControllerAnimated:FALSE];
[navigationController pushViewController:callView animated:TRUE];
linphone_call_enable_camera(call, FALSE);
}
+ (BuschJaegerMainView *) instance {
return mainViewInstance;
}
@end

View file

@ -12,9 +12,11 @@
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUIButton</string>
<string>IBUILabel</string>
<string>IBUINavigationBar</string>
<string>IBUINavigationController</string>
<string>IBUINavigationItem</string>
<string>IBUIView</string>
<string>IBUIViewController</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -32,95 +34,84 @@
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUILabel" id="324231259">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 20}, {245, 50}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="606095570"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<object class="IBUIViewController" id="105759972">
<string key="IBUINibName">BuschJaegerCallView</string>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="660452430">
<string key="IBUINibName">BuschJaegerWelcomeView</string>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="396228537">
<string key="IBUINibName">BuschJaegerSettingsView</string>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUINavigationController" id="292382756">
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<bool key="IBUIDefinesPresentationContext">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
<object class="IBUINavigationBar" key="IBUINavigationBar" id="62639881">
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{0, 0}</string>
<string key="NSReuseIdentifierKey">_NS:15</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<array class="NSMutableArray" key="IBUIViewControllers">
<object class="IBUIViewController" id="831081166">
<object class="IBUINavigationItem" key="IBUINavigationItem" id="786979008">
<reference key="IBUINavigationBar"/>
<string key="IBUITitle">Root View Controller</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIParentViewController" ref="292382756"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Welcome</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">1</int>
</object>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<float key="IBUIMinimumFontSize">10</float>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">38</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">38</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="606095570">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{236, 13}, {64, 64}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<double key="IBUIContentEdgeInsets.top">10</double>
<double key="IBUIContentEdgeInsets.bottom">10</double>
<double key="IBUIContentEdgeInsets.left">10</double>
<double key="IBUIContentEdgeInsets.right">10</double>
<object class="NSColor" key="IBUIHighlightedTitleColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">bj_settings.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIHorizontal">NO</bool>
</object>
</array>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<bool key="IBUINavigationBarHidden">YES</bool>
</object>
<object class="IBUIView" id="192697182">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="324231259"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</array>
@ -128,28 +119,43 @@
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<string key="label">callView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
<reference key="destination" ref="105759972"/>
</object>
<int key="connectionID">3</int>
<int key="connectionID">11</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">settingsButton</string>
<string key="label">settingsView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="606095570"/>
<reference key="destination" ref="396228537"/>
</object>
<int key="connectionID">6</int>
<int key="connectionID">12</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">settingsClick:</string>
<reference key="source" ref="606095570"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">welcomeView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="660452430"/>
</object>
<int key="connectionID">7</int>
<int key="connectionID">13</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">navigationController</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="292382756"/>
</object>
<int key="connectionID">20</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="192697182"/>
</object>
<int key="connectionID">22</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
@ -160,15 +166,6 @@
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children">
<reference ref="324231259"/>
<reference ref="606095570"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
@ -181,15 +178,52 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="324231259"/>
<reference key="parent" ref="191373211"/>
<int key="objectID">9</int>
<reference key="object" ref="396228537"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="606095570"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">Button - Settings</string>
<int key="objectID">10</int>
<reference key="object" ref="105759972"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="660452430"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="292382756"/>
<array class="NSMutableArray" key="children">
<reference ref="62639881"/>
<reference ref="831081166"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="62639881"/>
<reference key="parent" ref="292382756"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="831081166"/>
<array class="NSMutableArray" key="children">
<reference ref="786979008"/>
</array>
<reference key="parent" ref="292382756"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="786979008"/>
<reference key="parent" ref="831081166"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="192697182"/>
<reference key="parent" ref="0"/>
</object>
</array>
</object>
@ -198,20 +232,162 @@
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="10.CustomClassName">BuschJaegerCallView</string>
<string key="10.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="16.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="17.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="18.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="19.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="21.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.CustomClassName">BuschJaegerWelcomeView</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="9.CustomClassName">BuschJaegerSettingsView</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">7</int>
<int key="maxID">22</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">BuschJaegerCallView</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="startCall:">id</string>
<string key="takeCall:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="startCall:">
<string key="name">startCall:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="takeCall:">
<string key="name">takeCall:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="decline">UIHangUpButton</string>
<string key="endOrRejectCall">UIHangUpButton</string>
<string key="lights">UIDigitButton</string>
<string key="mute">UIToggleButton</string>
<string key="openDoor">UIDigitButton</string>
<string key="startCall">UIButton</string>
<string key="takeCall">UIButton</string>
<string key="videoView">UIView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="decline">
<string key="name">decline</string>
<string key="candidateClassName">UIHangUpButton</string>
</object>
<object class="IBToOneOutletInfo" key="endOrRejectCall">
<string key="name">endOrRejectCall</string>
<string key="candidateClassName">UIHangUpButton</string>
</object>
<object class="IBToOneOutletInfo" key="lights">
<string key="name">lights</string>
<string key="candidateClassName">UIDigitButton</string>
</object>
<object class="IBToOneOutletInfo" key="mute">
<string key="name">mute</string>
<string key="candidateClassName">UIToggleButton</string>
</object>
<object class="IBToOneOutletInfo" key="openDoor">
<string key="name">openDoor</string>
<string key="candidateClassName">UIDigitButton</string>
</object>
<object class="IBToOneOutletInfo" key="startCall">
<string key="name">startCall</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="takeCall">
<string key="name">takeCall</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="videoView">
<string key="name">videoView</string>
<string key="candidateClassName">UIView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/BuschJaegerCallView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">BuschJaegerMainView</string>
<string key="superclassName">UINavigationController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="callView">BuschJaegerCallView</string>
<string key="settingsView">BuschJaegerSettingsView</string>
<string key="welcomeView">BuschJaegerWelcomeView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="callView">
<string key="name">callView</string>
<string key="candidateClassName">BuschJaegerCallView</string>
</object>
<object class="IBToOneOutletInfo" key="settingsView">
<string key="name">settingsView</string>
<string key="candidateClassName">BuschJaegerSettingsView</string>
</object>
<object class="IBToOneOutletInfo" key="welcomeView">
<string key="name">welcomeView</string>
<string key="candidateClassName">BuschJaegerWelcomeView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/BuschJaegerMainView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">BuschJaegerSettingsView</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="onBackClick:">id</string>
<string key="onScanClick:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="onBackClick:">
<string key="name">onBackClick:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="onScanClick:">
<string key="name">onScanClick:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="backButton">UIView</string>
<string key="scanButton">UIView</string>
<string key="waitView">UIView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="backButton">
<string key="name">backButton</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo" key="scanButton">
<string key="name">scanButton</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo" key="waitView">
<string key="name">waitView</string>
<string key="candidateClassName">UIView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/BuschJaegerSettingsView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">BuschJaegerWelcomeView</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">settingsClick:</string>
@ -237,7 +413,50 @@
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/BuschJaegerMainView.h</string>
<string key="minorKey">./Classes/BuschJaegerWelcomeView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIDigitButton</string>
<string key="superclassName">UILongTouchButton</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">addressField</string>
<string key="NS.object.0">UITextField</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">addressField</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">addressField</string>
<string key="candidateClassName">UITextField</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIDigitButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIHangUpButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIHangUpButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UILongTouchButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UILongTouchButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIToggleButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIToggleButton.h</string>
</object>
</object>
</array>
@ -250,10 +469,6 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NS.key.0">bj_settings.png</string>
<string key="NS.object.0">{128, 128}</string>
</object>
<string key="IBCocoaTouchPluginVersion">1498</string>
</data>
</archive>

View file

@ -19,7 +19,7 @@
#import "BuschJaegerSettingsView.h"
#import "BuschJaegerUtils.h"
#import "BuschJaegerAppDelegate.h"
#import "BuschJaegerMainView.h"
@implementation BuschJaegerSettingsView
@ -79,7 +79,7 @@
}
- (IBAction)onBackClick:(id)sender {
[[BuschJaegerAppDelegate instance].navigationController popViewControllerAnimated:TRUE];
[[BuschJaegerMainView instance].navigationController popViewControllerAnimated:TRUE];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
@ -87,10 +87,10 @@
if(zbs != nil) {
BOOL handled = FALSE;
for(ZBarSymbol *symbol in zbs) {
if([[[BuschJaegerAppDelegate instance] configuration] parseQRCode:[symbol data] delegate:self]) {
/*if([[[LinphoneManager instance] configuration] parseQRCode:[symbol data] delegate:self]) {
handled = TRUE;
[waitView setHidden:FALSE];
}
}*/
}
if(handled) {
[self dismissModalViewControllerAnimated:TRUE];

View file

@ -0,0 +1,30 @@
/* BuschJaegerWelcomeView.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>
@interface BuschJaegerWelcomeView : UIViewController {
UIButton* settingsButton;
}
@property (nonatomic, retain) IBOutlet UIButton* settingsButton;
- (IBAction)settingsClick:(id)sender;
@end

View file

@ -0,0 +1,31 @@
/* BuschJaegerWelcomeView.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 "BuschJaegerWelcomeView.h"
#import "BuschJaegerMainView.h"
@implementation BuschJaegerWelcomeView
@synthesize settingsButton;
- (IBAction)settingsClick:(id)sender {
[[BuschJaegerMainView instance].navigationController pushViewController:[BuschJaegerMainView instance].settingsView animated:TRUE];
}
@end

View file

@ -1,21 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C74</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138.23</string>
<string key="IBDocument.HIToolboxVersion">567.00</string>
<int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">11E53</string>
<string key="IBDocument.InterfaceBuilderVersion">2549</string>
<string key="IBDocument.AppKitVersion">1138.47</string>
<string key="IBDocument.HIToolboxVersion">569.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
<string key="NS.object.0">1498</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBUIImageView</string>
<string>IBUIActivityIndicatorView</string>
<string>IBUIView</string>
<string>IBUILabel</string>
<string>IBProxyObject</string>
<string>IBUIButton</string>
<string>IBUILabel</string>
<string>IBUIView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -33,113 +32,125 @@
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="848661322">
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIImageView" id="332800514">
<reference key="NSNextResponder" ref="848661322"/>
<int key="NSvFlags">-2147483356</int>
<string key="NSFrame">{{0, -1}, {25, 23}}</string>
<reference key="NSSuperview" ref="848661322"/>
<object class="IBUILabel" id="324231259">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 20}, {245, 50}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="665185352"/>
<string key="NSReuseIdentifierKey">_NS:567</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">status_gray.png</string>
</object>
</object>
<object class="IBUIActivityIndicatorView" id="665185352">
<reference key="NSNextResponder" ref="848661322"/>
<int key="NSvFlags">-2147483356</int>
<string key="NSFrame">{{0, 1}, {20, 20}}</string>
<reference key="NSSuperview" ref="848661322"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="200467549"/>
<string key="NSReuseIdentifierKey">_NS:1030</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIStyle">2</int>
</object>
<object class="IBUILabel" id="200467549">
<reference key="NSNextResponder" ref="848661322"/>
<int key="NSvFlags">-2147483356</int>
<string key="NSFrame">{{28, 0}, {280, 21}}</string>
<reference key="NSSuperview" ref="848661322"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:328</string>
<reference key="NSNextKeyView" ref="606095570"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">CARAMBA</string>
<string key="IBUIText">Welcome</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">1</int>
</object>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<int key="IBUIBaselineAdjustment">0</int>
<float key="IBUIMinimumFontSize">10</float>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">17</double>
<double key="pointSize">38</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">17</double>
<double key="NSSize">38</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="606095570">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{236, 13}, {64, 64}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<double key="IBUIContentEdgeInsets.top">10</double>
<double key="IBUIContentEdgeInsets.bottom">10</double>
<double key="IBUIContentEdgeInsets.left">10</double>
<double key="IBUIContentEdgeInsets.right">10</double>
<object class="NSColor" key="IBUIHighlightedTitleColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">bj_settings.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
</array>
<string key="NSFrameSize">{255, 23}</string>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="332800514"/>
<string key="NSReuseIdentifierKey">_NS:196</string>
<reference key="NSNextKeyView" ref="324231259"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
<bytes key="NSWhite">MAA</bytes>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">image</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="332800514"/>
</object>
<int key="connectionID">8</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">label</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="200467549"/>
</object>
<int key="connectionID">9</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">spinner</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="665185352"/>
</object>
<int key="connectionID">10</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="848661322"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">11</int>
<int key="connectionID">3</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">settingsButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="606095570"/>
</object>
<int key="connectionID">6</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">settingsClick:</string>
<reference key="source" ref="606095570"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">7</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
@ -150,6 +161,15 @@
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children">
<reference ref="324231259"/>
<reference ref="606095570"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
@ -163,90 +183,66 @@
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="848661322"/>
<array class="NSMutableArray" key="children">
<reference ref="665185352"/>
<reference ref="332800514"/>
<reference ref="200467549"/>
</array>
<reference key="parent" ref="0"/>
<string key="objectName">status_view</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="665185352"/>
<reference key="parent" ref="848661322"/>
<string key="objectName">status_spin</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="200467549"/>
<reference key="parent" ref="848661322"/>
<string key="objectName">status_label</string>
<reference key="object" ref="324231259"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="332800514"/>
<reference key="parent" ref="848661322"/>
<string key="objectName">status_image</string>
<reference key="object" ref="606095570"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">Button - Settings</string>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">StatusSubViewController</string>
<string key="-1.CustomClassName">BuschJaegerWelcomeView</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">11</int>
<int key="maxID">7</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">StatusSubViewController</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="image">UIImageView</string>
<string key="label">UILabel</string>
<string key="spinner">UIActivityIndicatorView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="image">
<string key="name">image</string>
<string key="candidateClassName">UIImageView</string>
<string key="className">BuschJaegerWelcomeView</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">settingsClick:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">settingsClick:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">settingsClick:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo" key="label">
<string key="name">label</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="spinner">
<string key="name">spinner</string>
<string key="candidateClassName">UIActivityIndicatorView</string>
</object>
</dictionary>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/StatusSubViewController.h</string>
<string key="minorKey">./Classes/BuschJaegerWelcomeView.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<real value="1296" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NS.key.0">status_gray.png</string>
<string key="NS.object.0">{25, 23}</string>
<string key="NS.key.0">bj_settings.png</string>
<string key="NS.object.0">{55, 57}</string>
</object>
<string key="IBCocoaTouchPluginVersion">933</string>
<string key="IBCocoaTouchPluginVersion">1498</string>
</data>
</archive>

View file

@ -1,253 +0,0 @@
/* CallHistoryTableViewController.m
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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 "CallHistoryTableViewController.h"
#import "LinphoneManager.h"
@implementation CallHistoryTableViewController
@synthesize clear;
/*
- (id)initWithStyle:(UITableViewStyle)style {
// Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
if (self = [super initWithStyle:style]) {
}
return self;
}
*/
- (void)viewDidLoad {
[super viewDidLoad];
UIBarButtonItem* clearButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemTrash
target:self
action:@selector(doAction:)];
[self.navigationItem setRightBarButtonItem:clearButton];
[clearButton release];
}
/*
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}
*/
/*
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
}
*/
/*
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
}
*/
/*
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
}
*/
/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
-(void) doAction:(id)sender {
linphone_core_clear_call_logs([LinphoneManager getLc]);
[self.tableView reloadData];
}
#pragma mark Table view methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
const MSList * logs = linphone_core_get_call_logs([LinphoneManager getLc]);
return ms_list_size(logs);
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
[cell.textLabel setTextColor:[UIColor colorWithRed:0.7 green:0.745 blue:0.78 alpha:1.0]];
[cell.detailTextLabel setTextColor:cell.textLabel.textColor];
}
// Set up the cell...
LinphoneAddress* partyToDisplay;
const MSList * logs = linphone_core_get_call_logs([LinphoneManager getLc]);
LinphoneCallLog* callLogs = ms_list_nth_data(logs, indexPath.row) ;
NSString *path;
if (callLogs->dir == LinphoneCallIncoming) {
if (callLogs->status == LinphoneCallSuccess) {
path = [[NSBundle mainBundle] pathForResource:callLogs->video_enabled?@"in_call_video":@"in_call" ofType:@"png"];
} else {
//missed call
path = [[NSBundle mainBundle] pathForResource:@"missed_call" ofType:@"png"];
}
partyToDisplay=callLogs->from;
} else {
path = [[NSBundle mainBundle] pathForResource:callLogs->video_enabled?@"out_call_video":@"out_call" ofType:@"png"];
partyToDisplay=callLogs->to;
}
UIImage *image = [UIImage imageWithContentsOfFile:path];
cell.imageView.image = image;
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
const char* username = linphone_address_get_username(partyToDisplay)!=0?linphone_address_get_username(partyToDisplay):"";
const char* displayName = linphone_address_get_display_name(partyToDisplay);
if (displayName) {
NSString* str1 = [NSString stringWithFormat:@"%s", displayName];
[cell.textLabel setText:str1];
NSString* str2 = [NSString stringWithFormat:@"%s"/* [%s]"*/,username/*,callLogs->start_date*/];
[cell.detailTextLabel setText:str2];
} else {
NSString* str1 = [NSString stringWithFormat:@"%s", username];
[cell.textLabel setText:str1];
[cell.detailTextLabel setText:nil];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
// AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil];
// [self.navigationController pushViewController:anotherViewController];
// [anotherViewController release];
[tableView deselectRowAtIndexPath:indexPath animated:NO];
const MSList * logs = linphone_core_get_call_logs([LinphoneManager getLc]);
LinphoneCallLog* callLogs = ms_list_nth_data(logs, indexPath.row) ;
LinphoneAddress* partyToCall;
if (callLogs->dir == LinphoneCallIncoming) {
partyToCall=callLogs->from;
} else {
partyToCall=callLogs->to;
}
const char* username = linphone_address_get_username(partyToCall)!=0?linphone_address_get_username(partyToCall):"";
const char* displayName = linphone_address_get_display_name(partyToCall)!=0?linphone_address_get_display_name(partyToCall):"";
const char* domain = linphone_address_get_domain(partyToCall);
LinphoneProxyConfig* proxyCfg;
linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg);
NSString* phoneNumber;
if (proxyCfg && (strcmp(domain, linphone_proxy_config_get_domain(proxyCfg)) == 0)) {
phoneNumber = [[NSString alloc] initWithCString:username encoding:[NSString defaultCStringEncoding]];
} else {
phoneNumber = [[NSString alloc] initWithCString:linphone_address_as_string_uri_only(partyToCall) encoding:[NSString defaultCStringEncoding]];
}
NSString* dispName = [[NSString alloc] initWithCString:displayName encoding:[NSString defaultCStringEncoding]];
[[LinphoneManager instance].callDelegate displayDialerFromUI:self
forUser:phoneNumber
withDisplayName:dispName];
[phoneNumber release];
[dispName release];
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
- (void)dealloc {
[super dealloc];
}
@end

View file

@ -1,201 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.03">
<data>
<int key="IBDocument.SystemTarget">784</int>
<string key="IBDocument.SystemVersion">9L31a</string>
<string key="IBDocument.InterfaceBuilderVersion">680</string>
<string key="IBDocument.AppKitVersion">949.54</string>
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="4"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
</object>
<object class="IBUITableView" id="873029372">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<bool key="IBUIBouncesZoom">NO</bool>
<int key="IBUISeparatorStyle">1</int>
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
<float key="IBUIRowHeight">4.400000e+01</float>
<float key="IBUISectionHeaderHeight">4.400000e+01</float>
<float key="IBUISectionFooterHeight">2.200000e+01</float>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="873029372"/>
</object>
<int key="connectionID">5</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">dataSource</string>
<reference key="source" ref="873029372"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">6</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="873029372"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">7</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<object class="NSArray" key="object" id="829125109">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="829125109"/>
<string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="829125109"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="873029372"/>
<reference key="parent" ref="829125109"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>4.IBEditorWindowLastContentRect</string>
<string>4.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>CallHistoryTableViewController</string>
<string>UIResponder</string>
<string>{{163, 500}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">13</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">CallHistoryTableViewController</string>
<string key="superclassName">GenericTabViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">doAction:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">clear</string>
<string key="NS.object.0">UIButton</string>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/CallHistoryTableViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">GenericTabViewController</string>
<string key="superclassName">UITableViewController</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>header</string>
<string>linphoneDelegate</string>
<string>phoneControllerDelegate</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIView</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/GenericTabViewController.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.LastKnownRelativeProjectPath">../linphone.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">3.1</string>
</data>
</archive>

View file

@ -1,257 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C74</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138.23</string>
<string key="IBDocument.HIToolboxVersion">567.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBUITableViewCell</string>
<string>IBUIImageView</string>
<string>IBUILabel</string>
<string>IBProxyObject</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUITableViewCell" id="592306609">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIView" id="203820029">
<reference key="NSNextResponder" ref="592306609"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIImageView" id="565632536">
<reference key="NSNextResponder" ref="203820029"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{80, 80}</string>
<reference key="NSSuperview" ref="203820029"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="874623941"/>
<string key="NSReuseIdentifierKey">_NS:567</string>
<int key="IBUITag">1</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUILabel" id="874623941">
<reference key="NSNextResponder" ref="203820029"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{80, 0}, {212, 80}}</string>
<reference key="NSSuperview" ref="203820029"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="818419664"/>
<string key="NSReuseIdentifierKey">_NS:328</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<int key="IBUITag">2</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Texte de test</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">40</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">40</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIImageView" id="818419664">
<reference key="NSNextResponder" ref="203820029"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{292, 26}, {28, 28}}</string>
<reference key="NSSuperview" ref="203820029"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:567</string>
<int key="IBUITag">3</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</array>
<string key="NSFrameSize">{320, 79}</string>
<reference key="NSSuperview" ref="592306609"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="565632536"/>
<string key="NSReuseIdentifierKey">_NS:395</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">4</int>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</array>
<string key="NSFrameSize">{320, 80}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="203820029"/>
<string key="NSReuseIdentifierKey">_NS:384</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUIContentView" ref="203820029"/>
<string key="IBUIReuseIdentifier">ConferenceDetailCellIdentifier</string>
<real value="80" key="IBUIRowHeight"/>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">conferenceDetailCell</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="592306609"/>
</object>
<int key="connectionID">7</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="592306609"/>
<array class="NSMutableArray" key="children">
<reference ref="565632536"/>
<reference ref="874623941"/>
<reference ref="818419664"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="565632536"/>
<reference key="parent" ref="592306609"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="818419664"/>
<reference key="parent" ref="592306609"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="874623941"/>
<reference key="parent" ref="592306609"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">ConferenceCallDetailView</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">8</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">ConferenceCallDetailView</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="addCall">UIButton</string>
<string key="back">UIButton</string>
<string key="conferenceDetailCell">UITableViewCell</string>
<string key="hangup">UIButton</string>
<string key="mute">UIButton</string>
<string key="speaker">UIButton</string>
<string key="table">UITableView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="addCall">
<string key="name">addCall</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="back">
<string key="name">back</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="conferenceDetailCell">
<string key="name">conferenceDetailCell</string>
<string key="candidateClassName">UITableViewCell</string>
</object>
<object class="IBToOneOutletInfo" key="hangup">
<string key="name">hangup</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="mute">
<string key="name">mute</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="speaker">
<string key="name">speaker</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="table">
<string key="name">table</string>
<string key="candidateClassName">UITableView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/ConferenceCallDetailView.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>

View file

@ -1,479 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C74</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138.23</string>
<string key="IBDocument.HIToolboxVersion">567.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBUIButton</string>
<string>IBUITableView</string>
<string>IBUIView</string>
<string>IBProxyObject</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUITableView" id="682450328">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{768, 872}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="492050748"/>
<string key="NSReuseIdentifierKey">_NS:418</string>
<object class="NSColor" key="IBUIBackgroundColor" id="270413770">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClipsSubviews">YES</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIAlwaysBounceVertical">YES</bool>
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
<bool key="IBUIAllowsSelection">NO</bool>
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
<float key="IBUIRowHeight">44</float>
<float key="IBUISectionHeaderHeight">22</float>
<float key="IBUISectionFooterHeight">22</float>
</object>
<object class="IBUIButton" id="492050748">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{224, 874}, {107, 66}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="548356310"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="763261649">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="102583944">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="NSCustomResource" key="IBUINormalBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">effacer.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="758567310">
<string key="name">Helvetica-Bold</string>
<string key="family">Helvetica</string>
<int key="traits">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont" id="1000099959">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="285534295">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{437, 873}, {107, 66}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="IBUIBackgroundColor" ref="270413770"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIHighlightedTitleColor" ref="763261649"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="102583944"/>
<object class="NSCustomResource" key="IBUISelectedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">HP_inverse.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">HP.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="322491891">
<int key="type">2</int>
<int key="size">2</int>
</object>
<object class="NSFont" key="IBUIFont" id="310685398">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">18</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="548356310">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{224, 938}, {320, 66}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="378152807"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAwIDAuMDgyMzIwMjU5MDQgMC4xOAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIHighlightedTitleColor" ref="763261649"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="102583944"/>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">stopcall-red.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">clavier-01-106px.png</string>
</object>
<reference key="IBUIFontDescription" ref="758567310"/>
<reference key="IBUIFont" ref="1000099959"/>
</object>
<object class="IBUIButton" id="378152807">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{331, 873}, {106, 66}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="285534295"/>
<reference key="IBUIBackgroundColor" ref="270413770"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIHighlightedTitleColor" ref="763261649"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="102583944"/>
<object class="NSCustomResource" key="IBUIDisabledImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">mic_active.png</string>
</object>
<object class="NSCustomResource" key="IBUISelectedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">micro_inverse.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">micro.png</string>
</object>
<reference key="IBUIFontDescription" ref="322491891"/>
<reference key="IBUIFont" ref="310685398"/>
</object>
</array>
<string key="NSFrame">{{0, 20}, {768, 1004}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="682450328"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">back</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="492050748"/>
</object>
<int key="connectionID">8</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">hangup</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="548356310"/>
</object>
<int key="connectionID">9</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">mute</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="378152807"/>
</object>
<int key="connectionID">10</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">speaker</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="285534295"/>
</object>
<int key="connectionID">11</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">table</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="682450328"/>
</object>
<int key="connectionID">12</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">13</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">dataSource</string>
<reference key="source" ref="682450328"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="682450328"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">15</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children">
<reference ref="682450328"/>
<reference ref="548356310"/>
<reference ref="378152807"/>
<reference ref="285534295"/>
<reference ref="492050748"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="492050748"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">Erase</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="285534295"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">speaker</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="682450328"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="548356310"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">end</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="378152807"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">mute</string>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">ConferenceCallDetailView</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="3.CustomClassName">UIEraseButton</string>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.CustomClassName">UISpeakerButton</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="1" key="4.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.CustomClassName">UIHangUpButton</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="7.CustomClassName">UIMuteButton</string>
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="2" key="7.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">15</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">ConferenceCallDetailView</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="addCall">UIButton</string>
<string key="back">UIButton</string>
<string key="conferenceDetailCell">UITableViewCell</string>
<string key="hangup">UIButton</string>
<string key="mute">UIButton</string>
<string key="speaker">UIButton</string>
<string key="table">UITableView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="addCall">
<string key="name">addCall</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="back">
<string key="name">back</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="conferenceDetailCell">
<string key="name">conferenceDetailCell</string>
<string key="candidateClassName">UITableViewCell</string>
</object>
<object class="IBToOneOutletInfo" key="hangup">
<string key="name">hangup</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="mute">
<string key="name">mute</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="speaker">
<string key="name">speaker</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="table">
<string key="name">table</string>
<string key="candidateClassName">UITableView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/ConferenceCallDetailView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIEraseButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIEraseButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIHangUpButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIHangUpButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIMuteButton</string>
<string key="superclassName">UIToggleButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIMuteButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISpeakerButton</string>
<string key="superclassName">UIToggleButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UISpeakerButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIToggleButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIToggleButton.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="HP.png">{107, 67}</string>
<string key="HP_inverse.png">{107, 67}</string>
<string key="clavier-01-106px.png">{106, 60}</string>
<string key="effacer.png">{66, 65}</string>
<string key="mic_active.png">{20, 20}</string>
<string key="micro.png">{107, 67}</string>
<string key="micro_inverse.png">{107, 67}</string>
<string key="stopcall-red.png">{62, 54}</string>
</dictionary>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>

View file

@ -1,44 +0,0 @@
/* ConferenceCallDetailView.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 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 "LinphoneUI/UIMuteButton.h"
#import "LinphoneUI/UISpeakerButton.h"
@interface ConferenceCallDetailView : UIViewController<UITableViewDelegate, UITableViewDataSource> {
UIMuteButton* mute;
UISpeakerButton* speaker;
UIButton* back;
UIButton* hangup;
UITableView* table;
UITableViewCell* conferenceDetailCell;
}
@property (nonatomic, retain) IBOutlet UIButton* mute;
@property (nonatomic, retain) IBOutlet UIButton* speaker;
@property (nonatomic, retain) IBOutlet UIButton* addCall;
@property (nonatomic, retain) IBOutlet UIButton* back;
@property (nonatomic, retain) IBOutlet UIButton* hangup;
@property (nonatomic, retain) IBOutlet UITableView* table;
@property (nonatomic, assign) IBOutlet UITableViewCell* conferenceDetailCell;
-(void) updateCallQuality;
@end

View file

@ -1,165 +0,0 @@
/* ConferenceCallDetailView.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 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 "ConferenceCallDetailView.h"
#import "linphonecore.h"
#import "LinphoneManager.h"
#import "IncallViewController.h"
@implementation ConferenceCallDetailView
@synthesize mute;
@synthesize speaker;
@synthesize back;
@synthesize hangup;
@synthesize table;
@synthesize addCall;
@synthesize conferenceDetailCell;
NSTimer *callQualityRefresher;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
[back addTarget:self action:@selector(backButtonPressed) forControlEvents:UIControlEventTouchUpInside];
table.rowHeight = 80;
[mute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE button"];
[speaker initWithOnImage:[UIImage imageNamed:@"HP_inverse.png"] offImage:[UIImage imageNamed:@"HP.png"] debugName:"SPEAKER button"];
}
-(void) backButtonPressed {
[self dismissModalViewControllerAnimated:YES];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
-(void) viewWillAppear:(BOOL)animated {
[table reloadData];
[mute reset];
[speaker reset];
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
[super viewWillAppear:animated];
}
-(void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
callQualityRefresher = [NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(updateCallQuality)
userInfo:nil
repeats:YES];
}
-(void) viewDidDisappear:(BOOL)animated {
[[UIApplication sharedApplication] setIdleTimerDisabled:NO];
if (callQualityRefresher != nil) {
[callQualityRefresher invalidate];
callQualityRefresher=nil;
}
}
-(void) updateCallQuality {
[table reloadData];
[table setNeedsDisplay];
}
#pragma mark - UITableView delegates
-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row % 2)
cell.backgroundColor = [UIColor lightGrayColor];
else
cell.backgroundColor = [UIColor darkGrayColor];
}
-(UITableViewCell*) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString* identifier = @"ConferenceDetailCellIdentifier";
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"ConferenceCallDetailCell" owner:self options:nil];
cell = conferenceDetailCell;
self.conferenceDetailCell = nil;
}
/* retrieve cell's fields using tags */
UIImageView* image = (UIImageView*) [cell viewWithTag:1];
UILabel* label = (UILabel*) [cell viewWithTag:2];
/* update cell content */
LinphoneCall* call = [IncallViewController retrieveCallAtIndex:indexPath.row inConference:YES];
[IncallViewController updateCellImageView:image Label:label DetailLabel:nil AndAccessoryView:nil withCall:call];
cell.accessoryType = UITableViewCellAccessoryNone;
if (cell.accessoryView == nil) {
UIView *containerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 28, 28)] autorelease];
cell.accessoryView = containerView;
}
else {
for (UIView *view in cell.accessoryView.subviews) {
[view removeFromSuperview];
}
}
UIImageView* callquality = (UIImageView*) [cell viewWithTag:3];
[IncallViewController updateIndicator:callquality withCallQuality:linphone_call_get_average_quality(call)];
tableView.rowHeight = 80;
return cell;
}
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
LinphoneCore* lc = [LinphoneManager getLc];
int result = linphone_core_get_conference_size(lc) - (int)linphone_core_is_in_conference(lc);
return result;
}
@end

View file

@ -1,478 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C74</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138.23</string>
<string key="IBDocument.HIToolboxVersion">567.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBUITableView</string>
<string>IBUIButton</string>
<string>IBUIView</string>
<string>IBProxyObject</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUITableView" id="202949628">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{320, 328}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="502975112"/>
<string key="NSReuseIdentifierKey">_NS:418</string>
<object class="NSColor" key="IBUIBackgroundColor" id="508694975">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClipsSubviews">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIAlwaysBounceVertical">YES</bool>
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
<bool key="IBUIAllowsSelection">NO</bool>
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
<float key="IBUIRowHeight">44</float>
<float key="IBUISectionHeaderHeight">22</float>
<float key="IBUISectionFooterHeight">22</float>
</object>
<object class="IBUIButton" id="502975112">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{107, 328}, {106, 66}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="IBUIBackgroundColor" ref="508694975"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="715364517">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="129151944">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="NSCustomResource" key="IBUIDisabledImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">mic_active.png</string>
</object>
<object class="NSCustomResource" key="IBUISelectedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">micro_inverse.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">micro.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="246923771">
<int key="type">2</int>
<int key="size">2</int>
</object>
<object class="NSFont" key="IBUIFont" id="213214630">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">18</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="305687417">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{213, 328}, {107, 66}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1019646602"/>
<reference key="IBUIBackgroundColor" ref="508694975"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIHighlightedTitleColor" ref="715364517"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="129151944"/>
<object class="NSCustomResource" key="IBUISelectedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">HP_inverse.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">HP.png</string>
</object>
<reference key="IBUIFontDescription" ref="246923771"/>
<reference key="IBUIFont" ref="213214630"/>
</object>
<object class="IBUIButton" id="874802963">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{0, 394}, {320, 66}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAwIDAuMDgyMzIwMjU5MDQgMC4xOAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIHighlightedTitleColor" ref="715364517"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="129151944"/>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">stopcall-red.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">clavier-01-106px.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="645103076">
<string key="name">Helvetica-Bold</string>
<string key="family">Helvetica</string>
<int key="traits">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont" id="1042027645">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="1019646602">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{0, 328}, {107, 66}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="874802963"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIHighlightedTitleColor" ref="715364517"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="129151944"/>
<object class="NSCustomResource" key="IBUINormalBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">effacer.png</string>
</object>
<reference key="IBUIFontDescription" ref="645103076"/>
<reference key="IBUIFont" ref="1042027645"/>
</object>
</array>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="202949628"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">back</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="1019646602"/>
</object>
<int key="connectionID">16</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">hangup</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="874802963"/>
</object>
<int key="connectionID">17</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">mute</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="502975112"/>
</object>
<int key="connectionID">18</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">speaker</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="305687417"/>
</object>
<int key="connectionID">19</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">20</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">table</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="202949628"/>
</object>
<int key="connectionID">23</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">dataSource</string>
<reference key="source" ref="202949628"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">21</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="202949628"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">22</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children">
<reference ref="874802963"/>
<reference ref="305687417"/>
<reference ref="202949628"/>
<reference ref="502975112"/>
<reference ref="1019646602"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="202949628"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">10</int>
<reference key="object" ref="502975112"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">mute</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">11</int>
<reference key="object" ref="874802963"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">end</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="305687417"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">speaker</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">14</int>
<reference key="object" ref="1019646602"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">Erase</string>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">ConferenceCallDetailView</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="10.CustomClassName">UIMuteButton</string>
<string key="10.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="2" key="10.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="11.CustomClassName">UIHangUpButton</string>
<string key="11.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="12.CustomClassName">UISpeakerButton</string>
<string key="12.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="1" key="12.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="14.CustomClassName">UIEraseButton</string>
<string key="14.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">23</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">ConferenceCallDetailView</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="addCall">UIButton</string>
<string key="back">UIButton</string>
<string key="conferenceDetailCell">UITableViewCell</string>
<string key="hangup">UIButton</string>
<string key="mute">UIButton</string>
<string key="speaker">UIButton</string>
<string key="table">UITableView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="addCall">
<string key="name">addCall</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="back">
<string key="name">back</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="conferenceDetailCell">
<string key="name">conferenceDetailCell</string>
<string key="candidateClassName">UITableViewCell</string>
</object>
<object class="IBToOneOutletInfo" key="hangup">
<string key="name">hangup</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="mute">
<string key="name">mute</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="speaker">
<string key="name">speaker</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="table">
<string key="name">table</string>
<string key="candidateClassName">UITableView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/ConferenceCallDetailView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIEraseButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIEraseButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIHangUpButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIHangUpButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIMuteButton</string>
<string key="superclassName">UIToggleButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIMuteButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISpeakerButton</string>
<string key="superclassName">UIToggleButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UISpeakerButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIToggleButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIToggleButton.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="HP.png">{107, 67}</string>
<string key="HP_inverse.png">{107, 67}</string>
<string key="clavier-01-106px.png">{106, 60}</string>
<string key="effacer.png">{66, 65}</string>
<string key="mic_active.png">{20, 20}</string>
<string key="micro.png">{107, 67}</string>
<string key="micro_inverse.png">{107, 67}</string>
<string key="stopcall-red.png">{62, 54}</string>
</dictionary>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>

View file

@ -1,36 +0,0 @@
/* ConsoleViewController.h
*
* Copyright (C) 2010 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 "LogView.h"
@interface ConsoleViewController : UIViewController <LogView> {
UITextView* logs;
UIView* logsView;
}
-(void) doAction;
@property (nonatomic, retain) IBOutlet UITextView* logs;
@property (nonatomic, retain) IBOutlet UIView* logsView;
@end

View file

@ -1,106 +0,0 @@
/*ConsoleViewController.h
*
* Copyright (C) 2010 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "ConsoleViewController.h"
@implementation ConsoleViewController
NSMutableString* MoreViewController_logs;
@synthesize logs;
@synthesize logsView;
/*
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Custom initialization
}
return self;
}
*/
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
UIBarButtonItem* clear = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemTrash
target:self
action:@selector(doAction)] autorelease];
[self.navigationItem setRightBarButtonItem:clear];
}
/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/
-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[logs setText:MoreViewController_logs];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
-(void) addLog:(NSString*) log {
@synchronized(self) {
if (!MoreViewController_logs) {
MoreViewController_logs = [[NSMutableString alloc] init];
}
[MoreViewController_logs appendString:log];
if (MoreViewController_logs.length > 50000) {
NSRange range = {0,log.length};
[MoreViewController_logs deleteCharactersInRange:range];
}
}
}
-(void) doAction{
@synchronized(self) {
NSMutableString* oldString = MoreViewController_logs;
MoreViewController_logs = [[NSMutableString alloc] init];
[oldString release];
[logs setText:@""];
}
}
- (void)dealloc {
[super dealloc];
}
@end

View file

@ -1,228 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.03">
<data>
<int key="IBDocument.SystemTarget">784</int>
<string key="IBDocument.SystemVersion">9L31a</string>
<string key="IBDocument.InterfaceBuilderVersion">680</string>
<string key="IBDocument.AppKitVersion">949.54</string>
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="10"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
</object>
<object class="IBUIViewController" id="962557183">
<object class="IBUIView" key="IBUIView" id="679133499">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUITextView" id="249557632">
<reference key="NSNextResponder" ref="679133499"/>
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{320, 450}</string>
<reference key="NSSuperview" ref="679133499"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<bool key="IBUIShowsHorizontalScrollIndicator">NO</bool>
<bool key="IBUIDelaysContentTouches">NO</bool>
<bool key="IBUICanCancelContentTouches">NO</bool>
<bool key="IBUIBouncesZoom">NO</bool>
<bool key="IBUIEditable">NO</bool>
<string key="IBUIText"/>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<int key="IBUIAutocapitalizationType">2</int>
</object>
</object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">logs</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="249557632"/>
</object>
<int key="connectionID">9</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">logsView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="679133499"/>
</object>
<int key="connectionID">13</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="679133499"/>
</object>
<int key="connectionID">14</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<object class="NSArray" key="object" id="732835941">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="732835941"/>
<string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="732835941"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">10</int>
<reference key="object" ref="962557183"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="679133499"/>
</object>
<reference key="parent" ref="732835941"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="679133499"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="249557632"/>
</object>
<reference key="parent" ref="962557183"/>
<string key="objectName">logView</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="249557632"/>
<reference key="parent" ref="679133499"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>10.CustomClassName</string>
<string>10.IBEditorWindowLastContentRect</string>
<string>10.IBPluginDependency</string>
<string>4.IBPluginDependency</string>
<string>7.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>ConsoleViewController</string>
<string>UIResponder</string>
<string>ConsoleViewController</string>
<string>{{807, 300}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">14</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">ConsoleViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>logs</string>
<string>logsView</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITextView</string>
<string>UIView</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/ConsoleViewController.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.LastKnownRelativeProjectPath">../linphone.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">3.1</string>
</data>
</archive>

View file

@ -1,30 +0,0 @@
/* ContactPickerDelegate.h
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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 <AddressBookUI/ABPeoplePickerNavigationController.h>
#import "PhoneViewController.h"
#import "linphoneAppDelegate.h"
@interface ContactPickerDelegate : NSObject<ABPeoplePickerNavigationControllerDelegate> {
}
@end

View file

@ -1,53 +0,0 @@
/* ContactPickerDelegate.m
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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 "ContactPickerDelegate.h"
#import "LinphoneManager.h"
@implementation ContactPickerDelegate
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person {
return true;
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier {
CFTypeRef multiValue = ABRecordCopyValue(person, property);
CFIndex valueIdx = ABMultiValueGetIndexForIdentifier(multiValue,identifier);
NSString *phoneNumber = (NSString *)ABMultiValueCopyValueAtIndex(multiValue, valueIdx);
[[LinphoneManager instance].callDelegate displayDialerFromUI:nil
forUser:phoneNumber
withDisplayName:[(NSString*)ABRecordCopyCompositeName(person) autorelease]];
[phoneNumber release];
CFRelease(multiValue);
return false;
}
- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker {
[[LinphoneManager instance].callDelegate displayDialerFromUI:nil
forUser:nil
withDisplayName:@""];
}
@end

View file

@ -1,125 +0,0 @@
/* FirstLoginViewController.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 "FirstLoginViewController.h"
#import "LinphoneManager.h"
@implementation FirstLoginViewController
@synthesize ok;
@synthesize username;
@synthesize passwd;
@synthesize activityIndicator;
@synthesize site;
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
//[username setText:[[NSUserDefaults standardUserDefaults] stringForKey:@"username_preference"]];
//[passwd setText:[[NSUserDefaults standardUserDefaults] stringForKey:@"password_preference"]];
}
-(void) viewDidLoad {
NSString* siteUrl = [[NSUserDefaults standardUserDefaults] stringForKey:@"firt_login_view_url"];
if (siteUrl==nil) {
siteUrl=@"http://www.linphone.org";
}
[site setTitle:siteUrl forState:UIControlStateNormal];
}
- (void)dealloc {
[super dealloc];
[ok dealloc];
[site dealloc];
[username dealloc];
[activityIndicator dealloc];
}
-(void) doOk:(id)sender {
if (sender == site) {
NSURL *url = [NSURL URLWithString:site.titleLabel.text];
[[UIApplication sharedApplication] openURL:url];
return;
}
NSString* errorMessage=nil;
if ([username.text length]==0 ) {
errorMessage=NSLocalizedString(@"Enter your username",nil);
} else if ([passwd.text length]==0 ) {
errorMessage=NSLocalizedString(@"Enter your password",nil);
}
if (errorMessage != nil) {
UIAlertView* error=nil;
error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Alert",nil)
message:errorMessage
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil];
[error show];
[error release];
} else {
[[NSUserDefaults standardUserDefaults] setObject:username.text forKey:@"username_preference"];
[[NSUserDefaults standardUserDefaults] setObject:passwd.text forKey:@"password_preference"];
[[LinphoneManager instance] reconfigureLinphoneIfNeeded:nil];
[self.activityIndicator setHidden:false];
};
}
-(void) displayRegisteredFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain {
[[NSUserDefaults standardUserDefaults] setBool:false forKey:@"enable_first_login_view_preference"];
[self.activityIndicator setHidden:true];
[self dismissModalViewControllerAnimated:YES];
}
-(void) displayRegisteringFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain {
[self.activityIndicator setHidden:false];
}
-(void) displayRegistrationFailedFromUI:(UIViewController*) viewCtrl forUser:(NSString*) user withDisplayName:(NSString*) displayName onDomain:(NSString*)domain forReason:(NSString*) reason {
[self.activityIndicator setHidden:true];
//default behavior if no registration delegates
//UIAlertView* error = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"Registration failure for user %@",user]
// message:reason
// delegate:nil
// cancelButtonTitle:@"Continue"
// otherButtonTitles:nil ,nil];
//[error show];
//[error release];
//erase uername passwd
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"username_preference"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"password_preference"];
}
-(void) displayNotRegisteredFromUI:(UIViewController*) viewCtrl {
[self.activityIndicator setHidden:true];
}
- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
// When the user presses return, take focus away from the text field so that the keyboard is dismissed.
[theTextField resignFirstResponder];
return YES;
}
@end

View file

@ -1,500 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">784</int>
<string key="IBDocument.SystemVersion">10K549</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1038.36</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>IBUIView</string>
<string>IBUIImageView</string>
<string>IBUIViewController</string>
<string>IBProxyObject</string>
<string>IBUIActivityIndicatorView</string>
<string>IBUITextField</string>
<string>IBUIButton</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIViewController" id="284579969">
<object class="IBUIView" key="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIImageView" id="427931982">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{0, -20}, {360, 480}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="210410556"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentMode">9</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">wallpaper_iphone_320x480.png</string>
</object>
</object>
<object class="IBUIButton" id="731646357">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">-2147483356</int>
<string key="NSFrame">{{60, 400}, {200, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="992101396">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="64173324">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<string key="name">Helvetica-Bold</string>
<string key="family">Helvetica</string>
<int key="traits">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUITextField" id="415396672">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{60, 200}, {200, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="157624641"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Password</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace" id="925734638">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIClearsOnBeginEditing">YES</bool>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<int key="IBUIAutocorrectionType">1</int>
<bool key="IBUISecureTextEntry">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="927759199">
<int key="type">1</int>
<double key="pointSize">12</double>
</object>
<object class="NSFont" key="IBUIFont" id="348267750">
<string key="NSName">Helvetica</string>
<double key="NSSize">12</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUITextField" id="300056741">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{60, 150}, {200, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="415396672"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Username</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<reference key="NSCustomColorSpace" ref="925734638"/>
</object>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<int key="IBUIAutocorrectionType">1</int>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIFontDescription" ref="927759199"/>
<reference key="IBUIFont" ref="348267750"/>
</object>
<object class="IBUIButton" id="157624641">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{60, 300}, {200, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="731646357"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Login</string>
<reference key="IBUIHighlightedTitleColor" ref="992101396"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">5</int>
<bytes key="NSCMYK">MSAwLjY2MDAwMDAyNjIgMCAwAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">3</int>
</object>
<characters key="NSComponents">1 0.66 0 0 1</characters>
</object>
<reference key="IBUINormalTitleShadowColor" ref="64173324"/>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">2</int>
<int key="size">2</int>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">18</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIView" id="210410556">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">-2147483356</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIActivityIndicatorView" id="871218378">
<reference key="NSNextResponder" ref="210410556"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{142, 211}, {37, 37}}</string>
<reference key="NSSuperview" ref="210410556"/>
<reference key="NSNextKeyView" ref="300056741"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHidesWhenStopped">NO</bool>
<bool key="IBUIAnimating">YES</bool>
<int key="IBUIStyle">0</int>
</object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSNextKeyView" ref="871218378"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MSAwLjY2AA</bytes>
<reference key="NSCustomColorSpace" ref="925734638"/>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView" ref="427931982"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<reference key="NSCustomColorSpace" ref="925734638"/>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">3</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">passwd</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="415396672"/>
</object>
<int key="connectionID">15</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">activityIndicator</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="210410556"/>
</object>
<int key="connectionID">33</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">username</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="300056741"/>
</object>
<int key="connectionID">38</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">site</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="731646357"/>
</object>
<int key="connectionID">36</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="300056741"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">39</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="415396672"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">17</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doOk:</string>
<reference key="source" ref="157624641"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">20</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doOk:</string>
<reference key="source" ref="731646357"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">37</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<object class="NSArray" key="object" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="284579969"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="191373211"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="157624641"/>
<reference ref="300056741"/>
<reference ref="731646357"/>
<reference ref="415396672"/>
<reference ref="427931982"/>
<reference ref="210410556"/>
</object>
<reference key="parent" ref="284579969"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="157624641"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="300056741"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">username</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="415396672"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">passwd</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="427931982"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">31</int>
<reference key="object" ref="210410556"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="871218378"/>
</object>
<reference key="parent" ref="191373211"/>
<string key="objectName">wait</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">32</int>
<reference key="object" ref="871218378"/>
<reference key="parent" ref="210410556"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">35</int>
<reference key="object" ref="731646357"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">site</string>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
<string>-2.IBPluginDependency</string>
<string>1.IBPluginDependency</string>
<string>1.IBUserGuides</string>
<string>12.IBPluginDependency</string>
<string>12.IBUIButtonInspectorSelectedStateConfigurationMetadataKey</string>
<string>31.IBPluginDependency</string>
<string>32.IBPluginDependency</string>
<string>35.IBPluginDependency</string>
<string>4.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
<string>8.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>FirstLoginViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<object class="NSMutableArray">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUserGuide">
<reference key="view" ref="191373211"/>
<double key="location">104</double>
<int key="affinity">0</int>
</object>
</object>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="0.0"/>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">54</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<integer value="784" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<real value="1280" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NS.key.0">wallpaper_iphone_320x480.png</string>
<string key="NS.object.0">{320, 480}</string>
</object>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>

File diff suppressed because it is too large Load diff

View file

@ -1,145 +0,0 @@
/* IncallViewController.h
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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 "linphonecore.h"
#import "PhoneViewController.h"
#import "ConferenceCallDetailView.h"
#import <AddressBookUI/ABPeoplePickerNavigationController.h>
#include "UILinphone.h"
#import "UIToggleVideoButton.h"
#import "VideoZoomHandler.h"
@class VideoViewController;
@interface IncallViewController : UIViewController <ABPeoplePickerNavigationControllerDelegate,LinphoneUICallDelegate, UITableViewDelegate, UITableViewDataSource, UIActionSheetCustomDelegate> {
UIView* controlSubView, *hangUpView;
UIButton* endCtrl;
UIButton* dialer;
UIMuteButton* mute;
UIButton* pause;
UISpeakerButton* speaker;
UIButton* contacts;
UIToggleVideoButton* addVideo;
UITableView* callTableView;
UIButton* addCall, *mergeCalls;
UIButton* transfer;
//key pad
UIView* padSubView;
UIDigitButton* one;
UIDigitButton* two;
UIDigitButton* three;
UIDigitButton* four;
UIDigitButton* five;
UIDigitButton* six;
UIDigitButton* seven;
UIDigitButton* eight;
UIDigitButton* nine;
UIDigitButton* star;
UIDigitButton* zero;
UIDigitButton* hash;
UIButton* close;
UIView* videoGroup;
UIView* videoView;
UIView* videoPreview;
UIImageView* videoCallQuality;
UICamSwitch* videoCameraSwitch;
UIActivityIndicatorView* videoUpdateIndicator;
UIActivityIndicatorView* videoWaitingForFirstImage;
bool dismissed;
NSTimer *durationRefreasher;
NSTimer * glowingTimer;
float glow;
NSIndexPath* activePath;
ABPeoplePickerNavigationController* myPeoplePickerController;
UITableViewCell* activeCallCell;
VideoViewController* mVideoViewController;
ConferenceCallDetailView* conferenceDetail;
BOOL mVideoShown;
BOOL mVideoIsPending;
BOOL mIncallViewIsReady;
UIImage* verified, *unverified;
UIImage* stat_sys_signal_0, *stat_sys_signal_1, *stat_sys_signal_2, *stat_sys_signal_3, *stat_sys_signal_4;
UIActionSheet* visibleActionSheet;
NSTimer* hideControlsTimer;
VideoZoomHandler* videoZoomHandler;
}
-(void)displayStatus:(NSString*) message;
- (IBAction)doAction:(id)sender;
+(LinphoneCall*) retrieveCallAtIndex: (NSInteger) index inConference:(bool) conf;
+ (void) updateCellImageView:(UIImageView*)imageView Label:(UILabel*)label DetailLabel:(UILabel*)detailLabel AndAccessoryView:(UIView*)accessoryView withCall:(LinphoneCall*) call;
+(void) updateIndicator:(UIImageView*) indicator withCallQuality:(float) quality;
@property (nonatomic, retain) IBOutlet UIView* controlSubView;
@property (nonatomic, retain) IBOutlet UIView* padSubView;
@property (nonatomic, retain) IBOutlet UIView* hangUpView;
@property (nonatomic, retain) IBOutlet UIViewController* conferenceDetail;
@property (nonatomic, retain) IBOutlet UIButton* endCtrl;
@property (nonatomic, retain) IBOutlet UIButton* dialer;
@property (nonatomic, retain) IBOutlet UIButton* mute;
@property (nonatomic, retain) IBOutlet UIButton* pause;
@property (nonatomic, retain) IBOutlet UIButton* speaker;
@property (nonatomic, retain) IBOutlet UIButton* contacts;
@property (nonatomic, retain) IBOutlet UIToggleVideoButton* addVideo;
@property (nonatomic, retain) IBOutlet UITableView* callTableView;
@property (nonatomic, retain) IBOutlet UIButton* addCall;
@property (nonatomic, retain) IBOutlet UIButton* mergeCalls;
@property (nonatomic, retain) IBOutlet UIButton* transfer;
@property (nonatomic, retain) IBOutlet UIButton* one;
@property (nonatomic, retain) IBOutlet UIButton* two;
@property (nonatomic, retain) IBOutlet UIButton* three;
@property (nonatomic, retain) IBOutlet UIButton* four;
@property (nonatomic, retain) IBOutlet UIButton* five;
@property (nonatomic, retain) IBOutlet UIButton* six;
@property (nonatomic, retain) IBOutlet UIButton* seven;
@property (nonatomic, retain) IBOutlet UIButton* eight;
@property (nonatomic, retain) IBOutlet UIButton* nine;
@property (nonatomic, retain) IBOutlet UIButton* star;
@property (nonatomic, retain) IBOutlet UIButton* zero;
@property (nonatomic, retain) IBOutlet UIButton* hash;
@property (nonatomic, retain) IBOutlet UIButton* close;
@property (nonatomic, retain) IBOutlet VideoViewController* videoViewController;
@property (nonatomic, retain) IBOutlet UIView* videoGroup;
@property (nonatomic, retain) IBOutlet UIView* videoView;
@property (nonatomic, retain) IBOutlet UIView* videoPreview;
@property (nonatomic, retain) IBOutlet UIImageView* videoCallQuality;
@property (nonatomic, retain) IBOutlet UICamSwitch* videoCameraSwitch;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* videoUpdateIndicator;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* videoWaitingForFirstImage;
@end

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* linphoneAppDelegate.h
/* LinphoneAppDelegate.h
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
*
@ -17,44 +17,21 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <UIKit/UIKit.h>
#import <AddressBookUI/ABPeoplePickerNavigationController.h>
#import "CoreTelephony/CTCallCenter.h"
#define DIALER_TAB_INDEX 1
#define CONTACTS_TAB_INDEX 2
#define HISTORY_TAB_INDEX 0
#define MORE_TAB_INDEX 3
@class ContactPickerDelegate;
@class IncallViewController;
@class PhoneViewController;
@class CallHistoryTableViewController;
@interface linphoneAppDelegate : NSObject <UIApplicationDelegate,UIAlertViewDelegate> {
UIWindow *window;
IBOutlet UITabBarController* myTabBarController;
IBOutlet ABPeoplePickerNavigationController* myPeoplePickerController;
IBOutlet PhoneViewController* myPhoneViewController;
CallHistoryTableViewController* myCallHistoryTableViewController;
ContactPickerDelegate* myContactPickerDelegate;
CTCallCenter* callCenter;
}
- (void) loadDefaultSettings:(NSDictionary *) appDefaults;
-(void) setupUI;
-(void) setupGSMInteraction;
-(void) startApplication;
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UITabBarController* myTabBarController;
@property (nonatomic, retain) ABPeoplePickerNavigationController* myPeoplePickerController;
@property (nonatomic, retain) IBOutlet PhoneViewController* myPhoneViewController;
#import <CoreTelephony/CTCallCenter.h>
@interface UILinphoneWindow : UIWindow
@end
@interface LinphoneAppDelegate : NSObject <UIApplicationDelegate,UIAlertViewDelegate> {
UIWindow *window;
CTCallCenter* callCenter;
BOOL started;
}
@property (assign) BOOL started;
@end

View file

@ -1,4 +1,4 @@
/* linphoneAppDelegate.m
/* LinphoneAppDelegate.m
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
*
@ -17,18 +17,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "PhoneViewController.h"
#import "linphoneAppDelegate.h"
#import "ContactPickerDelegate.h"
#import "AddressBook/ABPerson.h"
#import "BuschJaegerMainView.h"
#import "CoreTelephony/CTCallCenter.h"
#import "CoreTelephony/CTCall.h"
#import "ConsoleViewController.h"
#import "MoreViewController.h"
#include "CallHistoryTableViewController.h"
#include "LinphoneManager.h"
#include "linphonecore.h"
@ -39,51 +34,77 @@ int __aeabi_idiv(int a, int b) {
}
#endif
@implementation linphoneAppDelegate
@implementation UILinphoneWindow
@synthesize window;
@synthesize myTabBarController;
@synthesize myPeoplePickerController;
@synthesize myPhoneViewController;
@end
-(void) handleGSMCallInteration: (id) cCenter {
@implementation LinphoneAppDelegate
@synthesize started;
#pragma mark - Lifecycle Functions
- (id)init {
self = [super init];
if(self != nil) {
self->started = FALSE;
}
return self;
}
- (void)dealloc {
[super dealloc];
}
#pragma mark -
- (void)handleGSMCallInteration: (id) cCenter {
CTCallCenter* ct = (CTCallCenter*) cCenter;
int callCount = [ct.currentCalls count];
if (!callCount) {
NSLog(@"No GSM call -> enabling SIP calls");
[LinphoneLogger logc:LinphoneLoggerLog format:"No GSM call -> enabling SIP calls"];
linphone_core_set_max_calls([LinphoneManager getLc], 3);
} else {
NSLog(@"%d GSM call(s) -> disabling SIP calls", callCount);
[LinphoneLogger logc:LinphoneLoggerLog format:"%d GSM call(s) -> disabling SIP calls", callCount];
/* pause current call, if any */
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (call) {
NSLog(@"Pausing SIP call");
[LinphoneLogger logc:LinphoneLoggerLog format:"Pausing SIP call"];
linphone_core_pause_call([LinphoneManager getLc], call);
}
linphone_core_set_max_calls([LinphoneManager getLc], 0);
}
}
-(void)applicationWillResignActive:(UIApplication *)application {
- (void)applicationDidEnterBackground:(UIApplication *)application{
[LinphoneLogger logc:LinphoneLoggerLog format:"applicationDidEnterBackground"];
if(![LinphoneManager isLcReady]) return;
[[LinphoneManager instance] enterBackgroundMode];
}
- (void)applicationWillResignActive:(UIApplication *)application {
[LinphoneLogger logc:LinphoneLoggerLog format:"applicationWillResignActive"];
if(![LinphoneManager isLcReady]) return;
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneCall* call = linphone_core_get_current_call(lc);
if (call == NULL)
return;
if (call){
/* save call context */
LinphoneManager* instance = [LinphoneManager instance];
instance->currentCallContextBeforeGoingBackground.call = call;
instance->currentCallContextBeforeGoingBackground.cameraIsEnabled = linphone_call_camera_enabled(call);
/* save call context */
LinphoneManager* instance = [LinphoneManager instance];
instance->currentCallContextBeforeGoingBackground.call = call;
instance->currentCallContextBeforeGoingBackground.cameraIsEnabled = linphone_call_camera_enabled(call);
const LinphoneCallParams* params = linphone_call_get_current_params(call);
if (linphone_call_params_video_enabled(params)) {
linphone_call_enable_camera(call, false);
}
}
const LinphoneCallParams* params = linphone_call_get_current_params(call);
if (linphone_call_params_video_enabled(params)) {
linphone_call_enable_camera(call, false);
}
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
if (![[LinphoneManager instance] enterBackgroundMode]) {
if (![[LinphoneManager instance] resignActive]) {
// destroying eventHandler if app cannot go in background.
// Otherwise if a GSM call happen and Linphone is resumed,
// the handler will be called before LinphoneCore is built.
@ -92,50 +113,48 @@ int __aeabi_idiv(int a, int b) {
[callCenter release];
callCenter = nil;
}
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground
&& [[NSUserDefaults standardUserDefaults] boolForKey:@"disable_autoboot_preference"]) {
// autoboot disabled, doing nothing
return;
} else if ([LinphoneManager instance] == nil) {
[self startApplication];
}
[LinphoneLogger logc:LinphoneLoggerLog format:"applicationDidBecomeActive"];
[self startApplication];
[[LinphoneManager instance] becomeActive];
if (callCenter == nil) {
callCenter = [[CTCallCenter alloc] init];
callCenter.callEventHandler = ^(CTCall* call) {
// post on main thread
[self performSelectorOnMainThread:@selector(handleGSMCallInteration:)
withObject:callCenter
waitUntilDone:YES];
};
}
// check call state at startup
[self handleGSMCallInteration:callCenter];
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneCall* call = linphone_core_get_current_call(lc);
if (call == NULL)
return;
LinphoneManager* instance = [LinphoneManager instance];
if (call == instance->currentCallContextBeforeGoingBackground.call) {
const LinphoneCallParams* params = linphone_call_get_current_params(call);
if (linphone_call_params_video_enabled(params)) {
linphone_call_enable_camera(
if (call){
LinphoneManager* instance = [LinphoneManager instance];
if (call == instance->currentCallContextBeforeGoingBackground.call) {
const LinphoneCallParams* params = linphone_call_get_current_params(call);
if (linphone_call_params_video_enabled(params)) {
linphone_call_enable_camera(
call,
instance->currentCallContextBeforeGoingBackground.cameraIsEnabled);
}
instance->currentCallContextBeforeGoingBackground.call = 0;
}
instance->currentCallContextBeforeGoingBackground.call = 0;
}
}
}
- (void)setupGSMInteraction {
if (callCenter == nil) {
callCenter = [[CTCallCenter alloc] init];
callCenter.callEventHandler = ^(CTCall* call) {
// post on main thread
[self performSelectorOnMainThread:@selector(handleGSMCallInteration:)
withObject:callCenter
waitUntilDone:YES];
};
}
}
- (void) loadDefaultSettings:(NSDictionary *) appDefaults {
- (void) loadDefaultSettings {
NSString *settingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
if(!settingsBundle) {
NSLog(@"Could not find Settings.bundle");
@ -143,145 +162,137 @@ int __aeabi_idiv(int a, int b) {
}
NSMutableDictionary *rootSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Root.plist"]];
NSMutableDictionary *audioSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"audio.plist"]];
NSMutableDictionary *videoSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"video.plist"]];
NSMutableDictionary *advancedSettings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Advanced.plist"]];
NSMutableArray *preferences = [rootSettings objectForKey:@"PreferenceSpecifiers"];
[preferences addObjectsFromArray:[audioSettings objectForKey:@"PreferenceSpecifiers"]];
[preferences addObjectsFromArray:[videoSettings objectForKey:@"PreferenceSpecifiers"]];
[preferences addObjectsFromArray:[advancedSettings objectForKey:@"PreferenceSpecifiers"]];
NSMutableDictionary *defaultsToRegister = [[NSMutableDictionary alloc] initWithCapacity:[preferences count]];
for(NSDictionary *prefSpecification in preferences) {
NSString *key = [prefSpecification objectForKey:@"Key"];
if(key && [prefSpecification objectForKey:@"DefaultValue"]) {
[defaultsToRegister setObject:[prefSpecification objectForKey:@"DefaultValue"] forKey:key];
}
}
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
@"YES", @"debugenable_preference",
@"YES", @"enable_video_preference",
@"YES", @"start_video_preference",
@"YES", @"h264_preference",
@"YES", @"vp8_preference",
@"NO", @"mpeg4_preference",
@"YES", @"pcmu_preference",
@"YES", @"pcma_preference",
@"tcp", @"transport_preference",
@"NO", @"enable_srtp_preference",
@"YES", @"backgroundmode_preference",
@"YES", @"outbound_proxy_preference",
nil];
[defaultsToRegister addEntriesFromDictionary:appDefaults];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsToRegister];
[defaultsToRegister release];
[[NSUserDefaults standardUserDefaults] synchronize];
}
-(void) setupUI {
//as defined in PhoneMainView.xib
//dialer
myPhoneViewController = (PhoneViewController*) [myTabBarController.viewControllers objectAtIndex: DIALER_TAB_INDEX];
myPhoneViewController.myTabBarController = myTabBarController;
//Call history
myCallHistoryTableViewController = [[CallHistoryTableViewController alloc] initWithNibName:@"CallHistoryTableViewController"
bundle:[NSBundle mainBundle]];
UINavigationController *aCallHistNavigationController = [[UINavigationController alloc] initWithRootViewController:myCallHistoryTableViewController];
aCallHistNavigationController.tabBarItem = [(UIViewController*)[myTabBarController.viewControllers objectAtIndex:HISTORY_TAB_INDEX] tabBarItem];
//people picker delegates
myContactPickerDelegate = [[ContactPickerDelegate alloc] init];
//people picker
myPeoplePickerController = [[[ABPeoplePickerNavigationController alloc] init] autorelease];
[myPeoplePickerController setDisplayedProperties:[NSArray arrayWithObject:[NSNumber numberWithInt:kABPersonPhoneProperty]]];
[myPeoplePickerController setPeoplePickerDelegate:myContactPickerDelegate];
//copy tab bar item
myPeoplePickerController.tabBarItem = [(UIViewController*)[myTabBarController.viewControllers objectAtIndex:CONTACTS_TAB_INDEX] tabBarItem];
//more tab
MoreViewController *moreViewController = [[MoreViewController alloc] initWithNibName:@"MoreViewController" bundle:[NSBundle mainBundle]];
UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:moreViewController];
[moreViewController release];
//copy tab bar item
aNavigationController.tabBarItem = [(UIViewController*)[myTabBarController.viewControllers objectAtIndex:MORE_TAB_INDEX] tabBarItem];
//insert contact controller
NSMutableArray* newArray = [NSMutableArray arrayWithArray:self.myTabBarController.viewControllers];
[newArray replaceObjectAtIndex:CONTACTS_TAB_INDEX withObject:myPeoplePickerController];
[newArray replaceObjectAtIndex:MORE_TAB_INDEX withObject:aNavigationController];
[aNavigationController release];
[newArray replaceObjectAtIndex:HISTORY_TAB_INDEX withObject:aCallHistNavigationController];
[aCallHistNavigationController release];
[myTabBarController setSelectedIndex:DIALER_TAB_INDEX];
[myTabBarController setViewControllers:newArray animated:NO];
[window addSubview:myTabBarController.view];
[window makeKeyAndVisible];
[[LinphoneManager instance] setCallDelegate:myPhoneViewController];
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self loadDefaultSettings];
[UIDevice currentDevice].batteryMonitoringEnabled = YES;
}
-(void) setupGSMInteraction {
callCenter = [[CTCallCenter alloc] init];
callCenter.callEventHandler = ^(CTCall* call) {
// post on main thread
[self performSelectorOnMainThread:@selector(handleGSMCallInteration:)
withObject:callCenter
waitUntilDone:YES];
};
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
@"NO", @"enable_first_login_view_preference", //
#ifdef HAVE_AMR
@"YES",@"amr_8k_preference", // enable amr by default if compiled with
#endif
#ifdef HAVE_G729
@"YES",@"g729_preference", // enable amr by default if compiled with
#endif
//@"+33",@"countrycode_preference",
nil];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound];
[self loadDefaultSettings: appDefaults];
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground
&& (![[NSUserDefaults standardUserDefaults] boolForKey:@"start_at_boot_preference"] ||
![[NSUserDefaults standardUserDefaults] boolForKey:@"backgroundmode_preference"])) {
// autoboot disabled, doing nothing
return YES;
}
[self startApplication];
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground
&& [[NSUserDefaults standardUserDefaults] boolForKey:@"disable_autoboot_preference"]) {
// autoboot disabled, doing nothing
} else {
[self startApplication];
}
return YES;
}
-(void) startApplication {
/* explicitely instanciate LinphoneManager */
LinphoneManager* lm = [[LinphoneManager alloc] init];
assert(lm == [LinphoneManager instance]);
[self setupUI];
[[LinphoneManager instance] startLibLinphone];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound];
[self setupGSMInteraction];
- (void)startApplication {
// Restart Linphone Core if needed
if(![LinphoneManager isLcReady]) {
[[LinphoneManager instance] startLibLinphone];
}
if([LinphoneManager isLcReady]) {
[self setupGSMInteraction];
// Only execute one time at application start
if(!started) {
started = TRUE;
[window setRootViewController:[[[BuschJaegerMainView alloc] initWithNibName:@"BuschJaegerMainView" bundle:[NSBundle mainBundle]] autorelease]];
//[[PhoneMainView instance] startUp];
}
}
}
- (void)applicationWillTerminate:(UIApplication *)application {
}
- (void)dealloc {
[window release];
[myPeoplePickerController release];
[super dealloc];
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
[self startApplication];
if([LinphoneManager isLcReady]) {
if([[url scheme] isEqualToString:@"sip"]) {
/*
// Go to ChatRoom view
DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController);
if(controller != nil) {
[controller setAddress:[url absoluteString]];
}
*/
}
}
return YES;
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
[LinphoneLogger log:LinphoneLoggerDebug format:@"PushNotification: Receive %@", userInfo];
NSDictionary *aps = [userInfo objectForKey:@"aps"];
if(aps != nil) {
NSDictionary *alert = [aps objectForKey:@"alert"];
if(alert != nil) {
NSString *loc_key = [alert objectForKey:@"loc-key"];
if(loc_key != nil) {
if([loc_key isEqualToString:@"IM_MSG"]) {
/*
[[LinphoneManager instance] addInhibitedEvent:kLinphoneTextReceivedSound];
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
*/
}
}
}
}
}
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
LinphoneCall* call;
[(NSData*)([notification.userInfo objectForKey:@"call"]) getBytes:&call];
if (!call) {
ms_warning("Local notification received with nil call");
return;
if([notification.userInfo objectForKey:@"call"] != nil) {
LinphoneCall* call;
[(NSData*)[notification.userInfo objectForKey:@"call"] getBytes:&call];
if (!call) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Local notification received with nil call"];
return;
}
linphone_core_accept_call([LinphoneManager getLc], call);
} else if([notification.userInfo objectForKey:@"chat"] != nil) {
/*
NSString *remoteContact = (NSString*)[notification.userInfo objectForKey:@"chat"];
// Go to ChatRoom view
ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController);
if(controller != nil) {
[controller setRemoteAddress:remoteContact];
}
*/
}
linphone_core_accept_call([LinphoneManager getLc], call);
}
#pragma mark - PushNotification Functions
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
[LinphoneLogger log:LinphoneLoggerDebug format:@"PushNotification: Token %@", deviceToken];
[[LinphoneManager instance] setPushNotificationToken:deviceToken];
}
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error {
[LinphoneLogger log:LinphoneLoggerDebug format:@"PushNotification: Error %@", error];
[[LinphoneManager instance] setPushNotificationToken:nil];
}
@end

View file

@ -20,16 +20,30 @@
#import <Foundation/Foundation.h>
#import <AVFoundation/AVAudioSession.h>
#import <SystemConfiguration/SCNetworkReachability.h>
#include "linphonecore.h"
#import <AudioToolbox/AudioToolbox.h>
#import <sqlite3.h>
#import "LogView.h"
#import "LinphoneUIDelegates.h"
#import "FastAddressBook.h"
#import "Utils.h"
#import "BuschJaegerConfigParser.h"
#include "linphonecore.h"
extern NSString *const kLinphoneTextReceived;
extern NSString *const kLinphoneTextReceivedSound;
extern NSString *const kLinphoneCallUpdate;
extern NSString *const kLinphoneRegistrationUpdate;
extern NSString *const kLinphoneMainViewChange;
extern NSString *const kLinphoneAddressBookUpdate;
extern NSString *const kContactSipField;
typedef enum _Connectivity {
wifi,
wwan
,none
} Connectivity;
@class FastAddressBook;
/* Application specific call context */
typedef struct _CallContext {
@ -44,59 +58,74 @@ struct NetworkReachabilityContext {
typedef struct _LinphoneCallAppData {
bool_t batteryWarningShown;
// transfer data
int transferButtonIndex;
UILocalNotification *notification;
} LinphoneCallAppData;
typedef struct _LinphoneManagerSounds {
SystemSoundID call;
SystemSoundID message;
} LinphoneManagerSounds;
@interface LinphoneManager : NSObject <AVAudioSessionDelegate> {
@protected
SCNetworkReachabilityRef proxyReachability;
@private
NSTimer* mIterateTimer;
id<LogView> mLogView;
bool isbackgroundModeEnabled;
id<LinphoneUICallDelegate> callDelegate;
id<LinphoneUIRegistrationDelegate> registrationDelegate;
UIViewController* mCurrentViewController;
Connectivity connectivity;
FastAddressBook* mFastAddressBook;
const char* frontCamId;
const char* backCamId;
NSDictionary* currentSettings;
FastAddressBook* fastAddressBook;
LinphoneManagerSounds sounds;
NSMutableArray *inhibitedEvent;
sqlite3 *database;
@public
CallContext currentCallContextBeforeGoingBackground;
}
+(LinphoneManager*) instance;
+(LinphoneCore*) getLc;
+(BOOL) runningOnIpad;
+(void) set:(UIView*)view hidden: (BOOL) hidden withName:(const char*)name andReason:(const char*) reason;
+(void) logUIElementPressed:(const char*) name;
+ (LinphoneManager*)instance;
#ifdef DEBUG
+ (void)instanceRelease;
#endif
+ (LinphoneCore*) getLc;
+ (BOOL)isLcReady;
+ (BOOL)runningOnIpad;
+ (BOOL)isNotIphone3G;
+ (NSString *)getPreferenceForCodec: (const char*) name withRate: (int) rate;
+ (NSSet *)unsupportedCodecs;
+ (NSString *)getUserAgent;
-(void) displayDialer;
- (void)startLibLinphone;
- (void)destroyLibLinphone;
- (BOOL)resignActive;
- (void)becomeActive;
- (BOOL)enterBackgroundMode;
-(void) registerLogView:(id<LogView>) view;
+ (void)kickOffNetworkConnection;
- (void)setupNetworkReachabilityCallback;
-(void) startLibLinphone;
-(BOOL) isNotIphone3G;
-(void) destroyLibLinphone;
-(BOOL) enterBackgroundMode;
-(void) becomeActive;
-(void) kickOffNetworkConnection;
-(NSString*) getDisplayNameFromAddressBook:(NSString*) number andUpdateCallLog:(LinphoneCallLog*)log;
-(UIImage*) getImageFromAddressBook:(NSString*) number;
- (void)refreshRegisters;
-(BOOL) reconfigureLinphoneIfNeeded:(NSDictionary *)oldSettings;
-(void) setupNetworkReachabilityCallback: (const char*) nodeName withContext:(SCNetworkReachabilityContext*) ctx;
- (void)enableSpeaker:(BOOL)enable;
- (BOOL)isSpeakerEnabled;
@property (nonatomic, retain) id<LinphoneUICallDelegate> callDelegate;
@property (nonatomic, retain) id<LinphoneUIRegistrationDelegate> registrationDelegate;
- (void)addInhibitedEvent:(NSString*)event;
- (BOOL)removeInhibitedEvent:(NSString*)event;
- (void)call:(NSString *)address displayName:(NSString*)displayName transfer:(BOOL)transfer;
@property (readonly) FastAddressBook* fastAddressBook;
@property Connectivity connectivity;
@property (nonatomic) int defaultExpires;
@property (readonly) const char* frontCamId;
@property (readonly) const char* backCamId;
@property (readonly) sqlite3* database;
@property (nonatomic, retain) NSData *pushNotificationToken;
@property (readonly) LinphoneManagerSounds sounds;
@end

904
Classes/LinphoneManager.m Normal file
View file

@ -0,0 +1,904 @@
/* LinphoneManager.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.
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <sys/sysctl.h>
#import <AVFoundation/AVAudioSession.h>
#import <AudioToolbox/AudioToolbox.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <CoreTelephony/CTCallCenter.h>
#import "LinphoneManager.h"
#include "linphonecore_utils.h"
#include "lpconfig.h"
#include "private.h"
static LinphoneCore* theLinphoneCore = nil;
static LinphoneManager* theLinphoneManager = nil;
NSString *const kLinphoneTextReceived = @"LinphoneTextReceived";
NSString *const kLinphoneTextReceivedSound = @"LinphoneTextReceivedSound";
NSString *const kLinphoneCallUpdate = @"LinphoneCallUpdate";
NSString *const kLinphoneRegistrationUpdate = @"LinphoneRegistrationUpdate";
NSString *const kLinphoneAddressBookUpdate = @"LinphoneAddressBookUpdate";
NSString *const kLinphoneMainViewChange = @"LinphoneMainViewChange";
NSString *const kContactSipField = @"SIP";
extern void libmsilbc_init();
#ifdef HAVE_AMR
extern void libmsamr_init();
#endif
#ifdef HAVE_X264
extern void libmsx264_init();
#endif
#define FRONT_CAM_NAME "AV Capture: com.apple.avfoundation.avcapturedevice.built-in_video:1" /*"AV Capture: Front Camera"*/
#define BACK_CAM_NAME "AV Capture: com.apple.avfoundation.avcapturedevice.built-in_video:0" /*"AV Capture: Back Camera"*/
#if defined (HAVE_SILK)
extern void libmssilk_init();
#endif
#if HAVE_G729
extern void libmsbcg729_init();
#endif
@implementation LinphoneManager
@synthesize connectivity;
@synthesize frontCamId;
@synthesize backCamId;
@synthesize defaultExpires;
@synthesize database;
@synthesize fastAddressBook;
@synthesize pushNotificationToken;
@synthesize sounds;
struct codec_name_pref_table{
const char *name;
int rate;
NSString *prefname;
};
struct codec_name_pref_table codec_pref_table[]={
{ "speex", 8000, @"speex_8k_preference" },
{ "speex", 16000, @"speex_16k_preference" },
{ "silk", 24000, @"silk_24k_preference" },
{ "silk", 16000, @"silk_16k_preference" },
{ "amr", 8000, @"amr_8k_preference" },
{ "ilbc", 8000, @"ilbc_preference"},
{ "pcmu", 8000, @"pcmu_preference"},
{ "pcma", 8000, @"pcma_preference"},
{ "g722", 8000, @"g722_preference"},
{ "g729", 8000, @"g729_preference"},
{ "mp4v-es", 90000, @"mp4v-es_preference"},
{ "h264", 90000, @"h264_preference"},
{ "vp8", 90000, @"vp8_preference"},
{ NULL,0,Nil }
};
+ (NSString *)getPreferenceForCodec: (const char*) name withRate: (int) rate{
int i;
for(i=0;codec_pref_table[i].name!=NULL;++i){
if (strcasecmp(codec_pref_table[i].name,name)==0 && codec_pref_table[i].rate==rate)
return codec_pref_table[i].prefname;
}
return Nil;
}
+ (NSSet *)unsupportedCodecs {
NSMutableSet *set = [NSMutableSet set];
for(int i=0;codec_pref_table[i].name!=NULL;++i) {
if(linphone_core_find_payload_type([LinphoneManager getLc],codec_pref_table[i].name, codec_pref_table[i].rate) == NULL) {
[set addObject:codec_pref_table[i].prefname];
}
}
return set;
}
+ (BOOL)runningOnIpad {
#ifdef UI_USER_INTERFACE_IDIOM
return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
#else
return NO;
#endif
}
+ (BOOL)isNotIphone3G
{
static BOOL done=FALSE;
static BOOL result;
if (!done){
size_t size;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
char *machine = malloc(size);
sysctlbyname("hw.machine", machine, &size, NULL, 0);
NSString *platform = [[NSString alloc ] initWithUTF8String:machine];
free(machine);
result = ![platform isEqualToString:@"iPhone1,2"];
[platform release];
done=TRUE;
}
return result;
}
+ (NSString *)getUserAgent {
return [NSString stringWithFormat:@"LinphoneIphone/%@ (Linphone/%s; Apple %@/%@)",
[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey],
linphone_core_get_version(),
[UIDevice currentDevice].systemName,
[UIDevice currentDevice].systemVersion];
}
+ (LinphoneManager*)instance {
if(theLinphoneManager == nil) {
theLinphoneManager = [LinphoneManager alloc];
[theLinphoneManager init];
}
return theLinphoneManager;
}
#ifdef DEBUG
+ (void)instanceRelease {
if(theLinphoneManager != nil) {
[theLinphoneManager release];
theLinphoneManager = nil;
}
}
#endif
#pragma mark - Lifecycle Functions
- (id)init {
if ((self = [super init])) {
fastAddressBook = [[FastAddressBook alloc] init];
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"01" ofType:@"wav"];
sounds.call = 0;
OSStatus status = AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &sounds.call);
if(status != 0){
[LinphoneLogger log:LinphoneLoggerWarning format:@"Can't set \"call\" system sound"];
}
}
/*{
NSString *path = [[NSBundle mainBundle] pathForResource:@"msg" ofType:@"wav"];
sounds.message = 0;
OSStatus status = AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &sounds.message);
if(status != 0){
[LinphoneLogger log:LinphoneLoggerWarning format:@"Can't set \"message\" system sound"];
}
}*/
inhibitedEvent = [[NSMutableArray alloc] init];
database = NULL;
self.defaultExpires = 600;
[self openDatabase];
}
return self;
}
- (void)dealloc {
if(sounds.call) {
AudioServicesDisposeSystemSoundID(sounds.call);
}
if(sounds.message) {
AudioServicesDisposeSystemSoundID(sounds.message);
}
[inhibitedEvent release];
[fastAddressBook release];
[self closeDatabase];
[super dealloc];
}
#pragma mark - Database Functions
- (void)openDatabase {
/*NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
NSString *databaseDocumentPath = [documentsPath stringByAppendingPathComponent:@"database.txt"];
// Copy default database
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error = nil;
//[fileManager removeItemAtPath:databaseDocumentPath error:&error]; //TODO REMOVE
if ([fileManager fileExistsAtPath:databaseDocumentPath] == NO) {
[LinphoneLogger logc:LinphoneLoggerLog format:"Create sqlite3 database"];
NSString *resourceDocumentPath = [[NSBundle mainBundle] pathForResource:@"database" ofType:@"sqlite"];
[fileManager copyItemAtPath:resourceDocumentPath toPath:databaseDocumentPath error:&error];
if(error != nil) {
[LinphoneLogger log:LinphoneLoggerError format:@"Can't copy database: %@", [error localizedDescription]];
return;
}
}
if(sqlite3_open([databaseDocumentPath UTF8String], &database) != SQLITE_OK) {
[LinphoneLogger log:LinphoneLoggerError format:@"Can't open \"%@\" sqlite3 database.", databaseDocumentPath];
}*/
}
- (void)closeDatabase {
/*if(database != NULL) {
if(sqlite3_close(database) != SQLITE_OK) {
[LinphoneLogger logc:LinphoneLoggerError format:"Can't close sqlite3 database."];
}
}*/
}
#pragma mark - Linphone Core Functions
+ (LinphoneCore*)getLc {
if (theLinphoneCore==nil) {
@throw([NSException exceptionWithName:@"LinphoneCoreException" reason:@"Linphone core not initialized yet" userInfo:nil]);
}
return theLinphoneCore;
}
+ (BOOL)isLcReady {
return theLinphoneCore != nil;
}
#pragma mark - Logs Functions
//generic log handler for debug version
void linphone_iphone_log_handler(int lev, const char *fmt, va_list args){
NSString* format = [[NSString alloc] initWithUTF8String:fmt];
NSLogv(format, args);
NSString* formatedString = [[NSString alloc] initWithFormat:format arguments:args];
//[[LinphoneManager instance] addLog:formatedString];
[formatedString release];
[format release];
}
//Error/warning log handler
static void linphone_iphone_log(struct _LinphoneCore * lc, const char * message) {
NSString* log = [NSString stringWithCString:message encoding:[NSString defaultCStringEncoding]];
NSLog(log, NULL);
//[[LinphoneManager instance] addLog:log];
}
#pragma mark - Display Status Functions
- (void)displayStatus:(NSString*) message {
// Post event
NSDictionary* dict = [[[NSDictionary alloc] initWithObjectsAndKeys:
message, @"message",
nil] autorelease];
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneDisplayStatus" object:self userInfo:dict];
}
static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char * message) {
NSString* status = [[NSString alloc] initWithCString:message encoding:[NSString defaultCStringEncoding]];
[(LinphoneManager*)linphone_core_get_user_data(lc) displayStatus:status];
[status release];
}
#pragma mark - Call State Functions
- (void)onCall:(LinphoneCall*)call StateChanged:(LinphoneCallState)state withMessage:(const char *)message {
// Handling wrapper
if(state == LinphoneCallReleased) {
if(linphone_call_get_user_pointer(call) != NULL) {
free (linphone_call_get_user_pointer(call));
linphone_call_set_user_pointer(call, NULL);
}
return;
}
if (!linphone_call_get_user_pointer(call)) {
LinphoneCallAppData* data = (LinphoneCallAppData*) malloc(sizeof(LinphoneCallAppData));
data->batteryWarningShown = FALSE;
data->notification = nil;
linphone_call_set_user_pointer(call, data);
}
// Disable speaker when no more call
if ((state == LinphoneCallEnd || state == LinphoneCallError)) {
if(linphone_core_get_calls_nb([LinphoneManager getLc]) == 0)
[self enableSpeaker:FALSE];
}
// Enable speaker when video
if(state == LinphoneCallIncomingReceived ||
state == LinphoneCallOutgoingInit ||
state == LinphoneCallConnected ||
state == LinphoneCallStreamsRunning ||
state == LinphoneCallUpdated) {
if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
[self enableSpeaker:TRUE];
}
}
// Post event
NSDictionary* dict = [[[NSDictionary alloc] initWithObjectsAndKeys:
[NSValue valueWithPointer:call], @"call",
[NSNumber numberWithInt:state], @"state",
[NSString stringWithUTF8String:message], @"message", nil] autorelease];
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneCallUpdate" object:self userInfo:dict];
}
static void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall* call, LinphoneCallState state,const char* message) {
[(LinphoneManager*)linphone_core_get_user_data(lc) onCall:call StateChanged: state withMessage: message];
}
#pragma mark - Transfert State Functions
static void linphone_iphone_transfer_state_changed(LinphoneCore* lc, LinphoneCall* call, LinphoneCallState state) {
}
#pragma mark - Registration State Functions
-(void) onRegister:(LinphoneCore *)lc cfg:(LinphoneProxyConfig*) cfg state:(LinphoneRegistrationState) state message:(const char*) message {
[LinphoneLogger logc:LinphoneLoggerLog format:"NEW REGISTRATION STATE: '%s' (message: '%s')", linphone_registration_state_to_string(state), message];
// Post event
NSDictionary* dict = [[[NSDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithInt:state], @"state",
[NSValue valueWithPointer:cfg], @"cfg",
[NSString stringWithUTF8String:message], @"message",
nil] autorelease];
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneRegistrationUpdate" object:self userInfo:dict];
}
static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyConfig* cfg, LinphoneRegistrationState state,const char* message) {
[(LinphoneManager*)linphone_core_get_user_data(lc) onRegister:lc cfg:cfg state:state message:message];
}
#pragma mark - Text Received Functions
- (void)onTextReceived:(LinphoneCore *)lc room:(LinphoneChatRoom *)room from:(const LinphoneAddress *)from message:(const char *)message {
char *fromStr = linphone_address_as_string_uri_only(from);
if(fromStr == NULL)
return;
}
static void linphone_iphone_text_received(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message) {
[(LinphoneManager*)linphone_core_get_user_data(lc) onTextReceived:lc room:room from:from message:message];
}
#pragma mark - Network Functions
+ (void)kickOffNetworkConnection {
/*start a new thread to avoid blocking the main ui in case of peer host failure*/
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
CFWriteStreamRef writeStream;
CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"192.168.0.200"/*"linphone.org"*/, 15000, nil, &writeStream);
CFWriteStreamOpen (writeStream);
const char* buff="hello";
CFWriteStreamWrite (writeStream,(const UInt8*)buff,strlen(buff));
CFWriteStreamClose (writeStream);
CFRelease(writeStream);
});
}
static void showNetworkFlags(SCNetworkReachabilityFlags flags){
[LinphoneLogger logc:LinphoneLoggerLog format:"Network connection flags:"];
if (flags==0) [LinphoneLogger logc:LinphoneLoggerLog format:"no flags."];
if (flags & kSCNetworkReachabilityFlagsTransientConnection)
[LinphoneLogger logc:LinphoneLoggerLog format:"kSCNetworkReachabilityFlagsTransientConnection"];
if (flags & kSCNetworkReachabilityFlagsReachable)
[LinphoneLogger logc:LinphoneLoggerLog format:"kSCNetworkReachabilityFlagsReachable"];
if (flags & kSCNetworkReachabilityFlagsConnectionRequired)
[LinphoneLogger logc:LinphoneLoggerLog format:"kSCNetworkReachabilityFlagsConnectionRequired"];
if (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic)
[LinphoneLogger logc:LinphoneLoggerLog format:"kSCNetworkReachabilityFlagsConnectionOnTraffic"];
if (flags & kSCNetworkReachabilityFlagsConnectionOnDemand)
[LinphoneLogger logc:LinphoneLoggerLog format:"kSCNetworkReachabilityFlagsConnectionOnDemand"];
if (flags & kSCNetworkReachabilityFlagsIsLocalAddress)
[LinphoneLogger logc:LinphoneLoggerLog format:"kSCNetworkReachabilityFlagsIsLocalAddress"];
if (flags & kSCNetworkReachabilityFlagsIsDirect)
[LinphoneLogger logc:LinphoneLoggerLog format:"kSCNetworkReachabilityFlagsIsDirect"];
if (flags & kSCNetworkReachabilityFlagsIsWWAN)
[LinphoneLogger logc:LinphoneLoggerLog format:"kSCNetworkReachabilityFlagsIsWWAN"];
}
void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* nilCtx){
showNetworkFlags(flags);
LinphoneManager* lLinphoneMgr = [LinphoneManager instance];
SCNetworkReachabilityFlags networkDownFlags=kSCNetworkReachabilityFlagsConnectionRequired |kSCNetworkReachabilityFlagsConnectionOnTraffic | kSCNetworkReachabilityFlagsConnectionOnDemand;
if ([LinphoneManager getLc] != nil) {
LinphoneProxyConfig* proxy;
linphone_core_get_default_proxy([LinphoneManager getLc], &proxy);
struct NetworkReachabilityContext* ctx = nilCtx ? ((struct NetworkReachabilityContext*)nilCtx) : 0;
if ((flags == 0) || (flags & networkDownFlags)) {
linphone_core_set_network_reachable([LinphoneManager getLc],false);
lLinphoneMgr.connectivity = none;
[LinphoneManager kickOffNetworkConnection];
} else {
Connectivity newConnectivity;
BOOL isWifiOnly = lp_config_get_int(linphone_core_get_config([LinphoneManager getLc]),"app","wifi_only_preference",FALSE);
if (!ctx || ctx->testWWan)
newConnectivity = flags & kSCNetworkReachabilityFlagsIsWWAN ? wwan:wifi;
else
newConnectivity = wifi;
if (newConnectivity == wwan
&& proxy
&& isWifiOnly
&& (lLinphoneMgr.connectivity == newConnectivity || lLinphoneMgr.connectivity == none)) {
linphone_proxy_config_expires(proxy, 0);
} else if (proxy){
linphone_proxy_config_expires(proxy, lLinphoneMgr.defaultExpires); //might be better to save the previous value
}
if (lLinphoneMgr.connectivity == none) {
linphone_core_set_network_reachable([LinphoneManager getLc],true);
} else if (lLinphoneMgr.connectivity != newConnectivity) {
// connectivity has changed
linphone_core_set_network_reachable([LinphoneManager getLc],false);
if (newConnectivity == wwan && proxy && isWifiOnly) {
linphone_proxy_config_expires(proxy, 0);
}
linphone_core_set_network_reachable([LinphoneManager getLc],true);
[LinphoneLogger logc:LinphoneLoggerLog format:"Network connectivity changed to type [%s]",(newConnectivity==wifi?"wifi":"wwan")];
}
lLinphoneMgr.connectivity=newConnectivity;
}
if (ctx && ctx->networkStateChanged) {
(*ctx->networkStateChanged)(lLinphoneMgr.connectivity);
}
}
}
- (void)setupNetworkReachabilityCallback {
SCNetworkReachabilityContext *ctx=NULL;
const char *nodeName="linphone.org";
if (proxyReachability) {
[LinphoneLogger logc:LinphoneLoggerLog format:"Cancelling old network reachability"];
SCNetworkReachabilityUnscheduleFromRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
CFRelease(proxyReachability);
proxyReachability = nil;
}
proxyReachability = SCNetworkReachabilityCreateWithName(nil, nodeName);
//initial state is network off should be done as soon as possible
SCNetworkReachabilityFlags flags;
if (!SCNetworkReachabilityGetFlags(proxyReachability, &flags)) {
[LinphoneLogger logc:LinphoneLoggerError format:"Cannot get reachability flags: %s", SCErrorString(SCError())];
return;
}
networkReachabilityCallBack(proxyReachability, flags, ctx ? ctx->info : 0);
if (!SCNetworkReachabilitySetCallback(proxyReachability, (SCNetworkReachabilityCallBack)networkReachabilityCallBack, ctx)){
[LinphoneLogger logc:LinphoneLoggerError format:"Cannot register reachability cb: %s", SCErrorString(SCError())];
return;
}
if(!SCNetworkReachabilityScheduleWithRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)){
[LinphoneLogger logc:LinphoneLoggerError format:"Cannot register schedule reachability cb: %s", SCErrorString(SCError())];
return;
}
}
#pragma mark -
static LinphoneCoreVTable linphonec_vtable = {
.show =NULL,
.call_state_changed =(LinphoneCallStateCb)linphone_iphone_call_state,
.registration_state_changed = linphone_iphone_registration_state,
.notify_recv = NULL,
.new_subscription_request = NULL,
.auth_info_requested = NULL,
.display_status = linphone_iphone_display_status,
.display_message=linphone_iphone_log,
.display_warning=linphone_iphone_log,
.display_url=NULL,
.text_received=linphone_iphone_text_received,
.dtmf_received=NULL,
.transfer_state_changed=linphone_iphone_transfer_state_changed
};
//scheduling loop
- (void)iterate {
linphone_core_iterate(theLinphoneCore);
}
- (void)startLibLinphone {
//get default config from bundle
NSBundle* myBundle = [NSBundle mainBundle];
NSString* factoryConfig = [myBundle pathForResource:[LinphoneManager runningOnIpad]?@"linphonerc-ipad":@"linphonerc" ofType:nil] ;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *confiFileName = [[paths objectAtIndex:0] stringByAppendingString:@"/.linphonerc"];
NSString *zrtpSecretsFileName = [[paths objectAtIndex:0] stringByAppendingString:@"/zrtp_secrets"];
const char* lRootCa = [[myBundle pathForResource:@"rootca"ofType:@"pem"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
connectivity=none;
signal(SIGPIPE, SIG_IGN);
//log management
libmsilbc_init();
#if defined (HAVE_SILK)
libmssilk_init();
#endif
#ifdef HAVE_AMR
libmsamr_init(); //load amr plugin if present from the liblinphone sdk
#endif
#ifdef HAVE_X264
libmsx264_init(); //load x264 plugin if present from the liblinphone sdk
#endif
#if HAVE_G729
libmsbcg729_init(); // load g729 plugin
#endif
/* Initialize linphone core*/
[LinphoneLogger logc:LinphoneLoggerLog format:"Create linphonecore"];
theLinphoneCore = linphone_core_new (&linphonec_vtable
, [confiFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]
, [factoryConfig cStringUsingEncoding:[NSString defaultCStringEncoding]]
,self);
linphone_core_set_root_ca(theLinphoneCore, lRootCa);
// Set audio assets
const char* lRing = [[myBundle pathForResource:@"ring"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
linphone_core_set_ring(theLinphoneCore, lRing );
const char* lRingBack = [[myBundle pathForResource:@"ringback"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
linphone_core_set_ringback(theLinphoneCore, lRingBack);
const char* lPlay = [[myBundle pathForResource:@"hold"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
linphone_core_set_play_file(theLinphoneCore, lPlay);
linphone_core_set_zrtp_secrets_file(theLinphoneCore, [zrtpSecretsFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]);
[self setupNetworkReachabilityCallback];
// start scheduler
mIterateTimer = [NSTimer scheduledTimerWithTimeInterval:0.1
target:self
selector:@selector(iterate)
userInfo:nil
repeats:YES];
//init audio session
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
BOOL bAudioInputAvailable= [audioSession inputIsAvailable];
[audioSession setDelegate:self];
NSError* err;
[audioSession setActive:NO error: &err];
if(!bAudioInputAvailable){
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"No microphone",nil)
message:NSLocalizedString(@"You need to plug a microphone to your device to use this application.",nil)
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Ok",nil)
otherButtonTitles:nil ,nil];
[error show];
[error release];
}
NSString* path = [myBundle pathForResource:@"nowebcamCIF" ofType:@"jpg"];
if (path) {
const char* imagePath = [path cStringUsingEncoding:[NSString defaultCStringEncoding]];
[LinphoneLogger logc:LinphoneLoggerLog format:"Using '%s' as source image for no webcam", imagePath];
linphone_core_set_static_picture(theLinphoneCore, imagePath);
}
/*DETECT cameras*/
frontCamId= backCamId=nil;
char** camlist = (char**)linphone_core_get_video_devices(theLinphoneCore);
for (char* cam = *camlist;*camlist!=NULL;cam=*++camlist) {
if (strcmp(FRONT_CAM_NAME, cam)==0) {
frontCamId = cam;
//great set default cam to front
linphone_core_set_video_device(theLinphoneCore, cam);
}
if (strcmp(BACK_CAM_NAME, cam)==0) {
backCamId = cam;
}
}
NSUInteger cpucount = [[NSProcessInfo processInfo] processorCount];
ms_set_cpu_count(cpucount);
if (![LinphoneManager isNotIphone3G]){
PayloadType *pt=linphone_core_find_payload_type(theLinphoneCore,"SILK",24000);
if (pt) {
linphone_core_enable_payload_type(theLinphoneCore,pt,FALSE);
[LinphoneLogger logc:LinphoneLoggerWarning format:"SILK/24000 and video disabled on old iPhone 3G"];
}
linphone_core_enable_video(theLinphoneCore, FALSE, FALSE);
}
if ([LinphoneManager runningOnIpad])
ms_set_cpu_count(2);
else
ms_set_cpu_count(1);
[LinphoneLogger logc:LinphoneLoggerWarning format:"Linphone [%s] started on [%s]"
,linphone_core_get_version()
,[[UIDevice currentDevice].model cStringUsingEncoding:[NSString defaultCStringEncoding]]];
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground) {
//go directly to bg mode
[self resignActive];
}
}
- (void)destroyLibLinphone {
[mIterateTimer invalidate];
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setDelegate:nil];
#if 0
if (settingsStore != nil) {
[settingsStore release];
settingsStore = nil;
}
#endif
if (theLinphoneCore != nil) { //just in case application terminate before linphone core initialization
[LinphoneLogger logc:LinphoneLoggerLog format:"Destroy linphonecore"];
linphone_core_destroy(theLinphoneCore);
theLinphoneCore = nil;
SCNetworkReachabilityUnscheduleFromRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
if (proxyReachability)
CFRelease(proxyReachability);
proxyReachability=nil;
}
}
- (BOOL)resignActive {
linphone_core_stop_dtmf_stream(theLinphoneCore);
return YES;
}
- (BOOL)enterBackgroundMode {
LinphoneProxyConfig* proxyCfg;
linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg);
if (proxyCfg && [[NSUserDefaults standardUserDefaults] boolForKey:@"backgroundmode_preference"]) {
//For registration register
linphone_core_refresh_registers(theLinphoneCore);
//wait for registration answer
int i=0;
while (!linphone_proxy_config_is_registered(proxyCfg) && i++<40 ) {
linphone_core_iterate(theLinphoneCore);
usleep(100000);
}
//register keepalive
if ([[UIApplication sharedApplication] setKeepAliveTimeout:600/*(NSTimeInterval)linphone_proxy_config_get_expires(proxyCfg)*/
handler:^{
[LinphoneLogger logc:LinphoneLoggerWarning format:"keepalive handler"];
if (theLinphoneCore == nil) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"It seems that Linphone BG mode was deactivated, just skipping"];
return;
}
//kick up network cnx, just in case
[LinphoneManager kickOffNetworkConnection];
[self refreshRegisters];
linphone_core_iterate(theLinphoneCore);
}
]) {
[LinphoneLogger logc:LinphoneLoggerLog format:"keepalive handler succesfully registered"];
} else {
[LinphoneLogger logc:LinphoneLoggerLog format:"keepalive handler cannot be registered"];
}
LCSipTransports transportValue;
if (linphone_core_get_sip_transports(theLinphoneCore, &transportValue)) {
[LinphoneLogger logc:LinphoneLoggerError format:"cannot get current transport"];
}
return YES;
}
else {
[LinphoneLogger logc:LinphoneLoggerLog format:"Entering lite bg mode"];
[self destroyLibLinphone];
return NO;
}
}
- (void)becomeActive {
[self refreshRegisters];
/*IOS specific*/
linphone_core_start_dtmf_stream(theLinphoneCore);
}
- (void)beginInterruption {
LinphoneCall* c = linphone_core_get_current_call(theLinphoneCore);
[LinphoneLogger logc:LinphoneLoggerLog format:"Sound interruption detected!"];
if (c) {
linphone_core_pause_call(theLinphoneCore, c);
}
}
- (void)endInterruption {
[LinphoneLogger logc:LinphoneLoggerLog format:"Sound interruption ended!"];
}
- (void)refreshRegisters{
/*first check if network is available*/
if (proxyReachability){
SCNetworkReachabilityFlags flags=0;
if (!SCNetworkReachabilityGetFlags(proxyReachability, &flags)) {
[LinphoneLogger logc:LinphoneLoggerError format:"Cannot get reachability flags, re-creating reachability context."];
[self setupNetworkReachabilityCallback];
}else{
networkReachabilityCallBack(proxyReachability, flags, 0);
if (flags==0){
/*workaround iOS bug: reachability API cease to work after some time.*/
/*when flags==0, either we have no network, or the reachability object lies. To workaround, create a new one*/
[self setupNetworkReachabilityCallback];
}
}
}else [LinphoneLogger logc:LinphoneLoggerError format:"No proxy reachability context created !"];
linphone_core_refresh_registers(theLinphoneCore);//just to make sure REGISTRATION is up to date
}
#pragma mark - Speaker Functions
- (void)enableSpeaker:(BOOL)enable {
//redirect audio to speaker
if(enable) {
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute
, sizeof (audioRouteOverride)
, &audioRouteOverride);
} else {
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_None;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute
, sizeof (audioRouteOverride)
, &audioRouteOverride);
}
}
- (BOOL)isSpeakerEnabled {
bool enabled = false;
CFStringRef lNewRoute = CFSTR("Unknown");
UInt32 lNewRouteSize = sizeof(lNewRoute);
OSStatus lStatus = AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &lNewRouteSize, &lNewRoute);
if (!lStatus && lNewRouteSize > 0) {
NSString *route = (NSString *) lNewRoute;
[LinphoneLogger logc:LinphoneLoggerLog format:"Current audio route is [%s]", [route cStringUsingEncoding:[NSString defaultCStringEncoding]]];
enabled = [route isEqualToString: @"Speaker"] || [route isEqualToString: @"SpeakerAndMicrophone"];
CFRelease(lNewRoute);
}
return enabled;
}
#pragma mark - Call Functions
- (void)call:(NSString *)address displayName:(NSString*)displayName transfer:(BOOL)transfer {
if (!linphone_core_is_network_reachabled(theLinphoneCore)) {
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Network Error",nil)
message:NSLocalizedString(@"There is no network connection available, enable WIFI or WWAN prior to place a call",nil)
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil];
[error show];
[error release];
return;
}
CTCallCenter* ct = [[CTCallCenter alloc] init];
if ([ct.currentCalls count] > 0) {
[LinphoneLogger logc:LinphoneLoggerError format:"GSM call in progress, cancelling outgoing SIP call request"];
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot make call",nil)
message:NSLocalizedString(@"Please terminate GSM call",nil)
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil];
[error show];
[error release];
[ct release];
return;
}
[ct release];
LinphoneProxyConfig* proxyCfg;
//get default proxy
linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg);
LinphoneCallParams* lcallParams = linphone_core_create_default_call_parameters([LinphoneManager getLc]);
if ([address length] == 0) return; //just return
if ([address hasPrefix:@"sip:"]) {
LinphoneAddress* linphoneAddress = linphone_address_new([address cStringUsingEncoding:[NSString defaultCStringEncoding]]);
if(displayName!=nil) {
linphone_address_set_display_name(linphoneAddress,[displayName cStringUsingEncoding:[NSString defaultCStringEncoding]]);
}
if(transfer) {
linphone_core_transfer_call([LinphoneManager getLc], linphone_core_get_current_call([LinphoneManager getLc]), [address cStringUsingEncoding:[NSString defaultCStringEncoding]]);
} else {
linphone_core_invite_address_with_params([LinphoneManager getLc], linphoneAddress, lcallParams);
}
linphone_address_destroy(linphoneAddress);
} else if (proxyCfg==nil){
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid sip address",nil)
message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a call or use a valid sip address (I.E sip:john@example.net)",nil)
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil];
[error show];
[error release];
} else {
char normalizedUserName[256];
LinphoneAddress* linphoneAddress = linphone_address_new(linphone_core_get_identity([LinphoneManager getLc]));
linphone_proxy_config_normalize_number(proxyCfg,[address cStringUsingEncoding:[NSString defaultCStringEncoding]],normalizedUserName,sizeof(normalizedUserName));
linphone_address_set_username(linphoneAddress, normalizedUserName);
if(displayName!=nil) {
linphone_address_set_display_name(linphoneAddress, [displayName cStringUsingEncoding:[NSString defaultCStringEncoding]]);
}
if(transfer) {
linphone_core_transfer_call([LinphoneManager getLc], linphone_core_get_current_call([LinphoneManager getLc]), normalizedUserName);
} else {
linphone_core_invite_address_with_params([LinphoneManager getLc], linphoneAddress, lcallParams);
}
linphone_address_destroy(linphoneAddress);
}
linphone_call_params_destroy(lcallParams);
}
#pragma mark - Property Functions
- (void)setPushNotificationToken:(NSData *)apushNotificationToken {
if(apushNotificationToken == pushNotificationToken) {
return;
}
if(pushNotificationToken != nil) {
[pushNotificationToken release];
pushNotificationToken = nil;
}
if(apushNotificationToken != nil) {
pushNotificationToken = [apushNotificationToken retain];
}
}
- (void)addInhibitedEvent:(NSString*)event {
[inhibitedEvent addObject:event];
}
- (BOOL)removeInhibitedEvent:(NSString*)event {
NSUInteger index = [inhibitedEvent indexOfObject:kLinphoneTextReceivedSound];
if(index != NSNotFound) {
[inhibitedEvent removeObjectAtIndex:index];
return TRUE;
}
return FALSE;
}
@end

View file

@ -1,101 +0,0 @@
/* FastAddressBook.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 "FastAddressBook.h"
@implementation FastAddressBook
@synthesize addressBook;
-(Contact*) getMatchingRecord:(NSString*) number {
@synchronized (mAddressBookMap){
return (Contact*) [mAddressBookMap objectForKey:number];
}
}
+(NSString*) appendCountryCodeIfPossible:(NSString*) number {
if (![number hasPrefix:@"+"] && ![number hasPrefix:@"00"]) {
NSString* lCountryCode = [[NSUserDefaults standardUserDefaults] stringForKey:@"countrycode_preference"];
if (lCountryCode && [lCountryCode length]>0) {
//append country code
return [lCountryCode stringByAppendingString:number];
}
}
return number;
}
+(NSString*) normalizePhoneNumber:(NSString*) number {
NSString* lNormalizedNumber = [(NSString*)number stringByReplacingOccurrencesOfString:@" " withString:@""];
lNormalizedNumber = [lNormalizedNumber stringByReplacingOccurrencesOfString:@"(" withString:@""];
lNormalizedNumber = [lNormalizedNumber stringByReplacingOccurrencesOfString:@")" withString:@""];
lNormalizedNumber = [lNormalizedNumber stringByReplacingOccurrencesOfString:@"-" withString:@""];
lNormalizedNumber = [FastAddressBook appendCountryCodeIfPossible:lNormalizedNumber];
return lNormalizedNumber;
}
void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) {
NSMutableDictionary* lAddressBookMap = (NSMutableDictionary*)context;
@synchronized (lAddressBookMap) {
[lAddressBookMap removeAllObjects];
NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);
for (id lPerson in lContacts) {
ABMutableMultiValueRef lPhoneNumbers = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonPhoneProperty);
for ( int i=0; i<ABMultiValueGetCount(lPhoneNumbers); i++) {
CFStringRef lValue = ABMultiValueCopyValueAtIndex(lPhoneNumbers,i);
CFStringRef lLabel = ABMultiValueCopyLabelAtIndex(lPhoneNumbers,i);
CFStringRef lLocalizedLabel = ABAddressBookCopyLocalizedLabel(lLabel);
NSString* lNormalizedKey = [FastAddressBook normalizePhoneNumber:(NSString*)lValue];
Contact* lContact = [[Contact alloc] initWithRecord:lPerson ofType:(NSString *)lLocalizedLabel];
[lAddressBookMap setObject:lContact forKey:lNormalizedKey];
CFRelease(lValue);
[lContact release];
if (lLabel) CFRelease(lLabel);
if (lLocalizedLabel) CFRelease(lLocalizedLabel);
}
CFRelease(lPhoneNumbers);
}
CFRelease(lContacts);
}
}
-(FastAddressBook*) init {
if ((self = [super init])) {
mAddressBookMap = [[NSMutableDictionary alloc] init];
addressBook = ABAddressBookCreate();
ABAddressBookRegisterExternalChangeCallback (addressBook,sync_address_book,mAddressBookMap);
sync_address_book(addressBook,nil,mAddressBookMap);
}
return self;
}
@end
@implementation Contact
@synthesize record;
@synthesize numberType;
-(id) initWithRecord:(ABRecordRef) aRecord ofType:(NSString*) type {
if ((self = [super init])) {
record=CFRetain(aRecord);
numberType= [type?type:@"unknown" retain];
}
return self;
}
- (void)dealloc {
CFRelease(record);
[numberType release];
[super dealloc];
}
@end

File diff suppressed because it is too large Load diff

View file

@ -1,43 +0,0 @@
/* LinphoneUIControler.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>
#include "linphonecore.h"
@protocol LinphoneUICallDelegate
// UI changes
-(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName;
-(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName;
-(void) displayIncomingCall: (LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName;
-(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName;
-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName;
//status reporting
-(void) displayStatus:(NSString*) message;
-(void) displayAskToEnableVideoCall:(LinphoneCall*) call forUser:(NSString*) username withDisplayName:(NSString*) displayName;
-(void) firstVideoFrameDecoded:(LinphoneCall*) call;
@end
@protocol LinphoneUIRegistrationDelegate
// UI changes for registration
-(void) displayRegisteredFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain ;
-(void) displayRegisteringFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain ;
-(void) displayRegistrationFailedFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain forReason:(NSString*) reason;
-(void) displayNotRegisteredFromUI:(UIViewController*) viewCtrl;
@end

View file

@ -0,0 +1,24 @@
/* UIAddressTextField.h
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <UIKit/UIKit.h>
@interface UIAddressTextField : UITextField
@end

View file

@ -0,0 +1,29 @@
/* UIAddressTextField.h
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UIAddressTextField.h"
@implementation UIAddressTextField
- (void)setText:(NSString *)text {
[super setText:text];
[self sendActionsForControlEvents:UIControlEventEditingChanged];
}
@end

View file

@ -19,13 +19,15 @@
#import "UIBluetoothButton.h"
#import <AudioToolbox/AudioToolbox.h>
#import "Utils.h"
#include "linphonecore.h"
@implementation UIBluetoothButton
#define check_auresult(au,method) \
if (au!=0) ms_error("UIBluetoothButton error for %s: ret=%ld",method,au)
if (au!=0) [LinphoneLogger logc:LinphoneLoggerError format:"UIBluetoothButton error for %s: ret=%ld",method,au]
-(void) onOn {
- (void)onOn {
//redirect audio to bluetooth
UInt32 size = sizeof(CFStringRef);
@ -42,7 +44,8 @@ if (au!=0) ms_error("UIBluetoothButton error for %s: ret=%ld",method,au)
check_auresult(result,"set kAudioSessionProperty_OverrideCategoryEnableBluetoothInput 1");
}
-(void) onOff {
- (void)onOff {
//redirect audio to bluetooth
int allowBluetoothInput = 0;
OSStatus result = AudioSessionSetProperty (
@ -58,22 +61,13 @@ if (au!=0) ms_error("UIBluetoothButton error for %s: ret=%ld",method,au)
}
-(bool) isInitialStateOn {
- (bool)onUpdate {
return false;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code.
}
*/
- (void)dealloc {
[super dealloc];
}
@end

View file

@ -22,11 +22,9 @@
@interface UICallButton : UIButton {
@private
UITextField* mAddress;
UITextField* addressField;
}
-(void) initWithAddress:(UITextField*) address;
+(void) enableTransforMode:(BOOL) enable;
+(BOOL) transforModeEnabled;
@property (nonatomic, retain) IBOutlet UITextField* addressField;
@end

View file

@ -19,116 +19,61 @@
#import "UICallButton.h"
#import "LinphoneManager.h"
#import "CoreTelephony/CTCallCenter.h"
#import <CoreTelephony/CTCallCenter.h>
@implementation UICallButton
static BOOL transferMode = NO;
@synthesize addressField;
+(void) enableTransforMode:(BOOL) enable {
transferMode = enable;
#pragma mark - Lifecycle Functions
- (void)initUICallButton {
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
}
+(BOOL) transforModeEnabled {
return transferMode;
}
-(void) touchUp:(id) sender {
if (!linphone_core_is_network_reachabled([LinphoneManager getLc])) {
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Network Error",nil)
message:NSLocalizedString(@"There is no network connection available, enable WIFI or WWAN prior to place a call",nil)
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil];
[error show];
[error release];
return;
}
CTCallCenter* ct = [[CTCallCenter alloc] init];
if ([ct.currentCalls count] > 0) {
ms_error("GSM call in progress, cancelling outgoing SIP call request");
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot make call",nil)
message:NSLocalizedString(@"Please terminate GSM call",nil)
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil];
[error show];
[error release];
[ct release];
return;
- (id)init {
self = [super init];
if (self) {
[self initUICallButton];
}
[ct release];
if (TRUE /*!linphone_core_in_call([LinphoneManager getLc])*/) {
LinphoneProxyConfig* proxyCfg;
//get default proxy
linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg);
LinphoneCallParams* lcallParams = linphone_core_create_default_call_parameters([LinphoneManager getLc]);
if ([mAddress.text length] == 0) return; //just return
if ([mAddress.text hasPrefix:@"sip:"]) {
if (transferMode) {
linphone_core_transfer_call([LinphoneManager getLc], linphone_core_get_current_call([LinphoneManager getLc]), [mAddress.text cStringUsingEncoding:[NSString defaultCStringEncoding]]);
} else {
linphone_core_invite_with_params([LinphoneManager getLc],[mAddress.text cStringUsingEncoding:[NSString defaultCStringEncoding]],lcallParams);
}
[UICallButton enableTransforMode:NO];
} else if ( proxyCfg==nil){
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid sip address",nil)
message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a call or use a valid sip address (I.E sip:john@example.net)",nil)
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil];
[error show];
[error release];
} else {
char normalizedUserName[256];
NSString* toUserName = [NSString stringWithString:[mAddress text]];
NSString* lDisplayName = [[LinphoneManager instance] getDisplayNameFromAddressBook:toUserName andUpdateCallLog:nil];
linphone_proxy_config_normalize_number(proxyCfg,[toUserName cStringUsingEncoding:[NSString defaultCStringEncoding]],normalizedUserName,sizeof(normalizedUserName));
LinphoneAddress* tmpAddress = linphone_address_new(linphone_core_get_identity([LinphoneManager getLc]));
linphone_address_set_username(tmpAddress,normalizedUserName);
linphone_address_set_display_name(tmpAddress,(lDisplayName)?[lDisplayName cStringUsingEncoding:[NSString defaultCStringEncoding]]:nil);
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUICallButton];
}
return self;
}
if (transferMode) {
linphone_core_transfer_call([LinphoneManager getLc], linphone_core_get_current_call([LinphoneManager getLc]), normalizedUserName);
} else {
linphone_core_invite_address_with_params([LinphoneManager getLc],tmpAddress,lcallParams) ;
}
linphone_address_destroy(tmpAddress);
}
linphone_call_params_destroy(lcallParams);
[UICallButton enableTransforMode:NO];
} else if (linphone_core_inc_invite_pending([LinphoneManager getLc])) {
linphone_core_accept_call([LinphoneManager getLc],linphone_core_get_current_call([LinphoneManager getLc]));
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self initUICallButton];
}
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code.
}
*/
-(void) initWithAddress:(UITextField*) address{
mAddress=[address retain];
transferMode = NO;
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
}
return self;
}
- (void)dealloc {
[addressField release];
[super dealloc];
[mAddress release];
}
#pragma mark -
- (void)touchUp:(id) sender {
NSString *address = [addressField text];
NSString *displayName = nil;
ABRecordRef contact = [[[LinphoneManager instance] fastAddressBook] getContact:address];
if(contact) {
displayName = [FastAddressBook getContactDisplayName:contact];
}
[[LinphoneManager instance] call:address displayName:displayName transfer:FALSE];
}
@end

View file

@ -20,24 +20,13 @@
#import "UICamSwitch.h"
#include "LinphoneManager.h"
@implementation UICamSwitch
@synthesize preview;
-(void) touchUp:(id) sender {
if (nextCamId!=currentCamId) {
ms_message("Switching from [%s] to [%s]",currentCamId,nextCamId);
linphone_core_set_video_device([LinphoneManager getLc], nextCamId);
nextCamId=currentCamId;
currentCamId = linphone_core_get_video_device([LinphoneManager getLc]);
linphone_core_update_call([LinphoneManager getLc]
, linphone_core_get_current_call([LinphoneManager getLc])
,NULL);
linphone_core_set_native_preview_window_id([LinphoneManager getLc],
(unsigned long)preview);
}
}
- (id) init {
#pragma mark - Lifecycle Functions
- (id)initUICamSwitch {
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
currentCamId = (char*)linphone_core_get_video_device([LinphoneManager getLc]);
if ([LinphoneManager instance].frontCamId !=nil ) {
@ -52,18 +41,28 @@
}
return self;
}
- (id)init {
self = [super init];
if (self) {
[self initUICamSwitch];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self init];
[self initUICamSwitch];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self init];
[self initUICamSwitch];
}
return self;
}
@ -75,7 +74,24 @@
}
#pragma mark -
-(void) touchUp:(id) sender {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot tigger camswitch button: Linphone core not ready"];
return;
}
if (nextCamId != currentCamId) {
[LinphoneLogger logc:LinphoneLoggerLog format:"Switching from [%s] to [%s]",currentCamId,nextCamId];
linphone_core_set_video_device([LinphoneManager getLc], nextCamId);
nextCamId=currentCamId;
currentCamId = linphone_core_get_video_device([LinphoneManager getLc]);
linphone_core_update_call([LinphoneManager getLc]
, linphone_core_get_current_call([LinphoneManager getLc])
, NULL);
/*linphone_core_set_native_preview_window_id([LinphoneManager getLc],
(unsigned long)preview);*/
}
}
@end

View file

@ -16,24 +16,21 @@
* 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>
#include "linphonecore.h"
@interface UIDigitButton : UIButton {
#import "UILongTouchButton.h"
@interface UIDigitButton : UILongTouchButton<UILongTouchButtonDelegate> {
@private
char mDigit;
UITextField* mAddress;
bool_t sendDtmfDuringCall;
@public
LinphoneChatRoom* chatRoom;
char digit;
bool dtmf;
UITextField* addressField;
}
-(void) initWithNumber:(char)digit ;
-(void) initWithNumber:(char)digit addressField:(UITextField*) address dtmf:(bool_t)send;
@property bool_t sendDtmfDuringCall;
@property (nonatomic, retain) IBOutlet UITextField* addressField;
@property char digit;
@property bool dtmf;
@end

View file

@ -23,60 +23,85 @@
@implementation UIDigitButton
@synthesize sendDtmfDuringCall;
@synthesize dtmf;
@synthesize digit;
@synthesize addressField;
#pragma mark - Lifecycle Functions
-(void) touchDown:(id) sender {
LinphoneCall *call=linphone_core_get_current_call([LinphoneManager getLc]);
if (call && linphone_call_get_state(call)==LinphoneCallStreamsRunning) {
linphone_core_send_dtmf([LinphoneManager getLc],mDigit);
} else if (chatRoom) {
char msg[] = {mDigit, '\0'};
linphone_chat_room_send_message(chatRoom, msg);
}
}
-(void) touchUp:(id) sender {
linphone_core_stop_dtmf([LinphoneManager getLc]);
if (mDigit == '0') {
//cancel timer for +
[NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(doKeyZeroLongPress)
object:nil];
}
}
-(void)doKeyZeroLongPress {
NSString* newAddress = [[mAddress.text substringToIndex: [mAddress.text length]-1] stringByAppendingString:@"+"];
[mAddress setText:newAddress];
}
-(void) initWithNumber:(char)digit {
[self initWithNumber:digit addressField:nil dtmf:true];
}
-(void) initWithNumber:(char)digit addressField:(UITextField*) address dtmf:(bool_t)sendDtmf{
sendDtmfDuringCall = sendDtmf;
mDigit=digit ;
mAddress=address?[address retain]:nil;
- (void)initUIDigitButton {
self->dtmf = FALSE;
[self addTarget:self action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown];
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code.
}
*/
- (id)init {
self = [super init];
if (self) {
[self initUIDigitButton];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUIDigitButton];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self initUIDigitButton];
}
return self;
}
- (void)dealloc {
[super dealloc];
[mAddress release];
[addressField release];
}
#pragma mark - Actions Functions
- (void)touchDown:(id) sender {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot trigger digit button: Linphone core not ready"];
return;
}
if (addressField && (!dtmf || !linphone_core_in_call([LinphoneManager getLc]))) {
NSString* newAddress = [NSString stringWithFormat:@"%@%c",addressField.text, digit];
[addressField setText:newAddress];
linphone_core_play_dtmf([LinphoneManager getLc], digit, -1);
} else {
linphone_core_send_dtmf([LinphoneManager getLc], digit);
linphone_core_play_dtmf([LinphoneManager getLc], digit, 100);
}
}
- (void)touchUp:(id) sender {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot trigger digit button: Linphone core not ready"];
return;
}
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

@ -1,6 +1,6 @@
/* CallHistoryTableViewController.h
/* UIEditableTableViewCell.h
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,15 +15,14 @@
* 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 "GenericTabViewController.h"
@interface CallHistoryTableViewController : GenericTabViewController {
UIButton* clear;
@interface UIEditableTableViewCell : UITableViewCell {
UITextField *detailTextField;
}
-(void) doAction:(id) sender;
@property (nonatomic, retain) IBOutlet UIButton* clear;
@property (nonatomic, retain) IBOutlet UITextField *detailTextField;
@end

View file

@ -0,0 +1,96 @@
/* UIEditableTableViewCell.m
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UIEditableTableViewCell.h"
@implementation UIEditableTableViewCell
@synthesize detailTextField;
#pragma mark - Lifecycle Functions
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
UIView *parent = [self.detailTextLabel superview];
self.detailTextField = [[UITextField alloc] init];
[self.detailTextField setHidden:TRUE];
[self.detailTextField setClearButtonMode: UITextFieldViewModeWhileEditing];
[self.detailTextField setContentVerticalAlignment: UIControlContentVerticalAlignmentCenter];
UIFont *font = [UIFont fontWithName:@"Helvetica-Bold" size:[UIFont systemFontSize]];
[self.detailTextLabel setFont:font];
[self.detailTextField setFont:font];
[parent addSubview:detailTextField];
}
return self;
}
- (void)dealloc {
[self.detailTextField release];
[super dealloc];
}
#pragma mark - View Functions
- (void)layoutSubviews {
[super layoutSubviews];
CGRect fieldframe;
fieldframe.origin.x = 15;
fieldframe.origin.y = 0;
fieldframe.size.height = 44;
if([[self.textLabel text] length] != 0)
fieldframe.origin.x += [self.textLabel frame].size.width;
CGRect superframe = [[self.detailTextField superview]frame];
fieldframe.size.width = superframe.size.width - fieldframe.origin.x;
[self.detailTextField setFrame:fieldframe];
CGRect labelFrame = [self.detailTextLabel frame];
labelFrame.origin.x = fieldframe.origin.x;
[self.detailTextLabel setFrame:labelFrame];
}
#pragma mark - UITableViewCell Functions
- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
[super setEditing:editing animated:animated];
if(editing) {
[self.detailTextField setHidden:FALSE];
[self.detailTextLabel setHidden:TRUE];
} else {
[self.detailTextField setHidden:TRUE];
[self.detailTextLabel setHidden:FALSE];
}
}
- (void)setEditing:(BOOL)editing {
[self setEditing:editing animated:FALSE];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
}
@end

View file

@ -19,11 +19,13 @@
#import <UIKit/UIKit.h>
#import "UILongTouchButton.h"
@interface UIEraseButton : UIButton {
@interface UIEraseButton : UILongTouchButton<UILongTouchButtonDelegate> {
@private
UITextField* mAddress;
UITextField* addressField;
}
-(void) initWithAddressField:(UITextField*) address;
@property (nonatomic, retain) IBOutlet UITextField* addressField;
@end

View file

@ -21,20 +21,62 @@
@implementation UIEraseButton
-(void) touchUp:(id) sender {
if ([mAddress.text length] > 0) {
[mAddress setText:[mAddress.text substringToIndex:[mAddress.text length]-1]];
}
@synthesize addressField;
#pragma mark - Lifecycle Functions
- (void)initUIEraseButton {
[self addTarget:self action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown];
}
-(void) initWithAddressField:(UITextField*) address {
mAddress = address;
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
- (id)init {
self = [super init];
if (self) {
[self initUIEraseButton];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUIEraseButton];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self initUIEraseButton];
}
return self;
}
- (void)dealloc {
[super dealloc];
[addressField release];
}
#pragma mark - Action Functions
-(void) touchDown:(id) sender {
if ([addressField.text length] > 0) {
[addressField setText:[addressField.text substringToIndex:[addressField.text length]-1]];
}
}
#pragma mark - UILongTouchButtonDelegate Functions
- (void)onRepeatTouch {
}
- (void)onLongTouch {
[addressField setText:@""];
}
@end

View file

@ -16,11 +16,13 @@
* 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 <UIKit/UIKit.h>
@interface UIHangUpButton : UIButton {
}
- (void)update;
@end

View file

@ -20,57 +20,109 @@
#import "UIHangUpButton.h"
#import "LinphoneManager.h"
#import "private.h"
@implementation UIHangUpButton
-(void) touchUp:(id) sender {
LinphoneCore* lc = [LinphoneManager getLc];
if (!lc)
return;
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (call)
linphone_core_terminate_call(lc,call);
else if (linphone_core_is_in_conference(lc)) {
linphone_core_terminate_conference(lc);
} else {
const MSList* calls = linphone_core_get_calls(lc);
if (ms_list_size(calls) == 1
&& !linphone_call_params_local_conference_mode(linphone_call_get_current_params((LinphoneCall*)(calls->data)))) {
//Only one call in the list, hangin up!
linphone_core_terminate_call(lc,(LinphoneCall*)(calls->data));
} else {
ms_message("Cannot make a decision on which call to terminate");
}
}
#pragma mark - Static Functions
+ (bool)isInConference:(LinphoneCall*) call {
if (!call)
return false;
return linphone_call_get_current_params(call)->in_conference;
}
- (id)initWithFrame:(CGRect)frame {
+ (int)callCount:(LinphoneCore*) lc {
int count = 0;
const MSList* calls = linphone_core_get_calls(lc);
self = [super initWithFrame:frame];
while (calls != 0) {
if (![UIHangUpButton isInConference:((LinphoneCall*)calls->data)]) {
count++;
}
calls = calls->next;
}
return count;
}
#pragma mark - Lifecycle Functions
- (void)initUIHangUpButton {
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
}
- (id)init{
self = [super init];
if (self) {
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
[self initUIHangUpButton];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
}
[self initUIHangUpButton];
}
return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code.
}
*/
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUIHangUpButton];
}
return self;
}
- (void)dealloc {
[super dealloc];
}
#pragma mark -
- (void)update {
if([LinphoneManager isLcReady]) {
LinphoneCore * lc = [LinphoneManager getLc];
if(linphone_core_get_calls_nb(lc) == 1 || // One call
linphone_core_get_current_call(lc) != NULL || // In call
linphone_core_is_in_conference(lc) || // In conference
(linphone_core_get_conference_size(lc) > 0 && [UIHangUpButton callCount:lc] == 0) // Only one conf
) {
[self setEnabled:true];
return;
}
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update hangup button: Linphone core not ready"];
}
[self setEnabled:false];
}
#pragma mark - Action Functions
-(void) touchUp:(id) sender {
if([LinphoneManager isLcReady]) {
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneCall* currentcall = linphone_core_get_current_call(lc);
if (linphone_core_is_in_conference(lc) || // In conference
(linphone_core_get_conference_size(lc) > 0 && [UIHangUpButton callCount:lc] == 0) // Only one conf
) {
linphone_core_terminate_conference(lc);
} else if(currentcall != NULL) { // In a call
linphone_core_terminate_call(lc, currentcall);
} else {
const MSList* calls = linphone_core_get_calls(lc);
if (ms_list_size(calls) == 1) { // Only one call
linphone_core_terminate_call(lc,(LinphoneCall*)(calls->data));
}
}
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot trigger hangup button: Linphone core not ready"];
}
}
@end

View file

@ -1,6 +1,6 @@
/* UILinphone.h
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -10,21 +10,28 @@
* 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.
* 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 "UICallButton.h"
#import "UIHangUpButton.h"
#import "UIDigitButton.h"
#import "UIToggleButton.h"
#import "UIMuteButton.h"
#import "UISpeakerButton.h"
#import "UIDuration.h"
#import "UIEraseButton.h"
#import "LinphoneUIDelegates.h"
#import "UICamSwitch.h"
#import "UIPauseResumeButton.h"
#import <UIKit/UIColor.h>
#define LINPHONE_MAIN_COLOR [UIColor colorWithRed:207.0f/255.0f green:76.0f/255.0f blue:41.0f/255.0f alpha:1.0f]
#define LINPHONE_TABLE_CELL_BACKGROUND_COLOR [UIColor colorWithRed:207.0f/255.0f green:76.0f/255.0f blue:41.0f/255.0f alpha:1.0f]
@interface UIColor (LightAndDark)
- (UIColor *)adjustHue:(float)hm saturation:(float)sm brightness:(float)bm alpha:(float)am;
- (UIColor *)lumColor:(float)mult;
- (UIColor *)lighterColor;
- (UIColor *)darkerColor;
@end
void removeTableBackground(UIView* view);

View file

@ -0,0 +1,106 @@
/* UILinphone.m
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UILinphone.h"
#import "ColorSpaceUtilities.h"
#import "Utils.h"
#import <UIKit/UIView.h>
@implementation UIColor (LightAndDark)
- (UIColor *)lumColor:(float)mult {
float hsbH, hsbS, hsbB;
float rgbaR, rgbaG, rgbaB, rgbaA;
// Get RGB
CGColorRef cgColor = [self CGColor];
CGColorSpaceRef cgColorSpace = CGColorGetColorSpace(cgColor);
if(CGColorSpaceGetModel(cgColorSpace) != kCGColorSpaceModelRGB) {
[LinphoneLogger log:LinphoneLoggerWarning format:@"Can't convert not RGB color"];
return self;
} else {
const float *colors = CGColorGetComponents(cgColor);
rgbaR = colors[0];
rgbaG = colors[1];
rgbaB = colors[2];
rgbaA = CGColorGetAlpha(cgColor);
}
RGB2HSL(rgbaR, rgbaG, rgbaB, &hsbH, &hsbS, &hsbB);
hsbB = MIN(MAX(hsbB * mult, 0.0), 1.0);
HSL2RGB(hsbH, hsbS, hsbB, &rgbaR, &rgbaG, &rgbaB);
return [UIColor colorWithRed:rgbaR green:rgbaG blue:rgbaB alpha:rgbaA];
}
- (UIColor *)adjustHue:(float)hm saturation:(float)sm brightness:(float)bm alpha:(float)am {
float hsbH, hsbS, hsbB;
float rgbaR, rgbaG, rgbaB, rgbaA;
// Get RGB
CGColorRef cgColor = [self CGColor];
CGColorSpaceRef cgColorSpace = CGColorGetColorSpace(cgColor);
if(CGColorSpaceGetModel(cgColorSpace) != kCGColorSpaceModelRGB) {
[LinphoneLogger log:LinphoneLoggerWarning format:@"Can't convert not RGB color"];
return self;
} else {
const float *colors = CGColorGetComponents(cgColor);
rgbaR = colors[0];
rgbaG = colors[1];
rgbaB = colors[2];
rgbaA = CGColorGetAlpha(cgColor);
}
RGB2HSL(rgbaR, rgbaG, rgbaB, &hsbH, &hsbS, &hsbB);
hsbH = MIN(MAX(hsbH + hm, 0.0), 1.0);
hsbS = MIN(MAX(hsbS + sm, 0.0), 1.0);
hsbB = MIN(MAX(hsbB + bm, 0.0), 1.0);
rgbaA = MIN(MAX(rgbaA + am, 0.0), 1.0);
HSL2RGB(hsbH, hsbS, hsbB, &rgbaR, &rgbaG, &rgbaB);
return [UIColor colorWithRed:rgbaR green:rgbaG blue:rgbaB alpha:rgbaA];
}
- (UIColor *)lighterColor {
return [self lumColor:1.3];
}
- (UIColor *)darkerColor {
return [self lumColor:0.75];
}
@end
void removeTableBackground(UIView*view) {
if([view isKindOfClass:[UITableView class]]) {
[view setBackgroundColor:[UIColor clearColor]];
}
if([view isKindOfClass:[UIImageView class]] && [[view superview] isKindOfClass:[UITableView class]]) {
[(UIImageView*)view setImage:nil];
}
for(UIView *subview in [view subviews]) {
removeTableBackground(subview);
}
}

View file

@ -0,0 +1,31 @@
/* UILongTouchButton.h
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <UIKit/UIKit.h>
@protocol UILongTouchButtonDelegate
-(void) onRepeatTouch;
-(void) onLongTouch;
@end
@interface UILongTouchButton : UIButton <UILongTouchButtonDelegate> {
}
@end

View file

@ -0,0 +1,89 @@
/* UILongTouchButton.h
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UILongTouchButton.h"
@implementation UILongTouchButton
#pragma mark - Lifecycle Functions
- (id)initUILongTouchButton {
[self addTarget:self action:@selector(___touchDown:) forControlEvents:UIControlEventTouchDown];
[self addTarget:self action:@selector(___touchUp:) forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside];
return self;
}
- (id)init {
self = [super init];
if (self) {
[self initUILongTouchButton];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUILongTouchButton];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self initUILongTouchButton];
}
return self;
}
- (void)dealloc {
[self removeTarget:self action:@selector(___touchDown:) forControlEvents:UIControlEventTouchDown];
[self removeTarget:self action:@selector(___touchUp:) forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside];
[super dealloc];
}
- (void)___touchDown:(id) sender {
[self performSelector:@selector(doLongTouch) withObject:nil afterDelay:0.5];
}
- (void)___touchUp:(id) sender {
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(doLongTouch) object:nil];
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(doRepeatTouch) object:nil];
}
- (void)doLongTouch {
[self onLongTouch];
[self onRepeatTouch];
[self performSelector:@selector(doRepeatTouch) withObject:nil afterDelay:0.1];
}
- (void)doRepeatTouch {
[self onRepeatTouch];
[self performSelector:@selector(doRepeatTouch) withObject:nil afterDelay:0.1];
}
- (void)onRepeatTouch {
}
- (void)onLongTouch {
}
@end

View file

@ -1,4 +1,4 @@
/* UIMuteButton.h
/* UIMicroButton.h
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
*
@ -18,10 +18,10 @@
*/
#import <UIKit/UIKit.h>
#import "UIToggleButton.h"
@interface UIMuteButton : UIToggleButton<UIToggleButtonDelegate> {
@interface UIMicroButton : UIToggleButton<UIToggleButtonDelegate> {
}

View file

@ -1,4 +1,4 @@
/* UIMuteButton.m
/* UIMicroButton.m
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
*
@ -15,42 +15,41 @@
* 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 "UIMuteButton.h"
#include "LinphoneManager.h"
*/
#import "UIMicroButton.h"
@implementation UIMuteButton
#import "LinphoneManager.h"
@implementation UIMicroButton
-(void) onOn {
linphone_core_mute_mic([LinphoneManager getLc], true);
}
-(void) onOff {
- (void)onOn {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle mic button: Linphone core not ready"];
return;
}
linphone_core_mute_mic([LinphoneManager getLc], false);
}
-(bool) isInitialStateOn {
@try {
return true == linphone_core_is_mic_muted([LinphoneManager getLc]);
} @catch(NSException* e) {
//not ready yet
return false;
}
- (void)onOff {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle mic button: Linphone core not ready"];
return;
}
linphone_core_mute_mic([LinphoneManager getLc], true);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code.
- (bool)onUpdate {
if([LinphoneManager isLcReady]) {
return linphone_core_is_mic_muted([LinphoneManager getLc]) == false;
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update mic button: Linphone core not ready"];
return true;
}
}
*/
- (void)dealloc {
[super dealloc];
}
@end

View file

@ -1,6 +1,6 @@
/* GenericTabViewController.h
/* UIPauseButton.h
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -17,15 +17,22 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <UIKit/UIKit.h>
#include "linphonecore.h"
#import "PhoneViewController.h"
#import "linphoneAppDelegate.h"
#import "UIToggleButton.h"
@interface GenericTabViewController : UITableViewController {
LinphoneCore* myLinphoneCore;
IBOutlet UIView* header;
#import "linphonecore.h"
typedef enum _UIPauseButtonType {
UIPauseButtonType_CurrentCall,
UIPauseButtonType_Call,
UIPauseButtonType_Conference
} UIPauseButtonType;
@interface UIPauseButton : UIToggleButton<UIToggleButtonDelegate> {
@private
UIPauseButtonType type;
LinphoneCall* call;
}
@property (nonatomic, retain) IBOutlet UIView* header;
@end
- (void)setType:(UIPauseButtonType) type call:(LinphoneCall*)call;
@end

View file

@ -0,0 +1,224 @@
/* UIPauseButton.m
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UIPauseButton.h"
#import "LinphoneManager.h"
#include "linphonecore.h"
#include "private.h"
@implementation UIPauseButton
#pragma mark - Lifecycle Functions
- (void)initUIPauseButton {
self->type = UIPauseButtonType_CurrentCall;
}
- (id)init{
self = [super init];
if (self) {
[self initUIPauseButton];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self initUIPauseButton];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUIPauseButton];
}
return self;
}
#pragma mark - Static Functions
+ (bool)isInConference: (LinphoneCall*) call {
if (!call)
return false;
return linphone_call_get_current_params(call)->in_conference;
}
+ (int)notInConferenceCallCount: (LinphoneCore*) lc {
int count = 0;
const MSList* calls = linphone_core_get_calls(lc);
while (calls != 0) {
if (![UIPauseButton isInConference: (LinphoneCall*)calls->data]) {
count++;
}
calls = calls->next;
}
return count;
}
+ (LinphoneCall*)getCall {
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneCall* currentCall = linphone_core_get_current_call(lc);
if (currentCall == nil && linphone_core_get_calls_nb(lc) == 1) {
currentCall = (LinphoneCall*) linphone_core_get_calls(lc)->data;
}
return currentCall;
}
#pragma mark -
- (void)setType:(UIPauseButtonType) atype call:(LinphoneCall*)acall {
self->type = atype;
self->call = acall;
}
#pragma mark - UIToggleButtonDelegate Functions
- (void)onOn {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle pause button: Linphone core not ready"];
return;
}
switch (type) {
case UIPauseButtonType_Call:
{
if (call != nil) {
linphone_core_pause_call([LinphoneManager getLc], call);
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle pause buttton, because no current call"];
}
break;
}
case UIPauseButtonType_Conference:
{
linphone_core_leave_conference([LinphoneManager getLc]);
// Fake event
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self];
break;
}
case UIPauseButtonType_CurrentCall:
{
LinphoneCall* currentCall = [UIPauseButton getCall];
if (currentCall != nil) {
linphone_core_pause_call([LinphoneManager getLc], currentCall);
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle pause buttton, because no current call"];
}
break;
}
}
}
- (void)onOff {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle pause button: Linphone core not ready"];
return;
}
switch (type) {
case UIPauseButtonType_Call:
{
if (call != nil) {
linphone_core_resume_call([LinphoneManager getLc], call);
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle pause buttton, because no current call"];
}
break;
}
case UIPauseButtonType_Conference:
{
linphone_core_enter_conference([LinphoneManager getLc]);
// Fake event
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self];
break;
}
case UIPauseButtonType_CurrentCall:
{
LinphoneCall* currentCall = [UIPauseButton getCall];
if (currentCall != nil) {
linphone_core_resume_call([LinphoneManager getLc], currentCall);
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle pause buttton, because no current call"];
}
break;
}
}
}
- (bool)onUpdate {
bool ret = false;
// TODO: disable pause on not running call
if([LinphoneManager isLcReady]) {
LinphoneCore *lc = [LinphoneManager getLc];
switch (type) {
case UIPauseButtonType_Call:
{
if (call != nil) {
LinphoneCallState state = linphone_call_get_state(call);
if(state == LinphoneCallPaused || state == LinphoneCallPausing) {
ret = true;
}
[self setEnabled:TRUE];
} else {
[self setEnabled:FALSE];
}
break;
}
case UIPauseButtonType_Conference:
{
if(linphone_core_get_conference_size(lc) > 0) {
if (!linphone_core_is_in_conference(lc)) {
ret = true;
}
[self setEnabled:TRUE];
} else {
[self setEnabled:FALSE];
}
break;
}
case UIPauseButtonType_CurrentCall:
{
LinphoneCall* currentCall = [UIPauseButton getCall];
if (currentCall != nil) {
LinphoneCallState state = linphone_call_get_state(currentCall);
if(state == LinphoneCallPaused || state == LinphoneCallPausing) {
ret = true;
}
[self setEnabled:TRUE];
} else {
[self setEnabled:FALSE];
}
break;
}
}
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update pause button: Linphone core not ready"];
}
return ret;
}
@end

View file

@ -1,69 +0,0 @@
/* UIMuteButton.m
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UIPauseResumeButton.h"
#include "LinphoneManager.h"
@implementation UIPauseResumeButton
-(void) onOn {
LinphoneCall* c = linphone_core_get_current_call([LinphoneManager getLc]);
if (c) {
linphone_core_pause_call([LinphoneManager getLc], c);
}
}
-(void) onOff {
const MSList* c = linphone_core_get_calls([LinphoneManager getLc]);
if (c) {
linphone_core_resume_call([LinphoneManager getLc], (LinphoneCall*) c->data);
}
}
-(bool) isInitialStateOn {
@try {
LinphoneCall* c = linphone_core_get_current_call([LinphoneManager getLc]);
if (c) {
return linphone_call_get_state(c) == LinphoneCallPaused;
} else {
/* if current call is paused -> c == null */
return true;
}
} @catch(NSException* e) {
//not ready yet
return false;
}
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code.
}
*/
- (void)dealloc {
[super dealloc];
}
@end

View file

@ -18,8 +18,8 @@
*/
#import <UIKit/UIKit.h>
#import "UIToggleButton.h"
#import "UIToggleButton.h"
@interface UISpeakerButton : UIToggleButton<UIToggleButtonDelegate> {

View file

@ -17,12 +17,20 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UISpeakerButton.h"
#import <AudioToolbox/AudioToolbox.h>
#import "UISpeakerButton.h"
#import "Utils.h"
#import "LinphoneManager.h"
#include "linphonecore.h"
@implementation UISpeakerButton
#pragma mark - Static Functions
static AudioSessionPropertyID routeChangeID = kAudioSessionProperty_AudioRouteChange;
static void audioRouteChangeListenerCallback (
void *inUserData, // 1
AudioSessionPropertyID inPropertyID, // 2
@ -30,63 +38,62 @@ static void audioRouteChangeListenerCallback (
const void *inPropertyValue // 4
) {
if (inPropertyID != kAudioSessionProperty_AudioRouteChange) return; // 5
[(UISpeakerButton*)inUserData reset];
[(UISpeakerButton*)inUserData update];
}
-(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage debugName:(const char *)name{
[super initWithOnImage:onImage offImage:offImage debugName:name];
AudioSessionPropertyID routeChangeID = kAudioSessionProperty_AudioRouteChange;
AudioSessionInitialize(NULL, NULL, NULL, NULL);
OSStatus lStatus = AudioSessionAddPropertyListener(routeChangeID, audioRouteChangeListenerCallback, self);
if (lStatus) {
ms_error ("cannot register route change handler [%ld]",lStatus);
}
- (void)initUISpeakerButton {
AudioSessionInitialize(NULL, NULL, NULL, NULL);
OSStatus lStatus = AudioSessionAddPropertyListener(routeChangeID, audioRouteChangeListenerCallback, self);
if (lStatus) {
[LinphoneLogger logc:LinphoneLoggerError format:"cannot register route change handler [%ld]",lStatus];
}
}
-(void) onOn {
//redirect audio to speaker
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute
, sizeof (audioRouteOverride)
, &audioRouteOverride);
}
-(void) onOff {
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_None;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute
, sizeof (audioRouteOverride)
, &audioRouteOverride);
}
-(bool) isInitialStateOn {
CFStringRef lNewRoute=CFSTR("Unknown");
UInt32 lNewRouteSize = sizeof(lNewRoute);
OSStatus lStatus = AudioSessionGetProperty(kAudioSessionProperty_AudioRoute
,&lNewRouteSize
,&lNewRoute);
if (!lStatus && CFStringGetLength(lNewRoute) > 0) {
char route[64];
CFStringGetCString(lNewRoute, route,sizeof(route), kCFStringEncodingUTF8);
ms_message("Current audio route is [%s]",route);
return ( kCFCompareEqualTo == CFStringCompare (lNewRoute,CFSTR("Speaker"),0)
|| kCFCompareEqualTo == CFStringCompare (lNewRoute,CFSTR("SpeakerAndMicrophone"),0));
} else
return false;
- (id)init {
self = [super init];
if (self) {
[self initUISpeakerButton];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUISpeakerButton];
}
return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code.
}
*/
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self initUISpeakerButton];
}
return self;
}
- (void)dealloc {
[super dealloc];
OSStatus lStatus = AudioSessionRemovePropertyListenerWithUserData(routeChangeID, audioRouteChangeListenerCallback, self);
if (lStatus) {
[LinphoneLogger logc:LinphoneLoggerError format:"cannot un register route change handler [%ld]",lStatus];
}
[super dealloc];
}
#pragma mark - UIToggleButtonDelegate Functions
- (void)onOn {
[[LinphoneManager instance] enableSpeaker:TRUE];
}
- (void)onOff {
[[LinphoneManager instance] enableSpeaker:FALSE];
}
- (bool)onUpdate {
return [[LinphoneManager instance] isSpeakerEnabled];
}
@end

View file

@ -20,23 +20,17 @@
#import <UIKit/UIKit.h>
@protocol UIToggleButtonDelegate
-(void) onOn;
-(void) onOff;
-(bool) isInitialStateOn;
- (void)onOn;
- (void)onOff;
- (bool)onUpdate;
@end
@interface UIToggleButton : UIButton <UIToggleButtonDelegate> {
@private
UIImage* mOnImage;
UIImage* mOffImage;
bool mIsOn;
const char* debugName;
@interface UIToggleButton : UIButton <UIToggleButtonDelegate> {
}
-(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage debugName:(const char*) name;
-(bool) reset;
-(bool) isOn;
-(bool) toggle;
- (bool)update;
- (void)setOn;
- (void)setOff;
- (bool)toggle;
@end

View file

@ -16,75 +16,99 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UIToggleButton.h"
#include "linphonecore.h"
@implementation UIToggleButton
-(void) touchUp:(id) sender {
[self toggle];
}
-(bool) isOn {
return mIsOn;
}
-(bool) toggle {
ms_message("UI - Toggle button '%s' state change %d -> %d",
debugName, mIsOn, !mIsOn);
if (mIsOn) {
[self setImage:mOffImage forState:UIControlStateNormal];
mIsOn=!mIsOn;
[self onOff];
} else {
[self setImage:mOnImage forState:UIControlStateNormal];
mIsOn=!mIsOn;
[self onOn];
}
return mIsOn;
}
-(bool) reset {
mIsOn = [self isInitialStateOn];
[self setImage:mIsOn?mOnImage:mOffImage forState:UIControlStateNormal];
return mIsOn;
}
-(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage debugName:(const char *)name{
mOnImage = [onImage retain];
mOffImage = [offImage retain];
mIsOn=false;
debugName = name;
[self reset];
#pragma mark - Lifecycle Functions
- (void)initUIToggleButton {
[self update];
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code.
}
*/
- (id)init {
self = [super init];
if (self) {
[self initUIToggleButton];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUIToggleButton];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self initUIToggleButton];
}
return self;
}
- (void)dealloc {
[super dealloc];
[mOffImage release];
[mOffImage release];
}
#pragma mark -
- (void)touchUp:(id) sender {
[self toggle];
}
- (bool)toggle {
if (self.selected) {
self.selected=!self.selected;
[self onOff];
} else {
self.selected=!self.selected;
[self onOn];
}
return self.selected;
}
- (void)setOn {
if (!self.selected) {
[self toggle];
}
}
- (void)setOff {
if (self.selected) {
[self toggle];
}
}
- (bool)update {
self.selected = [self onUpdate];
return self.selected;
}
#pragma mark - UIToggleButtonDelegate Functions
-(void) onOn {
[NSException raise:NSInternalInconsistencyException
format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)];
/*[NSException raise:NSInternalInconsistencyException
format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)];*/
}
-(void) onOff {
[NSException raise:NSInternalInconsistencyException
format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)];
/*[NSException raise:NSInternalInconsistencyException
format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)];*/
}
-(bool) isInitialStateOn {
[NSException raise:NSInternalInconsistencyException
format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)];
-(bool) onUpdate {
/*[NSException raise:NSInternalInconsistencyException
format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)];*/
return false;
}
@end

View file

@ -1,74 +0,0 @@
/* UIToggleVideoButton.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 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 "UIToggleVideoButton.h"
#include "LinphoneManager.h"
@implementation UIToggleVideoButton
@synthesize videoUpdateIndicator;
-(void) touchUp:(id) sender {
LinphoneCore* lc = [LinphoneManager getLc];
if (!linphone_core_video_enabled(lc))
return;
[videoUpdateIndicator startAnimating];
videoUpdateIndicator.hidden = NO;
self.enabled = NO;
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (call) {
LinphoneCallParams* call_params = linphone_call_params_copy(linphone_call_get_current_params(call));
if (linphone_call_params_video_enabled(call_params)) {
ms_message("Disabling video");
linphone_call_params_enable_video(call_params, FALSE);
} else {
ms_message("Enabling video");
linphone_call_params_enable_video(call_params, TRUE);
}
linphone_core_update_call(lc, call, call_params);
linphone_call_params_destroy(call_params);
} else {
ms_warning("Cannot toggle video, because no current call");
}
}
- (id) init {
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self init];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self init];
}
return self;
}
@end

View file

@ -1,6 +1,6 @@
/* UIDuration.h
/* UITransferButton.h
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,19 +15,15 @@
* 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>
@interface UIDuration : UILabel {
@private
NSTimer *durationRefreasher;
@interface UITransferButton : UIButton {
@private
UITextField* addressField;
}
-(void) start;
-(void) stop;
@property (nonatomic, retain) IBOutlet UITextField* addressField;
@end

View file

@ -1,6 +1,6 @@
/* UIDuration.m
/* UITransferButton.m
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,52 +15,57 @@
* 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 "UIDuration.h"
*/
#import "UITransferButton.h"
#import "LinphoneManager.h"
#import <CoreTelephony/CTCallCenter.h>
@implementation UIDuration
@implementation UITransferButton
-(void)updateCallDuration {
int lDuration = linphone_core_get_current_call_duration([LinphoneManager getLc]);
if (lDuration < 60) {
[self setText:[NSString stringWithFormat: @"%02i s", lDuration]];
} else {
[self setText:[NSString stringWithFormat: @"%02i:%02i", lDuration/60,lDuration - 60 *(lDuration/60)]];
@synthesize addressField;
#pragma mark - Lifecycle Functions
- (void)initUICallButton {
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
}
- (id)init {
self = [super init];
if (self) {
[self initUICallButton];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUICallButton];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self initUICallButton];
}
}
-(void) start {
[self setText:@"00 s"];
durationRefreasher = [NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(updateCallDuration)
userInfo:nil
repeats:YES];
}
-(void) stop {
[durationRefreasher invalidate];
durationRefreasher=nil;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code.
}
*/
return self;
}
- (void)dealloc {
[addressField release];
[super dealloc];
[durationRefreasher invalidate];
}
#pragma mark -
- (void)touchUp:(id) sender {
[[LinphoneManager instance] call:[addressField text] displayName:nil transfer:TRUE];
}
@end

View file

@ -1,6 +1,6 @@
/* UIMuteButton.h
/* UITransparentView.h
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -18,11 +18,7 @@
*/
#import <UIKit/UIKit.h>
#import "UIToggleButton.h"
@interface UIPauseResumeButton : UIToggleButton<UIToggleButtonDelegate> {
}
@interface UITransparentView : UIView
@end

View file

@ -1,6 +1,6 @@
/* FirstLoginViewController.h
/* UITransparentView.m
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,26 +15,30 @@
* 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 "LinphoneAppDelegate.h"
#import "LinphoneUIDelegates.h"
#import "UITransparentView.h"
@implementation UITransparentView
@interface FirstLoginViewController : UIViewController <UITextFieldDelegate,LinphoneUIRegistrationDelegate>{
UIButton* ok;
UIButton* site;
UITextField* username;
UIView* activityIndicator;
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
BOOL pointInside = NO;
for(UIView *child in [self subviews]) {
if(![child isHidden]) {
if(CGRectContainsPoint(child.frame, point)) {
CGPoint newPoint = point;
newPoint.x -= child.frame.origin.x;
newPoint.y -= child.frame.origin.y;
if([child pointInside:newPoint withEvent:event]) {
pointInside = YES;
break;
}
}
}
}
return pointInside;
}
-(void) doOk:(id)sender;
@property (nonatomic, retain) IBOutlet UIButton* ok;
@property (nonatomic, retain) IBOutlet UIButton* site;
@property (nonatomic, retain) IBOutlet UITextField* username;
@property (nonatomic, retain) IBOutlet UITextField* passwd;
@property (nonatomic, retain) IBOutlet UIView* activityIndicator;
@end

View file

@ -1,4 +1,4 @@
/* UIToggleVideoButton.h
/* UIVideoButton.h
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
*
@ -19,12 +19,17 @@
#import <UIKit/UIKit.h>
@interface UIToggleVideoButton : UIButton {
UIActivityIndicatorView* videoUpdateIndicator;
#import "UIToggleButton.h"
@interface UIVideoButton : UIToggleButton<UIToggleButtonDelegate> {
BOOL locked;
BOOL unlockVideoState;
UIActivityIndicatorView *waitView;
}
- (id)initWithCoder:(NSCoder *)decoder;
@property (assign) BOOL locked;
@property (assign) BOOL unlockVideoState;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* videoUpdateIndicator;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* waitView;
@end

View file

@ -0,0 +1,162 @@
/* UIToggleVideoButton.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 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 "UIVideoButton.h"
#include "LinphoneManager.h"
@implementation UIVideoButton
@synthesize locked;
@synthesize unlockVideoState;
@synthesize waitView;
- (void)initUIVideoButton {
self->locked = FALSE;
self->unlockVideoState = FALSE;
}
- (id)init{
self = [super init];
if (self) {
[self initUIVideoButton];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self initUIVideoButton];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initUIVideoButton];
}
return self;
}
- (void)onOn {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle video button: Linphone core not ready"];
return;
}
LinphoneCore* lc = [LinphoneManager getLc];
if (!linphone_core_video_enabled(lc))
return;
[self setEnabled: FALSE];
[waitView startAnimating];
[self setLocked: TRUE];
[self setUnlockVideoState: TRUE];
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (call) {
LinphoneCallParams* call_params = linphone_call_params_copy(linphone_call_get_current_params(call));
linphone_call_params_enable_video(call_params, TRUE);
linphone_core_update_call(lc, call, call_params);
linphone_call_params_destroy(call_params);
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle video button, because no current call"];
}
}
- (void)onOff {
if(![LinphoneManager isLcReady]) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle video button: Linphone core not ready"];
return;
}
LinphoneCore* lc = [LinphoneManager getLc];
if (!linphone_core_video_enabled(lc))
return;
[self setEnabled: FALSE];
[waitView startAnimating];
[self setLocked: TRUE];
[self setUnlockVideoState: FALSE];
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (call) {
LinphoneCallParams* call_params = linphone_call_params_copy(linphone_call_get_current_params(call));
linphone_call_params_enable_video(call_params, FALSE);
linphone_core_update_call(lc, call, call_params);
linphone_call_params_destroy(call_params);
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot toggle video button, because no current call"];
}
}
- (bool)onUpdate {
if([LinphoneManager isLcReady]) {
bool val = false;
if(linphone_core_video_enabled([LinphoneManager getLc])) {
LinphoneCall* currentCall = linphone_core_get_current_call([LinphoneManager getLc]);
if (currentCall) {
LinphoneCallState state = linphone_call_get_state(currentCall);
if (state == LinphoneCallStreamsRunning || state == LinphoneCallUpdated || state == LinphoneCallUpdatedByRemote) {
if (linphone_call_params_video_enabled(linphone_call_get_current_params(currentCall))) {
val = true;
if(locked && unlockVideoState) {
locked = FALSE;
[waitView stopAnimating];
}
} else {
if(locked && !unlockVideoState) {
locked = FALSE;
[waitView stopAnimating];
}
}
if(!locked) {
[self setEnabled:TRUE];
}
} else {
// Disable button if the call is not running
[self setEnabled:FALSE];
[waitView stopAnimating];
}
} else {
// Disable button if there is no call
[self setEnabled:FALSE];
[waitView stopAnimating];
}
} else {
// Disable button if video is not enabled
[self setEnabled:FALSE];
[waitView stopAnimating];
}
return val;
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update video button: Linphone core not ready"];
return false;
}
}
- (void)dealloc {
[waitView release];
[super dealloc];
}
@end

View file

@ -1,10 +1,21 @@
//
// VideoZoomHandler.h
// linphone
//
// Created by Pierre-Eric Pelloux-Prayer on 25/04/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
/* VideoZoomHandler.h
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <Foundation/Foundation.h>
@ -12,7 +23,8 @@
float zoomLevel, cx, cy;
UIView* videoView;
}
-(void) setup: (UIView*) videoView;
-(void) resetZoom;
- (void) setup: (UIView*) videoView;
- (void) resetZoom;
@end

View file

@ -1,10 +1,21 @@
//
// VideoZoomHandler.m
// linphone
//
// Created by Pierre-Eric Pelloux-Prayer on 25/04/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
/* VideoZoomHandler.m
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "VideoZoomHandler.h"
#include "linphonecore.h"
@ -12,8 +23,7 @@
@implementation VideoZoomHandler
-(void) zoomInOut:(UITapGestureRecognizer*) reco {
- (void)zoomInOut:(UITapGestureRecognizer*) reco {
if (zoomLevel != 1)
zoomLevel = 1;
else
@ -29,7 +39,7 @@
linphone_call_zoom_video(linphone_core_get_current_call([LinphoneManager getLc]), zoomLevel, &cx, &cy);
}
-(void) videoPan:(UIPanGestureRecognizer*) reco {
- (void)videoPan:(UIPanGestureRecognizer*) reco {
if (zoomLevel <= 1.0)
return;
@ -53,7 +63,7 @@
cy = y;
}
-(void) pinch:(UIPinchGestureRecognizer*) reco {
- (void)pinch:(UIPinchGestureRecognizer*) reco {
float s = zoomLevel;
// CGPoint point = [reco locationInView:videoGroup];
// float ccx = cx + (point.x / videoGroup.frame.size.width - 0.5) / s;
@ -76,13 +86,12 @@
linphone_call_zoom_video(linphone_core_get_current_call([LinphoneManager getLc]), s, &cx, &cy);
}
-(void) resetZoom {
- (void)resetZoom {
zoomLevel = 1;
cx = cy = 0.5;
}
-(void) setup: (UIView*) view {
- (void)setup: (UIView*) view {
videoView = view;
UITapGestureRecognizer* doubleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(zoomInOut:)];
@ -101,4 +110,5 @@
[self resetZoom];
}
@end

View file

@ -1,41 +0,0 @@
/* MainScreenWithVideoPreview.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 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 <AVFoundation/AVFoundation.h>
#import "PhoneViewController.h"
@interface MainScreenWithVideoPreview : UIViewController {
UIWindow *window;
PhoneViewController* phoneMainView;
AVCaptureSession* session;
AVCaptureDeviceInput* input;
int currentCamera;
}
-(void) showPreview:(BOOL) show;
-(void) useCameraAtIndex:(NSInteger)camIndex startSession:(BOOL)start;
@property (nonatomic, retain) IBOutlet PhoneViewController* phoneMainView;
@property (nonatomic, retain) IBOutlet UIWindow *window;
@end

View file

@ -1,182 +0,0 @@
/* MainScreenWithVideoPreview.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 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 "MainScreenWithVideoPreview.h"
#import <AVFoundation/AVFoundation.h>
#import "LinphoneUI/LinphoneManager.h"
@implementation MainScreenWithVideoPreview
@synthesize window;
@synthesize phoneMainView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
}
*/
-(void) initVideoPreview {
session = [[AVCaptureSession alloc] init];
currentCamera = 0;
AVCaptureVideoPreviewLayer* previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:session];
previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
previewLayer.frame = self.view.bounds;
[self.view.layer addSublayer:previewLayer];
[session beginConfiguration];
[session setSessionPreset:AVCaptureSessionPresetHigh];
[session commitConfiguration];
[self useCameraAtIndex:0 startSession:NO];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];
}
-(void) switchCameraPressed {
[self useCameraAtIndex: (currentCamera + 1) startSession:YES];
}
-(void) useCameraAtIndex:(NSInteger)camIndex startSession:(BOOL)start {
@synchronized (self) {
[session stopRunning];
if (input != nil)
[session removeInput:input];
NSError* error;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc]init];
NSArray* array = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
if ( [array count] == 0) {
ms_warning("No camera available (running on simulator ?");
return;
}
currentCamera = camIndex % [array count];
AVCaptureDevice* device = (AVCaptureDevice*) [array objectAtIndex:currentCamera];
input = [[AVCaptureDeviceInput deviceInputWithDevice:device
error:&error] retain];
[session addInput:input];
[pool drain];
if (start)
[session startRunning];
}
}
-(void) stopPreview:(id) a {
@synchronized (self) {
if (!session.running)
return;
[self.view removeFromSuperview];
[session stopRunning];
}
}
-(void) startPreview:(id) a {
@synchronized (self) {
if (session.running)
return;
[window addSubview:self.view];
[window sendSubviewToBack:self.view];
[session startRunning];
}
}
-(void) showPreview:(BOOL) show {
LinphoneCore* lc;
@try {
lc = [LinphoneManager getLc];
}
@catch (NSException *exception) {
return;
}
bool enableVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_video_preference"];
if (enableVideo) {
LinphoneCall* call = linphone_core_get_current_call(lc);
if (show && call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
return;
}
if (session == nil) {
[self initVideoPreview];
}
if (show && !session.running) {
[self performSelectorInBackground:@selector(startPreview:) withObject:nil];
} else if (!show && session.running) {
[self performSelectorInBackground:@selector(stopPreview:) withObject:nil];
}
} else {
[self stopPreview:nil];
}
}
-(void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[phoneMainView.switchCamera addTarget:self action:@selector(switchCameraPressed) forControlEvents:UIControlEventTouchUpInside];
}
-(void) viewDidDisappear:(BOOL)animated {
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
/*- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return NO;
}*/
@end

View file

@ -1,390 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C74</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138.23</string>
<string key="IBDocument.HIToolboxVersion">567.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUITabBarItem</string>
<string>IBUIViewController</string>
<string>IBUICustomObject</string>
<string>IBUITabBarController</string>
<string>IBUIWindow</string>
<string>IBUITabBar</string>
<string>IBUIView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUICustomObject" id="154803318">
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUIWindow" id="46357543">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{768, 1024}</string>
<reference key="NSSuperview"/>
<string key="NSReuseIdentifierKey">_NS:196</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIResizesToFullScreen">YES</bool>
</object>
<object class="IBUITabBarController" id="888354232">
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIHorizontal">NO</bool>
<object class="IBUIViewController" key="IBUISelectedViewController" id="446523710">
<object class="IBUITabBarItem" key="IBUITabBarItem" id="64676500">
<string key="IBUITitle">Dialer</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">dialer-orange.png</string>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<reference key="IBUIParentViewController" ref="888354232"/>
<string key="IBUINibName">PhoneViewController-ipad</string>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<array class="NSMutableArray" key="IBUIViewControllers">
<object class="IBUIViewController" id="538833779">
<string key="IBUITitle">History</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="918692703">
<string key="IBUITitle">History</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">history-orange.png</string>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<reference key="IBUIParentViewController" ref="888354232"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<reference ref="446523710"/>
<object class="IBUIViewController" id="369729967">
<object class="IBUITabBarItem" key="IBUITabBarItem" id="935176592">
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUISystemItemIdentifier">5</int>
</object>
<reference key="IBUIParentViewController" ref="888354232"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="954789010">
<object class="IBUITabBarItem" key="IBUITabBarItem" id="162230919">
<string key="IBUITitle"/>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUISystemItemIdentifier">0</int>
</object>
<reference key="IBUIParentViewController" ref="888354232"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</array>
<object class="IBUITabBar" key="IBUITabBar" id="752322970">
<reference key="NSNextResponder"/>
<int key="NSvFlags">266</int>
<string key="NSFrame">{{0, 975}, {768, 49}}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</object>
<object class="IBUIViewController" id="26482769">
<object class="IBUIView" key="IBUIView" id="433141527">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{0, 20}, {768, 1004}}</string>
<reference key="NSSuperview"/>
<string key="NSReuseIdentifierKey">_NS:212</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC40MzUwMTEzNDA3IDAuNjI1IDEAA</bytes>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="154803318"/>
</object>
<int key="connectionID">30</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="26482769"/>
<reference key="destination" ref="46357543"/>
</object>
<int key="connectionID">9</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">phoneMainView</string>
<reference key="source" ref="26482769"/>
<reference key="destination" ref="446523710"/>
</object>
<int key="connectionID">44</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="154803318"/>
<reference key="destination" ref="46357543"/>
</object>
<int key="connectionID">27</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">myTabBarController</string>
<reference key="source" ref="154803318"/>
<reference key="destination" ref="888354232"/>
</object>
<int key="connectionID">28</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">mMainScreenWithVideoPreview</string>
<reference key="source" ref="446523710"/>
<reference key="destination" ref="26482769"/>
</object>
<int key="connectionID">31</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="46357543"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="26482769"/>
<array class="NSMutableArray" key="children">
<reference ref="433141527"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="154803318"/>
<reference key="parent" ref="0"/>
<string key="objectName">linphoneAppDelegate</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="888354232"/>
<array class="NSMutableArray" key="children">
<reference ref="446523710"/>
<reference ref="538833779"/>
<reference ref="954789010"/>
<reference ref="369729967"/>
<reference ref="752322970"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="446523710"/>
<array class="NSMutableArray" key="children">
<reference ref="64676500"/>
</array>
<reference key="parent" ref="888354232"/>
<string key="objectName">dialer</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="538833779"/>
<array class="NSMutableArray" key="children">
<reference ref="918692703"/>
</array>
<reference key="parent" ref="888354232"/>
<string key="objectName">history</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="954789010"/>
<array class="NSMutableArray" key="children">
<reference ref="162230919"/>
</array>
<reference key="parent" ref="888354232"/>
<string key="objectName">more</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="369729967"/>
<array class="NSMutableArray" key="children">
<reference ref="935176592"/>
</array>
<reference key="parent" ref="888354232"/>
<string key="objectName">Contacts</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="752322970"/>
<reference key="parent" ref="888354232"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="935176592"/>
<reference key="parent" ref="369729967"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">24</int>
<reference key="object" ref="162230919"/>
<reference key="parent" ref="954789010"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">25</int>
<reference key="object" ref="918692703"/>
<reference key="parent" ref="538833779"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
<reference key="object" ref="64676500"/>
<reference key="parent" ref="446523710"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="433141527"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="26482769"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">UIApplication</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="16.CustomClassName">linphoneAppDelegate</string>
<string key="16.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="17.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="18.CustomClassName">PhoneViewController</string>
<string key="18.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="19.CustomClassName">CallHistoryTableViewController</string>
<string key="19.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="20.CustomClassName">MoreViewController</string>
<string key="20.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="21.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="24.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="25.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="26.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.CustomClassName">MainScreenWithVideoPreview</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">44</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="dialer-orange.png">{25, 24}</string>
<string key="history-orange.png">{25, 23}</string>
</dictionary>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>

View file

@ -1,48 +0,0 @@
/* MoreViewController.h
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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>
#include "linphoneAppDelegate.h"
@class ConsoleViewController;
@interface MoreViewController : UITableViewController {
bool isLogViewEnabled;
UITableViewCell *credit;
UITextView *creditText;
UITableViewCell *web;
UILabel *weburi;
UITableViewCell *console;
ConsoleViewController *consoleViewController;
bool isDebug;
}
@property (nonatomic, retain) IBOutlet UITableViewCell* web;
@property (nonatomic, retain) IBOutlet UITableViewCell* credit;
@property (nonatomic, retain) IBOutlet UITableViewCell* console;
@property (nonatomic, retain) IBOutlet UITextView *creditText;
@property (nonatomic, retain) IBOutlet UILabel *weburi;
@end

View file

@ -1,141 +0,0 @@
/* MoreViewController.m
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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 "MoreViewController.h"
#include "ConsoleViewController.h"
#import "LinphoneManager.h"
@implementation MoreViewController
@synthesize web;
@synthesize credit;
@synthesize console;
@synthesize creditText;
@synthesize weburi;
//Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
[creditText setText: [NSString stringWithFormat:creditText.text,[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]];
consoleViewController = [[ConsoleViewController alloc] initWithNibName:@"ConsoleViewController" bundle:[NSBundle mainBundle]];
[[LinphoneManager instance] registerLogView:consoleViewController];
isDebug = [[NSUserDefaults standardUserDefaults] boolForKey:@"debugenable_preference"];
}
/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
-(void) enableLogView {
isLogViewEnabled = true;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return 230;
} else {
return 44;
}
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return 1;
} else {
if (isDebug) {
return 2;
} else {
return 1;
}
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return credit;
} else {
switch (indexPath.row) {
case 0: return web;
case 1: return console;
}
}
return nil;
}
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
[self tableView:tableView didSelectRowAtIndexPath:indexPath];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:NO];
switch (indexPath.row) {
case 0: {
NSURL *url = [NSURL URLWithString:weburi.text];
[[UIApplication sharedApplication] openURL:url];
break;
};
case 1: {
[self.navigationController pushViewController:consoleViewController animated:true];
break;
}
}
}
@end

View file

@ -1,807 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">784</int>
<string key="IBDocument.SystemVersion">10J567</string>
<string key="IBDocument.InterfaceBuilderVersion">823</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">462.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">132</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="25"/>
<integer value="38"/>
<integer value="42"/>
<integer value="4"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIViewController" id="404009698">
<object class="IBUITableView" key="IBUIView" id="1023241257">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{0, 106}, {320, 247}}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">10</int>
<object class="NSImage" key="NSImage">
<int key="NSImageFlags">549453824</int>
<string key="NSSize">{84, 1}</string>
<object class="NSMutableArray" key="NSReps">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="0"/>
<object class="NSBitmapImageRep">
<object class="NSData" key="NSTIFFRepresentation">
<bytes key="NS.bytes">TU0AKgAAAVjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/
y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/
xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/
xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/
xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/
xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P8ADQEAAAMAAAABAFQAAAEB
AAMAAAABAAEAAAECAAMAAAAEAAAB+gEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABAAEAAAEXAAQAAAABAAABUAEcAAMAAAABAAEAAAFS
AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
</object>
</object>
<object class="NSColor" key="NSColor" id="852365409">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
</object>
<string key="IBUIColorCocoaTouchKeyPath">groupTableViewBackgroundColor</string>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIBouncesZoom">NO</bool>
<int key="IBUIStyle">1</int>
<int key="IBUISeparatorStyle">1</int>
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
<float key="IBUIRowHeight">44</float>
<float key="IBUISectionHeaderHeight">10</float>
<float key="IBUISectionFooterHeight">10</float>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUITableViewCell" id="616126654">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIView" id="958135278">
<reference key="NSNextResponder" ref="616126654"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUILabel" id="409894174">
<reference key="NSNextResponder" ref="958135278"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 0}, {300, 44}}</string>
<reference key="NSSuperview" ref="958135278"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">http://www.linphone.org</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwLjUwMTk2MDgxIDEAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
</object>
<string key="NSFrameSize">{300, 44}</string>
<reference key="NSSuperview" ref="616126654"/>
<reference key="IBUIBackgroundColor" ref="852365409"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">4</int>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<string key="NSFrameSize">{320, 44}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor" id="505875399">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUISeparatorStyle">1</int>
<int key="IBUIAccessoryType">1</int>
<reference key="IBUIContentView" ref="958135278"/>
</object>
<object class="IBUITableViewCell" id="135715970">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIView" id="804504498">
<reference key="NSNextResponder" ref="135715970"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUILabel" id="915917531">
<reference key="NSNextResponder" ref="804504498"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 0}, {300, 44}}</string>
<reference key="NSSuperview" ref="804504498"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Console</string>
<object class="NSColor" key="IBUITextColor" id="84851821">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
</object>
<string key="NSFrameSize">{300, 44}</string>
<reference key="NSSuperview" ref="135715970"/>
<reference key="IBUIBackgroundColor" ref="852365409"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">4</int>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<string key="NSFrameSize">{320, 44}</string>
<reference key="NSSuperview"/>
<reference key="IBUIBackgroundColor" ref="505875399"/>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUISeparatorStyle">1</int>
<int key="IBUIAccessoryType">1</int>
<reference key="IBUIContentView" ref="804504498"/>
</object>
<object class="IBUITableViewCell" id="345316828">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIView" id="869038871">
<reference key="NSNextResponder" ref="345316828"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIImageView" id="457821340">
<reference key="NSNextResponder" ref="869038871"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{28, -14}, {263, 154}}</string>
<reference key="NSSuperview" ref="869038871"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentMode">1</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">linphone-banner.png</string>
</object>
</object>
<object class="IBUITextView" id="432332592">
<reference key="NSNextResponder" ref="869038871"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{9, 109}, {301, 89}}</string>
<reference key="NSSuperview" ref="869038871"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIShowsHorizontalScrollIndicator">NO</bool>
<bool key="IBUIDelaysContentTouches">NO</bool>
<bool key="IBUICanCancelContentTouches">NO</bool>
<bool key="IBUIBouncesZoom">NO</bool>
<string key="IBUIText">Linphone %@ SIP (rfc3261) compatible phone under GNU General Public License V2 </string>
<int key="IBUITextAlignment">1</int>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<int key="IBUIAutocapitalizationType">2</int>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBUILabel" id="389892446">
<reference key="NSNextResponder" ref="869038871"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{28, 198}, {263, 21}}</string>
<reference key="NSSuperview" ref="869038871"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">© 2010 Belledonne Communications </string>
<reference key="IBUITextColor" ref="84851821"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">1</int>
</object>
</object>
<string key="NSFrameSize">{322, 230}</string>
<reference key="NSSuperview" ref="345316828"/>
<reference key="IBUIBackgroundColor" ref="852365409"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">4</int>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<string key="NSFrameSize">{322, 230}</string>
<reference key="NSSuperview"/>
<reference key="IBUIBackgroundColor" ref="505875399"/>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUISeparatorStyle">1</int>
<reference key="IBUIContentView" ref="869038871"/>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">web</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="616126654"/>
</object>
<int key="connectionID">32</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">console</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="135715970"/>
</object>
<int key="connectionID">40</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">credit</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="345316828"/>
</object>
<int key="connectionID">46</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="1023241257"/>
</object>
<int key="connectionID">47</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">creditText</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="432332592"/>
</object>
<int key="connectionID">48</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">weburi</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="409894174"/>
</object>
<int key="connectionID">50</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="404009698"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="1023241257"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">25</int>
<reference key="object" ref="616126654"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="409894174"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">web</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">34</int>
<reference key="object" ref="409894174"/>
<reference key="parent" ref="616126654"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">38</int>
<reference key="object" ref="135715970"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="915917531"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">console</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">39</int>
<reference key="object" ref="915917531"/>
<reference key="parent" ref="135715970"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">42</int>
<reference key="object" ref="345316828"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="457821340"/>
<reference ref="432332592"/>
<reference ref="389892446"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">about</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">43</int>
<reference key="object" ref="457821340"/>
<reference key="parent" ref="345316828"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">45</int>
<reference key="object" ref="432332592"/>
<reference key="parent" ref="345316828"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="1023241257"/>
<reference key="parent" ref="404009698"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">49</int>
<reference key="object" ref="389892446"/>
<reference key="parent" ref="345316828"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>18.IBEditorWindowLastContentRect</string>
<string>18.IBPluginDependency</string>
<string>25.IBEditorWindowLastContentRect</string>
<string>25.IBPluginDependency</string>
<string>34.IBPluginDependency</string>
<string>38.IBEditorWindowLastContentRect</string>
<string>38.IBPluginDependency</string>
<string>39.IBPluginDependency</string>
<string>4.IBEditorWindowLastContentRect</string>
<string>4.IBPluginDependency</string>
<string>42.IBEditorWindowLastContentRect</string>
<string>42.IBPluginDependency</string>
<string>43.IBPluginDependency</string>
<string>45.IBPluginDependency</string>
<string>49.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>MoreViewController</string>
<string>UIResponder</string>
<string>{{138, 864}, {320, 247}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>{{251, 502}, {320, 44}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>{{252, 1012}, {320, 44}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>{{79, 106}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>{{100, 713}, {322, 230}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">50</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">MoreViewController</string>
<string key="superclassName">UITableViewController</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>console</string>
<string>credit</string>
<string>creditText</string>
<string>web</string>
<string>weburi</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITableViewCell</string>
<string>UITableViewCell</string>
<string>UITextView</string>
<string>UITableViewCell</string>
<string>UILabel</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>console</string>
<string>credit</string>
<string>creditText</string>
<string>web</string>
<string>weburi</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">console</string>
<string key="candidateClassName">UITableViewCell</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">credit</string>
<string key="candidateClassName">UITableViewCell</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">creditText</string>
<string key="candidateClassName">UITextView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">web</string>
<string key="candidateClassName">UITableViewCell</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">weburi</string>
<string key="candidateClassName">UILabel</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/MoreViewController.h</string>
</object>
</object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="166778321">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIImageView</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIImageView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UILabel</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIResponder</string>
<string key="superclassName">NSObject</string>
<reference key="sourceIdentifier" ref="166778321"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIScrollView</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIScrollView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchDisplayController</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITableView</string>
<string key="superclassName">UIScrollView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITableView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITableViewCell</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITableViewCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITableViewController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITableViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITextView</string>
<string key="superclassName">UIScrollView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITextView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<integer value="784" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<integer value="1056" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">../linphone.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NS.key.0">linphone-banner.png</string>
<string key="NS.object.0">{300, 100}</string>
</object>
<string key="IBCocoaTouchPluginVersion">132</string>
</data>
</archive>

File diff suppressed because it is too large Load diff

View file

@ -1,101 +0,0 @@
/* PhoneViewController.h
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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 <Foundation/Foundation.h>
#import "linphonecore.h"
#import "UILinphone.h"
#import "CallDelegate.h"
#import "StatusSubViewController.h"
@class MainScreenWithVideoPreview;
@class IncallViewController;
@class FirstLoginViewController;
@interface PhoneViewController : UIViewController <UITextFieldDelegate,LinphoneUICallDelegate, UIActionSheetCustomDelegate, LinphoneUIRegistrationDelegate> {
@private
//UI definition
UIView* dialerView;
UITextField* address;
UILabel* mDisplayName;
UIEraseButton* erase;
UICallButton* callShort;
UICallButton* callLarge;
UILabel* status;
//key pad
UIDigitButton* one;
UIDigitButton* two;
UIDigitButton* three;
UIDigitButton* four;
UIDigitButton* five;
UIDigitButton* six;
UIDigitButton* seven;
UIDigitButton* eight;
UIDigitButton* nine;
UIDigitButton* star;
UIDigitButton* zero;
UIDigitButton* hash;
UIButton* backToCallView;
UIView* statusViewHolder;
UITabBarController* myTabBarController;
UIActionSheet *mIncomingCallActionSheet;
FirstLoginViewController* myFirstLoginViewController;
IncallViewController* mIncallViewController;
MainScreenWithVideoPreview* mMainScreenWithVideoPreview;
StatusSubViewController* statusSubViewController;
UIButton* switchCamera;
}
@property (nonatomic, retain) IBOutlet UIView* dialerView;
@property (nonatomic, retain) IBOutlet UITextField* address;
@property (nonatomic, retain) IBOutlet UIButton* callShort;
@property (nonatomic, retain) IBOutlet UIButton* callLarge;
@property (nonatomic, retain) IBOutlet UILabel* status;
@property (nonatomic, retain) IBOutlet UIEraseButton* erase;
@property (nonatomic, retain) IBOutlet UIButton* one;
@property (nonatomic, retain) IBOutlet UIButton* two;
@property (nonatomic, retain) IBOutlet UIButton* three;
@property (nonatomic, retain) IBOutlet UIButton* four;
@property (nonatomic, retain) IBOutlet UIButton* five;
@property (nonatomic, retain) IBOutlet UIButton* six;
@property (nonatomic, retain) IBOutlet UIButton* seven;
@property (nonatomic, retain) IBOutlet UIButton* eight;
@property (nonatomic, retain) IBOutlet UIButton* nine;
@property (nonatomic, retain) IBOutlet UIButton* star;
@property (nonatomic, retain) IBOutlet UIButton* zero;
@property (nonatomic, retain) IBOutlet UIButton* hash;
@property (nonatomic, retain) IBOutlet UIView* statusViewHolder;
@property (nonatomic, retain) IBOutlet UIButton* backToCallView;
@property (nonatomic, retain) IBOutlet UIButton* switchCamera;
@property (nonatomic, retain) IBOutlet UITabBarController* myTabBarController;
@property (nonatomic, retain) IBOutlet MainScreenWithVideoPreview* mMainScreenWithVideoPreview;
@end

View file

@ -1,426 +0,0 @@
/* PhoneViewController.h
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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 "PhoneViewController.h"
#import "linphoneAppDelegate.h"
#import "IncallViewController.h"
#import <AVFoundation/AVAudioSession.h>
#import <AudioToolbox/AudioToolbox.h>
#import "LinphoneManager.h"
#include "FirstLoginViewController.h"
#include "MainScreenWithVideoPreview.h"
#include "linphonecore.h"
#include "private.h"
@implementation PhoneViewController
@synthesize dialerView ;
@synthesize address ;
@synthesize callShort;
@synthesize callLarge;
@synthesize status;
@synthesize erase;
@synthesize one;
@synthesize two;
@synthesize three;
@synthesize four;
@synthesize five;
@synthesize six;
@synthesize seven;
@synthesize eight;
@synthesize nine;
@synthesize star;
@synthesize zero;
@synthesize hash;
@synthesize statusViewHolder;
@synthesize myTabBarController;
@synthesize mMainScreenWithVideoPreview;
@synthesize backToCallView;
@synthesize switchCamera;
-(void) updateStatusSubView {
LinphoneCore* lc = 0;
@try {
lc = [LinphoneManager getLc];
} @catch (NSException* exc) {
return;
}
if (!lc)
return;
BOOL enableCallButtons;
LinphoneProxyConfig* config;
linphone_core_get_default_proxy([LinphoneManager getLc], &config);
LinphoneRegistrationState s;
NSString* m = nil;
if (config == NULL) {
s = LinphoneRegistrationNone;
m = linphone_core_is_network_reachabled([LinphoneManager getLc]) ? NSLocalizedString(@"No SIP account configured", nil) : NSLocalizedString(@"Network down", nil);
} else {
s = linphone_proxy_config_get_state(config);
switch (s) {
case LinphoneRegistrationOk: m = @"Registered"; break;
case LinphoneRegistrationNone:
case LinphoneRegistrationCleared:
m=@"Not registered"; break;
case LinphoneRegistrationFailed: m = @"Registration failed"; break;
case LinphoneRegistrationProgress: m = @"Registration in progress"; break;
//case LinphoneRegistrationCleared: m= @"No SIP account"; break;
default: break;
}
}
enableCallButtons = [statusSubViewController updateWithRegistrationState:s message:m];
[callLarge setEnabled:enableCallButtons];
[callShort setEnabled:enableCallButtons];
[backToCallView setEnabled:enableCallButtons];
}
-(void) updateCallAndBackButtons {
@try {
bool zeroCall = (linphone_core_get_calls_nb([LinphoneManager getLc]) == 0);
[LinphoneManager set:callLarge hidden:!zeroCall withName:"CALL_LARGE button" andReason:__FUNCTION__];
[LinphoneManager set:switchCamera hidden:!zeroCall withName:"SWITCH_CAM button" andReason:__FUNCTION__];
[LinphoneManager set:callShort hidden:zeroCall withName:"CALL_SHORT button" andReason:__FUNCTION__];
[LinphoneManager set:backToCallView hidden:zeroCall withName:"BACK button" andReason:__FUNCTION__];
[callShort setTitle:[UICallButton transforModeEnabled] ? @"transfer":@"call" forState:UIControlStateNormal];
if (!callShort.hidden)
[callShort setEnabled:!linphone_core_sound_resources_locked([LinphoneManager getLc])];
} @catch (NSException* exc) {
// R.A.S: linphone core si simply not ready...
ms_warning("Catched exception %s: %s",
[exc.name cStringUsingEncoding:[NSString defaultCStringEncoding]],
[exc.reason cStringUsingEncoding:[NSString defaultCStringEncoding]]);
}
[self updateStatusSubView];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enable_first_login_view_preference"] == true) {
myFirstLoginViewController = [[FirstLoginViewController alloc] initWithNibName:@"FirstLoginViewController"
bundle:[NSBundle mainBundle]];
[self presentModalViewController:myFirstLoginViewController animated:true];
}
[[LinphoneManager instance] setRegistrationDelegate:self];
[mMainScreenWithVideoPreview showPreview:YES];
[self updateCallAndBackButtons];
}
-(void) viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib : may be called twice
- (void)viewDidLoad {
[super viewDidLoad];
[mDisplayName release];
mDisplayName = [UILabel alloc];
[zero initWithNumber:'0' addressField:address dtmf:false];
[one initWithNumber:'1' addressField:address dtmf:false];
[two initWithNumber:'2' addressField:address dtmf:false];
[three initWithNumber:'3' addressField:address dtmf:false];
[four initWithNumber:'4' addressField:address dtmf:false];
[five initWithNumber:'5' addressField:address dtmf:false];
[six initWithNumber:'6' addressField:address dtmf:false];
[seven initWithNumber:'7' addressField:address dtmf:false];
[eight initWithNumber:'8' addressField:address dtmf:false];
[nine initWithNumber:'9' addressField:address dtmf:false];
[star initWithNumber:'*' addressField:address dtmf:false];
[hash initWithNumber:'#' addressField:address dtmf:false];
[callShort initWithAddress:address];
[callLarge initWithAddress:address];
[erase initWithAddressField:address];
[backToCallView addTarget:self action:@selector(backToCallViewPressed) forControlEvents:UIControlEventTouchUpInside];
if (mIncallViewController == nil)
mIncallViewController = [[IncallViewController alloc] initWithNibName:[LinphoneManager runningOnIpad]?@"InCallViewController-ipad":@"IncallViewController"
bundle:[NSBundle mainBundle]];
if (statusSubViewController == nil) {
statusSubViewController = [[StatusSubViewController alloc] initWithNibName:@"StatusSubViewController"
bundle:[NSBundle mainBundle]];
[statusViewHolder addSubview:statusSubViewController.view];
}
[self updateCallAndBackButtons];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
if (theTextField == address) {
[address resignFirstResponder];
[mDisplayName setText:@""]; //display name only relefvant
}
return YES;
}
-(void)viewWillAppear:(BOOL)animated {
[self updateCallAndBackButtons];
[super viewWillAppear:animated];
}
-(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
//cancel local notification, just in case
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground ) {
// cancel local notif if needed
[[UIApplication sharedApplication] cancelAllLocalNotifications];
} else {
if (mIncomingCallActionSheet) {
[mIncomingCallActionSheet dismissWithClickedButtonIndex:1 animated:true];
mIncomingCallActionSheet=nil;
}
}
if (username) {
[address setText:username];
} //else keep previous
[mDisplayName setText:displayName];
[self updateCallAndBackButtons];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"firstlogindone_preference" ] == true) {
//first login case, dismmis first login view
[self dismissModalViewControllerAnimated:true];
};
[mIncallViewController displayDialerFromUI:viewCtrl
forUser:username
withDisplayName:displayName];
[myTabBarController setSelectedIndex:DIALER_TAB_INDEX];
[mMainScreenWithVideoPreview showPreview:YES];
}
//status reporting
-(void) displayStatus:(NSString*) message {
[mIncallViewController displayStatus:message];
}
-(void) displayIncomingCall:(LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[mMainScreenWithVideoPreview showPreview:NO];
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
// Create a new notification
UILocalNotification* notif = [[[UILocalNotification alloc] init] autorelease];
if (notif)
{
notif.repeatInterval = 0;
notif.alertBody =[NSString stringWithFormat:NSLocalizedString(@" %@ is calling you",nil),[displayName length]>0?displayName:username];
notif.alertAction = @"Answer";
notif.soundName = @"oldphone-mono-30s.caf";
NSData *callData = [NSData dataWithBytes:&call length:sizeof(call)];
notif.userInfo = [NSDictionary dictionaryWithObject:callData forKey:@"call"];
[[UIApplication sharedApplication] presentLocalNotificationNow:notif];
}
} else {
CallDelegate* cd = [[CallDelegate alloc] init];
cd.eventType = CD_NEW_CALL;
cd.delegate = self;
cd.call = call;
mIncomingCallActionSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@" %@ is calling you",nil),[displayName length]>0?displayName:username]
delegate:cd
cancelButtonTitle:NSLocalizedString(@"Decline",nil)
destructiveButtonTitle:NSLocalizedString(@"Answer",nil)
otherButtonTitles:nil];
mIncomingCallActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
if ([LinphoneManager runningOnIpad]) {
if (self.modalViewController != nil)
[mIncomingCallActionSheet showInView:[self.modalViewController view]];
else
[mIncomingCallActionSheet showInView:self.parentViewController.view];
} else {
[mIncomingCallActionSheet showInView:self.parentViewController.view];
}
[mIncomingCallActionSheet release];
}
[mMainScreenWithVideoPreview showPreview:NO];
}
-(void) backToCallViewPressed {
[UICallButton enableTransforMode:NO];
[self presentModalViewController:(UIViewController*)mIncallViewController animated:true];
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (!call || !linphone_call_params_video_enabled(linphone_call_get_current_params(call)) || linphone_call_get_state(call) != LinphoneCallStreamsRunning) {
[self displayInCall: call
FromUI:nil
forUser:nil
withDisplayName:nil];
} else {
[self displayVideoCall:call FromUI:nil forUser:nil withDisplayName:nil];
}
}
-(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[mMainScreenWithVideoPreview showPreview:NO];
if (self.presentedViewController != (UIViewController*)mIncallViewController) {
[self presentModalViewController:(UIViewController*)mIncallViewController animated:true];
}
[mIncallViewController displayCall:call InProgressFromUI:viewCtrl
forUser:username
withDisplayName:displayName];
[mMainScreenWithVideoPreview showPreview:NO];
}
-(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[mMainScreenWithVideoPreview showPreview:NO];
if (self.presentedViewController != (UIViewController*)mIncallViewController && (call == 0x0 ||
linphone_call_get_dir(call)==LinphoneCallIncoming)){
[self presentModalViewController:(UIViewController*)mIncallViewController animated:true];
}
[mIncallViewController displayInCall:call FromUI:viewCtrl
forUser:username
withDisplayName:displayName];
[LinphoneManager set:callLarge hidden:YES withName:"CALL_LARGE button" andReason:__FUNCTION__];
[LinphoneManager set:switchCamera hidden:YES withName:"SWITCH_CAMERA button" andReason:__FUNCTION__];
[LinphoneManager set:callShort hidden:NO withName:"CALL_SHORT button" andReason:__FUNCTION__];
[LinphoneManager set:backToCallView hidden:NO withName:"CALL_BACK button" andReason:__FUNCTION__];
[self updateCallAndBackButtons];
}
-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[mMainScreenWithVideoPreview showPreview:NO];
[mIncallViewController displayVideoCall:call FromUI:viewCtrl
forUser:username
withDisplayName:displayName];
[mMainScreenWithVideoPreview showPreview:NO];
[self updateCallAndBackButtons];
}
-(void) displayAskToEnableVideoCall:(LinphoneCall*) call forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[mIncallViewController displayAskToEnableVideoCall:call forUser:username withDisplayName:displayName];
}
- (void)actionSheet:(UIActionSheet *)actionSheet ofType:(enum CallDelegateType)type clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas {
if (type != CD_NEW_CALL)
return;
LinphoneCall* call = (LinphoneCall*)datas;
if (buttonIndex == actionSheet.destructiveButtonIndex ) {
linphone_core_accept_call([LinphoneManager getLc],call);
} else {
linphone_core_terminate_call ([LinphoneManager getLc], call);
}
mIncomingCallActionSheet = nil;
}
- (void)dealloc {
[address dealloc];
[ mDisplayName dealloc];
[dialerView dealloc];
[callShort dealloc];
[callLarge dealloc];
[status dealloc];
[one dealloc];
[two dealloc];
[three dealloc];
[four dealloc];
[five dealloc];
[six dealloc];
[seven dealloc];
[eight dealloc];
[nine dealloc];
[star dealloc];
[zero dealloc];
[hash dealloc];
[myTabBarController release];
[mIncallViewController release];
[super dealloc];
}
-(void) displayRegisteredFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain {
if (myFirstLoginViewController != nil && self.modalViewController == myFirstLoginViewController) {
[myFirstLoginViewController displayRegisteredFromUI:viewCtrl forUser:username withDisplayName:displayName onDomain:domain];
}
[self updateStatusSubView];
}
-(void) displayRegisteringFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain {
if (myFirstLoginViewController != nil && self.modalViewController == myFirstLoginViewController) {
[myFirstLoginViewController displayRegisteringFromUI:viewCtrl forUser:username withDisplayName:displayName onDomain:domain];
}
[self updateStatusSubView];
}
-(void) displayRegistrationFailedFromUI:(UIViewController*) viewCtrl forUser:(NSString*) user withDisplayName:(NSString*) displayName onDomain:(NSString*)domain forReason:(NSString*) reason {
if (myFirstLoginViewController != nil && self.modalViewController == myFirstLoginViewController) {
[myFirstLoginViewController displayRegistrationFailedFromUI:viewCtrl forUser:user withDisplayName:displayName onDomain:domain forReason:reason];
}
[self updateStatusSubView];
}
-(void) displayNotRegisteredFromUI:(UIViewController*) viewCtrl {
if (myFirstLoginViewController != nil && self.modalViewController == myFirstLoginViewController) {
[myFirstLoginViewController displayNotRegisteredFromUI:viewCtrl];
}
[self updateStatusSubView];
}
-(void) firstVideoFrameDecoded: (LinphoneCall*) call {
[mIncallViewController firstVideoFrameDecoded:call];
}
@end

File diff suppressed because it is too large Load diff

View file

@ -1,34 +0,0 @@
/* StatusSubViewController.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 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>
#include "linphonecore.h"
@interface StatusSubViewController : UIViewController {
UIImageView* image;
UIActivityIndicatorView* spinner;
UILabel* label;
}
@property (nonatomic, retain) IBOutlet UIImageView* image;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* spinner;
@property (nonatomic, retain) IBOutlet UILabel* label;
-(BOOL) updateWithRegistrationState:(LinphoneRegistrationState)state message:(NSString*) message;
@end

View file

@ -1,99 +0,0 @@
/* StatusSubViewController.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 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 "StatusSubViewController.h"
@implementation StatusSubViewController
@synthesize image;
@synthesize spinner;
@synthesize label;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)viewDidUnload
{
[super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
-(BOOL) updateWithRegistrationState:(LinphoneRegistrationState)state message:(NSString*) message {
label.hidden = NO;
switch(state) {
case LinphoneRegistrationCleared:
/* image.hidden = NO;
[image setImage:[UIImage imageNamed:@"status_orange.png"]];
[spinner stopAnimating];
[label setText:message != nil ? message : NSLocalizedString(@"No SIP account defined", nil)];
return YES;*/
case LinphoneRegistrationFailed:
image.hidden = NO;
[image setImage:[UIImage imageNamed:@"status_red.png"]];
[spinner stopAnimating];
[label setText:message];
return NO;
case LinphoneRegistrationNone:
image.hidden = NO;
[image setImage:[UIImage imageNamed:@"status_gray.png"]];
[spinner stopAnimating];
[label setText:message];
return NO;
case LinphoneRegistrationProgress:
image.hidden = YES;
spinner.hidden = NO;
[spinner startAnimating];
[label setText:message];
return NO;
case LinphoneRegistrationOk:
image.hidden = NO;
[image setImage:[UIImage imageNamed:@"status_green.png"]];
[spinner stopAnimating];
[label setText:message];
return YES;
}
return NO;
}
@end

View file

@ -0,0 +1,142 @@
/*
ColorConverter
you can use it to convert color from RGB space to HSL space and back.
HSL2RGB copied from GLPaint Apple sample: http://developer.apple.com/library/ios/#samplecode/GLPaint/Introduction/Intro.html
RGB2HSL translated from http://www.geekymonkey.com/Programming/CSharp/RGB2HSL_HSL2RGB.htm
From: https://github.com/alessani/ColorConverter
*/
void HSL2RGB(float h, float s, float l, float* outR, float* outG, float* outB)
{
float temp1,
temp2;
float temp[3];
int i;
// Check for saturation. If there isn't any just return the luminance value for each, which results in gray.
if(s == 0.0) {
if(outR)
*outR = l;
if(outG)
*outG = l;
if(outB)
*outB = l;
return;
}
// Test for luminance and compute temporary values based on luminance and saturation
if(l < 0.5)
temp2 = l * (1.0 + s);
else
temp2 = l + s - l * s;
temp1 = 2.0 * l - temp2;
// Compute intermediate values based on hue
temp[0] = h + 1.0 / 3.0;
temp[1] = h;
temp[2] = h - 1.0 / 3.0;
for(i = 0; i < 3; ++i) {
// Adjust the range
if(temp[i] < 0.0)
temp[i] += 1.0;
if(temp[i] > 1.0)
temp[i] -= 1.0;
if(6.0 * temp[i] < 1.0)
temp[i] = temp1 + (temp2 - temp1) * 6.0 * temp[i];
else {
if(2.0 * temp[i] < 1.0)
temp[i] = temp2;
else {
if(3.0 * temp[i] < 2.0)
temp[i] = temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp[i]) * 6.0;
else
temp[i] = temp1;
}
}
}
// Assign temporary values to R, G, B
if(outR)
*outR = temp[0];
if(outG)
*outG = temp[1];
if(outB)
*outB = temp[2];
}
void RGB2HSL(float r, float g, float b, float* outH, float* outS, float* outL)
{
/*r = r/255.0f;
g = g/255.0f;
b = b/255.0f;*/
float h,s, l, v, m, vm, r2, g2, b2;
h = 0;
s = 0;
l = 0;
v = MAX(r, g);
v = MAX(v, b);
m = MIN(r, g);
m = MIN(m, b);
l = (m+v)/2.0f;
if (l <= 0.0){
if(outH)
*outH = h;
if(outS)
*outS = s;
if(outL)
*outL = l;
return;
}
vm = v - m;
s = vm;
if (s > 0.0f){
s/= (l <= 0.5f) ? (v + m) : (2.0 - v - m);
}else{
if(outH)
*outH = h;
if(outS)
*outS = s;
if(outL)
*outL = l;
return;
}
r2 = (v - r)/vm;
g2 = (v - g)/vm;
b2 = (v - b)/vm;
if (r == v){
h = (g == m ? 5.0f + b2 : 1.0f - g2);
}else if (g == v){
h = (b == m ? 1.0f + r2 : 3.0 - b2);
}else{
h = (r == m ? 3.0f + g2 : 5.0f - r2);
}
h/=6.0f;
if(outH)
*outH = h;
if(outS)
*outS = s;
if(outL)
*outL = l;
}

View file

@ -0,0 +1,14 @@
/*
ColorConverter
you can use it to convert color from RGB space to HSL space and back.
HSL2RGB copied from GLPaint Apple sample: http://developer.apple.com/library/ios/#samplecode/GLPaint/Introduction/Intro.html
RGB2HSL translated from http://www.geekymonkey.com/Programming/CSharp/RGB2HSL_HSL2RGB.htm
From: https://github.com/alessani/ColorConverter
*/
void HSL2RGB(float h, float s, float l, float* outR, float* outG, float* outB);
void RGB2HSL(float r, float g, float b, float* outH, float* outS, float* outL);

View file

@ -20,26 +20,18 @@
#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>
@interface Contact : NSObject {
ABRecordRef record;
NSString* numberType;
}
-(id) initWithRecord:(ABRecordRef) record ofType:(NSString*) type;
@property (nonatomic, readonly) ABRecordRef record;
@property (nonatomic, readonly) NSString* numberType;
@end
@interface FastAddressBook : NSObject {
NSMutableDictionary* mAddressBookMap;
NSMutableDictionary* addressBookMap;
ABAddressBookRef addressBook;
}
-(Contact*) getMatchingRecord:(NSString*) number ;
+(NSString*) appendCountryCodeIfPossible:(NSString*) number ;
+(NSString*) normalizePhoneNumber:(NSString*) number ;
-(id) init ;
@property (nonatomic, readonly) ABAddressBookRef addressBook;
+ (BOOL)isSipURI:(NSString*)address;
+ (NSString*)getContactDisplayName:(ABRecordRef)contact;
+ (UIImage*)getContactImage:(ABRecordRef)contact thumbnail:(BOOL)thumbnail;
- (ABRecordRef)getContact:(NSString*)address;
+ (NSString*)appendCountryCodeIfPossible:(NSString*)number;
+ (NSString*)normalizePhoneNumber:(NSString*)number;
+ (NSString*)normalizeSipURI:(NSString*)address;
@end

View file

@ -0,0 +1,179 @@
/* FastAddressBook.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 "FastAddressBook.h"
#import "LinphoneManager.h"
@implementation FastAddressBook
+ (NSString*)getContactDisplayName:(ABRecordRef)contact {
NSString *retString = nil;
if (contact) {
CFStringRef lDisplayName = ABRecordCopyCompositeName(contact);
if(lDisplayName != NULL) {
retString = [NSString stringWithString:(NSString*)lDisplayName];
CFRelease(lDisplayName);
}
}
return retString;
}
+ (UIImage*)getContactImage:(ABRecordRef)contact thumbnail:(BOOL)thumbnail {
UIImage* retImage = nil;
if (contact && ABPersonHasImageData(contact)) {
CFDataRef imgData = ABPersonCopyImageDataWithFormat(contact, thumbnail?
kABPersonImageFormatThumbnail: kABPersonImageFormatOriginalSize);
retImage = [UIImage imageWithData:(NSData *)imgData];
CFRelease(imgData);
}
return retImage;
}
- (ABRecordRef)getContact:(NSString*)address {
@synchronized (addressBookMap){
return (ABRecordRef)[addressBookMap objectForKey:address];
}
}
+ (BOOL)isSipURI:(NSString*)address {
return [address hasPrefix:@"sip:"];
}
+ (NSString*)appendCountryCodeIfPossible:(NSString*)number {
if (![number hasPrefix:@"+"] && ![number hasPrefix:@"00"]) {
NSString* lCountryCode = [[NSUserDefaults standardUserDefaults] stringForKey:@"countrycode_preference"];
if (lCountryCode && [lCountryCode length]>0) {
//append country code
return [lCountryCode stringByAppendingString:number];
}
}
return number;
}
+ (NSString*)normalizeSipURI:(NSString*)address {
NSString* ret = address;
if([address rangeOfString:@"@"].location != NSNotFound) {
if([address rangeOfString:@"sip:" options:NSCaseInsensitiveSearch].location == 0) {
// have to be sure that start with sip: in lower case
ret = [ret substringFromIndex:4];
}
ret = [@"sip:" stringByAppendingString:ret];
}
return ret;
}
+ (NSString*)normalizePhoneNumber:(NSString*)address {
NSMutableString* lNormalizedAddress = [NSMutableString stringWithString:address];
[lNormalizedAddress replaceOccurrencesOfString:@" "
withString:@""
options:0
range:NSMakeRange(0, [lNormalizedAddress length])];
[lNormalizedAddress replaceOccurrencesOfString:@"("
withString:@""
options:0
range:NSMakeRange(0, [lNormalizedAddress length])];
[lNormalizedAddress replaceOccurrencesOfString:@")"
withString:@""
options:0
range:NSMakeRange(0, [lNormalizedAddress length])];
[lNormalizedAddress replaceOccurrencesOfString:@"-"
withString:@""
options:0
range:NSMakeRange(0, [lNormalizedAddress length])];
return [FastAddressBook appendCountryCodeIfPossible:lNormalizedAddress];
}
- (FastAddressBook*)init {
if ((self = [super init]) != nil) {
addressBookMap = [[NSMutableDictionary alloc] init];
addressBook = ABAddressBookCreate();
ABAddressBookRegisterExternalChangeCallback (addressBook, sync_address_book, self);
[self loadData];
}
return self;
}
- (void)loadData {
ABAddressBookRevert(addressBook);
@synchronized (addressBookMap) {
[addressBookMap removeAllObjects];
NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);
for (id lPerson in lContacts) {
// Phone
{
ABMultiValueRef lMap = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonPhoneProperty);
if(lMap) {
for (int i=0; i<ABMultiValueGetCount(lMap); i++) {
CFStringRef lValue = ABMultiValueCopyValueAtIndex(lMap, i);
CFStringRef lLabel = ABMultiValueCopyLabelAtIndex(lMap, i);
CFStringRef lLocalizedLabel = ABAddressBookCopyLocalizedLabel(lLabel);
NSString* lNormalizedKey = [FastAddressBook normalizePhoneNumber:(NSString*)lValue];
[addressBookMap setObject:lPerson forKey:lNormalizedKey];
CFRelease(lValue);
if (lLabel) CFRelease(lLabel);
if (lLocalizedLabel) CFRelease(lLocalizedLabel);
}
CFRelease(lMap);
}
}
// SIP
{
ABMultiValueRef lMap = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonInstantMessageProperty);
if(lMap) {
for(int i = 0; i < ABMultiValueGetCount(lMap); ++i) {
CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i);
BOOL add = false;
if(CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) {
if(CFStringCompare((CFStringRef)kContactSipField, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) {
add = true;
}
} else {
add = true;
}
if(add) {
CFStringRef lValue = CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey);
NSString* lNormalizedKey = [FastAddressBook normalizeSipURI:(NSString*)lValue];
[addressBookMap setObject:lPerson forKey:lNormalizedKey];
}
CFRelease(lDict);
}
CFRelease(lMap);
}
}
}
CFRelease(lContacts);
}
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneAddressBookUpdate object:self];
}
void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) {
FastAddressBook* fastAddressBook = (FastAddressBook*)context;
[fastAddressBook loadData];
}
- (void)dealloc {
ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, self);
CFRelease(addressBook);
[addressBookMap release];
[super dealloc];
}
@end

View file

@ -0,0 +1,37 @@
//
// OrderedDictionary.h
// OrderedDictionary
//
// Created by Matt Gallagher on 19/12/08.
// Copyright 2008 Matt Gallagher. All rights reserved.
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software. Permission is granted to anyone to
// use this software for any purpose, including commercial applications, and to
// alter it and redistribute it freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source
// distribution.
//
@interface OrderedDictionary : NSMutableDictionary
{
NSMutableDictionary *dictionary;
NSMutableArray *array;
}
- (void)insertObject:(id)anObject forKey:(id)aKey atIndex:(NSUInteger)anIndex;
// Added by Diorcet Yann
- (void)insertObject:(id)anObject forKey:(id)aKey selector:(SEL) sel;
//
- (id)keyAtIndex:(NSUInteger)anIndex;
- (NSEnumerator *)reverseKeyEnumerator;
@end

View file

@ -0,0 +1,170 @@
//
// OrderedDictionary.m
// OrderedDictionary
//
// Created by Matt Gallagher on 19/12/08.
// Copyright 2008 Matt Gallagher. All rights reserved.
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software. Permission is granted to anyone to
// use this software for any purpose, including commercial applications, and to
// alter it and redistribute it freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source
// distribution.
//
#import "OrderedDictionary.h"
NSString *DescriptionForObject(NSObject *object, id locale, NSUInteger indent)
{
NSString *objectString;
if ([object isKindOfClass:[NSString class]])
{
objectString = (NSString *)[[object retain] autorelease];
}
else if ([object respondsToSelector:@selector(descriptionWithLocale:indent:)])
{
objectString = [(NSDictionary *)object descriptionWithLocale:locale indent:indent];
}
else if ([object respondsToSelector:@selector(descriptionWithLocale:)])
{
objectString = [(NSSet *)object descriptionWithLocale:locale];
}
else
{
objectString = [object description];
}
return objectString;
}
@implementation OrderedDictionary
- (id)init
{
return [self initWithCapacity:0];
}
- (id)initWithCapacity:(NSUInteger)capacity
{
self = [super init];
if (self != nil)
{
dictionary = [[NSMutableDictionary alloc] initWithCapacity:capacity];
array = [[NSMutableArray alloc] initWithCapacity:capacity];
}
return self;
}
- (void)dealloc
{
[dictionary release];
[array release];
[super dealloc];
}
- (id)copy
{
return [self mutableCopy];
}
- (void)setObject:(id)anObject forKey:(id)aKey
{
if (![dictionary objectForKey:aKey])
{
[array addObject:aKey];
}
[dictionary setObject:anObject forKey:aKey];
}
- (void)removeObjectForKey:(id)aKey
{
[dictionary removeObjectForKey:aKey];
[array removeObject:aKey];
}
- (NSUInteger)count
{
return [dictionary count];
}
- (id)objectForKey:(id)aKey
{
return [dictionary objectForKey:aKey];
}
- (NSEnumerator *)keyEnumerator
{
return [array objectEnumerator];
}
- (NSEnumerator *)reverseKeyEnumerator
{
return [array reverseObjectEnumerator];
}
// Added by Diorcet Yann
- (void)insertObject:(id)anObject forKey:(id)aKey selector:(SEL)comparator
{
if ([dictionary objectForKey:aKey])
{
[self removeObjectForKey:aKey];
}
NSUInteger anIndex;
for(anIndex = 0; anIndex < [array count]; ++anIndex) {
NSComparisonResult result = (NSComparisonResult) [aKey performSelector:comparator withObject:[array objectAtIndex: anIndex]];
if(result <= 0) {
break;
}
}
[array insertObject:aKey atIndex:anIndex];
[dictionary setObject:anObject forKey:aKey];
}
//
- (void)insertObject:(id)anObject forKey:(id)aKey atIndex:(NSUInteger)anIndex
{
if ([dictionary objectForKey:aKey])
{
[self removeObjectForKey:aKey];
}
[array insertObject:aKey atIndex:anIndex];
[dictionary setObject:anObject forKey:aKey];
}
- (id)keyAtIndex:(NSUInteger)anIndex
{
return [array objectAtIndex:anIndex];
}
- (NSString *)descriptionWithLocale:(id)locale indent:(NSUInteger)level
{
NSMutableString *indentString = [NSMutableString string];
NSUInteger i, count = level;
for (i = 0; i < count; i++)
{
[indentString appendFormat:@" "];
}
NSMutableString *description = [NSMutableString string];
[description appendFormat:@"%@{\n", indentString];
for (NSObject *key in self)
{
[description appendFormat:@"%@ %@ = %@;\n",
indentString,
DescriptionForObject(key, locale, level),
DescriptionForObject([self objectForKey:key], locale, level)];
}
[description appendFormat:@"%@}\n", indentString];
return description;
}
@end

View file

@ -0,0 +1,27 @@
//
// TPMultiLayoutViewController.h
//
// Created by Michael Tyson on 14/08/2011.
// Copyright 2011 A Tasty Pixel. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TPMultiLayoutViewController : UIViewController {
UIView *portraitView;
UIView *landscapeView;
@private
NSDictionary *portraitAttributes;
NSDictionary *landscapeAttributes;
BOOL viewIsCurrentlyPortrait;
}
// Call directly to use with custom animation (override willRotateToInterfaceOrientation to disable the switch there)
- (void)applyLayoutForInterfaceOrientation:(UIInterfaceOrientation)newOrientation;
@property (nonatomic, retain) IBOutlet UIView *landscapeView;
@property (nonatomic, retain) IBOutlet UIView *portraitView;
@property (assign) BOOL viewIsCurrentlyPortrait;
@end

View file

@ -0,0 +1,238 @@
//
// TPMultiLayoutViewController.m
//
// Created by Michael Tyson on 14/08/2011.
// Copyright 2011 A Tasty Pixel. All rights reserved.
//
#import "TPMultiLayoutViewController.h"
#define VERBOSE_MATCH_FAIL 1 // Comment this out to be less verbose when associated views can't be found
@interface TPMultiLayoutViewController ()
- (NSDictionary*)attributeTableForViewHierarchy:(UIView*)rootView associateWithViewHierarchy:(UIView*)associatedRootView;
- (void)addAttributesForSubviewHierarchy:(UIView*)view associatedWithSubviewHierarchy:(UIView*)associatedView toTable:(NSMutableDictionary*)table;
- (UIView*)findAssociatedViewForView:(UIView*)view amongViews:(NSArray*)views;
- (void)applyAttributeTable:(NSDictionary*)table toViewHierarchy:(UIView*)view;
- (NSDictionary*)attributesForView:(UIView*)view;
- (void)applyAttributes:(NSDictionary*)attributes toView:(UIView*)view;
- (BOOL)shouldDescendIntoSubviewsOfView:(UIView*)view;
@end
@implementation TPMultiLayoutViewController
@synthesize portraitView, landscapeView, viewIsCurrentlyPortrait;
#pragma mark - View lifecycle
- (void)viewDidLoad {
[super viewDidLoad];
// Construct attribute tables
portraitAttributes = [[self attributeTableForViewHierarchy:portraitView associateWithViewHierarchy:self.view] retain];
landscapeAttributes = [[self attributeTableForViewHierarchy:landscapeView associateWithViewHierarchy:self.view] retain];
viewIsCurrentlyPortrait = (self.view == portraitView);
// Don't need to retain the original template view hierarchies any more
self.portraitView = nil;
self.landscapeView = nil;
}
- (void)viewDidUnload {
[super viewDidUnload];
[portraitAttributes release];
portraitAttributes = nil;
[landscapeAttributes release];
landscapeAttributes = nil;
}
- (void)dealloc {
[portraitAttributes release];
portraitAttributes = nil;
[landscapeAttributes release];
landscapeAttributes = nil;
[super dealloc];
}
- (void)viewWillAppear:(BOOL)animated {
// Display correct layout for orientation
/*if ( (UIInterfaceOrientationIsPortrait(self.interfaceOrientation) && !viewIsCurrentlyPortrait) ||
(UIInterfaceOrientationIsLandscape(self.interfaceOrientation) && viewIsCurrentlyPortrait) ) {
[self applyLayoutForInterfaceOrientation:self.interfaceOrientation];
}*/
[super viewWillAppear:animated];
}
#pragma mark - Rotation
- (void)applyLayoutForInterfaceOrientation:(UIInterfaceOrientation)newOrientation {
NSDictionary *table = UIInterfaceOrientationIsPortrait(newOrientation) ? portraitAttributes : landscapeAttributes;
[self applyAttributeTable:table toViewHierarchy:self.view];
viewIsCurrentlyPortrait = UIInterfaceOrientationIsPortrait(newOrientation);
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
//if ( (UIInterfaceOrientationIsPortrait(toInterfaceOrientation) && !viewIsCurrentlyPortrait) ||
// (UIInterfaceOrientationIsLandscape(toInterfaceOrientation) && viewIsCurrentlyPortrait) ) {
[self applyLayoutForInterfaceOrientation:toInterfaceOrientation];
//}
}
#pragma mark - Helpers
- (NSDictionary*)attributeTableForViewHierarchy:(UIView*)rootView associateWithViewHierarchy:(UIView*)associatedRootView {
NSMutableDictionary *table = [NSMutableDictionary dictionary];
[self addAttributesForSubviewHierarchy:rootView associatedWithSubviewHierarchy:associatedRootView toTable:table];
return table;
}
- (void)addAttributesForSubviewHierarchy:(UIView*)view associatedWithSubviewHierarchy:(UIView*)associatedView toTable:(NSMutableDictionary*)table {
[table setObject:[self attributesForView:view] forKey:[NSValue valueWithPointer:associatedView]];
if ( ![self shouldDescendIntoSubviewsOfView:view] ) return;
for ( UIView *subview in view.subviews ) {
UIView *associatedSubView = (view == associatedView ? subview : [self findAssociatedViewForView:subview amongViews:associatedView.subviews]);
if ( associatedSubView ) {
[self addAttributesForSubviewHierarchy:subview associatedWithSubviewHierarchy:associatedSubView toTable:table];
}
}
}
- (UIView*)findAssociatedViewForView:(UIView*)view amongViews:(NSArray*)views {
// First try to match tag
if ( view.tag != 0 ) {
UIView *associatedView = [[views filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"tag = %d", view.tag]] lastObject];
if ( associatedView ) return associatedView;
}
// Next, try to match class, targets and actions, if it's a control
if ( [view isKindOfClass:[UIControl class]] && [[(UIControl*)view allTargets] count] > 0 ) {
for ( UIView *otherView in views ) {
if ( [otherView isKindOfClass:[view class]]
&& [[(UIControl*)otherView allTargets] isEqualToSet:[(UIControl*)view allTargets]]
&& [(UIControl*)otherView allControlEvents] == [(UIControl*)view allControlEvents] ) {
// Try to match all actions and targets for each associated control event
BOOL allActionsMatch = YES;
UIControlEvents controlEvents = [(UIControl*)otherView allControlEvents];
for ( id target in [(UIControl*)otherView allTargets] ) {
// Iterate over each bit in the UIControlEvents bitfield
for ( NSInteger i=0; i<sizeof(UIControlEvents)*8; i++ ) {
UIControlEvents event = 1 << i;
if ( !(controlEvents & event) ) continue;
if ( ![[(UIControl*)otherView actionsForTarget:target forControlEvent:event] isEqualToArray:[(UIControl*)view actionsForTarget:target forControlEvent:event]] ) {
allActionsMatch = NO;
break;
}
}
if ( !allActionsMatch ) break;
}
if ( allActionsMatch ) {
return otherView;
}
}
}
}
// Next, try to match title or image, if it's a button
if ( [view isKindOfClass:[UIButton class]] ) {
for ( UIView *otherView in views ) {
if ( [otherView isKindOfClass:[view class]] && [[(UIButton*)otherView titleForState:UIControlStateNormal] isEqualToString:[(UIButton*)view titleForState:UIControlStateNormal]] ) {
return otherView;
}
}
for ( UIView *otherView in views ) {
if ( [otherView isKindOfClass:[view class]] && [(UIButton*)otherView imageForState:UIControlStateNormal] == [(UIButton*)view imageForState:UIControlStateNormal] ) {
return otherView;
}
}
}
// Try to match by title if it's a label
if ( [view isKindOfClass:[UILabel class]] ) {
for ( UIView *otherView in views ) {
if ( [otherView isKindOfClass:[view class]] && [[(UILabel*)otherView text] isEqualToString:[(UILabel*)view text]] ) {
return otherView;
}
}
}
// Try to match by text/placeholder if it's a text field
if ( [view isKindOfClass:[UITextField class]] ) {
for ( UIView *otherView in views ) {
if ( [otherView isKindOfClass:[view class]] && ([(UITextField*)view text] || [(UITextField*)view placeholder]) &&
((![(UITextField*)view text] && ![(UITextField*)otherView text]) || [[(UITextField*)otherView text] isEqualToString:[(UITextField*)view text]]) &&
((![(UITextField*)view placeholder] && ![(UITextField*)otherView placeholder]) || [[(UITextField*)otherView placeholder] isEqualToString:[(UITextField*)view placeholder]]) ) {
return otherView;
}
}
}
// Finally, try to match by class
NSArray *matches = [views filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"class = %@", [view class]]];
if ( [matches count] == 1 ) return [matches lastObject];
#if VERBOSE_MATCH_FAIL
NSMutableString *path = [NSMutableString string];
for ( UIView *v = view.superview; v != nil; v = v.superview ) {
[path insertString:[NSString stringWithFormat:@"%@ => ", NSStringFromClass([v class])] atIndex:0];
}
NSLog(@"Couldn't find match for %@%@", path, NSStringFromClass([view class]));
#endif
return nil;
}
- (void)applyAttributeTable:(NSDictionary*)table toViewHierarchy:(UIView*)view {
NSDictionary *attributes = [table objectForKey:[NSValue valueWithPointer:view]];
if ( attributes ) {
[self applyAttributes:attributes toView:view];
}
//if ( view.hidden ) return;
if ( ![self shouldDescendIntoSubviewsOfView:view] ) return;
for ( UIView *subview in view.subviews ) {
[self applyAttributeTable:table toViewHierarchy:subview];
}
}
- (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 numberWithBool:view.hidden] forKey:@"hidden"];
[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.hidden = [[attributes objectForKey:@"hidden"] boolValue];
view.autoresizingMask = [[attributes objectForKey:@"autoresizingMask"] integerValue];
}
- (BOOL)shouldDescendIntoSubviewsOfView:(UIView*)view {
if ( [view isKindOfClass:[UISlider class]] ||
[view isKindOfClass:[UISwitch class]] ||
[view isKindOfClass:[UITextField class]] ||
[view isKindOfClass:[UIWebView class]] ||
[view isKindOfClass:[UITableView class]] ||
[view isKindOfClass:[UIPickerView class]] ||
[view isKindOfClass:[UIDatePicker class]] ||
[view isKindOfClass:[UITextView class]] ||
[view isKindOfClass:[UIProgressView class]] ||
[view isKindOfClass:[UISegmentedControl class]] ) return NO;
return YES;
}
@end

View file

@ -0,0 +1,30 @@
//
// UACellBackgroundView.h
// Ambiance
//
// Created by Matt Coneybeare on 1/31/10.
// Copyright 2010 Urban Apps LLC. All rights reserved.
//
// Modified by Diorcet Yann on 07/12/12
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef enum {
UACellBackgroundViewPositionSingle = 0,
UACellBackgroundViewPositionTop,
UACellBackgroundViewPositionBottom,
UACellBackgroundViewPositionMiddle
} UACellBackgroundViewPosition;
@interface UACellBackgroundView : UIView {
UACellBackgroundViewPosition position;
BOOL automaticPositioning;
}
@property(nonatomic) UACellBackgroundViewPosition position;
@property(nonatomic, copy) UIColor *backgroundColor;
@property(assign) BOOL automaticPositioning;
@end

View file

@ -0,0 +1,273 @@
//
// UACellBackgroundView.m
// Ambiance
//
// Created by Matt Coneybeare on 1/31/10.
// Copyright 2010 Urban Apps LLC. All rights reserved.
//
// Modified by Diorcet Yann on 07/12/12
#define kDefaultMargin 10
#import "UACellBackgroundView.h"
static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth,float ovalHeight);
@implementation UACellBackgroundView
@synthesize position;
@synthesize backgroundColor;
@synthesize automaticPositioning;
- (void)initUACellBackgroundView {
[super setBackgroundColor:[UIColor clearColor]];
self->automaticPositioning = TRUE;
}
- (id)init {
self = [super init];
if(self != nil) {
[self initUACellBackgroundView];
}
return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if(self != nil) {
[self initUACellBackgroundView];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if(self != nil) {
[self initUACellBackgroundView];
}
return self;
}
- (BOOL)isOpaque {
return NO;
}
- (void)setBackgroundColor:(UIColor *)abackgroundColor {
if(self->backgroundColor != nil) {
[self->backgroundColor release];
}
self->backgroundColor = [[UIColor alloc]initWithCGColor:abackgroundColor.CGColor];
[self setNeedsDisplay];
}
- (void)layoutSubviews {
[super layoutSubviews];
if(!automaticPositioning)
return;
//
// Auto found position
//
UIView *view = [self superview];
// Find TableViewCell
if(view != nil && ![view isKindOfClass:[UITableView class]]) view = [view superview];
UIView *cellView = [self superview];
// Find TableViewCell
if(cellView != nil && ![cellView isKindOfClass:[UITableViewCell class]]) cellView = [cellView superview];
if(view != nil && cellView != nil) {
UITableViewCell *cell = (UITableViewCell*)cellView;
UITableView *tableView = (UITableView*)view;
if([tableView style] == UITableViewStyleGrouped) {
NSIndexPath *path = [tableView indexPathForCell:cell];
if(path) {
int count = [tableView numberOfRowsInSection:[path section]];
// Set Position for background view
if([path row] == 0) {
if([path row] == (count - 1)) {
[self setPosition:UACellBackgroundViewPositionSingle];
} else {
[self setPosition:UACellBackgroundViewPositionTop];
}
} else if([path row] == (count - 1)) {
[self setPosition:UACellBackgroundViewPositionBottom];
} else {
[self setPosition:UACellBackgroundViewPositionMiddle];
}
}
} else {
[self setPosition:UACellBackgroundViewPositionMiddle];
}
}
[self setNeedsDisplay];
}
- (void)drawRect:(CGRect)aRect {
// Drawing code
CGContextRef c = UIGraphicsGetCurrentContext();
int lineWidth = 1;
CGRect rect = [self bounds];
CGFloat minx = CGRectGetMinX(rect), midx = CGRectGetMidX(rect), maxx = CGRectGetMaxX(rect);
CGFloat miny = CGRectGetMinY(rect), midy = CGRectGetMidY(rect), maxy = CGRectGetMaxY(rect);
miny -= 1;
CGFloat locations[2] = { 0.0, 1.0 };
CGColorSpaceRef myColorspace = CGColorGetColorSpace([[self backgroundColor] CGColor]);
CGGradientRef myGradient = nil;
const CGFloat *default_components = CGColorGetComponents([[self backgroundColor] CGColor]);
CGFloat components[8] = {default_components[0], default_components[1], default_components[2], default_components[3], default_components[0] * 0.766f, default_components[1] * 0.766f, default_components[2] * 0.766f, default_components[3]};
CGContextSetStrokeColorWithColor(c, [[UIColor grayColor] CGColor]);
CGContextSetLineWidth(c, lineWidth);
CGContextSetAllowsAntialiasing(c, YES);
CGContextSetShouldAntialias(c, YES);
if (position == UACellBackgroundViewPositionTop) {
miny += 1;
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, minx, maxy);
CGPathAddArcToPoint(path, NULL, minx, miny, midx, miny, kDefaultMargin);
CGPathAddArcToPoint(path, NULL, maxx, miny, maxx, maxy, kDefaultMargin);
CGPathAddLineToPoint(path, NULL, maxx, maxy);
CGPathAddLineToPoint(path, NULL, minx, maxy);
CGPathCloseSubpath(path);
// Fill and stroke the path
CGContextSaveGState(c);
CGContextAddPath(c, path);
CGContextClip(c);
myGradient = CGGradientCreateWithColorComponents(myColorspace, components, locations, 2);
CGContextDrawLinearGradient(c, myGradient, CGPointMake(minx,miny), CGPointMake(minx,maxy), 0);
CGContextAddPath(c, path);
CGPathRelease(path);
CGContextStrokePath(c);
CGContextRestoreGState(c);
} else if (position == UACellBackgroundViewPositionBottom) {
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, minx, miny);
CGPathAddArcToPoint(path, NULL, minx, maxy, midx, maxy, kDefaultMargin);
CGPathAddArcToPoint(path, NULL, maxx, maxy, maxx, miny, kDefaultMargin);
CGPathAddLineToPoint(path, NULL, maxx, miny);
CGPathAddLineToPoint(path, NULL, minx, miny);
CGPathCloseSubpath(path);
// Fill and stroke the path
CGContextSaveGState(c);
CGContextAddPath(c, path);
CGContextClip(c);
myGradient = CGGradientCreateWithColorComponents(myColorspace, components, locations, 2);
CGContextDrawLinearGradient(c, myGradient, CGPointMake(minx,miny), CGPointMake(minx,maxy), 0);
CGContextAddPath(c, path);
CGPathRelease(path);
CGContextStrokePath(c);
CGContextRestoreGState(c);
} else if (position == UACellBackgroundViewPositionMiddle) {
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, minx, miny);
CGPathAddLineToPoint(path, NULL, maxx, miny);
CGPathAddLineToPoint(path, NULL, maxx, maxy);
CGPathAddLineToPoint(path, NULL, minx, maxy);
CGPathAddLineToPoint(path, NULL, minx, miny);
CGPathCloseSubpath(path);
// Fill and stroke the path
CGContextSaveGState(c);
CGContextAddPath(c, path);
CGContextClip(c);
myGradient = CGGradientCreateWithColorComponents(myColorspace, components, locations, 2);
CGContextDrawLinearGradient(c, myGradient, CGPointMake(minx,miny), CGPointMake(minx,maxy), 0);
CGContextAddPath(c, path);
CGPathRelease(path);
CGContextStrokePath(c);
CGContextRestoreGState(c);
} else if (position == UACellBackgroundViewPositionSingle) {
miny += 1;
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, minx, midy);
CGPathAddArcToPoint(path, NULL, minx, miny, midx, miny, kDefaultMargin);
CGPathAddArcToPoint(path, NULL, maxx, miny, maxx, midy, kDefaultMargin);
CGPathAddArcToPoint(path, NULL, maxx, maxy, midx, maxy, kDefaultMargin);
CGPathAddArcToPoint(path, NULL, minx, maxy, minx, midy, kDefaultMargin);
CGPathCloseSubpath(path);
// Fill and stroke the path
CGContextSaveGState(c);
CGContextAddPath(c, path);
CGContextClip(c);
myGradient = CGGradientCreateWithColorComponents(myColorspace, components, locations, 2);
CGContextDrawLinearGradient(c, myGradient, CGPointMake(minx,miny), CGPointMake(minx,maxy), 0);
CGContextAddPath(c, path);
CGPathRelease(path);
CGContextStrokePath(c);
CGContextRestoreGState(c);
}
CGColorSpaceRelease(myColorspace);
CGGradientRelease(myGradient);
return;
}
- (void)dealloc {
[backgroundColor release];
[super dealloc];
}
- (void)setPosition:(UACellBackgroundViewPosition)newPosition {
if (position != newPosition) {
position = newPosition;
[self setNeedsDisplay];
}
}
@end
static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth,float ovalHeight) {
float fw, fh;
if (ovalWidth == 0 || ovalHeight == 0) {// 1
CGContextAddRect(context, rect);
return;
}
CGContextSaveGState(context);// 2
CGContextTranslateCTM (context, CGRectGetMinX(rect),// 3
CGRectGetMinY(rect));
CGContextScaleCTM (context, ovalWidth, ovalHeight);// 4
fw = CGRectGetWidth (rect) / ovalWidth;// 5
fh = CGRectGetHeight (rect) / ovalHeight;// 6
CGContextMoveToPoint(context, fw, fh/2); // 7
CGContextAddArcToPoint(context, fw, fh, fw/2, fh, 1);// 8
CGContextAddArcToPoint(context, 0, fh, 0, fh/2, 1);// 9
CGContextAddArcToPoint(context, 0, 0, fw/2, 0, 1);// 10
CGContextAddArcToPoint(context, fw, 0, fw, fh/2, 1); // 11
CGContextClosePath(context);// 12
CGContextRestoreGState(context);// 13
}

View file

@ -1,6 +1,6 @@
/* GenericTabViewController.c
/* Utils.h
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,31 +15,32 @@
* 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 "GenericTabViewController.h"
#ifndef LINPHONE_UTILS_H
#define LINPHONE_UTILS_H
#define DYNAMIC_CAST(x, cls) \
({ \
cls *inst_ = (cls *)(x); \
[inst_ isKindOfClass:[cls class]]? inst_ : nil; \
})
typedef enum _LinphoneLoggerSeverity {
LinphoneLoggerLog = 0,
LinphoneLoggerDebug,
LinphoneLoggerWarning,
LinphoneLoggerError,
LinphoneLoggerFatal
} LinphoneLoggerSeverity;
@implementation GenericTabViewController
@synthesize header;
@interface LinphoneLogger : NSObject {
- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.tableHeaderView=header;
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self.tableView reloadData];
}
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
[self tableView:tableView didSelectRowAtIndexPath:indexPath];
}
+ (void)log:(LinphoneLoggerSeverity) severity format:(NSString *)format,...;
+ (void)logc:(LinphoneLoggerSeverity) severity format:(const char *)format,...;
@end
#endif

62
Classes/Utils/Utils.m Normal file
View file

@ -0,0 +1,62 @@
/* Utils.m
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "Utils.h"
#include "linphonecore.h"
@implementation LinphoneLogger
+ (void)log:(LinphoneLoggerSeverity) severity format:(NSString *)format,... {
va_list args;
va_start (args, format);
NSString *str = [[NSString alloc] initWithFormat: format arguments:args];
if(severity <= LinphoneLoggerLog) {
ms_message("%s", [str UTF8String]);
} else if(severity <= LinphoneLoggerDebug) {
ms_debug("%s", [str UTF8String]);
} else if(severity <= LinphoneLoggerWarning) {
ms_warning("%s", [str UTF8String]);
} else if(severity <= LinphoneLoggerError) {
ms_error("%s", [str UTF8String]);
} else if(severity <= LinphoneLoggerFatal) {
ms_fatal("%s", [str UTF8String]);
}
[str release];
va_end (args);
}
+ (void)logc:(LinphoneLoggerSeverity) severity format:(const char *)format,... {
va_list args;
va_start (args, format);
if(severity <= LinphoneLoggerLog) {
ortp_logv(ORTP_MESSAGE, format, args);
} else if(severity <= LinphoneLoggerDebug) {
ortp_logv(ORTP_DEBUG, format, args);
} else if(severity <= LinphoneLoggerWarning) {
ortp_logv(ORTP_WARNING, format, args);
} else if(severity <= LinphoneLoggerError) {
ortp_logv(ORTP_ERROR, format, args);
} else if(severity <= LinphoneLoggerFatal) {
ortp_logv(ORTP_FATAL, format, args);
}
va_end (args);
}
@end

Some files were not shown because too many files have changed in this diff Show more