Split main view in UICompositeViewController

This commit is contained in:
Yann Diorcet 2012-06-25 17:57:50 +02:00
parent 3dbced109b
commit 15d394318f
25 changed files with 615 additions and 723 deletions

View file

@ -19,10 +19,14 @@
#import <UIKit/UIKit.h>
#import "ChatTableViewController.h"
@interface ChatViewController : UIViewController {
ChatTableViewController *tableController;
}
@property (nonatomic, retain) IBOutlet ChatTableViewController* tableController;
- (IBAction)onNew:(id) event;
- (IBAction)onEdit:(id) event;

View file

@ -21,6 +21,12 @@
@implementation ChatViewController
@synthesize tableController;
- (id)init {
return [super initWithNibName:@"ChatViewController" bundle:[NSBundle mainBundle]];
}
- (IBAction)onNew: (id) event {
}

View file

@ -189,6 +189,14 @@
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">tableController</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="766067093"/>
</object>
<int key="connectionID">18</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
@ -315,7 +323,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">17</int>
<int key="maxID">18</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -344,6 +352,17 @@
<string key="candidateClassName">id</string>
</object>
</dictionary>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">tableController</string>
<string key="NS.object.0">ChatTableViewController</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">tableController</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">tableController</string>
<string key="candidateClassName">ChatTableViewController</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/ChatViewController.h</string>

View file

@ -35,6 +35,10 @@ typedef enum _HistoryView {
History_MAX
} HistoryView;
- (id)init {
return [super initWithNibName:@"ContactsViewController" bundle:[NSBundle mainBundle]];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self.tableView reloadData];

View file

@ -48,6 +48,10 @@
@synthesize zeroButton;
@synthesize hashButton;
- (id)init {
return [super initWithNibName:@"DialerViewController" bundle:[NSBundle mainBundle]];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
//TODO

View file

@ -34,6 +34,10 @@ typedef enum _HistoryView {
History_MAX
} HistoryView;
- (id)init {
return [super initWithNibName:@"HistoryViewController" bundle:[NSBundle mainBundle]];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self.tableView reloadData];

View file

@ -48,6 +48,10 @@ const NSInteger SECURE_BUTTON_TAG=5;
@synthesize testVideoView;
#endif
- (id)init {
return [super initWithNibName:@"InCallViewController" bundle:[NSBundle mainBundle]];
}
+ (bool)isInConference:(LinphoneCall*) call {
if (!call)
return false;

View file

@ -23,6 +23,10 @@
@synthesize addressLabel;
- (id)init {
return [super initWithNibName:@"IncomingCallViewController" bundle:[NSBundle mainBundle]];
}
- (IBAction)onAcceptClick:(id) event {
}

View file

@ -30,6 +30,10 @@
@synthesize microButton;
@synthesize speakerButton;
- (id)init {
return [super initWithNibName:@"UICallBar" bundle:[NSBundle mainBundle]];
}
- (void)viewDidLoad {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdate:) name:@"LinphoneCallUpdate" object:nil];
}

View file

@ -20,10 +20,12 @@
#import <UIKit/UIKit.h>
@interface UIChatCell : UITableViewCell {
UIImageView *avatarView;
UILabel *displayNameLabel;
UILabel *chatContentLabel;
}
@property (nonatomic, retain) IBOutlet UIImageView *avatarView;
@property (nonatomic, retain) IBOutlet UILabel* displayNameLabel;
@property (nonatomic, retain) IBOutlet UILabel* chatContentLabel;

View file

