mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
major mv
This commit is contained in:
parent
9b8daaed1e
commit
2c05f973c0
162 changed files with 1921 additions and 1995 deletions
39
Classes/AboutView.h
Normal file
39
Classes/AboutView.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/* AboutViewController.h
|
||||
*
|
||||
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UICompositeView.h"
|
||||
|
||||
@interface AboutView : UIViewController <UICompositeViewDelegate, UIWebViewDelegate> {
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UILabel *linphoneLabel;
|
||||
@property(nonatomic, strong) IBOutlet UILabel *linphoneIphoneVersionLabel;
|
||||
@property(nonatomic, strong) IBOutlet UILabel *linphoneCoreVersionLabel;
|
||||
@property(nonatomic, strong) IBOutlet UIView *contentView;
|
||||
@property(nonatomic, strong) IBOutlet UILabel *linkLabel;
|
||||
@property(nonatomic, strong) IBOutlet UILabel *copyrightLabel;
|
||||
@property(nonatomic, strong) IBOutlet UILabel *licenseLabel;
|
||||
@property(nonatomic, strong) IBOutlet UIWebView *licensesView;
|
||||
@property(nonatomic, strong) IBOutlet UITapGestureRecognizer *linkTapGestureRecognizer;
|
||||
|
||||
- (IBAction)onLinkTap:(id)sender;
|
||||
|
||||
@end
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
#include "linphone/lpconfig.h"
|
||||
#include "LinphoneIOSVersion.h"
|
||||
|
||||
@implementation AboutViewController
|
||||
@implementation AboutView
|
||||
|
||||
@synthesize linphoneCoreVersionLabel;
|
||||
@synthesize linphoneLabel;
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
self = [super initWithNibName:@"AboutViewController" bundle:[NSBundle mainBundle]];
|
||||
self = [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
if (self != nil) {
|
||||
self->linkTapGestureRecognizer =
|
||||
[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onLinkTap:)];
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
[LinphoneUtils adjustFontSize:self.view mult:2.22f];
|
||||
}
|
||||
|
||||
[AboutViewController removeBackground:licensesView];
|
||||
[AboutView removeBackground:licensesView];
|
||||
|
||||
// Create a request to the resource
|
||||
NSURLRequest *request =
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
// Load the resource using the request
|
||||
[licensesView setDelegate:self];
|
||||
[licensesView loadRequest:request];
|
||||
[[AboutViewController defaultScrollView:licensesView] setScrollEnabled:FALSE];
|
||||
[[AboutView defaultScrollView:licensesView] setScrollEnabled:FALSE];
|
||||
}
|
||||
|
||||
#pragma mark - UICompositeViewDelegate Functions
|
||||
|
|
@ -90,9 +90,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"About"
|
||||
content:@"AboutViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
tabBar:@"UIMainBar"
|
||||
content:@"AboutView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:@"TabBarViewController"
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
portraitMode:true];
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/* AboutViewController.h
|
||||
*
|
||||
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UICompositeViewController.h"
|
||||
|
||||
@interface AboutViewController : UIViewController<UICompositeViewDelegate, UIWebViewDelegate> {
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UILabel *linphoneLabel;
|
||||
@property (nonatomic, strong) IBOutlet UILabel *linphoneIphoneVersionLabel;
|
||||
@property (nonatomic, strong) IBOutlet UILabel *linphoneCoreVersionLabel;
|
||||
@property (nonatomic, strong) IBOutlet UIView *contentView;
|
||||
@property (nonatomic, strong) IBOutlet UILabel *linkLabel;
|
||||
@property (nonatomic, strong) IBOutlet UILabel *copyrightLabel;
|
||||
@property (nonatomic, strong) IBOutlet UILabel *licenseLabel;
|
||||
@property (nonatomic, strong) IBOutlet UIWebView *licensesView;
|
||||
@property (nonatomic, strong) IBOutlet UITapGestureRecognizer *linkTapGestureRecognizer;
|
||||
|
||||
- (IBAction)onLinkTap:(id)sender;
|
||||
|
||||
@end
|
||||
|
|
@ -19,11 +19,11 @@
|
|||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <XMLRPCConnectionDelegate.h>
|
||||
#import "UICompositeViewController.h"
|
||||
#import "UICompositeView.h"
|
||||
#import "TPKeyboardAvoidingScrollView.h"
|
||||
|
||||
@interface AssistantViewController : TPMultiLayoutViewController <UITextFieldDelegate, UICompositeViewDelegate,
|
||||
XMLRPCConnectionDelegate, UIAlertViewDelegate> {
|
||||
@interface AssistantView : TPMultiLayoutViewController <UITextFieldDelegate, UICompositeViewDelegate,
|
||||
XMLRPCConnectionDelegate, UIAlertViewDelegate> {
|
||||
@private
|
||||
UITextField *activeTextField;
|
||||
UIView *currentView;
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "AssistantViewController.h"
|
||||
#import "AssistantView.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "UITextField+DoneButton.h"
|
||||
|
|
@ -40,12 +40,12 @@ typedef enum _ViewElement {
|
|||
ViewElement_Username_Error = 404,
|
||||
} ViewElement;
|
||||
|
||||
@implementation AssistantViewController
|
||||
@implementation AssistantView
|
||||
|
||||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
self = [super initWithNibName:@"AssistantViewController" bundle:[NSBundle mainBundle]];
|
||||
self = [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
if (self != nil) {
|
||||
[[NSBundle mainBundle] loadNibNamed:@"AssistantViews" owner:self options:nil];
|
||||
historyViews = [[NSMutableArray alloc] init];
|
||||
|
|
@ -65,8 +65,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"Assistant"
|
||||
content:@"AssistantViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
content:@"AssistantView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:nil
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
|
|
@ -131,7 +131,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[(UITextField *)view setText:@""];
|
||||
} else {
|
||||
for (UIView *subview in view.subviews) {
|
||||
[AssistantViewController cleanTextField:subview];
|
||||
[AssistantView cleanTextField:subview];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -181,12 +181,12 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (void)resetTextFields {
|
||||
[AssistantViewController cleanTextField:_welcomeView];
|
||||
[AssistantViewController cleanTextField:_createAccountView];
|
||||
[AssistantViewController cleanTextField:_linphoneLoginView];
|
||||
[AssistantViewController cleanTextField:_loginView];
|
||||
[AssistantViewController cleanTextField:_createAccountActivationView];
|
||||
[AssistantViewController cleanTextField:_remoteProvisionningView];
|
||||
[AssistantView cleanTextField:_welcomeView];
|
||||
[AssistantView cleanTextField:_createAccountView];
|
||||
[AssistantView cleanTextField:_linphoneLoginView];
|
||||
[AssistantView cleanTextField:_loginView];
|
||||
[AssistantView cleanTextField:_createAccountActivationView];
|
||||
[AssistantView cleanTextField:_remoteProvisionningView];
|
||||
}
|
||||
|
||||
- (void)reset {
|
||||
|
|
@ -479,7 +479,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
switch (state) {
|
||||
case LinphoneRegistrationOk: {
|
||||
_waitView.hidden = true;
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerView compositeViewDescription]];
|
||||
break;
|
||||
}
|
||||
case LinphoneRegistrationNone:
|
||||
|
|
@ -605,7 +605,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (IBAction)onDialerBackClick:(id)sender {
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerView compositeViewDescription]];
|
||||
}
|
||||
|
||||
- (IBAction)onGotoCreateAccountClick:(id)sender {
|
||||
|
|
@ -690,8 +690,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
block:^{
|
||||
_waitView.hidden = true;
|
||||
[self addProxyConfig:username password:password domain:domain withTransport:transport];
|
||||
[[PhoneMainView instance]
|
||||
changeCurrentView:[DialerViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerView compositeViewDescription]];
|
||||
}];
|
||||
[alert show];
|
||||
} else {
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AboutViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AboutView">
|
||||
<connections>
|
||||
<outlet property="contentView" destination="51" id="64"/>
|
||||
<outlet property="copyrightLabel" destination="58" id="72"/>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AssistantViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AssistantView">
|
||||
<connections>
|
||||
<outlet property="contentView" destination="98" id="99"/>
|
||||
<outlet property="portraitView" destination="12" id="117"/>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AssistantViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AssistantView">
|
||||
<connections>
|
||||
<outlet property="createAccountActivationView" destination="101" id="cxQ-rX-4fA"/>
|
||||
<outlet property="createAccountView" destination="44" id="70"/>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="IncomingCallViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CallIncomingView">
|
||||
<connections>
|
||||
<outlet property="addressLabel" destination="78f-eb-xdx" id="Qjw-7G-oqG"/>
|
||||
<outlet property="avatarImage" destination="19" id="20"/>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="OutgoingCallViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CallOutgoingView">
|
||||
<connections>
|
||||
<outlet property="addressLabel" destination="2fa-Ag-3GW" id="2Oe-UW-rPC"/>
|
||||
<outlet property="avatarImage" destination="bNo-O5-DWh" id="eqo-0s-UoN"/>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="InCallViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CallView">
|
||||
<connections>
|
||||
<outlet property="callTableController" destination="162" id="167"/>
|
||||
<outlet property="callTableView" destination="106" id="109"/>
|
||||
|
|
@ -18,7 +17,7 @@
|
|||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewController id="162" userLabel="callTableController" customClass="InCallTableViewController">
|
||||
<tableViewController id="162" userLabel="callTableController" customClass="CallTableView">
|
||||
<extendedEdge key="edgesForExtendedLayout"/>
|
||||
<connections>
|
||||
<outlet property="view" destination="106" id="166"/>
|
||||
|
|
@ -67,7 +66,7 @@
|
|||
</accessibility>
|
||||
</view>
|
||||
<view contentMode="scaleAspectFit" id="127" userLabel="preview">
|
||||
<rect key="frame" x="254" y="355" width="113" height="140"/>
|
||||
<rect key="frame" x="254.00000029960563" y="354.99999967643191" width="113" height="140"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChatRoomViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChatConversationView">
|
||||
<connections>
|
||||
<outlet property="addressLabel" destination="40" id="43"/>
|
||||
<outlet property="avatarImage" destination="41" id="44"/>
|
||||
|
|
@ -185,7 +185,7 @@
|
|||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
|
||||
<point key="canvasLocation" x="235.5" y="366.5"/>
|
||||
</view>
|
||||
<tableViewController autoresizesArchivedViewToFullSize="NO" id="29" userLabel="tableController" customClass="ChatRoomTableViewController">
|
||||
<tableViewController autoresizesArchivedViewToFullSize="NO" id="29" userLabel="tableController" customClass="ChatConversationTableView">
|
||||
<extendedEdge key="edgesForExtendedLayout"/>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<connections>
|
||||
|
|
@ -1,18 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChatViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChatsListView">
|
||||
<connections>
|
||||
<outlet property="tableController" destination="4" id="18"/>
|
||||
<outlet property="view" destination="5" id="14"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewController autoresizesArchivedViewToFullSize="NO" id="4" userLabel="tableController" customClass="ChatTableViewController">
|
||||
<tableViewController autoresizesArchivedViewToFullSize="NO" id="4" userLabel="tableController" customClass="ChatsListTableView">
|
||||
<extendedEdge key="edgesForExtendedLayout"/>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<connections>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ContactDetailsLabelViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ContactDetailsLabelView">
|
||||
<connections>
|
||||
<outlet property="tableView" destination="5" id="15"/>
|
||||
<outlet property="view" destination="4" id="12"/>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ContactDetailsViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ContactDetailsView">
|
||||
<connections>
|
||||
<outlet property="backButton" destination="9" id="50"/>
|
||||
<outlet property="editButton" destination="8" id="31"/>
|
||||
|
|
@ -92,7 +91,7 @@
|
|||
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
|
||||
</view>
|
||||
<tableViewController id="20" userLabel="tableController" customClass="ContactDetailsTableViewController">
|
||||
<tableViewController id="20" userLabel="tableController" customClass="ContactDetailsTableView">
|
||||
<extendedEdge key="edgesForExtendedLayout"/>
|
||||
<connections>
|
||||
<outlet property="contactDetailsDelegate" destination="-1" id="53"/>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ContactsViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ContactsListView">
|
||||
<connections>
|
||||
<outlet property="addButton" destination="6" id="91"/>
|
||||
<outlet property="allButton" destination="4" id="27"/>
|
||||
|
|
@ -19,7 +18,7 @@
|
|||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewController id="TJG-JZ-YRR" userLabel="tableController" customClass="ContactsTableViewController">
|
||||
<tableViewController id="TJG-JZ-YRR" userLabel="tableController" customClass="ContactsListTableView">
|
||||
<connections>
|
||||
<outlet property="view" destination="zOo-FS-W6l" id="cM7-Da-i7e"/>
|
||||
</connections>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DialerViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DialerView">
|
||||
<connections>
|
||||
<outlet property="addCallButton" destination="184" id="227"/>
|
||||
<outlet property="addContactButton" destination="222" id="225"/>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HistoryDetailsViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HistoryDetailsView">
|
||||
<connections>
|
||||
<outlet property="addContactButton" destination="50" id="52"/>
|
||||
<outlet property="addressLabel" destination="EoB-ux-sD7" id="Ajw-2s-M6X"/>
|
||||
|
|
@ -144,7 +144,7 @@
|
|||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
|
||||
<point key="canvasLocation" x="254.5" y="288.5"/>
|
||||
</view>
|
||||
<tableViewController id="baU-d4-eu3" customClass="HistoryDetailsTableViewController">
|
||||
<tableViewController id="baU-d4-eu3" customClass="HistoryDetailsTableView">
|
||||
<connections>
|
||||
<outlet property="view" destination="k6N-Av-eOu" id="Dos-d4-5l5"/>
|
||||
</connections>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HistoryViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HistoryListView">
|
||||
<connections>
|
||||
<outlet property="allButton" destination="4" id="27"/>
|
||||
<outlet property="deleteButton" destination="35" id="36"/>
|
||||
|
|
@ -112,7 +111,7 @@
|
|||
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
|
||||
</view>
|
||||
<tableViewController autoresizesArchivedViewToFullSize="NO" id="18" userLabel="tableController" customClass="HistoryTableViewController">
|
||||
<tableViewController autoresizesArchivedViewToFullSize="NO" id="18" userLabel="tableController" customClass="HistoryListTableView">
|
||||
<extendedEdge key="edgesForExtendedLayout"/>
|
||||
<connections>
|
||||
<outlet property="view" destination="17" id="25"/>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ImageViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ImageView">
|
||||
<connections>
|
||||
<outlet property="backButton" destination="RW1-kp-wn7" id="DJc-Ps-J3p"/>
|
||||
<outlet property="scrollView" destination="12" id="13"/>
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
|
@ -38,7 +37,7 @@
|
|||
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
|
||||
</view>
|
||||
<viewController nibName="UICompositeViewController" wantsFullScreenLayout="YES" id="208" userLabel="mainViewController" customClass="UICompositeViewController">
|
||||
<viewController nibName="UICompositeViewController" wantsFullScreenLayout="YES" id="208" userLabel="mainViewController" customClass="UICompositeView">
|
||||
<extendedEdge key="edgesForExtendedLayout"/>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
</viewController>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<development version="6000" identifier="xcode"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SettingsViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SettingsView">
|
||||
<connections>
|
||||
<outlet property="navigationController" destination="10" id="15"/>
|
||||
<outlet property="settingsController" destination="6" id="8"/>
|
||||
45
Classes/CallIncomingView.h
Normal file
45
Classes/CallIncomingView.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/* IncomingCallViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UICompositeView.h"
|
||||
#import "TPMultiLayoutViewController.h"
|
||||
#include "LinphoneManager.h"
|
||||
|
||||
@protocol IncomingCallViewDelegate <NSObject>
|
||||
|
||||
- (void)incomingCallAccepted:(LinphoneCall *)call;
|
||||
- (void)incomingCallDeclined:(LinphoneCall *)call;
|
||||
- (void)incomingCallAborted:(LinphoneCall *)call;
|
||||
|
||||
@end
|
||||
|
||||
@interface CallIncomingView : TPMultiLayoutViewController <UICompositeViewDelegate> {
|
||||
}
|
||||
@property(weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||
@property(nonatomic, strong) IBOutlet UILabel *addressLabel;
|
||||
@property(nonatomic, strong) IBOutlet UIImageView *avatarImage;
|
||||
@property(nonatomic, assign) LinphoneCall *call;
|
||||
@property(nonatomic, strong) id<IncomingCallViewDelegate> delegate;
|
||||
|
||||
- (IBAction)onAcceptClick:(id)event;
|
||||
- (IBAction)onDeclineClick:(id)event;
|
||||
|
||||
@end
|
||||
|
|
@ -17,13 +17,13 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "IncomingCallViewController.h"
|
||||
#import "CallIncomingView.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "FastAddressBook.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "UILinphone.h"
|
||||
#import "Utils.h"
|
||||
|
||||
@implementation IncomingCallViewController
|
||||
@implementation CallIncomingView
|
||||
|
||||
@synthesize addressLabel;
|
||||
@synthesize avatarImage;
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
return [super initWithNibName:@"IncomingCallViewController" bundle:[NSBundle mainBundle]];
|
||||
return [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
|
|
@ -64,8 +64,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"IncomingCall"
|
||||
content:@"IncomingCallViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
content:@"CallIncomingView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:nil
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
|
|
@ -93,7 +93,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (void)dismiss {
|
||||
if ([[[PhoneMainView instance] currentView] equal:[IncomingCallViewController compositeViewDescription]]) {
|
||||
if ([[[PhoneMainView instance] currentView] equal:[CallIncomingView compositeViewDescription]]) {
|
||||
[[PhoneMainView instance] popCurrentView];
|
||||
}
|
||||
}
|
||||
|
|
@ -19,12 +19,12 @@
|
|||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UICompositeViewController.h"
|
||||
#import "UICompositeView.h"
|
||||
#import "TPMultiLayoutViewController.h"
|
||||
#include "linphone/linphonecore.h"
|
||||
#import "UIRoundedImageView.h"
|
||||
|
||||
@interface OutgoingCallViewController : TPMultiLayoutViewController <UICompositeViewDelegate> {
|
||||
@interface CallOutgoingView : TPMultiLayoutViewController <UICompositeViewDelegate> {
|
||||
}
|
||||
@property(weak, nonatomic) IBOutlet UIRoundedImageView *avatarImage;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||
|
|
@ -17,10 +17,10 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "OutgoingCallViewController.h"
|
||||
#import "CallOutgoingView.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
@implementation OutgoingCallViewController
|
||||
@implementation CallOutgoingView
|
||||
|
||||
#pragma mark - UICompositeViewDelegate Functions
|
||||
|
||||
|
|
@ -29,8 +29,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"OutgoingCall"
|
||||
content:@"OutgoingCallViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
content:@"CallOutgoingView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:nil
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
|
|
@ -4,18 +4,18 @@
|
|||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
#include "linphone/linphonecore.h"
|
||||
|
||||
@interface InCallTableViewController : UITableViewController {
|
||||
@private
|
||||
NSTimer *updateTime;
|
||||
BOOL minimized;
|
||||
@interface CallTableView : UITableViewController {
|
||||
@private
|
||||
NSTimer *updateTime;
|
||||
BOOL minimized;
|
||||
}
|
||||
|
||||
- (void)minimizeAll;
|
||||
|
|
@ -17,13 +17,13 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "InCallTableViewController.h"
|
||||
#import "CallTableView.h"
|
||||
#import "UICallCell.h"
|
||||
#import "UIConferenceHeader.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "Utils.h"
|
||||
|
||||
@implementation InCallTableViewController
|
||||
@implementation CallTableView
|
||||
|
||||
static NSString *const kLinphoneInCallCellData = @"LinphoneInCallCellData";
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ enum TableSection { ConferenceSection = 0, CallSection = 1 };
|
|||
const MSList *calls = linphone_core_get_calls(lc);
|
||||
|
||||
while (calls != 0) {
|
||||
if (![InCallTableViewController isInConference:((LinphoneCall *)calls->data)]) {
|
||||
if (![CallTableView isInConference:((LinphoneCall *)calls->data)]) {
|
||||
count++;
|
||||
}
|
||||
calls = calls->next;
|
||||
|
|
@ -100,7 +100,7 @@ enum TableSection { ConferenceSection = 0, CallSection = 1 };
|
|||
const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]);
|
||||
|
||||
while (calls != 0) {
|
||||
if ([InCallTableViewController isInConference:(LinphoneCall *)calls->data] == conf) {
|
||||
if ([CallTableView isInConference:(LinphoneCall *)calls->data] == conf) {
|
||||
if (index == 0)
|
||||
break;
|
||||
index--;
|
||||
|
|
@ -208,7 +208,7 @@ enum TableSection { ConferenceSection = 0, CallSection = 1 };
|
|||
|
||||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
LinphoneCall *currentCall = linphone_core_get_current_call(lc);
|
||||
LinphoneCall *call = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConference];
|
||||
LinphoneCall *call = [CallTableView retrieveCallAtIndex:indexPath.row inConference:inConference];
|
||||
[cell setData:[self addCallData:call]];
|
||||
|
||||
// Update cell
|
||||
|
|
@ -235,7 +235,7 @@ enum TableSection { ConferenceSection = 0, CallSection = 1 };
|
|||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
|
||||
if (section == CallSection) {
|
||||
count = [InCallTableViewController callCount:lc];
|
||||
count = [CallTableView callCount:lc];
|
||||
} else {
|
||||
count = linphone_core_get_conference_size(lc);
|
||||
if (linphone_core_is_in_conference(lc)) {
|
||||
|
|
@ -306,7 +306,7 @@ enum TableSection { ConferenceSection = 0, CallSection = 1 };
|
|||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
bool inConference = indexPath.section == ConferenceSection;
|
||||
LinphoneCall *call = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConference];
|
||||
LinphoneCall *call = [CallTableView retrieveCallAtIndex:indexPath.row inConference:inConference];
|
||||
UICallCellData *data = [self getCallData:call];
|
||||
if (data != nil && data->minimize)
|
||||
return [UICallCell getMinimizedHeight];
|
||||
50
Classes/CallView.h
Normal file
50
Classes/CallView.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/* InCallViewController.h
|
||||
*
|
||||
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "VideoZoomHandler.h"
|
||||
#import "UICamSwitch.h"
|
||||
|
||||
#import "UICompositeView.h"
|
||||
#import "CallTableView.h"
|
||||
|
||||
@class VideoView;
|
||||
|
||||
@interface CallView : UIViewController <UIGestureRecognizerDelegate, UICompositeViewDelegate> {
|
||||
@private
|
||||
UITapGestureRecognizer *singleFingerTap;
|
||||
NSTimer *hideControlsTimer;
|
||||
BOOL videoShown;
|
||||
VideoZoomHandler *videoZoomHandler;
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) IBOutlet CallTableView *callTableController;
|
||||
@property(nonatomic, strong) IBOutlet UITableView *callTableView;
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UIView *videoGroup;
|
||||
@property(nonatomic, strong) IBOutlet UIView *videoView;
|
||||
#ifdef TEST_VIDEO_VIEW_CHANGE
|
||||
@property(nonatomic, retain) IBOutlet UIView *testVideoView;
|
||||
#endif
|
||||
@property(nonatomic, strong) IBOutlet UIView *videoPreview;
|
||||
@property(nonatomic, strong) IBOutlet UICamSwitch *videoCameraSwitch;
|
||||
@property(nonatomic, strong) IBOutlet UIActivityIndicatorView *videoWaitingForFirstImage;
|
||||
|
||||
@end
|
||||
|
|
@ -24,17 +24,17 @@
|
|||
#import <OpenGLES/EAGL.h>
|
||||
#import <OpenGLES/EAGLDrawable.h>
|
||||
|
||||
#import "IncallViewController.h"
|
||||
#import "CallView.h"
|
||||
#import "UICallCell.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "UILinphone.h"
|
||||
#import "Utils.h"
|
||||
|
||||
#include "linphone/linphonecore.h"
|
||||
|
||||
const NSInteger SECURE_BUTTON_TAG = 5;
|
||||
|
||||
@implementation InCallViewController {
|
||||
@implementation CallView {
|
||||
BOOL hiddenVolume;
|
||||
}
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ const NSInteger SECURE_BUTTON_TAG = 5;
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
self = [super initWithNibName:@"InCallViewController" bundle:[NSBundle mainBundle]];
|
||||
self = [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
if (self != nil) {
|
||||
self->singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showControls:)];
|
||||
self->videoZoomHandler = [[VideoZoomHandler alloc] init];
|
||||
|
|
@ -75,8 +75,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"InCall"
|
||||
content:@"InCallViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
content:@"CallView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:nil
|
||||
fullscreen:false
|
||||
landscapeMode:false
|
||||
|
|
@ -201,68 +201,69 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
switch (state) {
|
||||
case LinphoneCallIncomingReceived:
|
||||
case LinphoneCallOutgoingInit: {
|
||||
if (linphone_core_get_calls_nb(lc) > 1) {
|
||||
[callTableController minimizeAll];
|
||||
}
|
||||
}
|
||||
case LinphoneCallConnected:
|
||||
case LinphoneCallStreamsRunning: {
|
||||
// check video
|
||||
if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
|
||||
[self displayVideoCall:animated];
|
||||
} else {
|
||||
[self displayTableCall:animated];
|
||||
const LinphoneCallParams *param = linphone_call_get_current_params(call);
|
||||
const LinphoneCallAppData *callAppData =
|
||||
(__bridge const LinphoneCallAppData *)(linphone_call_get_user_pointer(call));
|
||||
if (state == LinphoneCallStreamsRunning && callAppData->videoRequested &&
|
||||
linphone_call_params_low_bandwidth_enabled(param)) {
|
||||
// too bad video was not enabled because low bandwidth
|
||||
UIAlertView *alert = [[UIAlertView alloc]
|
||||
initWithTitle:NSLocalizedString(@"Low bandwidth", nil)
|
||||
message:NSLocalizedString(@"Video cannot be activated because of low bandwidth "
|
||||
@"condition, only audio is available",
|
||||
nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue", nil)
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
callAppData->videoRequested = FALSE; /*reset field*/
|
||||
case LinphoneCallIncomingReceived:
|
||||
case LinphoneCallOutgoingInit: {
|
||||
if (linphone_core_get_calls_nb(lc) > 1) {
|
||||
[callTableController minimizeAll];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LinphoneCallUpdatedByRemote: {
|
||||
const LinphoneCallParams *current = linphone_call_get_current_params(call);
|
||||
const LinphoneCallParams *remote = linphone_call_get_remote_params(call);
|
||||
case LinphoneCallConnected:
|
||||
case LinphoneCallStreamsRunning: {
|
||||
// check video
|
||||
if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
|
||||
[self displayVideoCall:animated];
|
||||
} else {
|
||||
[self displayTableCall:animated];
|
||||
const LinphoneCallParams *param = linphone_call_get_current_params(call);
|
||||
const LinphoneCallAppData *callAppData =
|
||||
(__bridge const LinphoneCallAppData *)(linphone_call_get_user_pointer(call));
|
||||
if (state == LinphoneCallStreamsRunning && callAppData->videoRequested &&
|
||||
linphone_call_params_low_bandwidth_enabled(param)) {
|
||||
// too bad video was not enabled because low bandwidth
|
||||
UIAlertView *alert = [[UIAlertView alloc]
|
||||
initWithTitle:NSLocalizedString(@"Low bandwidth", nil)
|
||||
message:NSLocalizedString(@"Video cannot be activated because of low bandwidth "
|
||||
@"condition, only audio is available",
|
||||
nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue", nil)
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
callAppData->videoRequested = FALSE; /*reset field*/
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LinphoneCallUpdatedByRemote: {
|
||||
const LinphoneCallParams *current = linphone_call_get_current_params(call);
|
||||
const LinphoneCallParams *remote = linphone_call_get_remote_params(call);
|
||||
|
||||
/* remote wants to add video */
|
||||
if (linphone_core_video_enabled(lc) && !linphone_call_params_video_enabled(current) &&
|
||||
linphone_call_params_video_enabled(remote) && !linphone_core_get_video_policy(lc)->automatically_accept) {
|
||||
linphone_core_defer_call_update(lc, call);
|
||||
[self displayAskToEnableVideoCall:call];
|
||||
} else if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) {
|
||||
/* remote wants to add video */
|
||||
if (linphone_core_video_enabled(lc) && !linphone_call_params_video_enabled(current) &&
|
||||
linphone_call_params_video_enabled(remote) &&
|
||||
!linphone_core_get_video_policy(lc)->automatically_accept) {
|
||||
linphone_core_defer_call_update(lc, call);
|
||||
[self displayAskToEnableVideoCall:call];
|
||||
} else if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) {
|
||||
[self displayTableCall:animated];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LinphoneCallPausing:
|
||||
case LinphoneCallPaused:
|
||||
case LinphoneCallPausedByRemote: {
|
||||
[self displayTableCall:animated];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LinphoneCallPausing:
|
||||
case LinphoneCallPaused:
|
||||
case LinphoneCallPausedByRemote: {
|
||||
[self displayTableCall:animated];
|
||||
break;
|
||||
}
|
||||
case LinphoneCallEnd:
|
||||
case LinphoneCallError: {
|
||||
if (linphone_core_get_calls_nb(lc) <= 2 && !videoShown) {
|
||||
[callTableController maximizeAll];
|
||||
case LinphoneCallEnd:
|
||||
case LinphoneCallError: {
|
||||
if (linphone_core_get_calls_nb(lc) <= 2 && !videoShown) {
|
||||
[callTableController maximizeAll];
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -272,7 +273,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
hideControlsTimer = nil;
|
||||
}
|
||||
|
||||
if ([[[PhoneMainView instance] currentView] equal:[InCallViewController compositeViewDescription]] && videoShown) {
|
||||
if ([[[PhoneMainView instance] currentView] equal:[CallView compositeViewDescription]] && videoShown) {
|
||||
// show controls
|
||||
[UIView beginAnimations:nil context:nil];
|
||||
[UIView setAnimationDuration:0.3];
|
||||
|
|
@ -297,7 +298,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
hideControlsTimer = nil;
|
||||
}
|
||||
|
||||
if ([[[PhoneMainView instance] currentView] equal:[InCallViewController compositeViewDescription]] && videoShown) {
|
||||
if ([[[PhoneMainView instance] currentView] equal:[CallView compositeViewDescription]] && videoShown) {
|
||||
[UIView beginAnimations:nil context:nil];
|
||||
[UIView setAnimationDuration:0.3];
|
||||
[videoCameraSwitch setAlpha:0.0];
|
||||
|
|
@ -433,7 +434,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
static void hideSpinner(LinphoneCall *call, void *user_data) {
|
||||
InCallViewController *thiz = (__bridge InCallViewController *)user_data;
|
||||
CallView *thiz = (__bridge CallView *)user_data;
|
||||
[thiz hideSpinnerIndicator:call];
|
||||
}
|
||||
|
||||
44
Classes/ChatConversationTableView.h
Normal file
44
Classes/ChatConversationTableView.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/* ChatRoomTableViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#include "linphone/linphonecore.h"
|
||||
|
||||
@protocol ChatConversationDelegate <NSObject>
|
||||
|
||||
- (BOOL)startImageUpload:(UIImage *)image url:(NSURL *)url;
|
||||
- (void)resendChat:(NSString *)message withExternalUrl:(NSString *)url;
|
||||
|
||||
@end
|
||||
|
||||
@interface ChatConversationTableView : UITableViewController {
|
||||
@private
|
||||
LinphoneChatRoom *chatRoom;
|
||||
MSList *messageList;
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) id<ChatConversationDelegate> chatRoomDelegate;
|
||||
|
||||
- (void)addChatEntry:(LinphoneChatMessage *)chat;
|
||||
- (void)scrollToBottom:(BOOL)animated;
|
||||
- (void)scrollToLastUnread:(BOOL)animated;
|
||||
- (void)updateChatEntry:(LinphoneChatMessage *)chat;
|
||||
- (void)setChatRoom:(LinphoneChatRoom *)room;
|
||||
|
||||
@end
|
||||
|
|
@ -18,11 +18,11 @@
|
|||
*/
|
||||
|
||||
#import "LinphoneManager.h"
|
||||
#import "ChatRoomTableViewController.h"
|
||||
#import "UIChatRoomCell.h"
|
||||
#import "ChatConversationTableView.h"
|
||||
#import "UIChatConversationCell.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
@implementation ChatRoomTableViewController
|
||||
@implementation ChatConversationTableView
|
||||
|
||||
@synthesize chatRoomDelegate;
|
||||
|
||||
|
|
@ -168,9 +168,9 @@
|
|||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
static NSString *kCellId = @"UIChatRoomCell";
|
||||
UIChatRoomCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId];
|
||||
UIChatConversationCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId];
|
||||
if (cell == nil) {
|
||||
cell = [[UIChatRoomCell alloc] initWithIdentifier:kCellId];
|
||||
cell = [[UIChatConversationCell alloc] initWithIdentifier:kCellId];
|
||||
}
|
||||
|
||||
LinphoneChatMessage *chat = ms_list_nth_data(self->messageList, (int)[indexPath row]);
|
||||
|
|
@ -209,7 +209,7 @@
|
|||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
LinphoneChatMessage *message = ms_list_nth_data(self->messageList, (int)[indexPath row]);
|
||||
return [UIChatRoomCell height:message width:[self.view frame].size.width];
|
||||
return [UIChatConversationCell height:message width:[self.view frame].size.width];
|
||||
}
|
||||
|
||||
@end
|
||||
63
Classes/ChatConversationView.h
Normal file
63
Classes/ChatConversationView.h
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/* ChatRoomViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UIToggleButton.h"
|
||||
#import "UICompositeView.h"
|
||||
#import "ChatConversationTableView.h"
|
||||
#import "ImagePickerView.h"
|
||||
#import "OrderedDictionary.h"
|
||||
|
||||
#include "linphone/linphonecore.h"
|
||||
|
||||
@interface ChatConversationView
|
||||
: UIViewController <UITextViewDelegate, UICompositeViewDelegate, ImagePickerDelegate, ChatConversationDelegate> {
|
||||
LinphoneChatRoom *chatRoom;
|
||||
OrderedDictionary *imageQualities;
|
||||
BOOL scrollOnGrowingEnabled;
|
||||
BOOL composingVisible;
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) IBOutlet ChatConversationTableView *tableController;
|
||||
@property(nonatomic, strong) IBOutlet UIToggleButton *editButton;
|
||||
@property(weak, nonatomic) IBOutlet UITextView *messageField;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *sendButton;
|
||||
@property(nonatomic, strong) IBOutlet UILabel *addressLabel;
|
||||
@property(nonatomic, strong) IBOutlet UIImageView *avatarImage;
|
||||
@property(nonatomic, strong) IBOutlet UIView *headerView;
|
||||
@property(nonatomic, strong) IBOutlet UIView *chatView;
|
||||
@property(nonatomic, strong) IBOutlet UIView *messageView;
|
||||
@property(nonatomic, strong) IBOutlet UITapGestureRecognizer *listTapGestureRecognizer;
|
||||
@property(nonatomic, strong) IBOutlet UISwipeGestureRecognizer *listSwipeGestureRecognizer;
|
||||
@property(strong, nonatomic) IBOutlet UILabel *composeLabel;
|
||||
@property(strong, nonatomic) IBOutlet UIView *composeIndicatorView;
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UIButton *pictureButton;
|
||||
|
||||
- (IBAction)onBackClick:(id)event;
|
||||
- (IBAction)onEditClick:(id)event;
|
||||
- (IBAction)onMessageChange:(id)sender;
|
||||
- (IBAction)onSendClick:(id)event;
|
||||
- (IBAction)onPictureClick:(id)event;
|
||||
- (IBAction)onListTap:(id)sender;
|
||||
|
||||
- (void)setChatRoom:(LinphoneChatRoom *)room;
|
||||
|
||||
@end
|
||||
|
|
@ -17,13 +17,13 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "ChatRoomViewController.h"
|
||||
#import "ChatConversationView.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "UILinphone.h"
|
||||
#import "Utils/FileTransferDelegate.h"
|
||||
#import "UIChatRoomCell.h"
|
||||
#import "Utils.h"
|
||||
#import "FileTransferDelegate.h"
|
||||
#import "UIChatConversationCell.h"
|
||||
|
||||
@implementation ChatRoomViewController
|
||||
@implementation ChatConversationView
|
||||
|
||||
@synthesize messageField;
|
||||
@synthesize tableController;
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
self = [super initWithNibName:@"ChatRoomViewController" bundle:[NSBundle mainBundle]];
|
||||
self = [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
if (self != nil) {
|
||||
self->scrollOnGrowingEnabled = TRUE;
|
||||
self->chatRoom = NULL;
|
||||
|
|
@ -71,9 +71,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"ChatRoom"
|
||||
content:@"ChatRoomViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
tabBar:@"UIMainBar"
|
||||
content:@"ChatConversationView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:@"TabBarViewController"
|
||||
fullscreen:false
|
||||
landscapeMode:false
|
||||
portraitMode:true];
|
||||
|
|
@ -207,7 +207,7 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
|
|||
? "photo transfer"
|
||||
: linphone_chat_message_get_text(msg);
|
||||
LOGI(@"Delivery status for [%s] is [%s]", text, linphone_chat_message_state_to_string(state));
|
||||
ChatRoomViewController *thiz = (__bridge ChatRoomViewController *)ud;
|
||||
ChatConversationView *thiz = (__bridge ChatConversationView *)ud;
|
||||
[thiz.tableController updateChatEntry:msg];
|
||||
}
|
||||
|
||||
|
|
@ -254,11 +254,11 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
|
|||
[errorAlert show];
|
||||
} else {
|
||||
LOGI(@"Image saved to [%@]", [assetURL absoluteString]);
|
||||
[self chatRoomStartImageUpload:image url:assetURL];
|
||||
[self startImageUpload:image url:assetURL];
|
||||
}
|
||||
}];
|
||||
} else {
|
||||
[self chatRoomStartImageUpload:image url:url];
|
||||
[self startImageUpload:image url:url];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -461,12 +461,12 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
|
|||
- (IBAction)onPictureClick:(id)event {
|
||||
[messageField resignFirstResponder];
|
||||
CGRect rect = [self.messageView convertRect:[pictureButton frame] toView:self.view];
|
||||
[ImagePickerViewController SelectImageFromDevice:self atPosition:rect inView:self.view];
|
||||
[ImagePickerView SelectImageFromDevice:self atPosition:rect inView:self.view];
|
||||
}
|
||||
|
||||
#pragma mark ChatRoomDelegate
|
||||
|
||||
- (BOOL)chatRoomStartImageUpload:(UIImage *)image url:(NSURL *)url {
|
||||
- (BOOL)startImageUpload:(UIImage *)image url:(NSURL *)url {
|
||||
FileTransferDelegate *fileTransfer = [[FileTransferDelegate alloc] init];
|
||||
[fileTransfer upload:image withURL:url forChatRoom:chatRoom];
|
||||
[tableController addChatEntry:linphone_chat_message_ref(fileTransfer.message)];
|
||||
|
|
@ -483,10 +483,9 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
|
|||
- (void)imagePickerDelegateImage:(UIImage *)image info:(NSDictionary *)info {
|
||||
// Dismiss popover on iPad
|
||||
if ([LinphoneManager runningOnIpad]) {
|
||||
UICompositeViewDescription *description = [ImagePickerViewController compositeViewDescription];
|
||||
ImagePickerViewController *controller =
|
||||
DYNAMIC_CAST([[PhoneMainView instance].mainViewController getCachedController:description.content],
|
||||
ImagePickerViewController);
|
||||
UICompositeViewDescription *description = [ImagePickerView compositeViewDescription];
|
||||
ImagePickerView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance].mainViewController getCachedController:description.content], ImagePickerView);
|
||||
if (controller != nil) {
|
||||
[controller.popoverController dismissPopoverAnimated:TRUE];
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
/* ChatRoomTableViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#include "linphone/linphonecore.h"
|
||||
|
||||
@protocol ChatRoomDelegate <NSObject>
|
||||
|
||||
- (BOOL)chatRoomStartImageUpload:(UIImage*)image url:(NSURL*)url;
|
||||
- (void)resendChat:(NSString*)message withExternalUrl:(NSString*)url;
|
||||
|
||||
@end
|
||||
|
||||
@interface ChatRoomTableViewController : UITableViewController {
|
||||
@private
|
||||
LinphoneChatRoom* chatRoom;
|
||||
MSList *messageList;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) id<ChatRoomDelegate> chatRoomDelegate;
|
||||
|
||||
- (void)addChatEntry:(LinphoneChatMessage*)chat;
|
||||
- (void)scrollToBottom:(BOOL)animated;
|
||||
- (void)scrollToLastUnread:(BOOL)animated;
|
||||
- (void)updateChatEntry:(LinphoneChatMessage*)chat;
|
||||
- (void)setChatRoom:(LinphoneChatRoom*)room;
|
||||
|
||||
@end
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
/* ChatRoomViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UIToggleButton.h"
|
||||
#import "UICompositeViewController.h"
|
||||
#import "ChatRoomTableViewController.h"
|
||||
#import "ImagePickerViewController.h"
|
||||
#import "OrderedDictionary.h"
|
||||
|
||||
#include "linphone/linphonecore.h"
|
||||
|
||||
@interface ChatRoomViewController
|
||||
: UIViewController <UITextViewDelegate, UICompositeViewDelegate, ImagePickerDelegate, ChatRoomDelegate> {
|
||||
LinphoneChatRoom *chatRoom;
|
||||
OrderedDictionary *imageQualities;
|
||||
BOOL scrollOnGrowingEnabled;
|
||||
BOOL composingVisible;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) IBOutlet ChatRoomTableViewController* tableController;
|
||||
@property (nonatomic, strong) IBOutlet UIToggleButton *editButton;
|
||||
@property(weak, nonatomic) IBOutlet UITextView *messageField;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* sendButton;
|
||||
@property (nonatomic, strong) IBOutlet UILabel *addressLabel;
|
||||
@property (nonatomic, strong) IBOutlet UIImageView *avatarImage;
|
||||
@property (nonatomic, strong) IBOutlet UIView *headerView;
|
||||
@property (nonatomic, strong) IBOutlet UIView *chatView;
|
||||
@property (nonatomic, strong) IBOutlet UIView *messageView;
|
||||
@property (nonatomic, strong) IBOutlet UITapGestureRecognizer *listTapGestureRecognizer;
|
||||
@property (nonatomic, strong) IBOutlet UISwipeGestureRecognizer *listSwipeGestureRecognizer;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *composeLabel;
|
||||
@property (strong, nonatomic) IBOutlet UIView *composeIndicatorView;
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UIButton* pictureButton;
|
||||
|
||||
- (IBAction)onBackClick:(id)event;
|
||||
- (IBAction)onEditClick:(id)event;
|
||||
- (IBAction)onMessageChange:(id)sender;
|
||||
- (IBAction)onSendClick:(id)event;
|
||||
- (IBAction)onPictureClick:(id)event;
|
||||
- (IBAction)onListTap:(id)sender;
|
||||
|
||||
- (void)setChatRoom:(LinphoneChatRoom*)room;
|
||||
|
||||
@end
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
/* ChatViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UIToggleButton.h"
|
||||
|
||||
#import "ChatTableViewController.h"
|
||||
#import "UICompositeViewController.h"
|
||||
|
||||
@interface ChatViewController : UIViewController<UITextFieldDelegate,UICompositeViewDelegate> {
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) IBOutlet ChatTableViewController* tableController;
|
||||
@property (nonatomic, strong) IBOutlet UIToggleButton *editButton;
|
||||
@property (nonatomic, strong) IBOutlet UITextField *addressField;
|
||||
|
||||
- (IBAction)onAddClick:(id) event;
|
||||
- (IBAction)onEditClick:(id) event;
|
||||
|
||||
@end
|
||||
|
|
@ -4,23 +4,23 @@
|
|||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#include "linphone/linphonecore.h"
|
||||
|
||||
@interface ChatTableViewController : UITableViewController {
|
||||
@interface ChatsListTableView : UITableViewController {
|
||||
}
|
||||
|
||||
- (void)loadData;
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "ChatTableViewController.h"
|
||||
#import "ChatsListTableView.h"
|
||||
#import "UIChatCell.h"
|
||||
|
||||
#import "FileTransferDelegate.h"
|
||||
|
|
@ -25,9 +25,9 @@
|
|||
#import "linphone/linphonecore.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "UACellBackgroundView.h"
|
||||
#import "UILinphone.h"
|
||||
#import "Utils.h"
|
||||
|
||||
@implementation ChatTableViewController {
|
||||
@implementation ChatsListTableView {
|
||||
MSList *data;
|
||||
}
|
||||
|
||||
|
|
@ -140,9 +140,9 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)ms_list_nth_data(data, (int)[indexPath row]);
|
||||
|
||||
// Go to ChatRoom view
|
||||
ChatRoomViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE],
|
||||
ChatRoomViewController);
|
||||
ChatConversationView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatConversationView compositeViewDescription] push:TRUE],
|
||||
ChatConversationView);
|
||||
[controller setChatRoom:chatRoom];
|
||||
}
|
||||
|
||||
37
Classes/ChatsListView.h
Normal file
37
Classes/ChatsListView.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/* ChatViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UIToggleButton.h"
|
||||
|
||||
#import "ChatsListTableView.h"
|
||||
#import "UICompositeView.h"
|
||||
|
||||
@interface ChatsListView : UIViewController <UITextFieldDelegate, UICompositeViewDelegate> {
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) IBOutlet ChatsListTableView *tableController;
|
||||
@property(nonatomic, strong) IBOutlet UIToggleButton *editButton;
|
||||
@property(nonatomic, strong) IBOutlet UITextField *addressField;
|
||||
|
||||
- (IBAction)onAddClick:(id)event;
|
||||
- (IBAction)onEditClick:(id)event;
|
||||
|
||||
@end
|
||||
|
|
@ -17,10 +17,10 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "ChatViewController.h"
|
||||
#import "ChatsListView.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
@implementation ChatViewController
|
||||
@implementation ChatsListView
|
||||
|
||||
@synthesize tableController;
|
||||
@synthesize editButton;
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
return [super initWithNibName:@"ChatViewController" bundle:[NSBundle mainBundle]];
|
||||
return [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
|
@ -64,9 +64,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"Chat"
|
||||
content:@"ChatViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
tabBar:@"UIMainBar"
|
||||
content:@"ChatsListView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:@"TabBarViewController"
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
portraitMode:true];
|
||||
|
|
@ -81,9 +81,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
LinphoneChatRoom *room =
|
||||
linphone_core_get_chat_room_from_uri([LinphoneManager getLc], [addressField.text UTF8String]);
|
||||
if (room != nil) {
|
||||
ChatRoomViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE],
|
||||
ChatRoomViewController);
|
||||
ChatConversationView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatConversationView compositeViewDescription] push:TRUE],
|
||||
ChatConversationView);
|
||||
if (controller != nil) {
|
||||
[controller setChatRoom:room];
|
||||
}
|
||||
|
|
@ -104,7 +104,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[ContactSelection setSipFilter:[LinphoneManager instance].contactFilter];
|
||||
[ContactSelection enableEmailFilter:FALSE];
|
||||
[ContactSelection setNameOrEmailFilter:nil];
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE];
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactsListView compositeViewDescription] push:TRUE];
|
||||
} else {
|
||||
[self startChatRoom];
|
||||
}
|
||||
40
Classes/ContactDetailsLabelView.h
Normal file
40
Classes/ContactDetailsLabelView.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/* ContactDetailsLabelViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "UICompositeView.h"
|
||||
|
||||
@protocol ContactDetailsLabelViewDelegate <NSObject>
|
||||
|
||||
- (void)changeContactDetailsLabel:(NSString *)label;
|
||||
|
||||
@end
|
||||
|
||||
@interface ContactDetailsLabelView
|
||||
: UIViewController <UITableViewDelegate, UITableViewDataSource, UICompositeViewDelegate> {
|
||||
}
|
||||
|
||||
@property(nonatomic, copy) NSString *selectedData;
|
||||
@property(nonatomic, strong) NSDictionary *dataList;
|
||||
@property(nonatomic, strong) IBOutlet UITableView *tableView;
|
||||
@property(nonatomic, strong) id<ContactDetailsLabelViewDelegate> delegate;
|
||||
|
||||
- (IBAction)onBackClick:(id)event;
|
||||
|
||||
@end
|
||||
|
|
@ -17,13 +17,13 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "ContactDetailsLabelViewController.h"
|
||||
#import "ContactDetailsLabelView.h"
|
||||
|
||||
#import "UACellBackgroundView.h"
|
||||
#import "UILinphone.h"
|
||||
#import "Utils.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
@implementation ContactDetailsLabelViewController
|
||||
@implementation ContactDetailsLabelView
|
||||
|
||||
@synthesize dataList;
|
||||
@synthesize tableView;
|
||||
|
|
@ -37,9 +37,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"ContactDetailsLabel"
|
||||
content:@"ContactDetailsLabelViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
tabBar:@"UIMainBar"
|
||||
content:@"ContactDetailsLabelView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:@"TabBarViewController"
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
portraitMode:true];
|
||||
|
|
@ -50,7 +50,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
#pragma mark -
|
||||
|
||||
- (void)dismiss {
|
||||
if ([[[PhoneMainView instance] currentView] equal:[ContactDetailsLabelViewController compositeViewDescription]]) {
|
||||
if ([[[PhoneMainView instance] currentView] equal:[ContactDetailsLabelView compositeViewDescription]]) {
|
||||
[[PhoneMainView instance] popCurrentView];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/* ContactDetailsLabelViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "UICompositeViewController.h"
|
||||
|
||||
@protocol ContactDetailsLabelViewDelegate <NSObject>
|
||||
|
||||
- (void)changeContactDetailsLabel:(NSString*)label;
|
||||
|
||||
@end
|
||||
|
||||
@interface ContactDetailsLabelViewController : UIViewController<UITableViewDelegate, UITableViewDataSource, UICompositeViewDelegate> {
|
||||
}
|
||||
|
||||
@property (nonatomic, copy) NSString *selectedData;
|
||||
@property (nonatomic, strong) NSDictionary *dataList;
|
||||
@property (nonatomic, strong) IBOutlet UITableView *tableView;
|
||||
@property (nonatomic, strong) id<ContactDetailsLabelViewDelegate> delegate;
|
||||
|
||||
- (IBAction)onBackClick:(id)event;
|
||||
|
||||
@end
|
||||
50
Classes/ContactDetailsTableView.h
Normal file
50
Classes/ContactDetailsTableView.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/* ContactDetailsTableViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <AddressBook/AddressBook.h>
|
||||
|
||||
#import "ContactDetailsDelegate.h"
|
||||
#import "ContactDetailsLabelView.h"
|
||||
|
||||
typedef enum _ContactSections {
|
||||
ContactSections_None = 0,
|
||||
ContactSections_Number,
|
||||
ContactSections_Sip,
|
||||
ContactSections_Email,
|
||||
ContactSections_MAX
|
||||
} ContactSections_e;
|
||||
|
||||
@interface ContactDetailsTableView : UITableViewController <ContactDetailsLabelViewDelegate, UITextFieldDelegate> {
|
||||
@private
|
||||
NSMutableArray *dataCache;
|
||||
NSMutableArray *labelArray;
|
||||
NSIndexPath *editingIndexPath;
|
||||
}
|
||||
|
||||
@property(nonatomic, assign, setter=setContact:) ABRecordRef contact;
|
||||
@property(nonatomic, strong) IBOutlet id<ContactDetailsDelegate> contactDetailsDelegate;
|
||||
|
||||
- (BOOL)isValid;
|
||||
- (void)addPhoneField:(NSString *)number;
|
||||
- (void)addSipField:(NSString *)address;
|
||||
- (void)addEmailField:(NSString *)address;
|
||||
- (void)setContact:(ABRecordRef)contact;
|
||||
|
||||
@end
|
||||
|
|
@ -17,11 +17,11 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "ContactDetailsTableViewController.h"
|
||||
#import "ContactDetailsTableView.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "UIEditableTableViewCell.h"
|
||||
#import "UACellBackgroundView.h"
|
||||
#import "UILinphone.h"
|
||||
#import "Utils.h"
|
||||
#import "OrderedDictionary.h"
|
||||
#import "FastAddressBook.h"
|
||||
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
@end
|
||||
|
||||
@implementation ContactDetailsTableViewController
|
||||
@implementation ContactDetailsTableView
|
||||
|
||||
static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSections_None, ContactSections_Number,
|
||||
ContactSections_Sip, ContactSections_Email};
|
||||
|
|
@ -118,14 +118,14 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
|
|||
|
||||
- (ABPropertyID)propertyIDForSection:(ContactSections_e)section {
|
||||
switch (section) {
|
||||
case ContactSections_Sip:
|
||||
return kABPersonInstantMessageProperty;
|
||||
case ContactSections_Number:
|
||||
return kABPersonPhoneProperty;
|
||||
case ContactSections_Email:
|
||||
return kABPersonEmailProperty;
|
||||
default:
|
||||
return kABInvalidPropertyType;
|
||||
case ContactSections_Sip:
|
||||
return kABPersonInstantMessageProperty;
|
||||
case ContactSections_Number:
|
||||
return kABPersonPhoneProperty;
|
||||
case ContactSections_Email:
|
||||
return kABPersonEmailProperty;
|
||||
default:
|
||||
return kABInvalidPropertyType;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -610,20 +610,19 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
|
|||
NSString *displayName = [FastAddressBook getContactDisplayName:contact];
|
||||
if ([ContactSelection getSelectionMode] != ContactSelectionModeMessage) {
|
||||
// Go to dialer view
|
||||
DialerViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]],
|
||||
DialerViewController);
|
||||
DialerView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerView compositeViewDescription]], DialerView);
|
||||
if (controller != nil) {
|
||||
[controller call:dest displayName:displayName];
|
||||
}
|
||||
} else {
|
||||
// Go to Chat room view
|
||||
[[PhoneMainView instance]
|
||||
popToView:[ChatViewController compositeViewDescription]]; // Got to Chat and push ChatRoom
|
||||
ChatRoomViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription]
|
||||
popToView:[ChatsListView compositeViewDescription]]; // Got to Chat and push ChatRoom
|
||||
ChatConversationView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatConversationView compositeViewDescription]
|
||||
push:TRUE],
|
||||
ChatRoomViewController);
|
||||
ChatConversationView);
|
||||
if (controller != nil) {
|
||||
LinphoneChatRoom *room =
|
||||
linphone_core_get_chat_room_from_uri([LinphoneManager getLc], [dest UTF8String]);
|
||||
|
|
@ -646,10 +645,10 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
|
|||
}
|
||||
if (key != nil) {
|
||||
editingIndexPath = indexPath;
|
||||
ContactDetailsLabelViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactDetailsLabelViewController compositeViewDescription]
|
||||
ContactDetailsLabelView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactDetailsLabelView compositeViewDescription]
|
||||
push:TRUE],
|
||||
ContactDetailsLabelViewController);
|
||||
ContactDetailsLabelView);
|
||||
if (controller != nil) {
|
||||
[controller setDataList:[self getLocalizedLabels]];
|
||||
[controller setSelectedData:key];
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
/* ContactDetailsTableViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <AddressBook/AddressBook.h>
|
||||
|
||||
#import "ContactDetailsDelegate.h"
|
||||
#import "ContactDetailsLabelViewController.h"
|
||||
|
||||
typedef enum _ContactSections {
|
||||
ContactSections_None = 0,
|
||||
ContactSections_Number,
|
||||
ContactSections_Sip,
|
||||
ContactSections_Email,
|
||||
ContactSections_MAX
|
||||
} ContactSections_e;
|
||||
|
||||
@interface ContactDetailsTableViewController : UITableViewController<ContactDetailsLabelViewDelegate, UITextFieldDelegate> {
|
||||
@private
|
||||
NSMutableArray *dataCache;
|
||||
NSMutableArray *labelArray;
|
||||
NSIndexPath *editingIndexPath;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign, setter=setContact:) ABRecordRef contact;
|
||||
@property (nonatomic, strong) IBOutlet id<ContactDetailsDelegate> contactDetailsDelegate;
|
||||
|
||||
- (BOOL)isValid;
|
||||
- (void)addPhoneField:(NSString*)number;
|
||||
- (void)addSipField:(NSString*)address;
|
||||
- (void)addEmailField:(NSString*)address;
|
||||
- (void)setContact:(ABRecordRef)contact;
|
||||
|
||||
@end
|
||||
47
Classes/ContactDetailsView.h
Normal file
47
Classes/ContactDetailsView.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/* ContactDetailsViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <AddressBook/AddressBook.h>
|
||||
|
||||
#import "UICompositeView.h"
|
||||
#import "UIToggleButton.h"
|
||||
#import "ContactDetailsTableView.h"
|
||||
|
||||
@interface ContactDetailsView : UIViewController <UICompositeViewDelegate, ContactDetailsDelegate> {
|
||||
ABAddressBookRef addressBook;
|
||||
BOOL inhibUpdate;
|
||||
}
|
||||
|
||||
@property(nonatomic, assign, setter=setContact:) ABRecordRef contact;
|
||||
@property(nonatomic, strong) IBOutlet ContactDetailsTableView *tableController;
|
||||
@property(nonatomic, strong) IBOutlet UIToggleButton *editButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *backButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *cancelButton;
|
||||
|
||||
- (IBAction)onBackClick:(id)event;
|
||||
- (IBAction)onCancelClick:(id)event;
|
||||
- (IBAction)onEditClick:(id)event;
|
||||
|
||||
- (void)newContact;
|
||||
- (void)newContact:(NSString *)address;
|
||||
- (void)editContact:(ABRecordRef)contact;
|
||||
- (void)editContact:(ABRecordRef)contact address:(NSString *)address;
|
||||
- (void)setContact:(ABRecordRef)contact;
|
||||
@end
|
||||
|
|
@ -17,10 +17,10 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "ContactDetailsViewController.h"
|
||||
#import "ContactDetailsView.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
@implementation ContactDetailsViewController
|
||||
@implementation ContactDetailsView
|
||||
|
||||
@synthesize tableController;
|
||||
@synthesize contact;
|
||||
|
|
@ -33,7 +33,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
self = [super initWithNibName:@"ContactDetailsViewController" bundle:[NSBundle mainBundle]];
|
||||
self = [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
if (self != nil) {
|
||||
inhibUpdate = FALSE;
|
||||
addressBook = ABAddressBookCreateWithOptions(nil, nil);
|
||||
|
|
@ -68,7 +68,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
|
|||
}
|
||||
|
||||
static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info, void *context) {
|
||||
ContactDetailsViewController *controller = (__bridge ContactDetailsViewController *)context;
|
||||
ContactDetailsView *controller = (__bridge ContactDetailsView *)context;
|
||||
if (!controller->inhibUpdate && ![[controller tableController] isEditing]) {
|
||||
[controller resetData];
|
||||
}
|
||||
|
|
@ -208,9 +208,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"ContactDetails"
|
||||
content:@"ContactDetailsViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
tabBar:@"UIMainBar"
|
||||
content:@"ContactDetailsView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:@"TabBarViewController"
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
portraitMode:true];
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
/* ContactDetailsViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <AddressBook/AddressBook.h>
|
||||
|
||||
#import "UICompositeViewController.h"
|
||||
#import "UIToggleButton.h"
|
||||
#import "ContactDetailsTableViewController.h"
|
||||
|
||||
@interface ContactDetailsViewController : UIViewController<UICompositeViewDelegate, ContactDetailsDelegate> {
|
||||
ABAddressBookRef addressBook;
|
||||
BOOL inhibUpdate;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign, setter=setContact:) ABRecordRef contact;
|
||||
@property (nonatomic, strong) IBOutlet ContactDetailsTableViewController *tableController;
|
||||
@property (nonatomic, strong) IBOutlet UIToggleButton *editButton;
|
||||
@property (nonatomic, strong) IBOutlet UIButton *backButton;
|
||||
@property (nonatomic, strong) IBOutlet UIButton *cancelButton;
|
||||
|
||||
- (IBAction)onBackClick:(id)event;
|
||||
- (IBAction)onCancelClick:(id)event;
|
||||
- (IBAction)onEditClick:(id)event;
|
||||
|
||||
- (void)newContact;
|
||||
- (void)newContact:(NSString*)address;
|
||||
- (void)editContact:(ABRecordRef)contact;
|
||||
- (void)editContact:(ABRecordRef)contact address:(NSString*)address;
|
||||
- (void)setContact:(ABRecordRef)contact;
|
||||
@end
|
||||
|
|
@ -4,30 +4,30 @@
|
|||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <AddressBook/AddressBook.h>
|
||||
|
||||
#import "OrderedDictionary.h"
|
||||
|
||||
@interface ContactsTableViewController : UITableViewController {
|
||||
@private
|
||||
OrderedDictionary* addressBookMap;
|
||||
NSMutableDictionary* avatarMap;
|
||||
|
||||
ABAddressBookRef addressBook;
|
||||
@interface ContactsListTableView : UITableViewController {
|
||||
@private
|
||||
OrderedDictionary *addressBookMap;
|
||||
NSMutableDictionary *avatarMap;
|
||||
|
||||
ABAddressBookRef addressBook;
|
||||
}
|
||||
|
||||
- (void)loadData;
|
||||
|
|
@ -17,14 +17,14 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "ContactsTableViewController.h"
|
||||
#import "ContactsListTableView.h"
|
||||
#import "UIContactCell.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "UACellBackgroundView.h"
|
||||
#import "UILinphone.h"
|
||||
#import "Utils.h"
|
||||
|
||||
@implementation ContactsTableViewController
|
||||
@implementation ContactsListTableView
|
||||
|
||||
static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info, void *context);
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) {
|
|||
}
|
||||
|
||||
static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info, void *context) {
|
||||
ContactsTableViewController *controller = (__bridge ContactsTableViewController *)context;
|
||||
ContactsListTableView *controller = (__bridge ContactsListTableView *)context;
|
||||
ABAddressBookRevert(addressBook);
|
||||
[controller->avatarMap removeAllObjects];
|
||||
[controller loadData];
|
||||
|
|
@ -230,9 +230,9 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
|
|||
ABRecordRef lPerson = (__bridge ABRecordRef)([subDic objectForKey:[subDic keyAtIndex:[indexPath row]]]);
|
||||
|
||||
// Go to Contact details view
|
||||
ContactDetailsViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE],
|
||||
ContactDetailsViewController);
|
||||
ContactDetailsView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactDetailsView compositeViewDescription] push:TRUE],
|
||||
ContactDetailsView);
|
||||
if (controller != nil) {
|
||||
if ([ContactSelection getSelectionMode] != ContactSelectionModeEdit) {
|
||||
[controller setContact:lPerson];
|
||||
|
|
@ -20,14 +20,14 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
#import <AddressBookUI/ABPeoplePickerNavigationController.h>
|
||||
|
||||
#import "UICompositeViewController.h"
|
||||
#import "ContactsTableViewController.h"
|
||||
#import "UICompositeView.h"
|
||||
#import "ContactsListTableView.h"
|
||||
|
||||
typedef enum _ContactSelectionMode {
|
||||
ContactSelectionModeNone,
|
||||
ContactSelectionModeEdit,
|
||||
ContactSelectionModePhone,
|
||||
ContactSelectionModeMessage
|
||||
ContactSelectionModeNone,
|
||||
ContactSelectionModeEdit,
|
||||
ContactSelectionModePhone,
|
||||
ContactSelectionModeMessage
|
||||
} ContactSelectionMode;
|
||||
|
||||
@interface ContactSelection : NSObject <UISearchBarDelegate> {
|
||||
|
|
@ -35,19 +35,19 @@ typedef enum _ContactSelectionMode {
|
|||
|
||||
+ (void)setSelectionMode:(ContactSelectionMode)selectionMode;
|
||||
+ (ContactSelectionMode)getSelectionMode;
|
||||
+ (void)setAddAddress:(NSString*)address;
|
||||
+ (NSString*)getAddAddress;
|
||||
+ (void)setAddAddress:(NSString *)address;
|
||||
+ (NSString *)getAddAddress;
|
||||
/*!
|
||||
* Filters contacts by SIP domain.
|
||||
* @param domain SIP domain to filter. Use @"*" or nil to disable it.
|
||||
*/
|
||||
+ (void)setSipFilter:(NSString*) domain;
|
||||
+ (void)setSipFilter:(NSString *)domain;
|
||||
|
||||
/*!
|
||||
* Weither contacts are filtered by SIP domain or not.
|
||||
* @return the filter used, or nil if none.
|
||||
*/
|
||||
+ (NSString*)getSipFilter;
|
||||
+ (NSString *)getSipFilter;
|
||||
|
||||
/*!
|
||||
* Weither always keep contacts with an email address or not.
|
||||
|
|
@ -65,27 +65,27 @@ typedef enum _ContactSelectionMode {
|
|||
* Filters contacts by name and/or email fuzzy matching pattern.
|
||||
* @param fuzzyName fuzzy word to match. Use nil to disable it.
|
||||
*/
|
||||
+ (void)setNameOrEmailFilter:(NSString*)fuzzyName;
|
||||
+ (void)setNameOrEmailFilter:(NSString *)fuzzyName;
|
||||
|
||||
/*!
|
||||
* Weither contacts are filtered by name and/or email.
|
||||
* @return the filter used, or nil if none.
|
||||
*/
|
||||
+ (NSString*)getNameOrEmailFilter;
|
||||
+ (NSString *)getNameOrEmailFilter;
|
||||
|
||||
@end
|
||||
|
||||
@interface ContactsViewController
|
||||
@interface ContactsListView
|
||||
: UIViewController <UICompositeViewDelegate, ABPeoplePickerNavigationControllerDelegate, UISearchBarDelegate>
|
||||
|
||||
@property(strong, nonatomic) IBOutlet ContactsTableViewController *tableController;
|
||||
@property (nonatomic, strong) IBOutlet UINavigationController* sysViewController;
|
||||
@property (strong, nonatomic) IBOutlet UIView *toolBar;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* allButton;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* linphoneButton;
|
||||
@property (nonatomic, strong) IBOutlet UIButton *backButton;
|
||||
@property (nonatomic, strong) IBOutlet UIButton *addButton;
|
||||
@property (strong, nonatomic) IBOutlet UISearchBar *searchBar;
|
||||
@property(strong, nonatomic) IBOutlet ContactsListTableView *tableController;
|
||||
@property(nonatomic, strong) IBOutlet UINavigationController *sysViewController;
|
||||
@property(strong, nonatomic) IBOutlet UIView *toolBar;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *allButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *linphoneButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *backButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *addButton;
|
||||
@property(strong, nonatomic) IBOutlet UISearchBar *searchBar;
|
||||
@property(weak, nonatomic) IBOutlet UITableView *tableView;
|
||||
|
||||
- (IBAction)onAllClick:(id)event;
|
||||
|
|
@ -75,7 +75,7 @@ static NSString *sNameOrEmailFilter;
|
|||
|
||||
@end
|
||||
|
||||
@implementation ContactsViewController
|
||||
@implementation ContactsListView
|
||||
|
||||
@synthesize tableController;
|
||||
@synthesize tableView;
|
||||
|
|
@ -93,7 +93,7 @@ typedef enum _HistoryView { History_All, History_Linphone, History_Search, Histo
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
return [super initWithNibName:@"ContactsViewController" bundle:[NSBundle mainBundle]];
|
||||
return [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
}
|
||||
|
||||
#pragma mark - UICompositeViewDelegate Functions
|
||||
|
|
@ -103,9 +103,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"Contacts"
|
||||
content:@"ContactsViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
tabBar:@"UIMainBar"
|
||||
content:@"ContactsListView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:@"TabBarViewController"
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
portraitMode:true];
|
||||
|
|
@ -158,7 +158,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
cancelButtonTitle:NSLocalizedString(@"Continue", nil)
|
||||
otherButtonTitles:nil];
|
||||
[error show];
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerView compositeViewDescription]];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -199,15 +199,15 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (void)refreshButtons {
|
||||
switch ([ContactSelection getSelectionMode]) {
|
||||
case ContactSelectionModePhone:
|
||||
case ContactSelectionModeMessage:
|
||||
[addButton setHidden:TRUE];
|
||||
[backButton setHidden:FALSE];
|
||||
break;
|
||||
default:
|
||||
[addButton setHidden:FALSE];
|
||||
[backButton setHidden:TRUE];
|
||||
break;
|
||||
case ContactSelectionModePhone:
|
||||
case ContactSelectionModeMessage:
|
||||
[addButton setHidden:TRUE];
|
||||
[backButton setHidden:FALSE];
|
||||
break;
|
||||
default:
|
||||
[addButton setHidden:FALSE];
|
||||
[backButton setHidden:TRUE];
|
||||
break;
|
||||
}
|
||||
if ([ContactSelection getSipFilter]) {
|
||||
allButton.selected = FALSE;
|
||||
|
|
@ -235,9 +235,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (IBAction)onAddContactClick:(id)event {
|
||||
// Go to Contact details view
|
||||
ContactDetailsViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE],
|
||||
ContactDetailsViewController);
|
||||
ContactDetailsView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactDetailsView compositeViewDescription] push:TRUE],
|
||||
ContactDetailsView);
|
||||
if (controller != nil) {
|
||||
if ([ContactSelection getAddAddress] == nil) {
|
||||
[controller newContact];
|
||||
|
|
@ -285,9 +285,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
CFIndex valueIdx = ABMultiValueGetIndexForIdentifier(multiValue, identifier);
|
||||
NSString *phoneNumber = (NSString *)CFBridgingRelease(ABMultiValueCopyValueAtIndex(multiValue, valueIdx));
|
||||
// Go to dialer view
|
||||
DialerViewController *controller =
|
||||
DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]],
|
||||
DialerViewController);
|
||||
DialerView *controller =
|
||||
DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerView compositeViewDescription]], DialerView);
|
||||
if (controller != nil) {
|
||||
[controller call:phoneNumber displayName:(NSString *)CFBridgingRelease(ABRecordCopyCompositeName(person))];
|
||||
}
|
||||
68
Classes/DialerView.h
Normal file
68
Classes/DialerView.h
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
/* DialerViewController.h
|
||||
*
|
||||
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UICompositeView.h"
|
||||
|
||||
#import "UICamSwitch.h"
|
||||
#import "UICallButton.h"
|
||||
#import "UITransferButton.h"
|
||||
#import "UIDigitButton.h"
|
||||
|
||||
@interface DialerView
|
||||
: UIViewController <UITextFieldDelegate, UICompositeViewDelegate, MFMailComposeViewControllerDelegate> {
|
||||
}
|
||||
|
||||
- (void)setAddress:(NSString *)address;
|
||||
- (void)call:(NSString *)address displayName:(NSString *)displayName;
|
||||
- (void)call:(NSString *)address;
|
||||
|
||||
@property(nonatomic, assign) BOOL transferMode;
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UITextField *addressField;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *addContactButton;
|
||||
@property(nonatomic, strong) IBOutlet UICallButton *callButton;
|
||||
@property(nonatomic, strong) IBOutlet UICallButton *addCallButton;
|
||||
@property(nonatomic, strong) IBOutlet UITransferButton *transferButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *backButton;
|
||||
@property(weak, nonatomic) IBOutlet UIIconButton *backspaceButton;
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *oneButton;
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *twoButton;
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *threeButton;
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *fourButton;
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *fiveButton;
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *sixButton;
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *sevenButton;
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *eightButton;
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *nineButton;
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *starButton;
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *zeroButton;
|
||||
@property(nonatomic, strong) IBOutlet UIDigitButton *sharpButton;
|
||||
@property(nonatomic, strong) IBOutlet UIView *backgroundView;
|
||||
@property(nonatomic, strong) IBOutlet UIView *videoPreview;
|
||||
@property(nonatomic, strong) IBOutlet UICamSwitch *videoCameraSwitch;
|
||||
|
||||
- (IBAction)onAddContactClick:(id)event;
|
||||
- (IBAction)onBackClick:(id)event;
|
||||
- (IBAction)onAddressChange:(id)sender;
|
||||
- (IBAction)onBackspaceClick:(id)sender;
|
||||
|
||||
@end
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
#import "LinphoneManager.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
@implementation DialerViewController
|
||||
@implementation DialerView
|
||||
|
||||
@synthesize transferMode;
|
||||
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
self = [super initWithNibName:@"DialerViewController" bundle:[NSBundle mainBundle]];
|
||||
self = [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
if (self) {
|
||||
self->transferMode = FALSE;
|
||||
}
|
||||
|
|
@ -75,9 +75,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"Dialer"
|
||||
content:@"DialerViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
tabBar:@"UIMainBar"
|
||||
content:@"DialerView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:@"TabBarViewController"
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
portraitMode:true];
|
||||
|
|
@ -190,20 +190,20 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
|
||||
CGRect frame = [videoPreview frame];
|
||||
switch (toInterfaceOrientation) {
|
||||
case UIInterfaceOrientationPortrait:
|
||||
[videoPreview setTransform:CGAffineTransformMakeRotation(0)];
|
||||
break;
|
||||
case UIInterfaceOrientationPortraitUpsideDown:
|
||||
[videoPreview setTransform:CGAffineTransformMakeRotation(M_PI)];
|
||||
break;
|
||||
case UIInterfaceOrientationLandscapeLeft:
|
||||
[videoPreview setTransform:CGAffineTransformMakeRotation(M_PI / 2)];
|
||||
break;
|
||||
case UIInterfaceOrientationLandscapeRight:
|
||||
[videoPreview setTransform:CGAffineTransformMakeRotation(-M_PI / 2)];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case UIInterfaceOrientationPortrait:
|
||||
[videoPreview setTransform:CGAffineTransformMakeRotation(0)];
|
||||
break;
|
||||
case UIInterfaceOrientationPortraitUpsideDown:
|
||||
[videoPreview setTransform:CGAffineTransformMakeRotation(M_PI)];
|
||||
break;
|
||||
case UIInterfaceOrientationLandscapeLeft:
|
||||
[videoPreview setTransform:CGAffineTransformMakeRotation(M_PI / 2)];
|
||||
break;
|
||||
case UIInterfaceOrientationLandscapeRight:
|
||||
[videoPreview setTransform:CGAffineTransformMakeRotation(-M_PI / 2)];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
[videoPreview setFrame:frame];
|
||||
}
|
||||
|
|
@ -399,15 +399,15 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[ContactSelection setSipFilter:nil];
|
||||
[ContactSelection setNameOrEmailFilter:nil];
|
||||
[ContactSelection enableEmailFilter:FALSE];
|
||||
ContactsViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE],
|
||||
ContactsViewController);
|
||||
ContactsListView *controller =
|
||||
DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactsListView compositeViewDescription] push:TRUE],
|
||||
ContactsListView);
|
||||
if (controller != nil) {
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)onBackClick:(id)event {
|
||||
[[PhoneMainView instance] changeCurrentView:[InCallViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[CallView compositeViewDescription]];
|
||||
}
|
||||
|
||||
- (IBAction)onAddressChange:(id)sender {
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
/* DialerViewController.h
|
||||
*
|
||||
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UICompositeViewController.h"
|
||||
|
||||
#import "UICamSwitch.h"
|
||||
#import "UICallButton.h"
|
||||
#import "UITransferButton.h"
|
||||
#import "UIDigitButton.h"
|
||||
|
||||
@interface DialerViewController : UIViewController <UITextFieldDelegate, UICompositeViewDelegate, MFMailComposeViewControllerDelegate> {
|
||||
}
|
||||
|
||||
- (void)setAddress:(NSString*)address;
|
||||
- (void)call:(NSString*)address displayName:(NSString *)displayName;
|
||||
- (void)call:(NSString*)address;
|
||||
|
||||
@property (nonatomic, assign) BOOL transferMode;
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UITextField* addressField;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* addContactButton;
|
||||
@property (nonatomic, strong) IBOutlet UICallButton* callButton;
|
||||
@property (nonatomic, strong) IBOutlet UICallButton* addCallButton;
|
||||
@property (nonatomic, strong) IBOutlet UITransferButton* transferButton;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* backButton;
|
||||
@property(weak, nonatomic) IBOutlet UIIconButton *backspaceButton;
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* oneButton;
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* twoButton;
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* threeButton;
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* fourButton;
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* fiveButton;
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* sixButton;
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* sevenButton;
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* eightButton;
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* nineButton;
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* starButton;
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* zeroButton;
|
||||
@property (nonatomic, strong) IBOutlet UIDigitButton* sharpButton;
|
||||
@property (nonatomic, strong) IBOutlet UIView* backgroundView;
|
||||
@property (nonatomic, strong) IBOutlet UIView* videoPreview;
|
||||
@property (nonatomic, strong) IBOutlet UICamSwitch* videoCameraSwitch;
|
||||
|
||||
- (IBAction)onAddContactClick: (id) event;
|
||||
- (IBAction)onBackClick: (id) event;
|
||||
- (IBAction)onAddressChange: (id)sender;
|
||||
- (IBAction)onBackspaceClick:(id)sender;
|
||||
|
||||
@end
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface HistoryDetailsTableViewController : UITableViewController {
|
||||
@interface HistoryDetailsTableView : UITableViewController {
|
||||
@private
|
||||
NSMutableArray *callLogs;
|
||||
}
|
||||
|
|
@ -6,11 +6,11 @@
|
|||
//
|
||||
//
|
||||
|
||||
#import "HistoryDetailsTableViewController.h"
|
||||
#import "HistoryDetailsTableView.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "Utils.h"
|
||||
|
||||
@implementation HistoryDetailsTableViewController
|
||||
@implementation HistoryDetailsTableView
|
||||
|
||||
- (void)loadData {
|
||||
if (callLogs == nil) {
|
||||
|
|
@ -4,39 +4,39 @@
|
|||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#include "linphone/linphonecore.h"
|
||||
|
||||
#import <AddressBook/AddressBook.h>
|
||||
#import "UICompositeViewController.h"
|
||||
#import "HistoryDetailsTableViewController.h"
|
||||
@interface HistoryDetailsViewController : UIViewController<UICompositeViewDelegate> {
|
||||
@private
|
||||
ABRecordRef contact;
|
||||
LinphoneCallLog *callLog;
|
||||
NSDateFormatter *dateFormatter;
|
||||
#import "UICompositeView.h"
|
||||
#import "HistoryDetailsTableView.h"
|
||||
@interface HistoryDetailsView : UIViewController <UICompositeViewDelegate> {
|
||||
@private
|
||||
ABRecordRef contact;
|
||||
LinphoneCallLog *callLog;
|
||||
NSDateFormatter *dateFormatter;
|
||||
}
|
||||
@property(weak, nonatomic) IBOutlet UILabel *contactLabel;
|
||||
@property (nonatomic, strong) IBOutlet UIImageView *avatarImage;
|
||||
@property (nonatomic, strong) IBOutlet UILabel *addressLabel;
|
||||
@property (nonatomic, strong) IBOutlet UIButton *addContactButton;
|
||||
@property (nonatomic, copy, setter=setCallLogId:) NSString *callLogId;
|
||||
@property(nonatomic, strong) IBOutlet UIImageView *avatarImage;
|
||||
@property(nonatomic, strong) IBOutlet UILabel *addressLabel;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *addContactButton;
|
||||
@property(nonatomic, copy, setter=setCallLogId:) NSString *callLogId;
|
||||
@property(weak, nonatomic) IBOutlet UIView *headerView;
|
||||
@property(weak, nonatomic) IBOutlet UITableView *callsTableView;
|
||||
@property(strong, nonatomic) IBOutlet HistoryDetailsTableViewController *tableView;
|
||||
@property(strong, nonatomic) IBOutlet HistoryDetailsTableView *tableView;
|
||||
|
||||
- (IBAction)onBackClick:(id)event;
|
||||
- (IBAction)onAddContactClick:(id)event;
|
||||
|
|
@ -17,17 +17,17 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "HistoryDetailsViewController.h"
|
||||
#import "HistoryDetailsView.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "FastAddressBook.h"
|
||||
|
||||
@implementation HistoryDetailsViewController {
|
||||
@implementation HistoryDetailsView {
|
||||
}
|
||||
|
||||
#pragma mark - LifeCycle Functions
|
||||
|
||||
- (id)init {
|
||||
self = [super initWithNibName:@"HistoryDetailsViewController" bundle:[NSBundle mainBundle]];
|
||||
self = [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
if (self != nil) {
|
||||
dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
|
||||
|
|
@ -49,9 +49,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"HistoryDetails"
|
||||
content:@"HistoryDetailsViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
tabBar:@"UIMainBar"
|
||||
content:@"HistoryDetailsView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:@"TabBarViewController"
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
portraitMode:true];
|
||||
|
|
@ -175,10 +175,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (IBAction)onContactClick:(id)event {
|
||||
if (contact) {
|
||||
ContactDetailsViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription]
|
||||
push:TRUE],
|
||||
ContactDetailsViewController);
|
||||
ContactDetailsView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactDetailsView compositeViewDescription] push:TRUE],
|
||||
ContactDetailsView);
|
||||
if (controller != nil) {
|
||||
[ContactSelection setSelectionMode:ContactSelectionModeNone];
|
||||
[controller setContact:contact];
|
||||
|
|
@ -199,9 +198,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[ContactSelection setSipFilter:nil];
|
||||
[ContactSelection enableEmailFilter:FALSE];
|
||||
[ContactSelection setNameOrEmailFilter:nil];
|
||||
DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription]
|
||||
push:TRUE],
|
||||
ContactsViewController);
|
||||
DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactsListView compositeViewDescription] push:TRUE],
|
||||
ContactsListView);
|
||||
ms_free(lAddress);
|
||||
}
|
||||
}
|
||||
|
|
@ -214,9 +213,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
return;
|
||||
NSString *displayName = [FastAddressBook displayNameForAddress:addr];
|
||||
|
||||
DialerViewController *controller =
|
||||
DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]],
|
||||
DialerViewController);
|
||||
DialerView *controller =
|
||||
DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerView compositeViewDescription]], DialerView);
|
||||
if (controller != nil) {
|
||||
[controller call:[NSString stringWithUTF8String:lAddress] displayName:displayName];
|
||||
}
|
||||
|
|
@ -228,10 +226,10 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
if (addr == NULL)
|
||||
return;
|
||||
// Go to ChatRoom view
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
|
||||
ChatRoomViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE],
|
||||
ChatRoomViewController);
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatsListView compositeViewDescription]];
|
||||
ChatConversationView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatConversationView compositeViewDescription] push:TRUE],
|
||||
ChatConversationView);
|
||||
if (controller != nil) {
|
||||
LinphoneChatRoom *room = linphone_core_get_chat_room([LinphoneManager getLc], addr);
|
||||
[controller setChatRoom:room];
|
||||
|
|
@ -4,27 +4,27 @@
|
|||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface HistoryTableViewController : UITableViewController {
|
||||
@private
|
||||
NSMutableArray *callLogs;
|
||||
@interface HistoryListTableView : UITableViewController {
|
||||
@private
|
||||
NSMutableArray *callLogs;
|
||||
}
|
||||
- (void)loadData;
|
||||
|
||||
@property (nonatomic, assign) BOOL missedFilter;
|
||||
@property(nonatomic, assign) BOOL missedFilter;
|
||||
|
||||
@end
|
||||
|
|
@ -17,14 +17,14 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "HistoryTableViewController.h"
|
||||
#import "HistoryListTableView.h"
|
||||
#import "UIHistoryCell.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "UACellBackgroundView.h"
|
||||
#import "UILinphone.h"
|
||||
#import "Utils.h"
|
||||
|
||||
@implementation HistoryTableViewController
|
||||
@implementation HistoryListTableView
|
||||
|
||||
@synthesize missedFilter;
|
||||
|
||||
|
|
@ -145,9 +145,8 @@
|
|||
char *uri = linphone_address_as_string(addr);
|
||||
|
||||
// Go to dialer view
|
||||
DialerViewController *controller =
|
||||
DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]],
|
||||
DialerViewController);
|
||||
DialerView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerView compositeViewDescription]], DialerView);
|
||||
if (controller != nil) {
|
||||
[controller call:[NSString stringWithUTF8String:uri]
|
||||
displayName:[FastAddressBook displayNameForAddress:addr]];
|
||||
42
Classes/HistoryListView.h
Normal file
42
Classes/HistoryListView.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* HistoryViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UICompositeView.h"
|
||||
#import "HistoryListTableView.h"
|
||||
#import "UIToggleButton.h"
|
||||
|
||||
@interface HistoryListView : UIViewController <UICompositeViewDelegate> {
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) IBOutlet HistoryListTableView *tableController;
|
||||
@property(nonatomic, strong) IBOutlet UITableView *tableView;
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UIButton *allButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *missedButton;
|
||||
@property(nonatomic, strong) IBOutlet UIToggleButton *editButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *deleteButton;
|
||||
|
||||
- (IBAction)onAllClick:(id)event;
|
||||
- (IBAction)onMissedClick:(id)event;
|
||||
- (IBAction)onEditClick:(id)event;
|
||||
- (IBAction)onDeleteClick:(id)event;
|
||||
|
||||
@end
|
||||
|
|
@ -17,9 +17,9 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "HistoryViewController.h"
|
||||
#import "HistoryListView.h"
|
||||
|
||||
@implementation HistoryViewController
|
||||
@implementation HistoryListView
|
||||
|
||||
@synthesize tableView;
|
||||
@synthesize tableController;
|
||||
|
|
@ -34,7 +34,7 @@ typedef enum _HistoryView { History_All, History_Missed, History_MAX } HistoryVi
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
return [super initWithNibName:@"HistoryViewController" bundle:[NSBundle mainBundle]];
|
||||
return [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
}
|
||||
|
||||
#pragma mark - UICompositeViewDelegate Functions
|
||||
|
|
@ -44,9 +44,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"History"
|
||||
content:@"HistoryViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
tabBar:@"UIMainBar"
|
||||
content:@"HistoryListView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:@"TabBarViewController"
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
portraitMode:true];
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/* HistoryViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UICompositeViewController.h"
|
||||
#import "HistoryTableViewController.h"
|
||||
#import "UIToggleButton.h"
|
||||
|
||||
@interface HistoryViewController : UIViewController<UICompositeViewDelegate> {
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) IBOutlet HistoryTableViewController* tableController;
|
||||
@property (nonatomic, strong) IBOutlet UITableView *tableView;
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UIButton* allButton;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* missedButton;
|
||||
@property (nonatomic, strong) IBOutlet UIToggleButton* editButton;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* deleteButton;
|
||||
|
||||
- (IBAction)onAllClick:(id) event;
|
||||
- (IBAction)onMissedClick:(id) event;
|
||||
- (IBAction)onEditClick:(id) event;
|
||||
- (IBAction)onDeleteClick:(id) event;
|
||||
|
||||
@end
|
||||
|
|
@ -17,23 +17,24 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "UICompositeViewController.h"
|
||||
#import "UICompositeView.h"
|
||||
|
||||
@protocol ImagePickerDelegate <NSObject>
|
||||
|
||||
- (void)imagePickerDelegateImage:(UIImage*)image info:(NSDictionary *)info;
|
||||
- (void)imagePickerDelegateImage:(UIImage *)image info:(NSDictionary *)info;
|
||||
|
||||
@end
|
||||
|
||||
@interface ImagePickerViewController : UIViewController <UICompositeViewDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIPopoverControllerDelegate> {
|
||||
@private
|
||||
UIImagePickerController *pickerController;
|
||||
@interface ImagePickerView : UIViewController <UICompositeViewDelegate, UINavigationControllerDelegate,
|
||||
UIImagePickerControllerDelegate, UIPopoverControllerDelegate> {
|
||||
@private
|
||||
UIImagePickerController *pickerController;
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) id<ImagePickerDelegate> imagePickerDelegate;
|
||||
@property(nonatomic) UIImagePickerControllerSourceType sourceType;
|
||||
@property(nonatomic,copy) NSArray *mediaTypes;
|
||||
@property(nonatomic) BOOL allowsEditing;
|
||||
@property(nonatomic) UIImagePickerControllerSourceType sourceType;
|
||||
@property(nonatomic, copy) NSArray *mediaTypes;
|
||||
@property(nonatomic) BOOL allowsEditing;
|
||||
@property(nonatomic, readonly) UIPopoverController *popoverController;
|
||||
|
||||
+ (void)SelectImageFromDevice:(id<ImagePickerDelegate>)delegate
|
||||
|
|
@ -19,10 +19,10 @@
|
|||
|
||||
#import <MobileCoreServices/UTCoreTypes.h>
|
||||
|
||||
#import "ImagePickerViewController.h"
|
||||
#import "ImagePickerView.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
@implementation ImagePickerViewController
|
||||
@implementation ImagePickerView
|
||||
|
||||
@synthesize imagePickerDelegate;
|
||||
@synthesize sourceType;
|
||||
|
|
@ -50,8 +50,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"ImagePicker"
|
||||
content:@"ImagePickerViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
content:@"ImagePickerView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:nil
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
|
|
@ -125,7 +125,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
#pragma mark -
|
||||
|
||||
- (void)dismiss {
|
||||
if ([[[PhoneMainView instance] currentView] equal:[ImagePickerViewController compositeViewDescription]]) {
|
||||
if ([[[PhoneMainView instance] currentView] equal:[ImagePickerView compositeViewDescription]]) {
|
||||
[[PhoneMainView instance] popCurrentView];
|
||||
}
|
||||
}
|
||||
|
|
@ -167,15 +167,14 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
atPosition:(CGRect)ipadPopoverPosition
|
||||
inView:(UIView *)view {
|
||||
void (^block)(UIImagePickerControllerSourceType) = ^(UIImagePickerControllerSourceType type) {
|
||||
UICompositeViewDescription *description = [ImagePickerViewController compositeViewDescription];
|
||||
ImagePickerViewController *controller;
|
||||
UICompositeViewDescription *description = [ImagePickerView compositeViewDescription];
|
||||
ImagePickerView *controller;
|
||||
if ([LinphoneManager runningOnIpad] && view) {
|
||||
controller =
|
||||
DYNAMIC_CAST([[PhoneMainView instance].mainViewController getCachedController:description.content],
|
||||
ImagePickerViewController);
|
||||
controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance].mainViewController getCachedController:description.content], ImagePickerView);
|
||||
} else {
|
||||
controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:description push:TRUE],
|
||||
ImagePickerViewController);
|
||||
controller =
|
||||
DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:description push:TRUE], ImagePickerView);
|
||||
}
|
||||
if (controller != nil) {
|
||||
controller.sourceType = type;
|
||||
40
Classes/ImageView.h
Normal file
40
Classes/ImageView.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/* ImageViewController.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 "UICompositeView.h"
|
||||
|
||||
@interface UIImageScrollView : UIScrollView <UIScrollViewDelegate>
|
||||
|
||||
@property(nonatomic, strong) UIImage *image;
|
||||
@property(readonly) IBOutlet UIImageView *imageView;
|
||||
|
||||
@end
|
||||
|
||||
@interface ImageView : UIViewController <UICompositeViewDelegate> {
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UIImageScrollView *scrollView;
|
||||
@property(nonatomic, strong) UIImage *image;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *backButton;
|
||||
|
||||
- (IBAction)onBackClick:(id)sender;
|
||||
|
||||
@end
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "ImageViewController.h"
|
||||
#import "ImageView.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
@implementation UIImageScrollView
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
|
||||
@end
|
||||
|
||||
@implementation ImageViewController
|
||||
@implementation ImageView
|
||||
|
||||
@synthesize scrollView;
|
||||
@synthesize backButton;
|
||||
|
|
@ -115,7 +115,7 @@
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
return [super initWithNibName:@"ImageViewController" bundle:[NSBundle mainBundle]];
|
||||
return [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
}
|
||||
|
||||
#pragma mark - UICompositeViewDelegate Functions
|
||||
|
|
@ -125,8 +125,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if (compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"ImageView"
|
||||
content:@"ImageViewController"
|
||||
stateBar:@"UIStateBar"
|
||||
content:@"ImageView"
|
||||
stateBar:@"StatusBarViewController"
|
||||
tabBar:nil
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
|
|
@ -148,7 +148,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
#pragma mark - Action Functions
|
||||
|
||||
- (IBAction)onBackClick:(id)sender {
|
||||
if ([[[PhoneMainView instance] currentView] equal:[ImageViewController compositeViewDescription]]) {
|
||||
if ([[[PhoneMainView instance] currentView] equal:[ImageView compositeViewDescription]]) {
|
||||
[[PhoneMainView instance] popCurrentView];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
/* ImageViewController.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 "UICompositeViewController.h"
|
||||
|
||||
@interface UIImageScrollView : UIScrollView<UIScrollViewDelegate>
|
||||
|
||||
@property (nonatomic, strong) UIImage *image;
|
||||
@property (readonly) IBOutlet UIImageView *imageView;
|
||||
|
||||
@end
|
||||
|
||||
@interface ImageViewController : UIViewController<UICompositeViewDelegate> {
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UIImageScrollView *scrollView;
|
||||
@property (nonatomic, strong) UIImage *image;
|
||||
@property (nonatomic, strong) IBOutlet UIButton *backButton;
|
||||
|
||||
- (IBAction)onBackClick:(id)sender;
|
||||
|
||||
@end
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
/* InCallViewController.h
|
||||
*
|
||||
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "VideoZoomHandler.h"
|
||||
#import "UICamSwitch.h"
|
||||
|
||||
#import "UICompositeViewController.h"
|
||||
#import "InCallTableViewController.h"
|
||||
|
||||
@class VideoViewController;
|
||||
|
||||
@interface InCallViewController : UIViewController <UIGestureRecognizerDelegate, UICompositeViewDelegate> {
|
||||
@private
|
||||
UITapGestureRecognizer* singleFingerTap;
|
||||
NSTimer* hideControlsTimer;
|
||||
BOOL videoShown;
|
||||
VideoZoomHandler* videoZoomHandler;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) IBOutlet InCallTableViewController* callTableController;
|
||||
@property (nonatomic, strong) IBOutlet UITableView* callTableView;
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UIView* videoGroup;
|
||||
@property (nonatomic, strong) IBOutlet UIView* videoView;
|
||||
#ifdef TEST_VIDEO_VIEW_CHANGE
|
||||
@property (nonatomic, retain) IBOutlet UIView* testVideoView;
|
||||
#endif
|
||||
@property (nonatomic, strong) IBOutlet UIView* videoPreview;
|
||||
@property (nonatomic, strong) IBOutlet UICamSwitch* videoCameraSwitch;
|
||||
@property (nonatomic, strong) IBOutlet UIActivityIndicatorView* videoWaitingForFirstImage;
|
||||
|
||||
@end
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
/* IncomingCallViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UICompositeViewController.h"
|
||||
#import "TPMultiLayoutViewController.h"
|
||||
#include "LinphoneManager.h"
|
||||
|
||||
@protocol IncomingCallViewDelegate <NSObject>
|
||||
|
||||
- (void)incomingCallAccepted:(LinphoneCall*)call;
|
||||
- (void)incomingCallDeclined:(LinphoneCall*)call;
|
||||
- (void)incomingCallAborted:(LinphoneCall*)call;
|
||||
|
||||
@end
|
||||
|
||||
@interface IncomingCallViewController : TPMultiLayoutViewController <UICompositeViewDelegate> {
|
||||
}
|
||||
@property(weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||
@property (nonatomic, strong) IBOutlet UILabel* addressLabel;
|
||||
@property (nonatomic, strong) IBOutlet UIImageView* avatarImage;
|
||||
@property (nonatomic, assign) LinphoneCall* call;
|
||||
@property (nonatomic, strong) id<IncomingCallViewDelegate> delegate;
|
||||
|
||||
- (IBAction)onAcceptClick:(id) event;
|
||||
- (IBAction)onDeclineClick:(id) event;
|
||||
|
||||
@end
|
||||
|
|
@ -252,9 +252,8 @@
|
|||
NSString *sipUri = [[url resourceSpecifier]
|
||||
stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
|
||||
|
||||
DialerViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]],
|
||||
DialerViewController);
|
||||
DialerView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerView compositeViewDescription]], DialerView);
|
||||
if (controller != nil) {
|
||||
[controller setAddress:sipUri];
|
||||
}
|
||||
|
|
@ -298,7 +297,7 @@
|
|||
|
||||
if ([loc_key isEqualToString:@"IM_MSG"]) {
|
||||
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatsListView compositeViewDescription]];
|
||||
|
||||
} else if ([loc_key isEqualToString:@"IC_MSG"]) {
|
||||
|
||||
|
|
@ -349,22 +348,21 @@
|
|||
} else if ([notification.userInfo objectForKey:@"from_addr"] != nil) {
|
||||
NSString *remoteContact = (NSString *)[notification.userInfo objectForKey:@"from_addr"];
|
||||
// Go to ChatRoom view
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatsListView compositeViewDescription]];
|
||||
LinphoneChatRoom *room = [self findChatRoomForContact:remoteContact];
|
||||
ChatRoomViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE],
|
||||
ChatRoomViewController);
|
||||
ChatConversationView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatConversationView compositeViewDescription] push:TRUE],
|
||||
ChatConversationView);
|
||||
if (controller != nil && room != nil) {
|
||||
[controller setChatRoom:room];
|
||||
}
|
||||
} else if ([notification.userInfo objectForKey:@"callLog"] != nil) {
|
||||
NSString *callLog = (NSString *)[notification.userInfo objectForKey:@"callLog"];
|
||||
// Go to HistoryDetails view
|
||||
[[PhoneMainView instance] changeCurrentView:[HistoryViewController compositeViewDescription]];
|
||||
HistoryDetailsViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[HistoryDetailsViewController compositeViewDescription]
|
||||
push:TRUE],
|
||||
HistoryDetailsViewController);
|
||||
[[PhoneMainView instance] changeCurrentView:[HistoryListView compositeViewDescription]];
|
||||
HistoryDetailsView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[HistoryDetailsView compositeViewDescription] push:TRUE],
|
||||
HistoryDetailsView);
|
||||
if (controller != nil) {
|
||||
[controller setCallLogId:callLog];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIStateBar">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="StatusBarView">
|
||||
<connections>
|
||||
<outlet property="callQualityImage" destination="13" id="16"/>
|
||||
<outlet property="callSecurityButton" destination="27" id="29"/>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIMainBar">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TabBarView">
|
||||
<connections>
|
||||
<outlet property="chatButton" destination="5" id="28"/>
|
||||
<outlet property="chatNotificationLabel" destination="38" id="40"/>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIChatRoomCell">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIChatConversationCell">
|
||||
<connections>
|
||||
<outlet property="backgroundImage" destination="3" id="11"/>
|
||||
<outlet property="backgroundView" destination="7" id="10"/>
|
||||
|
|
@ -1,12 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<development version="6000" identifier="xcode"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UICompositeViewController">
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UICompositeView">
|
||||
<connections>
|
||||
<outlet property="contentView" destination="15" id="17"/>
|
||||
<outlet property="landscapeView" destination="20" id="25"/>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* UIStateBar.h
|
||||
/* StatusBarViewController.h
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
|
|
@ -21,13 +21,13 @@
|
|||
#import "TPMultiLayoutViewController.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
@interface UIStateBar : TPMultiLayoutViewController<UIActionSheetDelegate> {
|
||||
DTActionSheet *securitySheet;
|
||||
@interface StatusBarView : TPMultiLayoutViewController <UIActionSheetDelegate> {
|
||||
DTActionSheet *securitySheet;
|
||||
}
|
||||
|
||||
@property(weak, nonatomic) IBOutlet UIButton *registrationState;
|
||||
@property (nonatomic, strong) IBOutlet UIImageView* callQualityImage;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* callSecurityButton;
|
||||
@property(nonatomic, strong) IBOutlet UIImageView *callQualityImage;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *callSecurityButton;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *voicemailButton;
|
||||
|
||||
@property(weak, nonatomic) IBOutlet UIView *incallView;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* UIStateBar.m
|
||||
/* StatusBarViewController.m
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
|
|
@ -17,11 +17,11 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "UIStateBar.h"
|
||||
#import "StatusBarView.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
@implementation UIStateBar {
|
||||
@implementation StatusBarView {
|
||||
|
||||
NSTimer *callQualityTimer;
|
||||
NSTimer *callSecurityTimer;
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
self = [super initWithNibName:@"UIStateBar" bundle:[NSBundle mainBundle]];
|
||||
self = [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
@ -169,38 +169,38 @@
|
|||
state = linphone_proxy_config_get_state(config);
|
||||
|
||||
switch (state) {
|
||||
case LinphoneRegistrationOk:
|
||||
message = NSLocalizedString(@"Registered", nil);
|
||||
break;
|
||||
case LinphoneRegistrationNone:
|
||||
case LinphoneRegistrationCleared:
|
||||
message = NSLocalizedString(@"Not registered", nil);
|
||||
break;
|
||||
case LinphoneRegistrationFailed:
|
||||
message = NSLocalizedString(@"Registration failed", nil);
|
||||
break;
|
||||
case LinphoneRegistrationProgress:
|
||||
message = NSLocalizedString(@"Registration in progress", nil);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case LinphoneRegistrationOk:
|
||||
message = NSLocalizedString(@"Registered", nil);
|
||||
break;
|
||||
case LinphoneRegistrationNone:
|
||||
case LinphoneRegistrationCleared:
|
||||
message = NSLocalizedString(@"Not registered", nil);
|
||||
break;
|
||||
case LinphoneRegistrationFailed:
|
||||
message = NSLocalizedString(@"Registration failed", nil);
|
||||
break;
|
||||
case LinphoneRegistrationProgress:
|
||||
message = NSLocalizedString(@"Registration in progress", nil);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (state) {
|
||||
case LinphoneRegistrationFailed:
|
||||
image = [UIImage imageNamed:@"led_error.png"];
|
||||
break;
|
||||
case LinphoneRegistrationCleared:
|
||||
case LinphoneRegistrationNone:
|
||||
image = [UIImage imageNamed:@"led_disconnected.png"];
|
||||
break;
|
||||
case LinphoneRegistrationProgress:
|
||||
image = [UIImage imageNamed:@"led_inprogress.png"];
|
||||
break;
|
||||
case LinphoneRegistrationOk:
|
||||
image = [UIImage imageNamed:@"led_connected.png"];
|
||||
break;
|
||||
case LinphoneRegistrationFailed:
|
||||
image = [UIImage imageNamed:@"led_error.png"];
|
||||
break;
|
||||
case LinphoneRegistrationCleared:
|
||||
case LinphoneRegistrationNone:
|
||||
image = [UIImage imageNamed:@"led_disconnected.png"];
|
||||
break;
|
||||
case LinphoneRegistrationProgress:
|
||||
image = [UIImage imageNamed:@"led_inprogress.png"];
|
||||
break;
|
||||
case LinphoneRegistrationOk:
|
||||
image = [UIImage imageNamed:@"led_connected.png"];
|
||||
break;
|
||||
}
|
||||
[registrationState setTitle:message forState:UIControlStateNormal];
|
||||
registrationState.accessibilityValue = message;
|
||||
|
|
@ -307,7 +307,7 @@
|
|||
linphone_call_get_authentication_token(call)];
|
||||
}
|
||||
if (securitySheet == nil) {
|
||||
__block __strong UIStateBar *weakSelf = self;
|
||||
__block __strong StatusBarView *weakSelf = self;
|
||||
securitySheet = [[DTActionSheet alloc] initWithTitle:message];
|
||||
[securitySheet setDelegate:self];
|
||||
[securitySheet addButtonWithTitle:NSLocalizedString(@"Ok", nil)
|
||||
|
|
@ -328,7 +328,7 @@
|
|||
}
|
||||
|
||||
- (IBAction)onSideMenuClick:(id)sender {
|
||||
UICompositeViewController *cvc = PhoneMainView.instance.mainViewController;
|
||||
UICompositeView *cvc = PhoneMainView.instance.mainViewController;
|
||||
if (cvc.sideMenuView.hidden) {
|
||||
[cvc hideSideMenu:NO];
|
||||
} else {
|
||||
41
Classes/LinphoneUI/TabBarView.h
Normal file
41
Classes/LinphoneUI/TabBarView.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/* TabBarViewController.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 <UIKit/UIKit.h>
|
||||
#import "TPMultiLayoutViewController.h"
|
||||
|
||||
@interface TabBarView : TPMultiLayoutViewController {
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UIButton *historyButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *contactsButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *dialerButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *chatButton;
|
||||
@property(nonatomic, strong) IBOutlet UIView *historyNotificationView;
|
||||
@property(nonatomic, strong) IBOutlet UILabel *historyNotificationLabel;
|
||||
@property(nonatomic, strong) IBOutlet UIView *chatNotificationView;
|
||||
@property(nonatomic, strong) IBOutlet UILabel *chatNotificationLabel;
|
||||
@property(weak, nonatomic) IBOutlet UIView *selectedBtnView;
|
||||
|
||||
- (IBAction)onHistoryClick:(id)event;
|
||||
- (IBAction)onContactsClick:(id)event;
|
||||
- (IBAction)onDialerClick:(id)event;
|
||||
- (IBAction)onChatClick:(id)event;
|
||||
|
||||
@end
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* UIMainBar.m
|
||||
/* TabBarViewController.m
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
|
|
@ -17,11 +17,11 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "UIMainBar.h"
|
||||
#import "TabBarView.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "CAAnimation+Blocks.h"
|
||||
|
||||
@implementation UIMainBar
|
||||
@implementation TabBarView
|
||||
|
||||
static NSString *const kBounceAnimation = @"bounce";
|
||||
static NSString *const kAppearAnimation = @"appear";
|
||||
|
|
@ -39,7 +39,7 @@ static NSString *const kDisappearAnimation = @"disappear";
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
return [super initWithNibName:@"UIMainBar" bundle:[NSBundle mainBundle]];
|
||||
return [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
|
@ -218,10 +218,10 @@ static NSString *const kDisappearAnimation = @"disappear";
|
|||
}
|
||||
|
||||
- (void)updateSelectedButton:(UICompositeViewDescription *)view {
|
||||
historyButton.selected = [view equal:[HistoryViewController compositeViewDescription]];
|
||||
contactsButton.selected = [view equal:[ContactsViewController compositeViewDescription]];
|
||||
dialerButton.selected = [view equal:[DialerViewController compositeViewDescription]];
|
||||
chatButton.selected = [view equal:[ChatViewController compositeViewDescription]];
|
||||
historyButton.selected = [view equal:[HistoryListView compositeViewDescription]];
|
||||
contactsButton.selected = [view equal:[ContactsListView compositeViewDescription]];
|
||||
dialerButton.selected = [view equal:[DialerView compositeViewDescription]];
|
||||
chatButton.selected = [view equal:[ChatsListView compositeViewDescription]];
|
||||
CGRect selectedNewFrame = _selectedBtnView.frame;
|
||||
selectedNewFrame.origin.x =
|
||||
(historyButton.selected
|
||||
|
|
@ -236,7 +236,7 @@ static NSString *const kDisappearAnimation = @"disappear";
|
|||
#pragma mark - Action Functions
|
||||
|
||||
- (IBAction)onHistoryClick:(id)event {
|
||||
[[PhoneMainView instance] changeCurrentView:[HistoryViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[HistoryListView compositeViewDescription]];
|
||||
}
|
||||
|
||||
- (IBAction)onContactsClick:(id)event {
|
||||
|
|
@ -245,19 +245,19 @@ static NSString *const kDisappearAnimation = @"disappear";
|
|||
[ContactSelection setSipFilter:nil];
|
||||
[ContactSelection enableEmailFilter:FALSE];
|
||||
[ContactSelection setNameOrEmailFilter:nil];
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[ContactsListView compositeViewDescription]];
|
||||
}
|
||||
|
||||
- (IBAction)onDialerClick:(id)event {
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[DialerView compositeViewDescription]];
|
||||
}
|
||||
|
||||
- (IBAction)onSettingsClick:(id)event {
|
||||
[[PhoneMainView instance] changeCurrentView:[SettingsViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[SettingsView compositeViewDescription]];
|
||||
}
|
||||
|
||||
- (IBAction)onChatClick:(id)event {
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
|
||||
[[PhoneMainView instance] changeCurrentView:[ChatsListView compositeViewDescription]];
|
||||
}
|
||||
|
||||
#pragma mark - Animation
|
||||
|
|
@ -20,7 +20,6 @@
|
|||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
#import "UICallCell.h"
|
||||
#import "UILinphone.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "FastAddressBook.h"
|
||||
#import "Utils.h"
|
||||
|
|
|
|||
61
Classes/LinphoneUI/UIChatConversationCell.h
Normal file
61
Classes/LinphoneUI/UIChatConversationCell.h
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
/* UIChatRoomCell.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 "ChatConversationTableView.h"
|
||||
#import "UILoadingImageView.h"
|
||||
#import "UITransparentTVCell.h"
|
||||
#import "UITextViewNoDefine.h"
|
||||
#include "linphone/linphonecore.h"
|
||||
#import "FileTransferDelegate.h"
|
||||
|
||||
@interface UIChatConversationCell : UITransparentTVCell {
|
||||
LinphoneChatMessage *chat;
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UIView *innerView;
|
||||
@property(nonatomic, strong) IBOutlet UIView *bubbleView;
|
||||
@property(nonatomic, strong) IBOutlet UIImageView *backgroundImage;
|
||||
@property(nonatomic, strong) IBOutlet UITextViewNoDefine *messageText;
|
||||
@property(nonatomic, strong) IBOutlet UILoadingImageView *messageImageView;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *deleteButton;
|
||||
@property(nonatomic, strong) IBOutlet UILabel *dateLabel;
|
||||
@property(nonatomic, strong) IBOutlet UIImageView *statusImage;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *downloadButton;
|
||||
@property(nonatomic, strong) IBOutlet UITapGestureRecognizer *imageTapGestureRecognizer;
|
||||
@property(nonatomic, strong) IBOutlet UITapGestureRecognizer *resendTapGestureRecognizer;
|
||||
@property(weak, nonatomic) IBOutlet UIProgressView *fileTransferProgress;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *cancelButton;
|
||||
|
||||
- (id)initWithIdentifier:(NSString *)identifier;
|
||||
+ (CGFloat)height:(LinphoneChatMessage *)chatMessage width:(int)width;
|
||||
|
||||
@property(nonatomic, strong) id<ChatConversationDelegate> chatRoomDelegate;
|
||||
|
||||
- (IBAction)onDeleteClick:(id)event;
|
||||
- (IBAction)onDownloadClick:(id)event;
|
||||
- (IBAction)onImageClick:(id)event;
|
||||
- (IBAction)onCancelDownloadClick:(id)sender;
|
||||
|
||||
- (void)setChatMessage:(LinphoneChatMessage *)message;
|
||||
|
||||
- (void)connectToFileDelegate:(FileTransferDelegate *)ftd;
|
||||
|
||||
@end
|
||||
|
|
@ -17,8 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "UIChatRoomCell.h"
|
||||
#import "UILinphone.h"
|
||||
#import "UIChatConversationCell.h"
|
||||
#import "Utils.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
|
@ -27,7 +26,7 @@
|
|||
#import <AssetsLibrary/ALAssetRepresentation.h>
|
||||
#include "linphone/linphonecore.h"
|
||||
|
||||
@implementation UIChatRoomCell {
|
||||
@implementation UIChatConversationCell {
|
||||
FileTransferDelegate *ftd;
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +57,7 @@ static UIFont *CELL_FONT = nil;
|
|||
|
||||
- (id)initWithIdentifier:(NSString *)identifier {
|
||||
if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]) != nil) {
|
||||
[[NSBundle mainBundle] loadNibNamed:@"UIChatRoomCell" owner:self options:nil];
|
||||
[[NSBundle mainBundle] loadNibNamed:@"UIChatConversationCell" owner:self options:nil];
|
||||
imageTapGestureRecognizer =
|
||||
[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onImageClick:)];
|
||||
[messageImageView addGestureRecognizer:imageTapGestureRecognizer];
|
||||
|
|
@ -194,7 +193,7 @@ static UIFont *CELL_FONT = nil;
|
|||
} else {
|
||||
[messageText setHidden:FALSE];
|
||||
if (text) {
|
||||
NSString *nstext = [UIChatRoomCell decodeTextMessage:text];
|
||||
NSString *nstext = [UIChatConversationCell decodeTextMessage:text];
|
||||
|
||||
/* We need to use an attributed string here so that data detector don't mess
|
||||
* with the text style. See http://stackoverflow.com/a/20669356 */
|
||||
|
|
@ -273,7 +272,7 @@ static UIFont *CELL_FONT = nil;
|
|||
CGSize messageSize;
|
||||
const char *url = linphone_chat_message_get_external_body_url(chat);
|
||||
const char *text = linphone_chat_message_get_text(chat);
|
||||
NSString *messageText = text ? [UIChatRoomCell decodeTextMessage:text] : @"";
|
||||
NSString *messageText = text ? [UIChatConversationCell decodeTextMessage:text] : @"";
|
||||
if (url == nil && linphone_chat_message_get_file_transfer_information(chat) == NULL) {
|
||||
if (CELL_FONT == nil) {
|
||||
CELL_FONT = [UIFont systemFontOfSize:CELL_FONT_SIZE];
|
||||
|
|
@ -310,7 +309,7 @@ static UIFont *CELL_FONT = nil;
|
|||
}
|
||||
|
||||
+ (CGFloat)height:(LinphoneChatMessage *)chatMessage width:(int)width {
|
||||
return [UIChatRoomCell viewSize:chatMessage width:width].height;
|
||||
return [UIChatConversationCell viewSize:chatMessage width:width].height;
|
||||
}
|
||||
|
||||
#pragma mark - View Functions
|
||||
|
|
@ -321,7 +320,7 @@ static UIFont *CELL_FONT = nil;
|
|||
// Resize inner
|
||||
CGRect innerFrame;
|
||||
BOOL is_outgoing = linphone_chat_message_is_outgoing(chat);
|
||||
innerFrame.size = [UIChatRoomCell viewSize:chat width:[self frame].size.width];
|
||||
innerFrame.size = [UIChatConversationCell viewSize:chat width:[self frame].size.width];
|
||||
if (!is_outgoing) { // Inverted
|
||||
innerFrame.origin.x = 0.0f;
|
||||
innerFrame.origin.y = 0.0f;
|
||||
|
|
@ -392,9 +391,8 @@ static UIFont *CELL_FONT = nil;
|
|||
[self onResendClick:nil];
|
||||
} else {
|
||||
if (![messageImageView isLoading]) {
|
||||
ImageViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ImageViewController compositeViewDescription] push:TRUE],
|
||||
ImageViewController);
|
||||
ImageView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[ImageView compositeViewDescription] push:TRUE], ImageView);
|
||||
if (controller != nil) {
|
||||
CGImageRef fullScreenRef = [[messageImageView.fullImageUrl defaultRepresentation] fullScreenImage];
|
||||
UIImage *fullScreen = [UIImage imageWithCGImage:fullScreenRef];
|
||||
|
|
@ -422,7 +420,7 @@ static UIFont *CELL_FONT = nil;
|
|||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL),
|
||||
^(void) {
|
||||
UIImage *image = [[UIImage alloc] initWithCGImage:[asset thumbnail]];
|
||||
[chatRoomDelegate chatRoomStartImageUpload:image url:imageUrl];
|
||||
[chatRoomDelegate startImageUpload:image url:imageUrl];
|
||||
});
|
||||
}
|
||||
failureBlock:^(NSError *error) {
|
||||
|
|
@ -444,7 +442,7 @@ static UIFont *CELL_FONT = nil;
|
|||
}
|
||||
#pragma mark - State changed handling
|
||||
static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState state) {
|
||||
UIChatRoomCell *thiz = (__bridge UIChatRoomCell *)linphone_chat_message_get_user_data(msg);
|
||||
UIChatConversationCell *thiz = (__bridge UIChatConversationCell *)linphone_chat_message_get_user_data(msg);
|
||||
LOGI(@"State for message [%p] changed to %s", msg, linphone_chat_message_state_to_string(state));
|
||||
if (linphone_chat_message_get_file_transfer_information(msg) != NULL) {
|
||||
if (state == LinphoneChatMessageStateDelivered || state == LinphoneChatMessageStateNotDelivered) {
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
/* UIChatRoomCell.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 "ChatRoomTableViewController.h"
|
||||
#import "UILoadingImageView.h"
|
||||
#import "UITransparentTVCell.h"
|
||||
#import "UITextViewNoDefine.h"
|
||||
#include "linphone/linphonecore.h"
|
||||
#import "FileTransferDelegate.h"
|
||||
|
||||
@interface UIChatRoomCell : UITransparentTVCell {
|
||||
LinphoneChatMessage* chat;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UIView *innerView;
|
||||
@property (nonatomic, strong) IBOutlet UIView *bubbleView;
|
||||
@property (nonatomic, strong) IBOutlet UIImageView* backgroundImage;
|
||||
@property (nonatomic, strong) IBOutlet UITextViewNoDefine *messageText;
|
||||
@property (nonatomic, strong) IBOutlet UILoadingImageView *messageImageView;
|
||||
@property (nonatomic, strong) IBOutlet UIButton *deleteButton;
|
||||
@property (nonatomic, strong) IBOutlet UILabel *dateLabel;
|
||||
@property (nonatomic, strong) IBOutlet UIImageView* statusImage;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* downloadButton;
|
||||
@property (nonatomic, strong) IBOutlet UITapGestureRecognizer* imageTapGestureRecognizer;
|
||||
@property (nonatomic, strong) IBOutlet UITapGestureRecognizer* resendTapGestureRecognizer;
|
||||
@property (weak, nonatomic) IBOutlet UIProgressView *fileTransferProgress;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *cancelButton;
|
||||
|
||||
- (id)initWithIdentifier:(NSString*)identifier;
|
||||
+ (CGFloat)height:(LinphoneChatMessage*)chatMessage width:(int)width;
|
||||
|
||||
@property (nonatomic, strong) id<ChatRoomDelegate> chatRoomDelegate;
|
||||
|
||||
- (IBAction)onDeleteClick:(id)event;
|
||||
- (IBAction)onDownloadClick:(id)event;
|
||||
- (IBAction)onImageClick:(id)event;
|
||||
- (IBAction)onCancelDownloadClick:(id)sender;
|
||||
|
||||
- (void)setChatMessage:(LinphoneChatMessage*)message;
|
||||
|
||||
- (void)connectToFileDelegate:(FileTransferDelegate*)ftd;
|
||||
|
||||
@end
|
||||
83
Classes/LinphoneUI/UICompositeView.h
Normal file
83
Classes/LinphoneUI/UICompositeView.h
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
/* UICompositeViewController.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 <QuartzCore/QuartzCore.h>
|
||||
|
||||
#import "LinphoneManager.h"
|
||||
#import "TPMultiLayoutViewController.h"
|
||||
#import "SideMenuTableView.h"
|
||||
|
||||
@interface UICompositeViewDescription : NSObject {
|
||||
}
|
||||
|
||||
@property(strong) NSString *name;
|
||||
@property(strong) NSString *content;
|
||||
@property(strong) NSString *stateBar;
|
||||
@property(strong) NSString *tabBar;
|
||||
@property(assign) BOOL fullscreen;
|
||||
@property(assign) BOOL landscapeMode;
|
||||
@property(assign) BOOL portraitMode;
|
||||
@property(assign) BOOL darkBackground;
|
||||
|
||||
- (id)copy;
|
||||
- (BOOL)equal:(UICompositeViewDescription *)description;
|
||||
- (id)init:(NSString *)name
|
||||
content:(NSString *)content
|
||||
stateBar:(NSString *)stateBar
|
||||
tabBar:(NSString *)tabBar
|
||||
fullscreen:(BOOL)fullscreen
|
||||
landscapeMode:(BOOL)landscapeMode
|
||||
portraitMode:(BOOL)portraitMode;
|
||||
|
||||
@end
|
||||
|
||||
@protocol UICompositeViewDelegate <NSObject>
|
||||
|
||||
+ (UICompositeViewDescription *)compositeViewDescription;
|
||||
|
||||
@end
|
||||
|
||||
@interface UICompositeView : TPMultiLayoutViewController {
|
||||
@private
|
||||
NSMutableDictionary *viewControllerCache;
|
||||
UICompositeViewDescription *currentViewDescription;
|
||||
UIInterfaceOrientation currentOrientation;
|
||||
}
|
||||
|
||||
@property(strong) CATransition *viewTransition;
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UIView *stateBarView;
|
||||
@property(nonatomic, strong) IBOutlet UIView *contentView;
|
||||
@property(nonatomic, strong) IBOutlet UIView *tabBarView;
|
||||
@property(strong, nonatomic) IBOutlet UIView *sideMenuView;
|
||||
|
||||
- (void)changeView:(UICompositeViewDescription *)description;
|
||||
- (void)setFullScreen:(BOOL)enabled;
|
||||
- (void)hideStateBar:(BOOL)hidden;
|
||||
- (void)hideToolBar:(BOOL)hidden;
|
||||
- (void)hideSideMenu:(BOOL)hidden;
|
||||
- (BOOL)currentViewSupportsLandscape;
|
||||
- (UIViewController *)getCachedController:(NSString *)name;
|
||||
- (UIViewController *)getCurrentViewController;
|
||||
- (UIInterfaceOrientation)currentOrientation;
|
||||
- (void)clearCache:(NSArray *)exclude;
|
||||
- (IBAction)onRightSwipe:(id)sender;
|
||||
|
||||
@end
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "UICompositeViewController.h"
|
||||
#import "UICompositeView.h"
|
||||
|
||||
#import "LinphoneAppDelegate.h"
|
||||
#import "Utils.h"
|
||||
|
|
@ -49,12 +49,12 @@
|
|||
}
|
||||
|
||||
- (id)init:(NSString *)aname
|
||||
content:(NSString *)acontent
|
||||
stateBar:(NSString *)astateBar
|
||||
tabBar:(NSString *)atabBar
|
||||
fullscreen:(BOOL)afullscreen
|
||||
landscapeMode:(BOOL)alandscapeMode
|
||||
portraitMode:(BOOL)aportraitMode {
|
||||
content:(NSString *)acontent
|
||||
stateBar:(NSString *)astateBar
|
||||
tabBar:(NSString *)atabBar
|
||||
fullscreen:(BOOL)afullscreen
|
||||
landscapeMode:(BOOL)alandscapeMode
|
||||
portraitMode:(BOOL)aportraitMode {
|
||||
self.name = aname;
|
||||
self.content = acontent;
|
||||
self.stateBar = astateBar;
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
}
|
||||
|
||||
@end
|
||||
@interface UICompositeViewController ()
|
||||
@interface UICompositeView ()
|
||||
|
||||
@property(nonatomic, strong) UIViewController *stateBarViewController;
|
||||
@property(nonatomic, strong) UIViewController *tabBarViewController;
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
|
||||
@end
|
||||
|
||||
@implementation UICompositeViewController
|
||||
@implementation UICompositeView
|
||||
|
||||
@synthesize stateBarView;
|
||||
@synthesize contentView;
|
||||
|
|
@ -170,7 +170,7 @@
|
|||
[super viewDidLoad];
|
||||
|
||||
_sideMenuViewController = [self getCachedController:@"SideMenuViewController"];
|
||||
[UICompositeViewController addSubView:_sideMenuViewController view:_sideMenuView];
|
||||
[UICompositeView addSubView:_sideMenuViewController view:_sideMenuView];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
|
|
@ -258,8 +258,7 @@
|
|||
UIInterfaceOrientation correctOrientation =
|
||||
[self getCorrectInterfaceOrientation:[[UIDevice currentDevice] orientation]];
|
||||
if (currentOrientation != correctOrientation) {
|
||||
[UICompositeViewController setOrientation:correctOrientation
|
||||
animated:currentOrientation != UIDeviceOrientationUnknown];
|
||||
[UICompositeView setOrientation:correctOrientation animated:currentOrientation != UIDeviceOrientationUnknown];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -288,7 +287,7 @@
|
|||
}];
|
||||
|
||||
if (firstResponder == nil) {
|
||||
firstResponder = [UICompositeViewController findFirstResponder:controller.view];
|
||||
firstResponder = [UICompositeView findFirstResponder:controller.view];
|
||||
}
|
||||
|
||||
[[UIApplication sharedApplication] setStatusBarOrientation:orientation animated:animated];
|
||||
|
|
@ -303,7 +302,7 @@
|
|||
return view;
|
||||
}
|
||||
for (UIView *subView in view.subviews) {
|
||||
UIView *ret = [UICompositeViewController findFirstResponder:subView];
|
||||
UIView *ret = [UICompositeView findFirstResponder:subView];
|
||||
if (ret != nil)
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -431,12 +430,12 @@
|
|||
UIViewController *newStateBarViewController = [self getCachedController:description.stateBar];
|
||||
UIViewController *newTabBarViewController = [self getCachedController:description.tabBar];
|
||||
|
||||
[UICompositeViewController removeSubView:oldContentViewController];
|
||||
[UICompositeView removeSubView:oldContentViewController];
|
||||
if (oldTabBarViewController != nil && oldTabBarViewController != newTabBarViewController) {
|
||||
[UICompositeViewController removeSubView:oldTabBarViewController];
|
||||
[UICompositeView removeSubView:oldTabBarViewController];
|
||||
}
|
||||
if (oldStateBarViewController != nil && oldStateBarViewController != newStateBarViewController) {
|
||||
[UICompositeViewController removeSubView:oldStateBarViewController];
|
||||
[UICompositeView removeSubView:oldStateBarViewController];
|
||||
}
|
||||
|
||||
self.stateBarViewController = newStateBarViewController;
|
||||
|
|
@ -447,8 +446,8 @@
|
|||
UIInterfaceOrientation correctOrientation = [self
|
||||
getCorrectInterfaceOrientation:(UIDeviceOrientation)[UIApplication sharedApplication].statusBarOrientation];
|
||||
if (currentOrientation != correctOrientation) {
|
||||
[UICompositeViewController setOrientation:correctOrientation
|
||||
animated:currentOrientation != UIDeviceOrientationUnknown];
|
||||
[UICompositeView setOrientation:correctOrientation
|
||||
animated:currentOrientation != UIDeviceOrientationUnknown];
|
||||
if (UIInterfaceOrientationIsLandscape(correctOrientation)) {
|
||||
[self.contentViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
|
||||
[self.tabBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
|
||||
|
|
@ -571,12 +570,12 @@
|
|||
|
||||
// Change view
|
||||
if (description != nil) {
|
||||
[UICompositeViewController addSubView:self.contentViewController view:contentView];
|
||||
[UICompositeView addSubView:self.contentViewController view:contentView];
|
||||
if (oldTabBarViewController == nil || oldTabBarViewController != self.tabBarViewController) {
|
||||
[UICompositeViewController addSubView:self.tabBarViewController view:tabBarView];
|
||||
[UICompositeView addSubView:self.tabBarViewController view:tabBarView];
|
||||
}
|
||||
if (oldStateBarViewController == nil || oldStateBarViewController != self.stateBarViewController) {
|
||||
[UICompositeViewController addSubView:self.stateBarViewController view:stateBarView];
|
||||
[UICompositeView addSubView:self.stateBarViewController view:stateBarView];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
/* UICompositeViewController.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 <QuartzCore/QuartzCore.h>
|
||||
|
||||
#import "LinphoneManager.h"
|
||||
#import "TPMultiLayoutViewController.h"
|
||||
#import "SideMenuTableViewController.h"
|
||||
|
||||
@interface UICompositeViewDescription: NSObject{
|
||||
}
|
||||
|
||||
@property (strong) NSString *name;
|
||||
@property (strong) NSString *content;
|
||||
@property (strong) NSString *stateBar;
|
||||
@property (strong) NSString *tabBar;
|
||||
@property (assign) BOOL fullscreen;
|
||||
@property (assign) BOOL landscapeMode;
|
||||
@property (assign) BOOL portraitMode;
|
||||
@property (assign) BOOL darkBackground;
|
||||
|
||||
- (id)copy;
|
||||
- (BOOL)equal:(UICompositeViewDescription*) description;
|
||||
- (id)init:(NSString *)name content:(NSString *)content stateBar:(NSString*)stateBar
|
||||
tabBar:(NSString*)tabBar
|
||||
fullscreen:(BOOL) fullscreen
|
||||
landscapeMode:(BOOL) landscapeMode
|
||||
portraitMode:(BOOL) portraitMode;
|
||||
|
||||
@end
|
||||
|
||||
@protocol UICompositeViewDelegate <NSObject>
|
||||
|
||||
+ (UICompositeViewDescription*) compositeViewDescription;
|
||||
|
||||
@end
|
||||
|
||||
@interface UICompositeViewController : TPMultiLayoutViewController {
|
||||
@private
|
||||
NSMutableDictionary *viewControllerCache;
|
||||
UICompositeViewDescription *currentViewDescription;
|
||||
UIInterfaceOrientation currentOrientation;
|
||||
}
|
||||
|
||||
@property (strong) CATransition *viewTransition;
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UIView* stateBarView;
|
||||
@property (nonatomic, strong) IBOutlet UIView* contentView;
|
||||
@property (nonatomic, strong) IBOutlet UIView* tabBarView;
|
||||
@property(strong, nonatomic) IBOutlet UIView *sideMenuView;
|
||||
|
||||
- (void)changeView:(UICompositeViewDescription *)description;
|
||||
- (void)setFullScreen:(BOOL)enabled;
|
||||
- (void)hideStateBar:(BOOL)hidden;
|
||||
- (void)hideToolBar:(BOOL)hidden;
|
||||
- (void)hideSideMenu:(BOOL)hidden;
|
||||
- (BOOL)currentViewSupportsLandscape;
|
||||
- (UIViewController *)getCachedController:(NSString*)name;
|
||||
- (UIViewController *)getCurrentViewController;
|
||||
- (UIInterfaceOrientation)currentOrientation;
|
||||
- (void)clearCache:(NSArray*)exclude;
|
||||
- (IBAction)onRightSwipe:(id)sender;
|
||||
|
||||
@end
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
return [super initWithNibName:@"UIConferenceHeader" bundle:[NSBundle mainBundle]];
|
||||
return [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]];
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
|
|
|||
|
|
@ -54,10 +54,9 @@
|
|||
- (IBAction)onDetails:(id)event {
|
||||
if (callLog != NULL && linphone_call_log_get_call_id(callLog) != NULL) {
|
||||
// Go to History details view
|
||||
HistoryDetailsViewController *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[HistoryDetailsViewController compositeViewDescription]
|
||||
push:TRUE],
|
||||
HistoryDetailsViewController);
|
||||
HistoryDetailsView *controller = DYNAMIC_CAST(
|
||||
[[PhoneMainView instance] changeCurrentView:[HistoryDetailsView compositeViewDescription] push:TRUE],
|
||||
HistoryDetailsView);
|
||||
if (controller != nil) {
|
||||
[controller setCallLogId:[NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)]];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
/* UILinphone.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/UIColor.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#define LINPHONE_MAIN_COLOR [UIColor colorWithRed:207.0f/255.0f green:76.0f/255.0f blue:41.0f/255.0f alpha:1.0f]
|
||||
#define LINPHONE_SETTINGS_BG_IOS7 [UIColor colorWithRed:164/255. green:175/255. blue:183/255. alpha:1.0]//[UIColor colorWithWhite:0.88 alpha:1.0]
|
||||
#define LINPHONE_TABLE_CELL_BACKGROUND_COLOR [UIColor colorWithRed:207.0f/255.0f green:76.0f/255.0f blue:41.0f/255.0f alpha:1.0f]
|
||||
|
||||
@interface UIColor (LightAndDark)
|
||||
|
||||
- (UIColor *)adjustHue:(float)hm saturation:(float)sm brightness:(float)bm alpha:(float)am;
|
||||
|
||||
- (UIColor *)lumColor:(float)mult;
|
||||
|
||||
- (UIColor *)lighterColor;
|
||||
|
||||
- (UIColor *)darkerColor;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface UIImage (ForceDecode)
|
||||
|
||||
+ (UIImage *)decodedImageWithImage:(UIImage *)image;
|
||||
|
||||
@end
|
||||
|
|
@ -1,126 +0,0 @@
|
|||
/* UILinphone.m
|
||||
*
|
||||
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "UILinphone.h"
|
||||
#import "ColorSpaceUtilities.h"
|
||||
#import "Utils.h"
|
||||
|
||||
#import <UIKit/UIView.h>
|
||||
|
||||
@implementation UIColor (LightAndDark)
|
||||
|
||||
- (UIColor *)lumColor:(float)mult {
|
||||
float hsbH, hsbS, hsbB;
|
||||
float rgbaR, rgbaG, rgbaB, rgbaA;
|
||||
|
||||
// Get RGB
|
||||
CGColorRef cgColor = [self CGColor];
|
||||
CGColorSpaceRef cgColorSpace = CGColorGetColorSpace(cgColor);
|
||||
if (CGColorSpaceGetModel(cgColorSpace) != kCGColorSpaceModelRGB) {
|
||||
LOGW(@"Can't convert not RGB color");
|
||||
return self;
|
||||
} else {
|
||||
const CGFloat *colors = CGColorGetComponents(cgColor);
|
||||
rgbaR = colors[0];
|
||||
rgbaG = colors[1];
|
||||
rgbaB = colors[2];
|
||||
rgbaA = CGColorGetAlpha(cgColor);
|
||||
}
|
||||
|
||||
RGB2HSL(rgbaR, rgbaG, rgbaB, &hsbH, &hsbS, &hsbB);
|
||||
|
||||
hsbB = MIN(MAX(hsbB * mult, 0.0), 1.0);
|
||||
|
||||
HSL2RGB(hsbH, hsbS, hsbB, &rgbaR, &rgbaG, &rgbaB);
|
||||
|
||||
return [UIColor colorWithRed:rgbaR green:rgbaG blue:rgbaB alpha:rgbaA];
|
||||
}
|
||||
|
||||
- (UIColor *)adjustHue:(float)hm saturation:(float)sm brightness:(float)bm alpha:(float)am {
|
||||
float hsbH, hsbS, hsbB;
|
||||
float rgbaR, rgbaG, rgbaB, rgbaA;
|
||||
|
||||
// Get RGB
|
||||
CGColorRef cgColor = [self CGColor];
|
||||
CGColorSpaceRef cgColorSpace = CGColorGetColorSpace(cgColor);
|
||||
if (CGColorSpaceGetModel(cgColorSpace) != kCGColorSpaceModelRGB) {
|
||||
LOGW(@"Can't convert not RGB color");
|
||||
return self;
|
||||
} else {
|
||||
const CGFloat *colors = CGColorGetComponents(cgColor);
|
||||
rgbaR = colors[0];
|
||||
rgbaG = colors[1];
|
||||
rgbaB = colors[2];
|
||||
rgbaA = CGColorGetAlpha(cgColor);
|
||||
}
|
||||
|
||||
RGB2HSL(rgbaR, rgbaG, rgbaB, &hsbH, &hsbS, &hsbB);
|
||||
|
||||
hsbH = MIN(MAX(hsbH + hm, 0.0), 1.0);
|
||||
hsbS = MIN(MAX(hsbS + sm, 0.0), 1.0);
|
||||
hsbB = MIN(MAX(hsbB + bm, 0.0), 1.0);
|
||||
rgbaA = MIN(MAX(rgbaA + am, 0.0), 1.0);
|
||||
|
||||
HSL2RGB(hsbH, hsbS, hsbB, &rgbaR, &rgbaG, &rgbaB);
|
||||
|
||||
return [UIColor colorWithRed:rgbaR green:rgbaG blue:rgbaB alpha:rgbaA];
|
||||
}
|
||||
|
||||
- (UIColor *)lighterColor {
|
||||
return [self lumColor:1.3];
|
||||
}
|
||||
|
||||
- (UIColor *)darkerColor {
|
||||
return [self lumColor:0.75];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation UIImage (ForceDecode)
|
||||
|
||||
+ (UIImage *)decodedImageWithImage:(UIImage *)image {
|
||||
CGImageRef imageRef = image.CGImage;
|
||||
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
CGContextRef context = CGBitmapContextCreate(
|
||||
NULL, CGImageGetWidth(imageRef), CGImageGetHeight(imageRef), 8,
|
||||
// Just always return width * 4 will be enough
|
||||
CGImageGetWidth(imageRef) * 4,
|
||||
// System only supports RGB, set explicitly
|
||||
colorSpace,
|
||||
// Makes system don't need to do extra conversion when displayed.
|
||||
// NOTE: here we remove the alpha channel for performance. Most of the time, images loaded
|
||||
// from the network are jpeg with no alpha channel. As a TODO, finding a way to detect
|
||||
// if alpha channel is necessary would be nice.
|
||||
kCGImageAlphaNoneSkipLast | kCGBitmapByteOrder32Little);
|
||||
CGColorSpaceRelease(colorSpace);
|
||||
if (!context)
|
||||
return nil;
|
||||
|
||||
CGRect rect = (CGRect){CGPointZero, {CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)}};
|
||||
CGContextDrawImage(context, rect, imageRef);
|
||||
CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context);
|
||||
CGContextRelease(context);
|
||||
|
||||
UIImage *decompressedImage =
|
||||
[[UIImage alloc] initWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation];
|
||||
CGImageRelease(decompressedImageRef);
|
||||
return decompressedImage;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
/* UIMainBar.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 <UIKit/UIKit.h>
|
||||
#import "TPMultiLayoutViewController.h"
|
||||
|
||||
@interface UIMainBar : TPMultiLayoutViewController {
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UIButton* historyButton;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* contactsButton;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* dialerButton;
|
||||
@property (nonatomic, strong) IBOutlet UIButton* chatButton;
|
||||
@property (nonatomic, strong) IBOutlet UIView *historyNotificationView;
|
||||
@property (nonatomic, strong) IBOutlet UILabel *historyNotificationLabel;
|
||||
@property (nonatomic, strong) IBOutlet UIView *chatNotificationView;
|
||||
@property (nonatomic, strong) IBOutlet UILabel *chatNotificationLabel;
|
||||
@property(weak, nonatomic) IBOutlet UIView *selectedBtnView;
|
||||
|
||||
-(IBAction) onHistoryClick: (id) event;
|
||||
-(IBAction) onContactsClick: (id) event;
|
||||
-(IBAction) onDialerClick: (id) event;
|
||||
-(IBAction) onChatClick: (id) event;
|
||||
|
||||
@end
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue