clean up headers

This commit is contained in:
Gautier Pelloux-Prayer 2015-09-08 13:13:32 +02:00
parent 4d329dd043
commit ad4feff82f
40 changed files with 73 additions and 90 deletions

View file

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "AboutViewController.h"
#import "PhoneMainView.h"
#import "LinphoneManager.h"
#include "linphone/lpconfig.h"
#include "LinphoneIOSVersion.h"

View file

@ -20,7 +20,6 @@
#import "LinphoneManager.h"
#import "ChatRoomTableViewController.h"
#import "UIChatRoomCell.h"
#import "Utils.h"
#import "PhoneMainView.h"
@implementation ChatRoomTableViewController

View file

@ -19,12 +19,9 @@
#import "ChatRoomViewController.h"
#import "PhoneMainView.h"
#import "DTActionSheet.h"
#import "UILinphone.h"
#import "DTAlertView.h"
#import "Utils/FileTransferDelegate.h"
#import <MobileCoreServices/UTCoreTypes.h>
#import "Utils.h"
#import "UIChatRoomCell.h"
@implementation ChatRoomViewController
@ -200,7 +197,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[error show];
return;
}
[FastAddressBook setDisplayNameLabel:addressLabel forAddress:linphoneAddress];
[ContactDisplay setDisplayNameLabel:addressLabel forAddress:linphoneAddress];
addressLabel.accessibilityValue = addressLabel.text;
avatarImage.image =
[FastAddressBook getContactImage:[FastAddressBook getContactWithLinphoneAddress:linphoneAddress] thumbnail:YES];

View file

