//
//  ICContactsTool.h
//  superCleaner
//
//  Created by GY.Z on 2020/7/6.
//  Copyright © 2020 Mazy. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Contacts/Contacts.h>

NS_ASSUME_NONNULL_BEGIN

@protocol ICContactsToolDelegate <NSObject>

// 获取iCloud联系人
-(void)getiCloudContactsMethods:(NSData *)obj fileInfo:(NSDictionary *)fileInfo;
/// 获取iCloud列表
-(void)getiCloudList:(NSArray *)lists;

@end

@interface ICContactsTool : NSObject

@property(nonatomic,weak)id <ICContactsToolDelegate> delegate;

+(instancetype)shareInstance;

// 获取联系人
-(NSArray *)fetchContacts;

// 获取联系人授权状态
-(BOOL)contactsAuthStatus;

// 删除联系人
- (void)deleteContact:(CNMutableContact *)contact;

// 更新联系人
- (void)updateContact:(CNMutableContact *)contact;

// 获取iCloud容器联系人
-(void)getiCloudContactsPath:(NSURL *)path;

/// 获取联系人列表
-(void)loadiCloudDirectory;

/// 备份联系人
-(void)synciCloudContactsFileName:(NSString *)fileName;

/// 删除备份
-(void)deleteiCloudContactsUrlFile:(NSURL *)urlFile;

// 获取日期天
-(NSInteger)getCurrentDay;

-(NSString *)convertStrToTime:(NSString *)timeStr;

/// 获取时间戳
-(NSString *)getNowTimeTimestamp;

/// 设置删除和合并次数
-(void)registerDeleteOrMergeCount;

/// 重置删除和合并次数
-(void)resetCount;

/// 联系人详情note信息
@property(nonatomic,copy)NSString *note;

/// 进入联系人详情
-(void)enterContactsDetail:(CNContact *)contact controller:(UIViewController *)controller push:(BOOL)push;


@end

NS_ASSUME_NONNULL_END
