2015-01-20 12:33:01 +00:00
|
|
|
/*
|
|
|
|
Copyright 2014 OpenMarket Ltd
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#import <AddressBook/AddressBook.h>
|
|
|
|
|
2015-01-20 15:29:42 +00:00
|
|
|
// warn when a contact has a new matrix identifier
|
|
|
|
// the contactID is provided in parameter
|
2015-01-23 13:22:02 +00:00
|
|
|
extern NSString *const kMXCContactMatrixIdentifierUpdateNotification;
|
2015-01-20 17:03:03 +00:00
|
|
|
// warn when the contact thumbnail is updated
|
|
|
|
// the contactID is provided in parameter
|
2015-01-23 13:22:02 +00:00
|
|
|
extern NSString *const kMXCContactThumbnailUpdateNotification;
|
2015-01-20 15:29:42 +00:00
|
|
|
|
2015-01-23 13:22:02 +00:00
|
|
|
@interface MXCContact : NSObject
|
2015-01-20 12:33:01 +00:00
|
|
|
|
2015-01-20 15:29:42 +00:00
|
|
|
// unique identifier
|
2015-01-21 12:26:29 +00:00
|
|
|
@property (nonatomic, readonly) NSString * contactID;
|
2015-01-20 12:33:01 +00:00
|
|
|
// display name
|
2015-01-21 12:26:29 +00:00
|
|
|
@property (nonatomic, readonly) NSString *displayName;
|
2015-01-20 15:29:42 +00:00
|
|
|
// contact thumbnail
|
2015-01-20 17:03:03 +00:00
|
|
|
@property (nonatomic, copy, readonly) UIImage *thumbnail;
|
2015-01-26 08:08:18 +00:00
|
|
|
// YES if the contact does not exist in the contacts book
|
|
|
|
// the contact has been created from a MXUser
|
|
|
|
@property (nonatomic, readonly) BOOL isMatrixContact;
|
2015-01-23 13:22:02 +00:00
|
|
|
// array of MXCPhoneNumber
|
2015-01-21 12:26:29 +00:00
|
|
|
@property (nonatomic, readonly) NSArray *phoneNumbers;
|
2015-01-23 13:22:02 +00:00
|
|
|
// array of MXCEmail
|
2015-01-21 12:26:29 +00:00
|
|
|
@property (nonatomic, readonly) NSArray *emailAddresses;
|
2015-01-20 17:03:03 +00:00
|
|
|
// array of matrix identifiers
|
2015-01-20 12:33:01 +00:00
|
|
|
@property (nonatomic, readonly) NSArray* matrixIdentifiers;
|
|
|
|
|
2015-01-22 11:01:12 +00:00
|
|
|
// create a contact from a local contact
|
2015-01-20 15:29:42 +00:00
|
|
|
- (id)initWithABRecord:(ABRecordRef)record;
|
|
|
|
|
2015-01-22 11:01:12 +00:00
|
|
|
// create a contact with the dedicated info
|
2015-01-26 08:08:18 +00:00
|
|
|
- (id)initWithDisplayName:(NSString*)displayName matrixID:(NSString*)matrixID;
|
2015-01-22 11:01:12 +00:00
|
|
|
|
2015-01-21 09:48:38 +00:00
|
|
|
// return thumbnail with a prefered size
|
|
|
|
// if the thumbnail is already loaded, this method returns this one
|
|
|
|
// if the thumbnail must trigger a server request, the expected size will be size
|
|
|
|
// self.thumbnail triggered a request with a 256 X 256 pixels
|
|
|
|
- (UIImage*)thumbnailWithPreferedSize:(CGSize)size;
|
|
|
|
|
2015-01-20 12:33:01 +00:00
|
|
|
@end
|