@ -21,6 +21,7 @@
@implementation UIChatCell
@synthesize avatarView;
@synthesize displayNameLabel;
@synthesize chatContentLabel;
@ -42,6 +43,9 @@
}
- (void)update{
[avatarView setImage:[UIImage imageNamed:@"avatar-small.png"]];
//
// Adapt size
//

View file

@ -123,7 +123,6 @@
<string key="NSFrame">{{276, 0}, {44, 44}}</string>
<reference key="NSSuperview" ref="316763236"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@ -198,6 +197,14 @@
</object>
<int key="connectionID">24</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">avatarView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="567463562"/>
</object>
<int key="connectionID">25</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">onDetails:</string>
@ -281,7 +288,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">24</int>
<int key="maxID">25</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -300,10 +307,15 @@
</object>
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="avatarView">UIImageView</string>
<string key="chatContentLabel">UILabel</string>
<string key="displayNameLabel">UILabel</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="avatarView">
<string key="name">avatarView</string>
<string key="candidateClassName">UIImageView</string>
</object>
<object class="IBToOneOutletInfo" key="chatContentLabel">
<string key="name">chatContentLabel</string>
<string key="candidateClassName">UILabel</string>

View file

@ -18,9 +18,47 @@
*/
#import <UIKit/UIKit.h>
#import "LinphoneManager.h"
@interface UICompositeViewDescription: NSObject{
@public
NSString *content;
NSString *stateBar;
BOOL stateBarEnabled;
NSString *tabBar;
BOOL tabBarEnabled;
BOOL fullscreen;
}
- (id)copy;
- (id)init:(NSString *)content stateBar:(NSString*)stateBar
stateBarEnabled:(BOOL) stateBarEnabled
tabBar:(NSString*)tabBar
tabBarEnabled:(BOOL) tabBarEnabled
fullscreen:(BOOL) fullscreen;
@end
@interface UICompositeViewController : UIViewController {
@private
UIView *stateBarView;
UIViewController *stateBarViewController;
UIView *contentView;
UIViewController *contentViewController;
UIView *tabBarView;
UIViewController *tabBarViewController;
NSMutableDictionary *viewControllerCache;
UICompositeViewDescription *currentViewDescription;
}
@property (nonatomic, retain) IBOutlet UIView* stateBarView;
@property (nonatomic, retain) IBOutlet UIView* contentView;
@property (nonatomic, retain) IBOutlet UIView* tabBarView;
- (void) changeView:(UICompositeViewDescription *)description;
- (void) setFullScreen:(BOOL) enabled;
- (void) setToolBarHidden:(BOOL) hidden;
- (UIViewController *) getCurrentViewController;
@end

View file

@ -19,6 +19,267 @@
#import "UICompositeViewController.h"
@implementation UICompositeViewController
#import <QuartzCore/QuartzCore.h>
@implementation UICompositeViewDescription
- (id)copy {
UICompositeViewDescription *copy = [UICompositeViewDescription alloc];
copy->content = self->content;
copy->tabBar = self->tabBar;
copy->tabBarEnabled = self->tabBarEnabled;
copy->stateBarEnabled = self->stateBarEnabled;
copy->fullscreen = self->fullscreen;
return copy;
}
- (id)init:(NSString *)acontent stateBar:(NSString*)astateBar
stateBarEnabled:(BOOL) astateBarEnabled
tabBar:(NSString*)atabBar
tabBarEnabled:(BOOL) atabBarEnabled
fullscreen:(BOOL) afullscreen {
self->content = acontent;
self->stateBar = astateBar;
self->stateBarEnabled = astateBarEnabled;
self->tabBar = atabBar;
self->tabBarEnabled = atabBarEnabled;
self->fullscreen = afullscreen;
return self;
}
@end
@implementation UICompositeViewController
@synthesize stateBarView;
@synthesize contentView;
@synthesize tabBarView;
- (void)myInit {
self->viewControllerCache = [[NSMutableDictionary alloc] init];
}
- (id)init{
self = [super init];
if (self) {
[self myInit];
}
return self;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
[self myInit];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self myInit];
}
return self;
}
- (void)dealloc {
[contentView release];
[stateBarView release];
[tabBarView release];
[viewControllerCache removeAllObjects];
[currentViewDescription dealloc];
[super dealloc];
}
+ (void)addSubView:(UIViewController*)controller view:(UIView*)view {
if(controller != nil) {
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[controller viewWillAppear:NO];
}
[view addSubview: controller.view];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[controller viewDidAppear:NO];
}
}
}
+ (void)removeSubView:(UIViewController*)controller {
if(controller != nil) {
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[controller viewWillDisappear:NO];
}
[controller.view removeFromSuperview];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[controller viewDidDisappear:NO];
}
}
}
- (UIViewController*)getCachedController:(NSString*)name {
UIViewController *controller = nil;
if(name != nil) {
controller = [viewControllerCache objectForKey:name];
if(controller == nil) {
controller = [[NSClassFromString(name) alloc] init];
[viewControllerCache setValue:controller forKey:name];
}
}
return controller;
}
- (void)update: (UICompositeViewDescription*) description tabBar:(NSNumber*)tabBar fullscreen:(NSNumber*)fullscreen {
// Copy view description
UICompositeViewDescription *oldViewDescription = (currentViewDescription != nil)? [currentViewDescription copy]: nil;
if(description != nil) {
currentViewDescription = description;
// Animate only with a previous screen
if(oldViewDescription != nil) {
CATransition* trans = [CATransition animation];
[trans setType:kCATransitionPush];
[trans setDuration:0.35];
[trans setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[trans setSubtype:kCATransitionFromRight];
[contentView.layer addAnimation:trans forKey:@"Transition"];
if((oldViewDescription->stateBarEnabled == true && currentViewDescription->stateBarEnabled == false) ||
(oldViewDescription->stateBarEnabled == false && currentViewDescription->stateBarEnabled == true)) {
[stateBarView.layer addAnimation:trans forKey:@"Transition"];
}
if(oldViewDescription->tabBar != currentViewDescription->tabBar) {
[tabBarView.layer addAnimation:trans forKey:@"Transition"];
}
}
if(contentViewController != nil) {
[UICompositeViewController removeSubView: contentViewController];
}
if(tabBarViewController != nil) {
[UICompositeViewController removeSubView: tabBarViewController];
}
if(stateBarViewController != nil) {
[UICompositeViewController removeSubView: stateBarViewController];
}
stateBarViewController = [self getCachedController:description->stateBar];
contentViewController = [self getCachedController:description->content];
tabBarViewController = [self getCachedController:description->tabBar];
}
if(currentViewDescription == nil) {
return;
}
if(tabBar != nil) {
currentViewDescription->tabBarEnabled = [tabBar boolValue];
}
if(fullscreen != nil) {
currentViewDescription->fullscreen = [fullscreen boolValue];
[[UIApplication sharedApplication] setStatusBarHidden:currentViewDescription->fullscreen withAnimation:UIStatusBarAnimationSlide ];
} else {
[[UIApplication sharedApplication] setStatusBarHidden:currentViewDescription->fullscreen withAnimation:UIStatusBarAnimationNone];
}
// Start animation
if(tabBar != nil || fullscreen != nil) {
[UIView beginAnimations:@"resize" context:nil];
[UIView setAnimationDuration:0.35];
[UIView setAnimationBeginsFromCurrentState:TRUE];
}
UIView *innerView = contentViewController.view;
CGRect contentFrame = contentView.frame;
// Resize StateBar
CGRect stateBarFrame = stateBarView.frame;
if(currentViewDescription->fullscreen)
stateBarFrame.origin.y = -20;
else
stateBarFrame.origin.y = 0;
if(stateBarViewController != nil && currentViewDescription->stateBarEnabled) {
stateBarView.hidden = false;
[stateBarView setFrame: stateBarFrame];
contentFrame.origin.y = stateBarFrame.size.height + stateBarFrame.origin.y;
} else {
stateBarView.hidden = true;
contentFrame.origin.y = stateBarFrame.origin.y;
}
// Resize TabBar
CGRect tabFrame = tabBarView.frame;
if(tabBarViewController != nil && currentViewDescription->tabBarEnabled) {
tabBarView.hidden = false;
tabFrame.origin.y = [[UIScreen mainScreen] bounds].size.height - 20;
tabFrame.origin.x = [[UIScreen mainScreen] bounds].size.width;
tabFrame.size.height = tabBarViewController.view.frame.size.height;
tabFrame.size.width = tabBarViewController.view.frame.size.width;
tabFrame.origin.y -= tabFrame.size.height;
tabFrame.origin.x -= tabFrame.size.width;
contentFrame.size.height = tabFrame.origin.y - contentFrame.origin.y;
for (UIView *view in tabBarViewController.view.subviews) {
if(view.tag == -1) {
contentFrame.size.height += view.frame.origin.y;
break;
}
}
} else {
tabBarView.hidden = true;
contentFrame.size.height = tabFrame.origin.y + tabFrame.size.height;
if(currentViewDescription->fullscreen)
contentFrame.size.height += 20;
tabFrame.origin.y = [[UIScreen mainScreen] bounds].size.height - 20;
}
// Resize innerView
CGRect innerContentFrame = innerView.frame;
innerContentFrame.size = contentFrame.size;
// Set frames
[contentView setFrame: contentFrame];
[innerView setFrame: innerContentFrame];
[tabBarView setFrame: tabFrame];
// Commit animation
if(tabBar != nil || fullscreen != nil) {
[UIView commitAnimations];
}
// Change view
if(description != nil) {
[UICompositeViewController addSubView: contentViewController view:contentView];
[UICompositeViewController addSubView: tabBarViewController view:tabBarView];
[UICompositeViewController addSubView: stateBarViewController view:stateBarView];
}
// Dealloc old view description
if(oldViewDescription != nil) {
[oldViewDescription dealloc];
}
}
- (void) changeView:(UICompositeViewDescription *)description {
[self view]; // Force view load
[self update:description tabBar:nil fullscreen:nil];
}
- (void) setFullScreen:(BOOL) enabled {
[self update:nil tabBar:nil fullscreen:[NSNumber numberWithBool:enabled]];
}
- (void) setToolBarHidden:(BOOL) hidden {
[self update:nil tabBar:[NSNumber numberWithBool:!hidden] fullscreen:nil];
}
- (UIViewController *) getCurrentViewController {
return contentViewController;
}
@end

View file

@ -98,6 +98,30 @@
</object>
<int key="connectionID">3</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">contentView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="481442126"/>
</object>
<int key="connectionID">17</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">stateBarView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="256276698"/>
</object>
<int key="connectionID">18</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">tabBarView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="548578981"/>
</object>
<int key="connectionID">19</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@ -162,13 +186,32 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">16</int>
<int key="maxID">19</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">UICompositeViewController</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="contentView">UIView</string>
<string key="stateBarView">UIView</string>
<string key="tabBarView">UIView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="contentView">
<string key="name">contentView</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo" key="stateBarView">
<string key="name">stateBarView</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo" key="tabBarView">
<string key="name">tabBarView</string>
<string key="candidateClassName">UIView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UICompositeViewController.h</string>

View file

@ -28,12 +28,21 @@
@synthesize settingsButton;
@synthesize chatButton;
- (id)init {
return [super initWithNibName:@"UIMainBar" bundle:[NSBundle mainBundle]];
}
- (void)viewDidLoad {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLinphoneMainViewChangeEvent:) name:@"LinphoneMainViewChange" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLinphoneMainViewChangeEvent:) name:@"LinphoneMainViewChange" object:nil];
[self update:[[LinphoneManager instance] currentView]];
}
- (void)receiveLinphoneMainViewChangeEvent: (NSNotification*) notif {
PhoneView view = [[notif.userInfo objectForKey: @"view"] intValue];
[self update:view];
}
- (void)update:(PhoneView) view {
if(view == PhoneView_History) {
historyButton.selected = TRUE;
} else {

View file

@ -30,6 +30,10 @@
NSTimer *callQualityTimer;
- (id)init {
return [super initWithNibName:@"UIStateBar" bundle:[NSBundle mainBundle]];
}
- (void)viewDidLoad {
[super viewDidLoad];
@ -45,7 +49,10 @@ NSTimer *callQualityTimer;
repeats:YES];
// Update to default state
[self proxyConfigUpdate: NULL];
LinphoneProxyConfig* config = NULL;
if([LinphoneManager isLcReady])
linphone_core_get_default_proxy([LinphoneManager getLc], &config);
[self proxyConfigUpdate: config];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

View file

@ -21,48 +21,21 @@
#import "LinphoneManager.h"
#import "CallDelegate.h"
@interface ViewsDescription: NSObject{
@public
UIViewController *content;
UIViewController *tabBar;
bool tabBarEnabled;
bool statusEnabled;
bool fullscreen;
PhoneView viewId;
}
-(id) copy;
@end
#import "UICompositeViewController.h"
@interface PhoneMainView : UIViewController<CallActionSheetDelegate> {
UIView *stateBarView;
UIView *contentView;
UIView *tabBarView;
UICompositeViewController *mainViewController;
UICompositeViewController *modalViewController;
@private
NSMutableDictionary *viewDescriptions;
NSArray *views;
UIViewController *stateBarController;
UIViewController *callTabBarController;
UIViewController *mainTabBarController;
UIViewController *incomingCallTabBarController;
ViewsDescription *currentViewDescription;
PhoneView currentPhoneView;
UIActionSheet *incomingCallActionSheet;
UIActionSheet *batteryActionSheet;
}
@property (nonatomic, retain) IBOutlet UIView* stateBarView;
@property (nonatomic, retain) IBOutlet UIView* contentView;
@property (nonatomic, retain) IBOutlet UIView* tabBarView;
@property (nonatomic, retain) IBOutlet UICompositeViewController *mainViewController;
@property (nonatomic, retain) IBOutlet UICompositeViewController *modalViewController;
@property (nonatomic, retain) IBOutlet UIViewController* stateBarController;
@property (nonatomic, retain) IBOutlet UIViewController* callTabBarController;
@property (nonatomic, retain) IBOutlet UIViewController* mainTabBarController;
@property (nonatomic, retain) IBOutlet UIViewController* incomingCallTabBarController;
-(void) changeView: (NSNotification*) notif;
@end

View file

@ -30,313 +30,163 @@
#import "AbstractCall.h"
@implementation ViewsDescription
- (id)copy {
ViewsDescription *copy = [ViewsDescription alloc];
copy->content = self->content;
copy->tabBar = self->tabBar;
copy->tabBarEnabled = self->tabBarEnabled;
copy->statusEnabled = self->statusEnabled;
copy->fullscreen = self->fullscreen;
copy->viewId = self->viewId;
return copy;
}
@end
@implementation PhoneMainView
@synthesize stateBarView;
@synthesize contentView;
@synthesize tabBarView;
@synthesize mainViewController;
@synthesize modalViewController;
@synthesize stateBarController;
@synthesize callTabBarController;
@synthesize mainTabBarController;
@synthesize incomingCallTabBarController;
+ (void)addSubView:(UIViewController*)controller view:(UIView*)view {
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[controller viewWillAppear:NO];
}
[view addSubview: controller.view];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[controller viewDidAppear:NO];
}
- (void)myInit {
self->currentPhoneView = -1;
}
+ (void)removeSubView:(UIViewController*)controller {
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[controller viewWillDisappear:NO];
}
[controller.view removeFromSuperview];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[controller viewDidDisappear:NO];
- (id)init {
self = [super init];
if (self) {
[self myInit];
}
return self;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
[self myInit];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self myInit];
}
return self;
}
- (void)changeView: (NSNotification*) notif {
NSNumber *viewId = [notif.userInfo objectForKey: @"view"];
NSNumber *tabBar = [notif.userInfo objectForKey: @"tabBar"];
NSNumber *fullscreen = [notif.userInfo objectForKey: @"fullscreen"];
// Copy view description
ViewsDescription *oldViewDescription = (currentViewDescription != nil)? [currentViewDescription copy]: nil;
// Check view change
if(viewId != nil) {
PhoneView view = [viewId intValue];
ViewsDescription* description = [viewDescriptions objectForKey:[NSNumber numberWithInt: view]];
UICompositeViewDescription* description = [viewDescriptions objectForKey:[NSNumber numberWithInt: view]];
if(description == nil)
return;
description->viewId = view; // Auto-set viewId
if(currentViewDescription == nil || description->viewId != currentViewDescription->viewId) {
if(currentViewDescription != nil)
[currentViewDescription dealloc];
currentViewDescription = [description copy];
} else {
viewId = nil;
}
}
if(currentViewDescription == nil) {
return;
if(view != currentPhoneView) {
[mainViewController changeView:description];
currentPhoneView = view;
}
}
if(tabBar != nil) {
currentViewDescription->tabBarEnabled = [tabBar boolValue];
[mainViewController setToolBarHidden:![tabBar boolValue]];
}
if(fullscreen != nil) {
currentViewDescription->fullscreen = [fullscreen boolValue];
[[UIApplication sharedApplication] setStatusBarHidden:currentViewDescription->fullscreen withAnimation:UIStatusBarAnimationSlide ];
} else {
[[UIApplication sharedApplication] setStatusBarHidden:currentViewDescription->fullscreen withAnimation:UIStatusBarAnimationNone];
}
// View Transitions
if(viewId != nil) {
if(oldViewDescription != nil) {
CATransition* trans = [CATransition animation];
[trans setType:kCATransitionPush];
[trans setDuration:0.35];
[trans setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[trans setSubtype:kCATransitionFromRight];
[contentView.layer addAnimation:trans forKey:@"Transition"];
if((oldViewDescription->statusEnabled == true && currentViewDescription->statusEnabled == false) ||
(oldViewDescription->statusEnabled == false && currentViewDescription->statusEnabled == true)) {
[stateBarView.layer addAnimation:trans forKey:@"Transition"];
}
if(oldViewDescription->tabBar != currentViewDescription->tabBar) {
[tabBarView.layer addAnimation:trans forKey:@"Transition"];
}
[PhoneMainView removeSubView: oldViewDescription->content];
[PhoneMainView removeSubView: oldViewDescription->tabBar];
}
}
// Start animation
if(tabBar != nil || fullscreen != nil) {
[UIView beginAnimations:@"resize" context:nil];
[UIView setAnimationDuration:0.35];
[UIView setAnimationBeginsFromCurrentState:TRUE];
}
UIView *innerView = currentViewDescription->content.view;
CGRect contentFrame = contentView.frame;
// Resize StateBar
CGRect stateBarFrame = stateBarView.frame;
if(currentViewDescription->fullscreen)
stateBarFrame.origin.y = -20;
else
stateBarFrame.origin.y = 0;
if(currentViewDescription->statusEnabled) {
stateBarView.hidden = false;
[stateBarView setFrame: stateBarFrame];
contentFrame.origin.y = stateBarFrame.size.height + stateBarFrame.origin.y;
} else {
stateBarView.hidden = true;
contentFrame.origin.y = stateBarFrame.origin.y;
}
// Resize TabBar
CGRect tabFrame = tabBarView.frame;
if(currentViewDescription->tabBar != nil && currentViewDescription->tabBarEnabled) {
tabFrame.origin.y = [[UIScreen mainScreen] bounds].size.height - 20;
tabFrame.origin.x = [[UIScreen mainScreen] bounds].size.width;
tabFrame.size.height = currentViewDescription->tabBar.view.frame.size.height;
tabFrame.size.width = currentViewDescription->tabBar.view.frame.size.width;
tabFrame.origin.y -= tabFrame.size.height;
tabFrame.origin.x -= tabFrame.size.width;
contentFrame.size.height = tabFrame.origin.y - contentFrame.origin.y;
for (UIView *view in currentViewDescription->tabBar.view.subviews) {
if(view.tag == -1) {
contentFrame.size.height += view.frame.origin.y;
break;
}
}
} else {
contentFrame.size.height = tabFrame.origin.y + tabFrame.size.height;
if(currentViewDescription->fullscreen)
contentFrame.size.height += 20;
tabFrame.origin.y = [[UIScreen mainScreen] bounds].size.height - 20;
}
// Resize innerView
CGRect innerContentFrame = innerView.frame;
innerContentFrame.size = contentFrame.size;
// Set frames
[contentView setFrame: contentFrame];
[innerView setFrame: innerContentFrame];
[tabBarView setFrame: tabFrame];
// Commit animation
if(tabBar != nil || fullscreen != nil) {
[UIView commitAnimations];
}
// Change view
if(viewId != nil) {
[PhoneMainView addSubView: currentViewDescription->content view:contentView];
[PhoneMainView addSubView: currentViewDescription->tabBar view:tabBarView];
[mainViewController setFullScreen:[fullscreen boolValue]];
}
// Call abstractCall
NSDictionary *dict = [notif.userInfo objectForKey: @"args"];
if(dict != nil)
[AbstractCall call:currentViewDescription->content dict:dict];
// Dealloc old view description
if(oldViewDescription != nil) {
[oldViewDescription dealloc];
}
[AbstractCall call:[mainViewController getCurrentViewController] dict:dict];
}
- (void)viewDidLoad {
[super viewDidLoad];
UIView *dumb;
[[self view] addSubview: mainViewController.view];
// Init view descriptions
viewDescriptions = [[NSMutableDictionary alloc] init];
// Load Bars
dumb = mainTabBarController.view;
// Status Bar
[stateBarView addSubview: stateBarController.view];
//
// Main View
//
DialerViewController* myDialerViewController = [[DialerViewController alloc]
initWithNibName:@"DialerViewController"
bundle:[NSBundle mainBundle]];
//[myPhoneViewController loadView];
ViewsDescription *dialerDescription = [ViewsDescription alloc];
dialerDescription->content = myDialerViewController;
dialerDescription->tabBar = mainTabBarController;
dialerDescription->statusEnabled = true;
dialerDescription->fullscreen = false;
UICompositeViewDescription *dialerDescription = [UICompositeViewDescription alloc];
dialerDescription->content = @"DialerViewController";
dialerDescription->tabBar = @"UIMainBar";
dialerDescription->tabBarEnabled = true;
dialerDescription->stateBar = @"UIStateBar";
dialerDescription->stateBarEnabled = true;
dialerDescription->fullscreen = false;
[viewDescriptions setObject:dialerDescription forKey:[NSNumber numberWithInt: PhoneView_Dialer]];
//
// Contacts View
//
ContactsViewController* myContactsController = [[ContactsViewController alloc]
initWithNibName:@"ContactsViewController"
bundle:[NSBundle mainBundle]];
//[myContactsController loadView];
ViewsDescription *contactsDescription = [ViewsDescription alloc];
contactsDescription->content = myContactsController;
contactsDescription->tabBar = mainTabBarController;
contactsDescription->statusEnabled = false;
contactsDescription->fullscreen = false;
UICompositeViewDescription *contactsDescription = [UICompositeViewDescription alloc];
contactsDescription->content = @"ContactsViewController";
contactsDescription->tabBar = @"UIMainBar";
contactsDescription->tabBarEnabled = true;
contactsDescription->stateBar = nil;
contactsDescription->stateBarEnabled = false;
contactsDescription->fullscreen = false;
[viewDescriptions setObject:contactsDescription forKey:[NSNumber numberWithInt: PhoneView_Contacts]];
//
// Call History View
//
HistoryViewController* myHistoryController = [[HistoryViewController alloc]
initWithNibName:@"HistoryViewController"
bundle:[NSBundle mainBundle]];
//[myHistoryController loadView];
ViewsDescription *historyDescription = [ViewsDescription alloc];
historyDescription->content = myHistoryController;
historyDescription->tabBar = mainTabBarController;
historyDescription->statusEnabled = false;
historyDescription->fullscreen = false;
UICompositeViewDescription *historyDescription = [UICompositeViewDescription alloc];
historyDescription->content = @"HistoryViewController";
historyDescription->tabBar = @"UIMainBar";
historyDescription->tabBarEnabled = true;
historyDescription->stateBar = nil;
historyDescription->stateBarEnabled = false;
historyDescription->fullscreen = false;
[viewDescriptions setObject:historyDescription forKey:[NSNumber numberWithInt: PhoneView_History]];
//
// IncomingCall View
//
IncomingCallViewController* myIncomingCallController = [[IncomingCallViewController alloc]
initWithNibName:@"IncomingCallViewController"
bundle:[NSBundle mainBundle]];
//[myChatViewController loadView];
ViewsDescription *incomingCallDescription = [ViewsDescription alloc];
incomingCallDescription->content = myIncomingCallController;
incomingCallDescription->tabBar = mainTabBarController;
incomingCallDescription->statusEnabled = true;
UICompositeViewDescription *incomingCallDescription = [UICompositeViewDescription alloc];
incomingCallDescription->content = @"IncomingCallViewController";
incomingCallDescription->tabBar = nil;
incomingCallDescription->tabBarEnabled = false;
incomingCallDescription->stateBar = @"UIStateBar";
incomingCallDescription->stateBarEnabled = true;
incomingCallDescription->fullscreen = false;
incomingCallDescription->tabBarEnabled = true;
[viewDescriptions setObject:incomingCallDescription forKey:[NSNumber numberWithInt: PhoneView_Chat]];
[viewDescriptions setObject:incomingCallDescription forKey:[NSNumber numberWithInt: PhoneView_IncomingCall]];
//
// InCall View
//
InCallViewController* myInCallController = [[InCallViewController alloc]
initWithNibName:@"InCallViewController"
bundle:[NSBundle mainBundle]];
//[myInCallController loadView];
ViewsDescription *inCallDescription = [ViewsDescription alloc];
inCallDescription->content = myInCallController;
inCallDescription->tabBar = nil;
inCallDescription->statusEnabled = true;
UICompositeViewDescription *inCallDescription = [UICompositeViewDescription alloc];
inCallDescription->content = @"InCallViewController";
inCallDescription->tabBar = @"UICallBar";
inCallDescription->tabBarEnabled = true;
inCallDescription->stateBar = @"UIStateBar";
inCallDescription->stateBarEnabled = true;
inCallDescription->fullscreen = false;
inCallDescription->tabBarEnabled = false;
[viewDescriptions setObject:inCallDescription forKey:[NSNumber numberWithInt: PhoneView_InCall]];
//
// Settings View
//
SettingsViewController* mySettingsViewController = [[SettingsViewController alloc]
initWithNibName:@"SettingsViewController"
bundle:[NSBundle mainBundle]];
//[mySettingsViewController loadView];
ViewsDescription *settingsDescription = [ViewsDescription alloc];
settingsDescription->content = mySettingsViewController;
settingsDescription->tabBar = mainTabBarController;
settingsDescription->statusEnabled = false;
settingsDescription->fullscreen = false;
UICompositeViewDescription *settingsDescription = [UICompositeViewDescription alloc];
settingsDescription->content = @"SettingsViewController";
settingsDescription->tabBar = @"UIMainBar";
settingsDescription->tabBarEnabled = true;
settingsDescription->stateBar = nil;
settingsDescription->stateBarEnabled = false;
settingsDescription->fullscreen = false;
[viewDescriptions setObject:settingsDescription forKey:[NSNumber numberWithInt: PhoneView_Settings]];
//
// Chat View
//
ChatViewController* myChatViewController = [[ChatViewController alloc]
initWithNibName:@"ChatViewController"
bundle:[NSBundle mainBundle]];
//[myChatViewController loadView];
ViewsDescription *chatDescription = [ViewsDescription alloc];
chatDescription->content = myChatViewController;
chatDescription->tabBar = mainTabBarController;
chatDescription->statusEnabled = false;
chatDescription->fullscreen = false;
UICompositeViewDescription *chatDescription = [UICompositeViewDescription alloc];
chatDescription->content = @"ChatViewController";
chatDescription->tabBar = @"UIMainBar";
chatDescription->tabBarEnabled = true;
chatDescription->stateBar = nil;
chatDescription->stateBarEnabled = false;
chatDescription->fullscreen = false;
[viewDescriptions setObject:chatDescription forKey:[NSNumber numberWithInt: PhoneView_Chat]];
// Set observers
@ -395,7 +245,7 @@
}
}
- (void)callUpdate: (NSNotification*) notif {
- (void)callUpdate:(NSNotification*) notif {
LinphoneCall *call = [[notif.userInfo objectForKey: @"call"] pointerValue];
LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue];
NSString *message = [notif.userInfo objectForKey: @"message"];
@ -521,6 +371,7 @@
- (void)displayIncomingCall:(LinphoneCall*) call{
#if 0
const char* userNameChars=linphone_address_get_username(linphone_call_get_remote_address(call));
NSString* userName = userNameChars?[[[NSString alloc] initWithUTF8String:userNameChars] autorelease]:NSLocalizedString(@"Unknown",nil);
const char* displayNameChars = linphone_address_get_display_name(linphone_call_get_remote_address(call));
@ -567,6 +418,10 @@
}
[incomingCallActionSheet release];
}
#endif
//UICompositeViewController *controller = [[UICompositeViewController alloc] initWithNibName:@"UICompositeViewController" bundle:[NSBundle mainBundle]];
[modalViewController changeView:[viewDescriptions objectForKey:[NSNumber numberWithInt:PhoneView_IncomingCall]]];
[self presentModalViewController:modalViewController animated:false];
}
- (void)batteryLevelChanged: (NSNotification*) notif {
@ -637,10 +492,8 @@
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[viewDescriptions removeAllObjects];
[viewDescriptions release];
[stateBarView release];
[stateBarController release];
[mainTabBarController release];
[super dealloc];
}

