Improve UI

Add conference stuff
Adjust button behaviours
This commit is contained in:
Yann Diorcet 2012-06-28 18:42:47 +02:00
parent 6d669665c9
commit 6b1d647c26
30 changed files with 1023 additions and 224 deletions

View file

@ -90,7 +90,7 @@ void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info,
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UIContactCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UIContactCell"];
if (cell == nil) {
cell = [[UIContactCell alloc] init];
cell = [[UIContactCell alloc] initWithIdentifier:@"UIContactCell"];
}
OrderedDictionary *subDic = [addressBookMap objectForKey: [addressBookMap keyAtIndex: [indexPath section]]];

View file

@ -534,15 +534,15 @@
<bool key="IBUIAdjustsImageWhenHighlighted">NO</bool>
<bool key="IBUIAdjustsImageWhenDisabled">NO</bool>
<reference key="IBUINormalTitleShadowColor" ref="177190558"/>
<object class="NSCustomResource" key="IBUIHighlightedBackgroundImage" id="642864408">
<object class="NSCustomResource" key="IBUIHighlightedBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">add-contact-over.png</string>
</object>
<object class="NSCustomResource" key="IBUIDisabledBackgroundImage" id="940547924">
<object class="NSCustomResource" key="IBUIDisabledBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">add-contact-inactif.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalBackgroundImage" id="755641438">
<object class="NSCustomResource" key="IBUINormalBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">add-contact-actif.png</string>
</object>
@ -567,9 +567,18 @@
<bool key="IBUIAdjustsImageWhenHighlighted">NO</bool>
<bool key="IBUIAdjustsImageWhenDisabled">NO</bool>
<reference key="IBUINormalTitleShadowColor" ref="177190558"/>
<reference key="IBUIHighlightedBackgroundImage" ref="642864408"/>
<reference key="IBUIDisabledBackgroundImage" ref="940547924"/>
<reference key="IBUINormalBackgroundImage" ref="755641438"/>
<object class="NSCustomResource" key="IBUIHighlightedBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">cancel_white_bg_over.png</string>
</object>
<object class="NSCustomResource" key="IBUIDisabledBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">cancel_white_bg_disabled.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">cancel_white_bg_default.png</string>
</object>
<reference key="IBUIFontDescription" ref="769584456"/>
<reference key="IBUIFont" ref="177658264"/>
</object>
@ -641,6 +650,7 @@
<string key="NSFrame">{{214, 0}, {106, 69}}</string>
<reference key="NSSuperview" ref="32193173"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@ -1177,7 +1187,7 @@
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="3"/>
<real value="0.0"/>
<string>UICallButton</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="0.0"/>
@ -1536,6 +1546,9 @@
<string>backspace-actif.png</string>
<string>backspace-disabled.png</string>
<string>backspace-over.png</string>
<string>cancel_white_bg_default.png</string>
<string>cancel_white_bg_disabled.png</string>
<string>cancel_white_bg_over.png</string>
<string>champ-saisie-numero.png</string>
<string>diese-actif.png</string>
<string>diese-over.png</string>
@ -1576,6 +1589,9 @@
<string>{213, 138}</string>
<string>{213, 138}</string>
<string>{213, 138}</string>
<string>{213, 138}</string>
<string>{213, 138}</string>
<string>{213, 138}</string>
<string>{640, 135}</string>
<string>{210, 113}</string>
<string>{210, 113}</string>

View file

@ -42,7 +42,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UIHistoryCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UIHistoryCell"];
if (cell == nil) {
cell = [[UIHistoryCell alloc] init];
cell = [[UIHistoryCell alloc] initWithIdentifier:@"UIHistoryCell"];
}
const MSList * logs = linphone_core_get_call_logs([LinphoneManager getLc]);

View file

@ -24,6 +24,7 @@
#include "linphonecore.h"
@interface InCallTableViewController : UITableViewController {
@private
NSMutableDictionary* callCellData;
NSTimer *updateTime;
}

View file