@ -26,7 +26,6 @@
#import "PhoneMainView.h"
#import "UACellBackgroundView.h"
#import "UILinphone.h"
#import "Utils.h"
@implementation ChatTableViewController {
MSList *data;

View file

@ -24,7 +24,6 @@
#import "UILinphone.h"
#import "OrderedDictionary.h"
#import "FastAddressBook.h"
#import "Utils.h"
@interface Entry : NSObject

View file

@ -23,7 +23,6 @@
#import "PhoneMainView.h"
#import "UACellBackgroundView.h"
#import "UILinphone.h"
#import "Utils.h"
@implementation ContactsTableViewController

View file

@ -17,10 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "ContactsViewController.h"
#import "PhoneMainView.h"
#import "Utils.h"
#import <AddressBook/ABPerson.h>
@implementation ContactSelection

View file

@ -20,14 +20,8 @@
#import <AVFoundation/AVAudioSession.h>
#import <AudioToolbox/AudioToolbox.h>
#import "DialerViewController.h"
#import "IncallViewController.h"
#import "DTAlertView.h"
#import "LinphoneManager.h"
#import "PhoneMainView.h"
#import "Utils.h"
#include "linphone/linphonecore.h"
@implementation DialerViewController

View file

@ -8,6 +8,7 @@
#import "HistoryDetailsTableViewController.h"
#import "LinphoneManager.h"
#import "Utils.h"
@implementation HistoryDetailsTableViewController

View file

@ -20,7 +20,6 @@
#import "HistoryDetailsViewController.h"
#import "PhoneMainView.h"
#import "FastAddressBook.h"
#import "Utils.h"
@implementation HistoryDetailsViewController {
}
@ -165,7 +164,7 @@ static UICompositeViewDescription *compositeDescription = nil;
// this address should NEVER be NULL: if this assert is broken, the bug is elsewhere.
assert(addr != NULL);
[FastAddressBook setDisplayNameLabel:_contactLabel forAddress:addr];
[ContactDisplay setDisplayNameLabel:_contactLabel forAddress:addr];
_avatarImage.image =
[FastAddressBook getContactImage:[FastAddressBook getContactWithLinphoneAddress:addr] thumbnail:NO];
char *addrURI = linphone_address_as_string_uri_only(addr);

View file

@ -23,7 +23,6 @@
#import "PhoneMainView.h"
#import "UACellBackgroundView.h"
#import "UILinphone.h"
#import "Utils.h"
@implementation HistoryTableViewController

View file

@ -19,7 +19,6 @@
#import "ImagePickerViewController.h"
#import "PhoneMainView.h"
#import "DTActionSheet.h"
@implementation ImagePickerViewController

View file

@ -25,7 +25,6 @@
#import <XMLRPCResponse.h>
#import <XMLRPCRequest.h>
#import "Utils.h"
#import "LinphoneManager.h"
#import "PhoneMainView.h"

View file

@ -21,6 +21,7 @@
#import "UICallCell.h"
#import "UIConferenceHeader.h"
#import "LinphoneManager.h"
#import "Utils.h"
@implementation InCallTableViewController

View file

@ -29,7 +29,6 @@
#import "LinphoneManager.h"
#import "PhoneMainView.h"
#import "UILinphone.h"
#import "DTActionSheet.h"
#include "linphone/linphonecore.h"

View file

@ -21,7 +21,7 @@
#import "UICompositeViewController.h"
#import "TPMultiLayoutViewController.h"
#include "linphone/linphonecore.h"
#include "LinphoneManager.h"
@protocol IncomingCallViewDelegate <NSObject>

View file

@ -102,7 +102,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[self view]; // Force view load
const LinphoneAddress *addr = linphone_call_get_remote_address(call);
[FastAddressBook setDisplayNameLabel:_nameLabel forAddress:addr];
[ContactDisplay setDisplayNameLabel:_nameLabel forAddress:addr];
char *uri = linphone_address_as_string_uri_only(addr);
addressLabel.text = [NSString stringWithUTF8String:uri];
ms_free(uri);

View file

@ -18,7 +18,7 @@
*/
#import "LinphoneCoreSettingsStore.h"
#import "DTAlertView.h"
#import "Utils.h"
#include "linphone/lpconfig.h"

View file

@ -30,7 +30,6 @@
#import "IASKSettingsStore.h"
#import "IASKAppSettingsViewController.h"
#import "FastAddressBook.h"
#import "Utils.h"
#import "InAppProductsManager.h"
#include "linphone/linphonecore.h"

View file

@ -41,6 +41,7 @@
#import "LinphoneIOSVersion.h"
#import <AVFoundation/AVAudioPlayer.h>
#import "Utils.h"
#define LINPHONE_LOGS_MAX_ENTRY 5000

View file

@ -23,6 +23,7 @@
#import "UILinphone.h"
#import "LinphoneManager.h"
#import "FastAddressBook.h"
#import "Utils.h"
@implementation UICallCellData

View file

@ -19,6 +19,7 @@
#import "UICamSwitch.h"
#include "LinphoneManager.h"
#import "Utils.h"
@implementation UICamSwitch
@synthesize preview;

View file

@ -69,7 +69,7 @@
return;
}
const LinphoneAddress *addr = linphone_chat_room_get_peer_address(chatRoom);
[FastAddressBook setDisplayNameLabel:addressLabel forAddress:addr];
[ContactDisplay setDisplayNameLabel:addressLabel forAddress:addr];
avatarImage.image =
[FastAddressBook getContactImage:[FastAddressBook getContactWithLinphoneAddress:addr] thumbnail:NO];

View file

@ -20,6 +20,7 @@
#import "UICompositeViewController.h"
#import "LinphoneAppDelegate.h"
#import "Utils.h"
@implementation UICompositeViewDescription

View file

@ -45,7 +45,7 @@
- (void)setContact:(ABRecordRef)acontact {
contact = acontact;
[FastAddressBook setDisplayNameLabel:nameLabel forContact:contact];
[ContactDisplay setDisplayNameLabel:nameLabel forContact:contact];
_linphoneImage.hidden = !([FastAddressBook contactHasValidSipDomain:contact]);
}

View file

@ -117,7 +117,7 @@
}
_stateImage.image = image;
[FastAddressBook setDisplayNameLabel:displayNameLabel forAddress:addr];
[ContactDisplay setDisplayNameLabel:displayNameLabel forAddress:addr];
ABRecordRef contact = [FastAddressBook getContactWithLinphoneAddress:addr];
_avatarImage.image = [FastAddressBook getContactImage:contact thumbnail:TRUE];
}

View file