View file

@ -38,53 +38,10 @@
<object class="IBUIView" id="891400674">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIView" id="813768660">
<reference key="NSNextResponder" ref="891400674"/>
<int key="NSvFlags">314</int>
<string key="NSFrame">{{0, 23}, {320, 380}}</string>
<reference key="NSSuperview" ref="891400674"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIClipsSubviews">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="512515388">
<reference key="NSNextResponder" ref="891400674"/>
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{320, 23}</string>
<reference key="NSSuperview" ref="891400674"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="813768660"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor" id="197650205">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<bool key="IBUIClipsSubviews">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="565712161">
<reference key="NSNextResponder" ref="891400674"/>
<int key="NSvFlags">280</int>
<string key="NSFrame">{{0, 400}, {320, 60}}</string>
<reference key="NSSuperview" ref="891400674"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClipsSubviews">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="512515388"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
@ -132,7 +89,10 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIHighlightedTitleColor" ref="197650205"/>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="197650205">
<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>
@ -165,6 +125,7 @@
<string key="NSFrame">{{192, 0}, {128, 72}}</string>
<reference key="NSSuperview" ref="909644813"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<object class="IBUIAccessibilityConfiguration" key="IBUIAccessibilityConfiguration">
@ -236,9 +197,9 @@
<bool key="IBUIAutoresizesSubviews">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIViewController" id="334571927">
<object class="IBUIViewController" id="839760968">
<bool key="IBUIAutoresizesArchivedViewToFullSize">NO</bool>
<string key="IBUINibName">UIMainBar</string>
<string key="IBUINibName">UICompositeViewController</string>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
@ -247,20 +208,9 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="355474761">
<object class="IBUIViewController" id="285037805">
<bool key="IBUIAutoresizesArchivedViewToFullSize">NO</bool>
<string key="IBUINibName">UICallBar</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="210198832">
<bool key="IBUIAutoresizesArchivedViewToFullSize">NO</bool>
<string key="IBUINibName">UIStateBar</string>
<string key="IBUINibName">UICompositeViewController</string>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
@ -283,51 +233,19 @@
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">tabBarView</string>
<string key="label">mainViewController</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="565712161"/>
<reference key="destination" ref="839760968"/>
</object>
<int key="connectionID">160</int>
<int key="connectionID">209</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">mainTabBarController</string>
<string key="label">modalViewController</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="334571927"/>
<reference key="destination" ref="285037805"/>
</object>
<int key="connectionID">192</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">callTabBarController</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="355474761"/>
</object>
<int key="connectionID">196</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">stateBarController</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="210198832"/>
</object>
<int key="connectionID">201</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">stateBarView</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="512515388"/>
</object>
<int key="connectionID">202</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">contentView</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="813768660"/>
</object>
<int key="connectionID">159</int>
<int key="connectionID">211</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@ -388,31 +306,10 @@
<reference key="object" ref="891400674"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="565712161"/>
<reference ref="813768660"/>
<reference ref="512515388"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">root</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">135</int>
<reference key="object" ref="565712161"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="parent" ref="891400674"/>
<string key="objectName">tabBar</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">53</int>
<reference key="object" ref="813768660"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="parent" ref="891400674"/>
<string key="objectName">content</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">169</int>
<reference key="object" ref="312046670"/>
@ -420,28 +317,16 @@
<string key="objectName">mask</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">175</int>
<reference key="object" ref="512515388"/>
<reference key="parent" ref="891400674"/>
<string key="objectName">stateBar</string>
<int key="objectID">208</int>
<reference key="object" ref="839760968"/>
<reference key="parent" ref="0"/>
<string key="objectName">mainViewController</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">178</int>
<reference key="object" ref="334571927"/>
<int key="objectID">210</int>
<reference key="object" ref="285037805"/>
<reference key="parent" ref="0"/>
<string key="objectName">mainTabBarController</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">190</int>
<reference key="object" ref="210198832"/>
<reference key="parent" ref="0"/>
<string key="objectName">stateBarController</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">194</int>
<reference key="object" ref="355474761"/>
<reference key="parent" ref="0"/>
<string key="objectName">callTabBarController</string>
<string key="objectName">modalViewController</string>
</object>
</object>
</object>
@ -460,17 +345,12 @@
<string>131.IBUIButtonInspectorSelectedStateConfigurationMetadataKey</string>
<string>133.IBPluginDependency</string>
<string>133.IBUIButtonInspectorSelectedStateConfigurationMetadataKey</string>
<string>135.IBPluginDependency</string>
<string>152.IBPluginDependency</string>
<string>169.IBPluginDependency</string>
<string>175.IBPluginDependency</string>
<string>178.CustomClassName</string>
<string>178.IBPluginDependency</string>
<string>190.CustomClassName</string>
<string>190.IBPluginDependency</string>
<string>194.CustomClassName</string>
<string>194.IBPluginDependency</string>
<string>53.IBPluginDependency</string>
<string>208.CustomClassName</string>
<string>208.IBPluginDependency</string>
<string>210.CustomClassName</string>
<string>210.IBPluginDependency</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -487,14 +367,9 @@
<real value="1"/>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UICompositeViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIMainBar</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIStateBar</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UICallBar</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UICompositeViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
@ -510,7 +385,7 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">207</int>
<int key="maxID">211</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -522,21 +397,53 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>callTabBarController</string>
<string>mainViewController</string>
<string>modalViewController</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UICompositeViewController</string>
<string>UICompositeViewController</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>mainViewController</string>
<string>modalViewController</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">mainViewController</string>
<string key="candidateClassName">UICompositeViewController</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">modalViewController</string>
<string key="candidateClassName">UICompositeViewController</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/PhoneMainView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UICompositeViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>contentView</string>
<string>incomingCallTabBarController</string>
<string>mainTabBarController</string>
<string>stateBarController</string>
<string>stateBarView</string>
<string>tabBarView</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIViewController</string>
<string>UIView</string>
<string>UIViewController</string>
<string>UIViewController</string>
<string>UIViewController</string>
<string>UIView</string>
<string>UIView</string>
</object>
@ -545,36 +452,16 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>callTabBarController</string>
<string>contentView</string>
<string>incomingCallTabBarController</string>
<string>mainTabBarController</string>
<string>stateBarController</string>
<string>stateBarView</string>
<string>tabBarView</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">callTabBarController</string>
<string key="candidateClassName">UIViewController</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">contentView</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">incomingCallTabBarController</string>
<string key="candidateClassName">UIViewController</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">mainTabBarController</string>
<string key="candidateClassName">UIViewController</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">stateBarController</string>
<string key="candidateClassName">UIViewController</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">stateBarView</string>
<string key="candidateClassName">UIView</string>
@ -587,273 +474,7 @@
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/PhoneMainView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UICallBar</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>microButton</string>
<string>pauseButton</string>
<string>speakerButton</string>
<string>videoButton</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIMicroButton</string>
<string>UIPauseButton</string>
<string>UISpeakerButton</string>
<string>UIVideoButton</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>microButton</string>
<string>pauseButton</string>
<string>speakerButton</string>
<string>videoButton</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">microButton</string>
<string key="candidateClassName">UIMicroButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">pauseButton</string>
<string key="candidateClassName">UIPauseButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">speakerButton</string>
<string key="candidateClassName">UISpeakerButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">videoButton</string>
<string key="candidateClassName">UIVideoButton</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UICallBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIMainBar</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>onChatClick:</string>
<string>onContactsClick:</string>
<string>onDialerClick:</string>
<string>onHistoryClick:</string>
<string>onSettingsClick:</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>onChatClick:</string>
<string>onContactsClick:</string>
<string>onDialerClick:</string>
<string>onHistoryClick:</string>
<string>onSettingsClick:</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBActionInfo">
<string key="name">onChatClick:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">onContactsClick:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">onDialerClick:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">onHistoryClick:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">onSettingsClick:</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>chatButton</string>
<string>contactsButton</string>
<string>dialerButton</string>
<string>historyButton</string>
<string>settingsButton</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIButton</string>
<string>UIButton</string>
<string>UIButton</string>
<string>UIButton</string>
<string>UIButton</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>chatButton</string>
<string>contactsButton</string>
<string>dialerButton</string>
<string>historyButton</string>
<string>settingsButton</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">chatButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">contactsButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">dialerButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">historyButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">settingsButton</string>
<string key="candidateClassName">UIButton</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIMainBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIMicroButton</string>
<string key="superclassName">UIToggleButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIMicroButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIPauseButton</string>
<string key="superclassName">UIToggleButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIPauseButton.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">UIStateBar</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>callQualityImage</string>
<string>registrationStateImage</string>
<string>registrationStateLabel</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIImageView</string>
<string>UIImageView</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>callQualityImage</string>
<string>registrationStateImage</string>
<string>registrationStateLabel</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">callQualityImage</string>
<string key="candidateClassName">UIImageView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">registrationStateImage</string>
<string key="candidateClassName">UIImageView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">registrationStateLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIStateBar.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>
<object class="IBPartialClassDescription">
<string key="className">UIVideoButton</string>
<string key="superclassName">UIToggleButton</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">videoUpdateIndicator</string>
<string key="NS.object.0">UIActivityIndicatorView</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">videoUpdateIndicator</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">videoUpdateIndicator</string>
<string key="candidateClassName">UIActivityIndicatorView</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIVideoButton.h</string>
<string key="minorKey">./Classes/UICompositeViewController.h</string>
</object>
</object>
</object>