@ -19,12 +19,18 @@
#import "InCallTableViewController.h"
#import "UICallCell.h"
#import "UIConferenceHeader.h"
#import "LinphoneManager.h"
#include "private.h"
@implementation InCallTableViewController
enum TableSection {
ConferenceSection = 0,
CallSection = 1
};
- (void)myInit {
self->callCellData = [[NSMutableDictionary alloc] init];
}
@ -53,6 +59,7 @@
return self;
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
updateTime = [NSTimer scheduledTimerWithTimeInterval:1
@ -92,9 +99,6 @@
+ (LinphoneCall*)retrieveCallAtIndex: (NSInteger) index inConference:(bool) conf{
const MSList* calls = linphone_core_get_calls([LinphoneManager getLc]);
if (!conf && linphone_core_get_conference_size([LinphoneManager getLc]))
index--;
while (calls != 0) {
if ([InCallTableViewController isInConference:(LinphoneCall*)calls->data] == conf) {
if (index == 0)
@ -113,24 +117,72 @@
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if(section == CallSection) {
return [[UIView alloc] initWithFrame:CGRectZero];
} else if(section == ConferenceSection) {
LinphoneCore* lc = [LinphoneManager getLc];
if(linphone_core_get_conference_size(lc) > 0){
UIConferenceHeader *headerController = [[UIConferenceHeader alloc] init];
[headerController update];
UIView *headerView = [headerController view];
[headerController release];
return headerView;
} else {
return [[UIView alloc] initWithFrame:CGRectZero];
}
}
return [[UIView alloc] initWithFrame:CGRectZero];
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
return [[UIView alloc] initWithFrame:CGRectZero];
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
LinphoneCore* lc = [LinphoneManager getLc];
if(section == CallSection) {
return 0.000001f; // Hack UITableView = 0
} else if(section == ConferenceSection) {
if(linphone_core_get_conference_size(lc) > 0) {
return [UIConferenceHeader getHeight];
}
}
return 0.000001f; // Hack UITableView = 0
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
LinphoneCore* lc = [LinphoneManager getLc];
if(section == CallSection) {
return 0.000000f; // Hack UITableView = 0
} else if(section == ConferenceSection) {
if(linphone_core_get_conference_size(lc) > 0) {
return 20;
}
}
return 0.000001f; // Hack UITableView = 0
}
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UICallCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UICallCell"];
if (cell == nil) {
cell = [[UICallCell alloc] init];
cell = [[UICallCell alloc] initWithIdentifier:@"UICallCell"];
}
bool inConference = indexPath.section == ConferenceSection;
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneCall* call = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:NO];
LinphoneCall* call = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConference];
[cell setData:[self addCallData:call]];
[cell update];
if ([indexPath row] == 0) {
if ([indexPath section] == CallSection && [indexPath row] == 0 && linphone_core_get_conference_size(lc) == 0) {
[cell firstCell];
} else {
[cell otherCell];
}
if (linphone_core_get_calls_nb(lc) > 1) {
if (linphone_core_get_calls_nb(lc) > 1 || linphone_core_get_conference_size(lc) > 0) {
tableView.scrollEnabled = TRUE;
} else {
tableView.scrollEnabled = FALSE;
@ -138,40 +190,40 @@
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
int count = 0;
LinphoneCore* lc = [LinphoneManager getLc];
return [InCallTableViewController callCount:lc] + (int)(linphone_core_get_conference_size(lc) > 0);
if(section == CallSection) {
count = [InCallTableViewController callCount:lc];
} else {
count = linphone_core_get_conference_size(lc);
if(linphone_core_is_in_conference(lc)) {
count--;
}
}
return count;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
LinphoneCore* lc = [LinphoneManager getLc];
int count = 0;
if ([InCallTableViewController callCount:lc] > 0)
count++;
if (linphone_core_get_conference_size([LinphoneManager getLc]) > 0)
count ++;
return count;
return 2;
}
- (NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
return nil;
return @"";
}
- (NSString*)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
{
return nil;
return @"";
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
LinphoneCall* call = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:NO];
bool inConference = indexPath.section == ConferenceSection;
LinphoneCall* call = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConference];
UICallCellData* data = [callCellData objectForKey:[NSValue valueWithPointer:call]];
if(data != nil &&data->minimize)
return [UICallCell getMinimizedHeight];
@ -184,11 +236,11 @@
LinphoneCore* lc = [LinphoneManager getLc];
bool inConf = (indexPath.row == 0 && linphone_core_get_conference_size(lc) > 0);
bool inConference = indexPath.section == ConferenceSection;
LinphoneCall* selectedCall = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConf];
LinphoneCall* selectedCall = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConference];
if (inConf) {
if (inConference) {
if (linphone_core_is_in_conference(lc))
return;
LinphoneCall* current = linphone_core_get_current_call(lc);

View file

@ -397,11 +397,17 @@ const NSInteger SECURE_BUTTON_TAG=5;
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
[super viewDidAppear:animated];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[callTableController viewDidAppear:NO];
}
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
if (visibleActionSheet != nil) {
[visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:NO];
}
@ -409,10 +415,26 @@ const NSInteger SECURE_BUTTON_TAG=5;
[hideControlsTimer invalidate];
hideControlsTimer = nil;
}
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[callTableController viewWillDisappear:NO];
}
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[callTableController viewWillAppear:NO];
}
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
if (!videoShown) [[UIApplication sharedApplication] setIdleTimerDisabled:false];
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[callTableController viewDidDisappear:NO];
}
}
- (void)viewDidUnload {
@ -463,6 +485,12 @@ static void hideSpinner(LinphoneCall* lc, void* user_data);
LinphoneCall *call = [[notif.userInfo objectForKey: @"call"] pointerValue];
LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue];
// Fake call update: Refresh UI
if(call == NULL) {
[self updateUIFromLinphoneState: YES];
return;
}
// Handle data associated with the call
if(state == LinphoneCallReleased) {
[callTableController removeCallData: call];
@ -517,7 +545,7 @@ static void hideSpinner(LinphoneCall* lc, void* user_data);
if(linphone_core_get_calls_nb([LinphoneManager getLc]) <= 1) {
[callTableController maximizeAll];
}
//[self updateUIFromLinphoneState: YES];
[self updateUIFromLinphoneState: YES];
break;
}
default:
@ -790,4 +818,8 @@ static void hideSpinner(LinphoneCall* call, void* user_data) {
ms_error("Unhandled CallDelegate event of type: %d received - ignoring", type);
}
}
@end

View file

@ -67,7 +67,7 @@
<string key="NSFrame">{{240, 354}, {80, 106}}</string>
<reference key="NSSuperview" ref="1009068048"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="662692377"/>
<reference key="NSNextKeyView" ref="972197710"/>
<reference key="IBUIBackgroundColor" ref="95762599"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
@ -100,25 +100,33 @@
<object class="IBUITableView" id="662692377">
<reference key="NSNextResponder" ref="858247959"/>
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{320, 460}</string>
<string key="NSFrame">{{0, -10}, {320, 480}}</string>
<reference key="NSSuperview" ref="858247959"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="972197710"/>
<reference key="NSNextKeyView" ref="1009068048"/>
<string key="NSReuseIdentifierKey">_NS:418</string>
<reference key="IBUIBackgroundColor" ref="95762599"/>
<bool key="IBUIClipsSubviews">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<double key="IBUIContentInset.top">0.0</double>
<double key="IBUIContentInset.bottom">20</double>
<double key="IBUIContentInset.top">10</double>
<double key="IBUIContentInset.bottom">25</double>
<double key="IBUIContentInset.left">0.0</double>
<double key="IBUIContentInset.right">0.0</double>
<bool key="IBUIAlwaysBounceVertical">YES</bool>
<bool key="IBUIBounces">NO</bool>
<bool key="IBUIShowsHorizontalScrollIndicator">NO</bool>
<double key="IBUIScrollIndicatorInsets.top">10</double>
<double key="IBUIScrollIndicatorInsets.bottom">25</double>
<double key="IBUIScrollIndicatorInsets.left">0.0</double>
<double key="IBUIScrollIndicatorInsets.right">0.0</double>
<int key="IBUIStyle">1</int>
<int key="IBUISeparatorStyle">1</int>
<reference key="IBUISeparatorColor" ref="95762599"/>
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
<bool key="IBUIAllowsSelection">NO</bool>
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
<float key="IBUIRowHeight">53</float>
<float key="IBUISectionHeaderHeight">22</float>
<float key="IBUISectionFooterHeight">22</float>
<float key="IBUIRowHeight">44</float>
<float key="IBUISectionHeaderHeight">10</float>
<float key="IBUISectionFooterHeight">10</float>
</object>
<object class="IBUIButton" id="972197710">
<reference key="NSNextResponder" ref="858247959"/>
@ -159,7 +167,7 @@
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1009068048"/>
<reference key="NSNextKeyView" ref="662692377"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>

View file

