aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc/provider/MCOMailProvidersManager.h
blob: e5d2b9d6712a8cb19bcfe25c5af3388d35f3376c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
//  MCOMailProvidersManager.h
//  mailcore2
//
//  Created by Robert Widmann on 4/28/13.
//  Copyright (c) 2013 MailCore. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
   This class is used to detect an email provider and it's associated
   metadata either by MX record or by the email addresss.

   An app might want to use this during setup to limit the number of settings
   a user has to input.
*/

@class MCOMailProvider;

@interface MCOMailProvidersManager : NSObject

NS_ASSUME_NONNULL_BEGIN

/** The shared manager that is used for all lookups */
+ (MCOMailProvidersManager *) sharedManager;

/** 
    Given an email address will try to determine the provider
    @return The email provider info or nil if it can't be determined.
*/
- (nullable MCOMailProvider *) providerForEmail:(NSString *)email;

/** 
    Given the DNS MX record will try to determine the provider
    @return The email provider info or nil if it can't be determined.
*/
- (nullable MCOMailProvider *) providerForMX:(NSString *)hostname;

/**
   Will return information about a provider. Useful if you already know the
   provider (like if it has been determined previously)
   @return The email provider info or nil if none matches
*/
- (nullable MCOMailProvider *) providerForIdentifier:(NSString *)identifier;

/**
   Registers the providers in the JSON file at the file path so they
   can be used with MCOMailProvidersManager.
 */
- (void) registerProvidersWithFilename:(NSString *)filename;

NS_ASSUME_NONNULL_END

@end