View file

@ -25,6 +25,10 @@
@synthesize settingsController;
@synthesize navigationController;
- (id)init {
return [super initWithNibName:@"SettingsViewController" bundle:[NSBundle mainBundle]];
}
- (void)viewDidLoad {
settingsController.delegate = [LinphoneManager instance];
settingsController.settingsReaderDelegate = self;

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
Resources/avatar-small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -187,6 +187,10 @@
D31B4B22159876C0002E6C72 /* UICompositeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D31B4B1F159876C0002E6C72 /* UICompositeViewController.m */; };
D31B4B23159876C0002E6C72 /* UICompositeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D31B4B20159876C0002E6C72 /* UICompositeViewController.xib */; };
D31B4B24159876C0002E6C72 /* UICompositeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D31B4B20159876C0002E6C72 /* UICompositeViewController.xib */; };
D31B4B281598A390002E6C72 /* avatar-inconnu.png in Resources */ = {isa = PBXBuildFile; fileRef = D31B4B261598A390002E6C72 /* avatar-inconnu.png */; };
D31B4B291598A390002E6C72 /* avatar-inconnu.png in Resources */ = {isa = PBXBuildFile; fileRef = D31B4B261598A390002E6C72 /* avatar-inconnu.png */; };
D31B4B2A1598A390002E6C72 /* avatar-small.png in Resources */ = {isa = PBXBuildFile; fileRef = D31B4B271598A390002E6C72 /* avatar-small.png */; };
D31B4B2B1598A390002E6C72 /* avatar-small.png in Resources */ = {isa = PBXBuildFile; fileRef = D31B4B271598A390002E6C72 /* avatar-small.png */; };
D31C9C8A158A179A00756B45 /* fond-detail-numero.png in Resources */ = {isa = PBXBuildFile; fileRef = D31C9C89158A179A00756B45 /* fond-detail-numero.png */; };
D31C9C8B158A179A00756B45 /* fond-detail-numero.png in Resources */ = {isa = PBXBuildFile; fileRef = D31C9C89158A179A00756B45 /* fond-detail-numero.png */; };
D31C9C90158A1C1000756B45 /* appel-entrant.png in Resources */ = {isa = PBXBuildFile; fileRef = D31C9C8D158A1C1000756B45 /* appel-entrant.png */; };
@ -884,6 +888,8 @@
D31B4B1E159876C0002E6C72 /* UICompositeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICompositeViewController.h; sourceTree = "<group>"; };
D31B4B1F159876C0002E6C72 /* UICompositeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICompositeViewController.m; sourceTree = "<group>"; };
D31B4B20159876C0002E6C72 /* UICompositeViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UICompositeViewController.xib; sourceTree = "<group>"; };
D31B4B261598A390002E6C72 /* avatar-inconnu.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "avatar-inconnu.png"; path = "Resources/avatar-inconnu.png"; sourceTree = "<group>"; };
D31B4B271598A390002E6C72 /* avatar-small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "avatar-small.png"; path = "Resources/avatar-small.png"; sourceTree = "<group>"; };
D31C9C89158A179A00756B45 /* fond-detail-numero.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "fond-detail-numero.png"; path = "Resources/fond-detail-numero.png"; sourceTree = "<group>"; };
D31C9C8D158A1C1000756B45 /* appel-entrant.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "appel-entrant.png"; path = "Resources/appel-entrant.png"; sourceTree = "<group>"; };
D31C9C8E158A1C1000756B45 /* appel-manque.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "appel-manque.png"; path = "Resources/appel-manque.png"; sourceTree = "<group>"; };
@ -1746,6 +1752,8 @@
D3ED3E7015861ABD006C0DE4 /* appeler-actif.png */,
D35E758C15934F360066B1C1 /* appeler-disabled.png */,
D3ED3E7115861ABD006C0DE4 /* appeler-over.png */,
D31B4B261598A390002E6C72 /* avatar-inconnu.png */,
D31B4B271598A390002E6C72 /* avatar-small.png */,
D3ED3E7615861B1B006C0DE4 /* backspace-actif.png */,
D35E758815932DE60066B1C1 /* backspace-disabled.png */,
D3ED3E7715861B1B006C0DE4 /* backspace-over.png */,
@ -2217,6 +2225,8 @@
D3F26BF915986DAD005F9CAB /* ok-edit-list-history-over.png in Resources */,
D3F26BFC15987083005F9CAB /* champ-titre-incoming.png in Resources */,
D31B4B23159876C0002E6C72 /* UICompositeViewController.xib in Resources */,
D31B4B281598A390002E6C72 /* avatar-inconnu.png in Resources */,
D31B4B2A1598A390002E6C72 /* avatar-small.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2387,6 +2397,8 @@
D3F26BFA15986DAD005F9CAB /* ok-edit-list-history-over.png in Resources */,
D3F26BFD15987083005F9CAB /* champ-titre-incoming.png in Resources */,
D31B4B24159876C0002E6C72 /* UICompositeViewController.xib in Resources */,
D31B4B291598A390002E6C72 /* avatar-inconnu.png in Resources */,
D31B4B2B1598A390002E6C72 /* avatar-small.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};