@ -23,25 +23,27 @@
#import "UIPauseButton.h"
#import "UISpeakerButton.h"
#import "UIVideoButton.h"
#import "UIHangUpButton.h"
@interface UICallBar: UIViewController {
UIPauseButton* pauseButton;
UIButton* startConferenceButton;
UIButton* stopConferenceButton;
UIButton* conferenceButton;
UIVideoButton* videoButton;
UIMicroButton* microButton;
UISpeakerButton* speakerButton;
UIButton* optionsButton;
UIHangUpButton* hangupButton;
}
@property (nonatomic, retain) IBOutlet UIPauseButton* pauseButton;
@property (nonatomic, retain) IBOutlet UIButton* startConferenceButton;
@property (nonatomic, retain) IBOutlet UIButton* stopConferenceButton;
@property (nonatomic, retain) IBOutlet UIButton* conferenceButton;
@property (nonatomic, retain) IBOutlet UIVideoButton* videoButton;
@property (nonatomic, retain) IBOutlet UIMicroButton* microButton;
@property (nonatomic, retain) IBOutlet UISpeakerButton* speakerButton;
@property (nonatomic, retain) IBOutlet UIButton* optionsButton;
@property (nonatomic, retain) IBOutlet UIButton* optionsButton;
@property (nonatomic, retain) IBOutlet UIHangUpButton* hangupButton;
- (IBAction)onOptionsClick:(id)sender;
- (IBAction)onConferenceClick:(id)sender;
@end

View file

@ -26,18 +26,19 @@
@implementation UICallBar
@synthesize pauseButton;
@synthesize startConferenceButton;
@synthesize stopConferenceButton;
@synthesize conferenceButton;
@synthesize videoButton;
@synthesize microButton;
@synthesize speakerButton;
@synthesize optionsButton;
@synthesize hangupButton;
- (id)init {
return [super initWithNibName:@"UICallBar" bundle:[NSBundle mainBundle]];
}
- (void)viewDidLoad {
[pauseButton setType:UIPauseButtonType_CurrentCall call:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdate:) name:@"LinphoneCallUpdate" object:nil];
}
@ -58,28 +59,24 @@
[microButton update];
[pauseButton update];
[videoButton update];
[hangupButton update];
if(linphone_core_get_calls_nb(lc) > 1) {
[pauseButton setHidden:true];
LinphoneCall *currentCall = linphone_core_get_current_call(lc);
if(currentCall == NULL || !linphone_call_get_current_params(currentCall)->in_conference) {
[startConferenceButton setHidden:false];
[stopConferenceButton setHidden:true];
} else {
[startConferenceButton setHidden:true];
[stopConferenceButton setHidden:false];
if(![pauseButton isHidden]) {
[pauseButton setHidden:true];
[conferenceButton setHidden:false];
}
} else {
[pauseButton setHidden:false];
[startConferenceButton setHidden:true];
[stopConferenceButton setHidden:true];
if([pauseButton isHidden]) {
[pauseButton setHidden:false];
[conferenceButton setHidden:true];
}
}
}
- (void)dealloc {
[pauseButton release];
[startConferenceButton release];
[stopConferenceButton release];
[conferenceButton release];
[videoButton release];
[microButton release];
[speakerButton release];
@ -99,4 +96,8 @@
[[LinphoneManager instance] changeView:PhoneView_Dialer dict:dict];
}
- (IBAction)onConferenceClick:(id)sender {
linphone_core_add_all_to_conference([LinphoneManager getLc]);
}
@end

View file

@ -221,7 +221,7 @@
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">pause-over.png</string>
</object>
<object class="NSCustomResource" key="IBUISelectedBackgroundImage" id="176604418">
<object class="NSCustomResource" key="IBUISelectedBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">play-actif.png</string>
</object>
@ -238,7 +238,7 @@
<string key="NSFrame">{{0, 67}, {105, 68}}</string>
<reference key="NSSuperview" ref="931774220"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="882972580"/>
<reference key="NSNextKeyView" ref="99607181"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<object class="IBUIAccessibilityConfiguration" key="IBUIAccessibilityConfiguration">
@ -248,42 +248,19 @@
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<bool key="IBUIAdjustsImageWhenHighlighted">NO</bool>
<bool key="IBUIAdjustsImageWhenDisabled">NO</bool>
<reference key="IBUINormalTitleShadowColor" ref="838911807"/>
<object class="NSCustomResource" key="IBUIHighlightedBackgroundImage" id="636202283">
<object class="NSCustomResource" key="IBUIHighlightedBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">start-conference-over.png</string>
</object>
<reference key="IBUISelectedBackgroundImage" ref="176604418"/>
<object class="NSCustomResource" key="IBUINormalBackgroundImage" id="441455868">
<object class="NSCustomResource" key="IBUINormalBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">start-conference-actif.png</string>
</object>
<reference key="IBUIFontDescription" ref="794091713"/>
<reference key="IBUIFont" ref="993152718"/>
</object>
<object class="IBUIButton" id="882972580">
<reference key="NSNextResponder" ref="931774220"/>
<int key="NSvFlags">-2147483384</int>
<string key="NSFrame">{{0, 67}, {105, 68}}</string>
<reference key="NSSuperview" ref="931774220"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="99607181"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<object class="IBUIAccessibilityConfiguration" key="IBUIAccessibilityConfiguration">
<string key="IBUIAccessibilityLabel">Stop conference</string>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<bool key="IBUIAdjustsImageWhenHighlighted">NO</bool>
<reference key="IBUINormalTitleShadowColor" ref="838911807"/>
<reference key="IBUIHighlightedBackgroundImage" ref="636202283"/>
<reference key="IBUISelectedBackgroundImage" ref="176604418"/>
<reference key="IBUINormalBackgroundImage" ref="441455868"/>
<reference key="IBUIFontDescription" ref="794091713"/>
<reference key="IBUIFont" ref="993152718"/>
</object>
<object class="IBUIButton" id="99607181">
<reference key="NSNextResponder" ref="931774220"/>
<int key="NSvFlags">264</int>
@ -318,6 +295,7 @@
<string key="NSFrame">{{215, 67}, {105, 68}}</string>
<reference key="NSSuperview" ref="931774220"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<object class="IBUIAccessibilityConfiguration" key="IBUIAccessibilityConfiguration">
@ -406,19 +384,19 @@
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">stopConferenceButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="882972580"/>
</object>
<int key="connectionID">25</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">startConferenceButton</string>
<string key="label">conferenceButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="351323248"/>
</object>
<int key="connectionID">26</int>
<int key="connectionID">27</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">hangupButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="99607181"/>
</object>
<int key="connectionID">29</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
@ -429,6 +407,15 @@
</object>
<int key="connectionID">20</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">onConferenceClick:</string>
<reference key="source" ref="351323248"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">28</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@ -462,7 +449,6 @@
<reference ref="262544423"/>
<reference ref="693636558"/>
<reference ref="351323248"/>
<reference ref="882972580"/>
</array>
<reference key="parent" ref="0"/>
<string key="objectName">callTabBar</string>
@ -520,13 +506,7 @@
<int key="objectID">21</int>
<reference key="object" ref="351323248"/>
<reference key="parent" ref="931774220"/>
<string key="objectName">startConferenceButton</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="882972580"/>
<reference key="parent" ref="931774220"/>
<string key="objectName">stopConferenceButton</string>
<string key="objectName">conferenceButton</string>
</object>
</array>
</object>
@ -545,8 +525,6 @@
<real value="0.0" key="12.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="21.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="1" key="21.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="1" key="23.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<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>
@ -565,34 +543,45 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">26</int>
<int key="maxID">29</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">UICallBar</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">onOptionsClick:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">onOptionsClick:</string>
<object class="IBActionInfo" key="NS.object.0">
<dictionary class="NSMutableDictionary" key="actions">
<string key="onConferenceClick:">id</string>
<string key="onOptionsClick:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="onConferenceClick:">
<string key="name">onConferenceClick:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="onOptionsClick:">
<string key="name">onOptionsClick:</string>
<string key="candidateClassName">id</string>
</object>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="conferenceButton">UIButton</string>
<string key="hangupButton">UIHangUpButton</string>
<string key="microButton">UIMicroButton</string>
<string key="optionsButton">UIButton</string>
<string key="pauseButton">UIPauseButton</string>
<string key="speakerButton">UISpeakerButton</string>
<string key="startConferenceButton">UIButton</string>
<string key="stopConferenceButton">UIButton</string>
<string key="videoButton">UIVideoButton</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="conferenceButton">
<string key="name">conferenceButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="hangupButton">
<string key="name">hangupButton</string>
<string key="candidateClassName">UIHangUpButton</string>
</object>
<object class="IBToOneOutletInfo" key="microButton">
<string key="name">microButton</string>
<string key="candidateClassName">UIMicroButton</string>
@ -609,14 +598,6 @@
<string key="name">speakerButton</string>
<string key="candidateClassName">UISpeakerButton</string>
</object>
<object class="IBToOneOutletInfo" key="startConferenceButton">
<string key="name">startConferenceButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="stopConferenceButton">
<string key="name">stopConferenceButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="videoButton">
<string key="name">videoButton</string>
<string key="candidateClassName">UIVideoButton</string>
@ -635,6 +616,22 @@
<string key="minorKey">./Classes/UIHangUpButton.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>

