aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc/provider/MCOAccountValidator.h
diff options
context:
space:
mode:
authorGravatar Christopher Hockley <christopher@putcocoa.in>2015-01-26 11:03:06 +0100
committerGravatar Christopher Hockley <christopher@putcocoa.in>2015-01-26 11:03:06 +0100
commite4374684684264f4264e85c4b12b02e4bcdcdb34 (patch)
tree607de58075d1491a13ed368a31b2d2c65c26c2b8 /src/objc/provider/MCOAccountValidator.h
parent49afff2da8d8b658faf8f10e5229b06252359d17 (diff)
AccountValidator
Added AccountValidator to used to validate an email provider and it's associated metadata and credentials.
Diffstat (limited to 'src/objc/provider/MCOAccountValidator.h')
-rw-r--r--src/objc/provider/MCOAccountValidator.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/objc/provider/MCOAccountValidator.h b/src/objc/provider/MCOAccountValidator.h
new file mode 100644
index 00000000..0cdc25aa
--- /dev/null
+++ b/src/objc/provider/MCOAccountValidator.h
@@ -0,0 +1,50 @@
+//
+// MCOAccountValidator.h
+// mailcore2
+//
+// Created by Christopher Hockley on 20/01/15.
+// Copyright (c) 2015 MailCore. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <MailCore/MCOOperation.h>
+
+/**
+ This class is used to validate an email provider and it's associated
+ metadata and credentials.
+
+ An app might want to use this during setup to limit the number of settings
+ a user has to input.
+ */
+
+@class MCONetService;
+
+@interface MCOAccountValidator : MCOOperation
+
+@property (nonatomic, copy) NSString * email; /* for SMTP */
+@property (nonatomic, copy) NSString * username;
+@property (nonatomic, copy) NSString * password;
+@property (nonatomic, copy) NSString * OAuth2Token;
+
+@property (nonatomic, retain) NSArray * /* MCONetService */ imapServers;
+@property (nonatomic, retain) NSArray * /* MCONetService */ popServers;
+@property (nonatomic, retain) NSArray * /* MCONetService */ smtpServers;
+
+// result
+@property (nonatomic, retain, readonly) NSString * identifier;
+@property (nonatomic, retain, readonly) MCONetService * imapServer;
+@property (nonatomic, retain, readonly) MCONetService * popServer;
+@property (nonatomic, retain, readonly) MCONetService * smtpServer;
+@property (nonatomic, retain, readonly) NSError * imapError;
+@property (nonatomic, retain, readonly) NSError * popError;
+@property (nonatomic, retain, readonly) NSError * smtpError;
+
+/**
+ Starts the asynchronous account validation operation.
+
+ @param completionBlock Called when the operation is finished.
+ */
+- (void) start:(void (^)(void))completionBlock;
+
+
+@end