@ -19,8 +19,7 @@
#import "UIPauseButton.h"
#import "LinphoneManager.h"
#include "linphone/linphonecore.h"
#import "Utils.h"
@implementation UIPauseButton

View file

@ -19,8 +19,7 @@
#import <UIKit/UIKit.h>
#import "TPMultiLayoutViewController.h"
#import "DTActionSheet.h"
#import "SideMenuTableViewController.h"
#import "PhoneMainView.h"
@interface UIStateBar : TPMultiLayoutViewController<UIActionSheetDelegate> {
DTActionSheet *securitySheet;

View file

@ -19,6 +19,7 @@
#import "UIVideoButton.h"
#include "LinphoneManager.h"
#import "Utils.h"
@implementation UIVideoButton {
BOOL last_update_state;

View file

@ -48,7 +48,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[[PhoneMainView instance] popCurrentView];
} else {
const LinphoneAddress *addr = linphone_call_get_remote_address(call);
[FastAddressBook setDisplayNameLabel:_nameLabel forAddress:addr];
[ContactDisplay setDisplayNameLabel:_nameLabel forAddress:addr];
char *uri = linphone_address_as_string_uri_only(addr);
_addressLabel.text = [NSString stringWithUTF8String:uri];
ms_free(uri);

View file

@ -4,43 +4,42 @@
*
* 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 <MediaPlayer/MediaPlayer.h>
#import "LinphoneManager.h"
#import "UICompositeViewController.h"
/* These imports are here so that we can import PhoneMainView.h without bothering to import all the rest of the view headers */
#import "AboutViewController.h"
#import "IncomingCallViewController.h"
#import "ChatRoomViewController.h"
#import "ChatViewController.h"
#import "DialerViewController.h"
#import "ContactsViewController.h"
#import "ContactDetailsViewController.h"
#import "ContactDetailsLabelViewController.h"
#import "ImagePickerViewController.h"
#import "HistoryViewController.h"
#import "ContactDetailsViewController.h"
#import "ContactsViewController.h"
#import "DialerViewController.h"
#import "HistoryDetailsViewController.h"
#import "InCallViewController.h"
#import "SettingsViewController.h"
#import "WizardViewController.h"
#import "IncomingCallViewController.h"
#import "HistoryViewController.h"
#import "ImageViewController.h"
#import "InCallViewController.h"
#import "IncomingCallViewController.h"
#import "OutgoingCallViewController.h"
#import "SettingsViewController.h"
#import "SideMenuViewController.h"
#import "WizardViewController.h"
#import "DTAlertView.h"
#import "DTActionSheet.h"
#import "Utils.h"
@class PhoneMainView;

View file

@ -22,8 +22,6 @@
#import "LinphoneAppDelegate.h"
#import "PhoneMainView.h"
#import "Utils.h"
#import "DTActionSheet.h"
static RootViewManager *rootViewManagerInstance = nil;

View file

@ -32,8 +32,6 @@
#import "IASKTextField.h"
#include "linphone/lpconfig.h"
#import "DTAlertView.h"
#ifdef DEBUG
@interface UIDevice (debug)

View file

@ -22,7 +22,7 @@
LinphoneProxyConfig *default_proxy = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
if (default_proxy != NULL) {
const LinphoneAddress *addr = linphone_proxy_config_get_identity_address(default_proxy);
[FastAddressBook setDisplayNameLabel:_nameLabel forAddress:addr];
[ContactDisplay setDisplayNameLabel:_nameLabel forAddress:addr];
char *as_string = linphone_address_as_string(addr);
_addressLabel.text = [NSString stringWithUTF8String:as_string];
ms_free(as_string);

View file

@ -40,10 +40,9 @@
+ (NSString *)getContactDisplayName:(ABRecordRef)contact;
+ (UIImage *)getContactImage:(ABRecordRef)contact thumbnail:(BOOL)thumbnail;
+ (BOOL)contactHasValidSipDomain:(ABRecordRef)person;
+ (void)setDisplayNameLabel:(UILabel *)label forContact:(ABRecordRef)contact;
+ (NSString *)displayNameForContact:(ABRecordRef)person;
+ (NSString *)displayNameForAddress:(const LinphoneAddress *)addr;
+ (void)setDisplayNameLabel:(UILabel *)label forAddress:(const LinphoneAddress *)addr;
+ (BOOL)isSipURI:(NSString *)address; // should be removed
+ (NSString *)appendCountryCodeIfPossible:(NSString *)number; // should be removed

View file

@ -20,7 +20,7 @@
#import "FastAddressBook.h"
#import "LinphoneManager.h"
#import "ContactsViewController.h"
#import "UILabel+Boldify.h"
#import "Utils.h"
@implementation FastAddressBook
@ -327,15 +327,6 @@ void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info, void
return match;
}
+ (void)setDisplayNameLabel:(UILabel *)label forContact:(ABRecordRef)contact {
label.text = [FastAddressBook displayNameForContact:contact];
NSString *lLastName = CFBridgingRelease(ABRecordCopyValue(contact, kABPersonLastNameProperty));
NSString *lLocalizedLastName = [FastAddressBook localizedLabel:lLastName];
if (lLocalizedLastName) {
[label boldSubstring:lLocalizedLastName];
}
}
+ (NSString *)displayNameForContact:(ABRecordRef)contact {
NSString *ret = NSLocalizedString(@"Unknown", nil);
if (contact != nil) {
@ -374,8 +365,4 @@ void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info, void
return ret;
}
+ (void)setDisplayNameLabel:(UILabel *)label forAddress:(const LinphoneAddress *)addr {
label.text = [FastAddressBook displayNameForAddress:addr];
}
@end

View file

@ -7,6 +7,8 @@
//
#import "FileTransferDelegate.h"
#import "Utils.h"
@interface FileTransferDelegate ()
@property(strong) NSMutableData *data;
@end

View file

@ -17,16 +17,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef LINPHONE_UTILS_H
#define LINPHONE_UTILS_H
#define DYNAMIC_CAST(x, cls) \
({ \
cls *inst_ = (cls *)(x); \
[inst_ isKindOfClass:[cls class]]? inst_ : nil; \
})
#import <ortp/ortp.h>
#import "LinphoneManager.h"
@interface LinphoneLogger : NSObject {
@ -63,10 +60,13 @@ void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
#define LOGE(...) LOGV(ORTP_ERROR, __VA_ARGS__)
#define LOGF(...) LOGV(ORTP_FATAL, __VA_ARGS__)
#endif
@interface NSString(md5)
- (NSString *)md5;
@end
@interface ContactDisplay : NSObject
+ (void)setDisplayNameLabel:(UILabel *)label forContact:(ABRecordRef)contact;
+ (void)setDisplayNameLabel:(UILabel *)label forAddress:(const LinphoneAddress *)addr;
@end

View file

@ -20,6 +20,8 @@
#import "Utils.h"
#include "linphone/linphonecore.h"
#import <CommonCrypto/CommonDigest.h>
#import "UILabel+Boldify.h"
#import "FastAddressBook.h"
@implementation LinphoneLogger
@ -335,3 +337,20 @@ void linphone_iphone_log_handler(int lev, const char *fmt, va_list args) {
}
@end
@implementation ContactDisplay
+ (void)setDisplayNameLabel:(UILabel *)label forContact:(ABRecordRef)contact {
label.text = [FastAddressBook displayNameForContact:contact];
NSString *lLastName = CFBridgingRelease(ABRecordCopyValue(contact, kABPersonLastNameProperty));
NSString *lLocalizedLastName = [FastAddressBook localizedLabel:lLastName];
if (lLocalizedLastName) {
[label boldSubstring:lLocalizedLastName];
}
}
+ (void)setDisplayNameLabel:(UILabel *)label forAddress:(const LinphoneAddress *)addr {
label.text = [FastAddressBook displayNameForAddress:addr];
}
@end

View file

@ -28,8 +28,6 @@
#import <XMLRPCResponse.h>
#import <XMLRPCRequest.h>
#import "DTAlertView.h"
typedef enum _ViewElement {
ViewElement_Username = 100,
ViewElement_Password = 101,