View file

@ -20,7 +20,7 @@
#import <UIKit/UIKit.h>
#include "linphonecore.h"
#include "UIPauseButton.h"
@interface UICallCellData : NSObject {
@public
@ -40,6 +40,7 @@
UILabel *addressLabel;
UILabel *stateLabel;
UIImageView *stateImage;
UIPauseButton *pauseButton;
UIImageView *avatarImage;
UIView *headerView;
@ -57,6 +58,7 @@
@property (nonatomic, retain) IBOutlet UILabel* stateLabel;
@property (nonatomic, retain) IBOutlet UIImageView* stateImage;
@property (nonatomic, retain) IBOutlet UIImageView* avatarImage;
@property (nonatomic, retain) IBOutlet UIPauseButton *pauseButton;
@property (nonatomic, retain) IBOutlet UIView* headerView;
@property (nonatomic, retain) IBOutlet UIView* avatarView;
@ -65,6 +67,8 @@
- (void)otherCell;
- (void)update;
- (id)initWithIdentifier:(NSString*)identifier;
- (IBAction)doHeaderClick:(id)sender;
+ (int)getMaximizedHeight;

View file

@ -42,12 +42,13 @@
@synthesize stateLabel;
@synthesize stateImage;
@synthesize avatarImage;
@synthesize pauseButton;
@synthesize headerView;
@synthesize avatarView;
- (id)init {
if ((self = [super init]) != nil) {
- (id)initWithIdentifier:(NSString*)identifier {
if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]) != nil) {
NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"UICallCell"
owner:self
options:nil];
@ -55,6 +56,9 @@
if ([arrayOfViews count] >= 1) {
[self addSubview:[[arrayOfViews objectAtIndex:0] retain]];
}
// Set selected+over background: IB lack !
[pauseButton setImage:[UIImage imageNamed:@"pause-champ-numero-over.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
}
return self;
}
@ -75,12 +79,13 @@
}
- (void)update {
if(data) {
LinphoneCall *call = data->call;
LinphoneCall *call = NULL;
if(data != nil && data->call != NULL) {
call = data->call;
const LinphoneAddress* addr = linphone_call_get_remote_address(call);
if (addr) {
const char* lUserNameChars=linphone_address_get_username(addr);
if (addr != NULL) {
const char* lUserNameChars = linphone_address_get_username(addr);
NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil);
NSMutableString* mss = [[NSMutableString alloc] init];
// contact name
@ -103,14 +108,19 @@
LinphoneCallState state = linphone_call_get_state(call);
if(state == LinphoneCallPaused || state == LinphoneCallPausing) {
[stateImage setImage:[UIImage imageNamed:@"pause-champ-numero-actif"]];
} else if(state == LinphoneCallOutgoingRinging) {
if(state == LinphoneCallOutgoingRinging) {
[stateImage setImage:[UIImage imageNamed:@"ring-champ-numero-actif"]];
[stateImage setHidden:false];
[pauseButton setHidden:true];
} else if(state == LinphoneCallOutgoingInit || state == LinphoneCallOutgoingProgress){
[stateImage setImage:nil];
[stateImage setImage:[UIImage imageNamed:@"outgoing-champ-numero-actif"]];
[stateImage setHidden:false];
[pauseButton setHidden:true];
} else {
[stateImage setImage:[UIImage imageNamed:@"play-champ-numero-actif"]];
[stateImage setHidden:true];
[pauseButton setHidden:false];
[pauseButton update];
}
NSMutableString* msDuration = [[NSMutableString alloc] init];
@ -131,6 +141,7 @@
[avatarView setHidden:true];
}
}
[pauseButton setType:UIPauseButtonType_Call call:call];
}
- (IBAction)doHeaderClick:(id)sender {
@ -143,12 +154,16 @@
- (void)selfUpdate {
UITableView *parentTable = (UITableView *)self.superview;
[parentTable beginUpdates];
[parentTable reloadData];
[parentTable endUpdates];
/*
if(parentTable) {
NSIndexPath *index= [parentTable indexPathForCell:self];
if(index != nil) {
[parentTable reloadRowsAtIndexPaths:[[NSArray alloc] initWithObjects:index, nil] withRowAnimation:false];
}
}
}*/
}
- (void)dealloc {
@ -163,11 +178,11 @@
}
+ (int)getMaximizedHeight {
return 300;
return 280;
}
+ (int)getMinimizedHeight {
return 58;
return 54;
}

View file

@ -49,6 +49,10 @@
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="617455101"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor" id="293312528">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
@ -83,6 +87,7 @@
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="846233730"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<reference key="IBUIBackgroundColor" ref="293312528"/>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
@ -98,6 +103,7 @@
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="227927177"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<reference key="IBUIBackgroundColor" ref="293312528"/>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
@ -111,10 +117,8 @@
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="942473668"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor" id="293312528">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<reference key="IBUIBackgroundColor" ref="293312528"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIAutoresizesSubviews">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
@ -130,7 +134,7 @@
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1003079266"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<reference key="IBUIBackgroundColor" ref="293312528"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
@ -146,12 +150,12 @@
<object class="IBUIButton" id="1003079266">
<reference key="NSNextResponder" ref="227927177"/>
<int key="NSvFlags">-2147483356</int>
<string key="NSFrameSize">{320, 68}</string>
<string key="NSFrameSize">{320, 63}</string>
<reference key="NSSuperview" ref="227927177"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="544229628"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<reference key="IBUIBackgroundColor" ref="293312528"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
@ -159,7 +163,7 @@
<reference key="IBUINormalTitleShadowColor" ref="127131304"/>
<object class="NSCustomResource" key="IBUINormalBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">champ-saisie-numero.png</string>
<string key="NSResourceName">champ-courbe-autres-numeros-first.png</string>
</object>
<reference key="IBUIFontDescription" ref="955169232"/>
<reference key="IBUIFont" ref="269414177"/>
@ -170,7 +174,7 @@
<string key="NSFrame">{{10, 0}, {206, 51}}</string>
<reference key="NSSuperview" ref="227927177"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="256572861"/>
<reference key="NSNextKeyView" ref="874892962"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIAutoresizesSubviews">NO</bool>
@ -4593,6 +4597,40 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIButton" id="874892962">
<reference key="NSNextResponder" ref="227927177"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{216, 6}, {41, 41}}</string>
<reference key="NSSuperview" ref="227927177"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="256572861"/>
<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>
<bool key="IBUIAdjustsImageWhenHighlighted">NO</bool>
<bool key="IBUIAdjustsImageWhenDisabled">NO</bool>
<double key="IBUIContentEdgeInsets.top">8</double>
<double key="IBUIContentEdgeInsets.bottom">8</double>
<double key="IBUIContentEdgeInsets.left">8</double>
<double key="IBUIContentEdgeInsets.right">8</double>
<reference key="IBUINormalTitleShadowColor" ref="127131304"/>
<object class="NSCustomResource" key="IBUIHighlightedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">play-champ-numero-over.png</string>
</object>
<object class="NSCustomResource" key="IBUISelectedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">pause-champ-numero-actif.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">play-champ-numero-actif.png</string>
</object>
<reference key="IBUIFontDescription" ref="955169232"/>
<reference key="IBUIFont" ref="269414177"/>
</object>
<object class="IBUILabel" id="932476762">
<reference key="NSNextResponder" ref="227927177"/>
<int key="NSvFlags">292</int>
@ -4656,6 +4694,19 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="176711572"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<reference key="IBUIBackgroundColor" ref="293312528"/>
<bool key="IBUIAutoresizesSubviews">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="260763535">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<reference key="IBUIBackgroundColor" ref="293312528"/>
<bool key="IBUIAutoresizesSubviews">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
@ -4726,6 +4777,22 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
</object>
<int key="connectionID">42</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">backgroundView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="260763535"/>
</object>
<int key="connectionID">46</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">pauseButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="874892962"/>
</object>
<int key="connectionID">48</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doHeaderClick:</string>
@ -4791,6 +4858,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<reference ref="1003079266"/>
<reference ref="111701986"/>
<reference ref="544229628"/>
<reference ref="874892962"/>
</array>
<reference key="parent" ref="675878782"/>
<string key="objectName">headerView</string>
@ -4817,7 +4885,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<int key="objectID">18</int>
<reference key="object" ref="256572861"/>
<reference key="parent" ref="227927177"/>
<string key="objectName">stateView</string>
<string key="objectName">stateImage</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
@ -4842,6 +4910,18 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<reference key="object" ref="846233730"/>
<reference key="parent" ref="176711572"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">45</int>
<reference key="object" ref="260763535"/>
<reference key="parent" ref="0"/>
<string key="objectName">background</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">47</int>
<reference key="object" ref="874892962"/>
<reference key="parent" ref="227927177"/>
<string key="objectName">pauseButton</string>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@ -4864,12 +4944,16 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<string key="38.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="1" key="38.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="44.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="45.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="47.CustomClassName">UIPauseButton</string>
<string key="47.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="2" key="47.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">44</int>
<int key="maxID">48</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -4894,6 +4978,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<string key="firstBackground">UIView</string>
<string key="headerView">UIView</string>
<string key="otherBackground">UIView</string>
<string key="pauseButton">UIPauseButton</string>
<string key="stateImage">UIImageView</string>
<string key="stateLabel">UILabel</string>
</dictionary>
@ -4922,6 +5007,10 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<string key="name">otherBackground</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo" key="pauseButton">
<string key="name">pauseButton</string>
<string key="candidateClassName">UIPauseButton</string>
</object>
<object class="IBToOneOutletInfo" key="stateImage">
<string key="name">stateImage</string>
<string key="candidateClassName">UIImageView</string>
@ -4936,6 +5025,22 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<string key="minorKey">./Classes/UICallCell.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">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>
@ -4948,9 +5053,12 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE</bytes>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="avatar-inconnu.png">{320, 339}</string>
<string key="champ-courbe-autres-numeros-first.png">{640, 125}</string>
<string key="champ-courbe-autres-numeros.png">{640, 125}</string>
<string key="champ-saisie-numero.png">{640, 135}</string>
<string key="ombre-cotes-avatar.png">{640, 523}</string>
<string key="pause-champ-numero-actif.png">{43, 50}</string>
<string key="play-champ-numero-actif.png">{43, 46}</string>
<string key="play-champ-numero-over.png">{43, 46}</string>
</dictionary>
<string key="IBCocoaTouchPluginVersion">1181</string>
</data>

View file

@ -0,0 +1,35 @@
/* UIConferenceHeader.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>
#import "UIPauseButton.h"
@interface UIConferenceHeader : UIViewController {
UIImageView *stateImage;
UIPauseButton *pauseButton;
}
@property (nonatomic, retain) IBOutlet UIImageView* stateImage;
@property (nonatomic, retain) IBOutlet UIPauseButton *pauseButton;
+ (int)getHeight;
- (void)update;
@end

View file

@ -0,0 +1,51 @@
/* UIConferenceHeader.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 "UIConferenceHeader.h"
#import "LinphoneManager.h"
@implementation UIConferenceHeader
@synthesize stateImage;
@synthesize pauseButton;
- (id)init {
return [super initWithNibName:@"UIConferenceHeader" bundle:[NSBundle mainBundle]];
}
- (void)viewDidLoad {
[super viewDidLoad];
// Set selected+over background: IB lack !
[pauseButton setImage:[UIImage imageNamed:@"pause-champ-numero-over.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
[pauseButton setType:UIPauseButtonType_Conference call:nil];
}
+ (int)getHeight {
return 50;
}
- (void)update {
[self view];
[stateImage setHidden:true];
[pauseButton update];
}
@end

View file

@ -0,0 +1,277 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">11E53</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</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">1181</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBUIButton</string>
<string>IBUIImageView</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="232140160">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIImageView" id="1047549470">
<reference key="NSNextResponder" ref="232140160"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 68}</string>
<reference key="NSSuperview" ref="232140160"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="735354432"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">champ-titre-conference.png</string>
</object>
</object>
<object class="IBUIImageView" id="242054672">
<reference key="NSNextResponder" ref="232140160"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{224, 14}, {25, 25}}</string>
<reference key="NSSuperview" ref="232140160"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIButton" id="735354432">
<reference key="NSNextResponder" ref="232140160"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{216, 6}, {41, 41}}</string>
<reference key="NSSuperview" ref="232140160"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="242054672"/>
<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>
<bool key="IBUIAdjustsImageWhenHighlighted">NO</bool>
<bool key="IBUIAdjustsImageWhenDisabled">NO</bool>
<double key="IBUIContentEdgeInsets.top">8</double>
<double key="IBUIContentEdgeInsets.bottom">8</double>
<double key="IBUIContentEdgeInsets.left">8</double>
<double key="IBUIContentEdgeInsets.right">8</double>
<object class="NSColor" key="IBUINormalTitleShadowColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="NSCustomResource" key="IBUIHighlightedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">play-champ-numero-over.png</string>
</object>
<object class="NSCustomResource" key="IBUISelectedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">pause-champ-numero-actif.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">play-champ-numero-actif.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">{320, 68}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1047549470"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<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="IBUIAutoresizesSubviews">NO</bool>
<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">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="232140160"/>
</object>
<int key="connectionID">5</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">stateImage</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="242054672"/>
</object>
<int key="connectionID">9</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">pauseButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="735354432"/>
</object>
<int key="connectionID">14</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">4</int>
<reference key="object" ref="232140160"/>
<array class="NSMutableArray" key="children">
<reference ref="1047549470"/>
<reference ref="242054672"/>
<reference ref="735354432"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="1047549470"/>
<reference key="parent" ref="232140160"/>
<string key="objectName">backgroundImage</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="242054672"/>
<reference key="parent" ref="232140160"/>
<string key="objectName">stateImage</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">13</int>
<reference key="object" ref="735354432"/>
<reference key="parent" ref="232140160"/>
<string key="objectName">pauseButton</string>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">UIConferenceHeader</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="13.CustomClassName">UIPauseButton</string>
<string key="13.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="2" key="13.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="7.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">14</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">UIConferenceHeader</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="pauseButton">UIPauseButton</string>
<string key="stateImage">UIImageView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="pauseButton">
<string key="name">pauseButton</string>
<string key="candidateClassName">UIPauseButton</string>
</object>
<object class="IBToOneOutletInfo" key="stateImage">
<string key="name">stateImage</string>
<string key="candidateClassName">UIImageView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/UIConferenceHeader.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">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>
<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>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="champ-titre-conference.png">{640, 135}</string>
<string key="pause-champ-numero-actif.png">{43, 50}</string>
<string key="play-champ-numero-actif.png">{43, 46}</string>
<string key="play-champ-numero-over.png">{43, 46}</string>
</dictionary>
<string key="IBCocoaTouchPluginVersion">1181</string>
</data>
</archive>

View file

@ -30,4 +30,6 @@
- (void)update:(ABRecordRef) record;
- (id)initWithIdentifier:(NSString*)identifier;
@end

View file

@ -24,8 +24,8 @@
@synthesize firstNameLabel;
@synthesize lastNameLabel;
- (id)init {
if ((self = [super init]) != nil) {
- (id)initWithIdentifier:(NSString*)identifier {
if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]) != nil) {
NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"UIContactCell"
owner:self
options:nil];

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,46 +20,91 @@
#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");
}
}
+ (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;
}
-(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));
}
}
}
}
- (void)myInit {
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
}
- (id)init{
self = [super init];
if (self) {
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
[self myInit];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
}
[self myInit];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self myInit];
}
return self;
}
- (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;
}
}
[self setEnabled:false];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.

View file

@ -35,6 +35,8 @@
@property (nonatomic, retain) IBOutlet UIButton* detailsButton;
@property (nonatomic, retain) IBOutlet UIButton* deleteButton;
- (id)initWithIdentifier:(NSString*)identifier;
- (IBAction)onDetails:(id) event;
- (IBAction)onDelete:(id) event;

View file

@ -29,8 +29,8 @@
#define DETAILS_DISABLED
- (id)init {
if ((self = [super init]) != nil) {
- (id)initWithIdentifier:(NSString*)identifier {
if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]) != nil) {
NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"UIHistoryCell"
owner:self
options:nil];

View file

@ -19,7 +19,20 @@
#import "UIToggleButton.h"
#import "linphonecore.h"
typedef enum _UIPauseButtonType {
UIPauseButtonType_CurrentCall,
UIPauseButtonType_Call,
UIPauseButtonType_Conference
} UIPauseButtonType;
@interface UIPauseButton : UIToggleButton<UIToggleButtonDelegate> {
@private
UIPauseButtonType type;
LinphoneCall* call;
}
- (void)setType:(UIPauseButtonType) type call:(LinphoneCall*)call;
@end

View file

@ -25,17 +25,91 @@
@implementation UIPauseButton
- (void)myInit {
self->type = UIPauseButtonType_CurrentCall;
}
- (id)init{
self = [super init];
if (self) {
[self myInit];
}
return self;
}
- (id)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (self) {
[self myInit];
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self myInit];
}
return self;
}
- (void)setType:(UIPauseButtonType) atype call:(LinphoneCall*)acall {
self->type = atype;
self->call = acall;
}
- (void)onOn {
LinphoneCall* currentCall = [UIPauseButton getCall];
if (currentCall != nil) {
linphone_core_pause_call([LinphoneManager getLc], currentCall);
switch (type) {
case UIPauseButtonType_Call:
{
if (call != nil) {
linphone_core_pause_call([LinphoneManager getLc], call);
}
break;
}
case UIPauseButtonType_Conference:
{
linphone_core_leave_conference([LinphoneManager getLc]);
// Fake event
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneCallUpdate" object:self];
break;
}
case UIPauseButtonType_CurrentCall:
{
LinphoneCall* currentCall = [UIPauseButton getCall];
if (currentCall != nil) {
linphone_core_pause_call([LinphoneManager getLc], currentCall);
}
break;
}
}
}
- (void)onOff {
LinphoneCall* currentCall = [UIPauseButton getCall];
if (currentCall != nil) {
linphone_core_resume_call([LinphoneManager getLc], currentCall);
switch (type) {
case UIPauseButtonType_Call:
{
if (call != nil) {
linphone_core_resume_call([LinphoneManager getLc], call);
}
break;
}
case UIPauseButtonType_Conference:
{
linphone_core_enter_conference([LinphoneManager getLc]);
// Fake event
[[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneCallUpdate" object:self];
break;
}
case UIPauseButtonType_CurrentCall:
{
LinphoneCall* currentCall = [UIPauseButton getCall];
if (currentCall != nil) {
linphone_core_resume_call([LinphoneManager getLc], currentCall);
}
break;
}
}
}
@ -59,35 +133,53 @@
}
- (bool)onUpdate {
bool ret = false;
// TODO: disable pause on not running call
if([LinphoneManager isLcReady]) {
bool ret = false;
LinphoneCall* currentCall = [UIPauseButton getCall];
if (currentCall != nil) {
LinphoneCallState state = linphone_call_get_state(currentCall);
if(state == LinphoneCallPaused || state == LinphoneCallPausing) {
ret = true;
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;
}
[LinphoneManager set:self enabled:TRUE withName:"PAUSE button" andReason:""];
} else {
[LinphoneManager set:self enabled:FALSE withName:"PAUSE button" andReason:""];
}
break;
}
case UIPauseButtonType_Conference:
{
if(linphone_core_get_conference_size(lc) > 0) {
if (!linphone_core_is_in_conference(lc)) {
ret = true;
}
[LinphoneManager set:self enabled:TRUE withName:"PAUSE button" andReason:""];
} else {
[LinphoneManager set:self enabled:FALSE withName:"PAUSE button" andReason:""];
}
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;
}
[LinphoneManager set:self enabled:TRUE withName:"PAUSE button" andReason:""];
} else {
[LinphoneManager set:self enabled:FALSE withName:"PAUSE button" andReason:""];
}
break;
}
}
LinphoneCore* lc = [LinphoneManager getLc];
int callsCount = linphone_core_get_calls_nb(lc);
if (currentCall) {
if (linphone_core_is_in_conference(lc)) {
[LinphoneManager set:self enabled:FALSE withName:"PAUSE button" andReason:"is in conference"];
} else if ([UIPauseButton notInConferenceCallCount: lc] == callsCount && callsCount == 1) {
[LinphoneManager set:self enabled:TRUE withName:"PAUSE button" andReason:"call count == 1"];
} else {
[LinphoneManager set:self enabled:FALSE withName:"PAUSE button" andReason:""];
}
} else {
[LinphoneManager set:self enabled:FALSE withName:"PAUSE button" andReason:""];
}
return ret;
} else {
//not ready yet
return false;
}
}
return ret;
}
+ (LinphoneCall*)getCall {

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -213,6 +213,20 @@
D31C9C95158A1C1000756B45 /* appel-sortant.png in Resources */ = {isa = PBXBuildFile; fileRef = D31C9C8F158A1C1000756B45 /* appel-sortant.png */; };
D31C9C98158A1CDF00756B45 /* UIHistoryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D31C9C97158A1CDE00756B45 /* UIHistoryCell.m */; };
D31C9C99158A1CDF00756B45 /* UIHistoryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D31C9C97158A1CDE00756B45 /* UIHistoryCell.m */; };
D3211BA6159C3D410098460B /* outgoing-champ-numero-actif.png in Resources */ = {isa = PBXBuildFile; fileRef = D3211BA5159C3D410098460B /* outgoing-champ-numero-actif.png */; };
D3211BA7159C3D410098460B /* outgoing-champ-numero-actif.png in Resources */ = {isa = PBXBuildFile; fileRef = D3211BA5159C3D410098460B /* outgoing-champ-numero-actif.png */; };
D3211BB0159C4EF10098460B /* UIConferenceHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = D3211BAE159C4EF00098460B /* UIConferenceHeader.m */; };
D3211BB1159C4EF10098460B /* UIConferenceHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = D3211BAE159C4EF00098460B /* UIConferenceHeader.m */; };
D3211BB2159C4EF10098460B /* UIConferenceHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3211BAF159C4EF10098460B /* UIConferenceHeader.xib */; };
D3211BB3159C4EF10098460B /* UIConferenceHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3211BAF159C4EF10098460B /* UIConferenceHeader.xib */; };
D3211BB9159C8A820098460B /* champ-courbe-autres-numeros-first.png in Resources */ = {isa = PBXBuildFile; fileRef = D3211BB8159C8A820098460B /* champ-courbe-autres-numeros-first.png */; };
D3211BBA159C8A820098460B /* champ-courbe-autres-numeros-first.png in Resources */ = {isa = PBXBuildFile; fileRef = D3211BB8159C8A820098460B /* champ-courbe-autres-numeros-first.png */; };
D3211BBE159CBFD60098460B /* cancel_white_bg_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3211BBB159CBFD60098460B /* cancel_white_bg_default.png */; };
D3211BBF159CBFD70098460B /* cancel_white_bg_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3211BBB159CBFD60098460B /* cancel_white_bg_default.png */; };
D3211BC0159CBFD70098460B /* cancel_white_bg_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = D3211BBC159CBFD60098460B /* cancel_white_bg_disabled.png */; };
D3211BC1159CBFD70098460B /* cancel_white_bg_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = D3211BBC159CBFD60098460B /* cancel_white_bg_disabled.png */; };
D3211BC2159CBFD70098460B /* cancel_white_bg_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3211BBD159CBFD60098460B /* cancel_white_bg_over.png */; };
D3211BC3159CBFD70098460B /* cancel_white_bg_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3211BBD159CBFD60098460B /* cancel_white_bg_over.png */; };
D32409C3158B49A600C8C119 /* UILongTouchButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D32409C2158B49A600C8C119 /* UILongTouchButton.m */; };
D32409C4158B49A600C8C119 /* UILongTouchButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D32409C2158B49A600C8C119 /* UILongTouchButton.m */; };
D326483815887D5200930C67 /* OrderedDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = D326483715887D5200930C67 /* OrderedDictionary.m */; };
@ -933,6 +947,14 @@
D31C9C8F158A1C1000756B45 /* appel-sortant.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "appel-sortant.png"; path = "Resources/appel-sortant.png"; sourceTree = "<group>"; };
D31C9C96158A1CDE00756B45 /* UIHistoryCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIHistoryCell.h; sourceTree = "<group>"; };
D31C9C97158A1CDE00756B45 /* UIHistoryCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIHistoryCell.m; sourceTree = "<group>"; };
D3211BA5159C3D410098460B /* outgoing-champ-numero-actif.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "outgoing-champ-numero-actif.png"; path = "Resources/outgoing-champ-numero-actif.png"; sourceTree = "<group>"; };
D3211BAD159C4EF00098460B /* UIConferenceHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIConferenceHeader.h; sourceTree = "<group>"; };
D3211BAE159C4EF00098460B /* UIConferenceHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIConferenceHeader.m; sourceTree = "<group>"; };
D3211BAF159C4EF10098460B /* UIConferenceHeader.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UIConferenceHeader.xib; sourceTree = "<group>"; };
D3211BB8159C8A820098460B /* champ-courbe-autres-numeros-first.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "champ-courbe-autres-numeros-first.png"; path = "Resources/champ-courbe-autres-numeros-first.png"; sourceTree = "<group>"; };
D3211BBB159CBFD60098460B /* cancel_white_bg_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cancel_white_bg_default.png; path = Resources/cancel_white_bg_default.png; sourceTree = "<group>"; };
D3211BBC159CBFD60098460B /* cancel_white_bg_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cancel_white_bg_disabled.png; path = Resources/cancel_white_bg_disabled.png; sourceTree = "<group>"; };
D3211BBD159CBFD60098460B /* cancel_white_bg_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cancel_white_bg_over.png; path = Resources/cancel_white_bg_over.png; sourceTree = "<group>"; };
D32409C1158B49A600C8C119 /* UILongTouchButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILongTouchButton.h; sourceTree = "<group>"; };
D32409C2158B49A600C8C119 /* UILongTouchButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UILongTouchButton.m; sourceTree = "<group>"; };
D326483615887D5200930C67 /* OrderedDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OrderedDictionary.h; path = Utils/OrderedDictionary.h; sourceTree = "<group>"; };
@ -1572,6 +1594,9 @@
D31B4B1E159876C0002E6C72 /* UICompositeViewController.h */,
D31B4B1F159876C0002E6C72 /* UICompositeViewController.m */,
D31B4B20159876C0002E6C72 /* UICompositeViewController.xib */,
D3211BAD159C4EF00098460B /* UIConferenceHeader.h */,
D3211BAE159C4EF00098460B /* UIConferenceHeader.m */,
D3211BAF159C4EF10098460B /* UIConferenceHeader.xib */,
D3A55FBA15877E5E003FD403 /* UIContactCell.h */,
D3A55FBB15877E5E003FD403 /* UIContactCell.m */,
D3A55FBE15877E69003FD403 /* UIContactCell.xib */,
@ -1817,6 +1842,10 @@
D3D6A3A7159B0EFE005F692C /* cadenas.png */,
D3F83F801582278D00336684 /* cancel-actif.png */,
D3F83F811582278D00336684 /* cancel-over.png */,
D3211BBB159CBFD60098460B /* cancel_white_bg_default.png */,
D3211BBC159CBFD60098460B /* cancel_white_bg_disabled.png */,
D3211BBD159CBFD60098460B /* cancel_white_bg_over.png */,
D3211BB8159C8A820098460B /* champ-courbe-autres-numeros-first.png */,
D36C43CC158F2F370048BA40 /* champ-courbe-autres-numeros.png */,
D36C43CD158F2F370048BA40 /* champ-courbe-participant-conf.png */,
D3ED3E441585FB8C006C0DE4 /* champ-saisie-numero.png */,
@ -1876,6 +1905,7 @@
D3D6A3A8159B0EFE005F692C /* options_default.png */,
D3D6A3A9159B0EFE005F692C /* options_disabled.png */,
D3D6A3AA159B0EFE005F692C /* options_over.png */,
D3211BA5159C3D410098460B /* outgoing-champ-numero-actif.png */,
D3F83EF8158205A100336684 /* pause-actif.png */,
D36C43ED158F61EA0048BA40 /* pause-champ-numero-actif.png */,
D36C43EE158F61EA0048BA40 /* pause-champ-numero-over.png */,
@ -2304,6 +2334,12 @@
D31AAF69159B5C68002C6B02 /* finir-conference-actif.png in Resources */,
D31AAF6B159B5C68002C6B02 /* finir-conference-over.png in Resources */,
D31AAF6E159B65E1002C6B02 /* ring-champ-numero-actif.png in Resources */,
D3211BA6159C3D410098460B /* outgoing-champ-numero-actif.png in Resources */,
D3211BB2159C4EF10098460B /* UIConferenceHeader.xib in Resources */,
D3211BB9159C8A820098460B /* champ-courbe-autres-numeros-first.png in Resources */,
D3211BBE159CBFD60098460B /* cancel_white_bg_default.png in Resources */,
D3211BC0159CBFD70098460B /* cancel_white_bg_disabled.png in Resources */,
D3211BC2159CBFD70098460B /* cancel_white_bg_over.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2489,6 +2525,12 @@
D31AAF6A159B5C68002C6B02 /* finir-conference-actif.png in Resources */,
D31AAF6C159B5C68002C6B02 /* finir-conference-over.png in Resources */,
D31AAF6F159B65E1002C6B02 /* ring-champ-numero-actif.png in Resources */,
D3211BA7159C3D410098460B /* outgoing-champ-numero-actif.png in Resources */,
D3211BB3159C4EF10098460B /* UIConferenceHeader.xib in Resources */,
D3211BBA159C8A820098460B /* champ-courbe-autres-numeros-first.png in Resources */,
D3211BBF159CBFD70098460B /* cancel_white_bg_default.png in Resources */,
D3211BC1159CBFD70098460B /* cancel_white_bg_disabled.png in Resources */,
D3211BC3159CBFD70098460B /* cancel_white_bg_over.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2563,6 +2605,7 @@
D31B4B21159876C0002E6C72 /* UICompositeViewController.m in Sources */,
D3F34F351599C354005BE94F /* UIModalViewController.m in Sources */,
D31AAF5E159B3919002C6B02 /* InCallTableViewController.m in Sources */,
D3211BB0159C4EF10098460B /* UIConferenceHeader.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2634,6 +2677,7 @@
D31B4B22159876C0002E6C72 /* UICompositeViewController.m in Sources */,
D3F34F361599C354005BE94F /* UIModalViewController.m in Sources */,
D31AAF5F159B3919002C6B02 /* InCallTableViewController.m in Sources */,
D3211BB1159C4EF10098460B /* UIConferenceHeader.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};