IOS-514 AccountVerificationServiceProtocol
authorDirk Zimmermann <dirk@pep-project.org>
Wed, 24 May 2017 11:06:06 +0200
changeset 219227bc2aecd298
parent 2191 a01eb69e9664
child 2193 75d9e8e00889
IOS-514 AccountVerificationServiceProtocol
pEpForiOS.xcodeproj/project.pbxproj
pEpForiOS/Network/AccountVerificationService/AccountVerificationServiceProtocol.swift
     1.1 --- a/pEpForiOS.xcodeproj/project.pbxproj	Tue May 23 11:32:32 2017 +0200
     1.2 +++ b/pEpForiOS.xcodeproj/project.pbxproj	Wed May 24 11:06:06 2017 +0200
     1.3 @@ -61,6 +61,7 @@
     1.4  		431BB9451E49B7A9000BCBF1 /* PorpoiseGalaxy_HubbleFraile_960.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 431BB9441E49B7A9000BCBF1 /* PorpoiseGalaxy_HubbleFraile_960.jpg */; };
     1.5  		431D60DB1E93BB2D001266D7 /* AttachmentsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 431D60DA1E93BB2D001266D7 /* AttachmentsView.swift */; };
     1.6  		431D60DD1E93D580001266D7 /* MessageAttachmentsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 431D60DC1E93D580001266D7 /* MessageAttachmentsCell.swift */; };
     1.7 +		431E58F61ED57F6500EFA77F /* AccountVerificationServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 431E58F51ED57F6500EFA77F /* AccountVerificationServiceProtocol.swift */; };
     1.8  		431E8F7E1CFDCF3A00C33647 /* EmailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 431E8F7D1CFDCF3A00C33647 /* EmailViewController.swift */; };
     1.9  		43209B541ECC5A9B007E7E2E /* libpEpObjCAdapter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 43209B531ECC5A9B007E7E2E /* libpEpObjCAdapter.a */; };
    1.10  		432142641E8FD66900FBE987 /* QuickSyncService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 432142631E8FD66900FBE987 /* QuickSyncService.swift */; };
    1.11 @@ -308,6 +309,7 @@
    1.12  		431BB9441E49B7A9000BCBF1 /* PorpoiseGalaxy_HubbleFraile_960.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = PorpoiseGalaxy_HubbleFraile_960.jpg; sourceTree = "<group>"; };
    1.13  		431D60DA1E93BB2D001266D7 /* AttachmentsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttachmentsView.swift; sourceTree = "<group>"; };
    1.14  		431D60DC1E93D580001266D7 /* MessageAttachmentsCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessageAttachmentsCell.swift; sourceTree = "<group>"; };
    1.15 +		431E58F51ED57F6500EFA77F /* AccountVerificationServiceProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountVerificationServiceProtocol.swift; sourceTree = "<group>"; };
    1.16  		431E8F7D1CFDCF3A00C33647 /* EmailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmailViewController.swift; sourceTree = "<group>"; };
    1.17  		43209B531ECC5A9B007E7E2E /* libpEpObjCAdapter.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpEpObjCAdapter.a; path = "../pEpObjCAdapter/build/Debug-iphoneos/libpEpObjCAdapter.a"; sourceTree = "<group>"; };
    1.18  		432142631E8FD66900FBE987 /* QuickSyncService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuickSyncService.swift; sourceTree = "<group>"; };
    1.19 @@ -598,6 +600,7 @@
    1.20  		43122B111DF5B48B00610253 /* Network */ = {
    1.21  			isa = PBXGroup;
    1.22  			children = (
    1.23 +				431E58F41ED57F4D00EFA77F /* AccountVerificationService */,
    1.24  				43122B3A1DF5B75000610253 /* Service */,
    1.25  				43122B121DF5B48B00610253 /* ConnectInfo.swift */,
    1.26  				43122B131DF5B48B00610253 /* EmailConnectInfo.swift */,
    1.27 @@ -658,6 +661,14 @@
    1.28  			path = AccountsAndFolders;
    1.29  			sourceTree = "<group>";
    1.30  		};
    1.31 +		431E58F41ED57F4D00EFA77F /* AccountVerificationService */ = {
    1.32 +			isa = PBXGroup;
    1.33 +			children = (
    1.34 +				431E58F51ED57F6500EFA77F /* AccountVerificationServiceProtocol.swift */,
    1.35 +			);
    1.36 +			path = AccountVerificationService;
    1.37 +			sourceTree = "<group>";
    1.38 +		};
    1.39  		4323FE871E83E502006785E1 /* Util */ = {
    1.40  			isa = PBXGroup;
    1.41  			children = (
    1.42 @@ -1418,6 +1429,7 @@
    1.43  				43B10C801EC2EE7F003E849F /* CppDummy.cpp in Sources */,
    1.44  				A1014DA71D1173CD00C472A8 /* UIHelper.swift in Sources */,
    1.45  				43A6E0581E57400E005BEE69 /* RatingReEvaluator.swift in Sources */,
    1.46 +				431E58F61ED57F6500EFA77F /* AccountVerificationServiceProtocol.swift in Sources */,
    1.47  				43A26FBF1E041BF200AF0B84 /* ImapSyncOperation.swift in Sources */,
    1.48  				43980EE01CBD24B000A7FC3C /* Log.swift in Sources */,
    1.49  				228038681DC9DE6D00F1CB45 /* TextfieldResponder.swift in Sources */,
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/pEpForiOS/Network/AccountVerificationService/AccountVerificationServiceProtocol.swift	Wed May 24 11:06:06 2017 +0200
     2.3 @@ -0,0 +1,30 @@
     2.4 +//
     2.5 +//  AccountVerificationServiceProtocol.swift
     2.6 +//  pEpForiOS
     2.7 +//
     2.8 +//  Created by Dirk Zimmermann on 24.05.17.
     2.9 +//  Copyright © 2017 p≡p Security S.A. All rights reserved.
    2.10 +//
    2.11 +
    2.12 +import UIKit
    2.13 +
    2.14 +enum AccountVerificationError: Error {
    2.15 +    case networkError
    2.16 +    case loginErrorIMAP
    2.17 +    case loginErrorSMTP
    2.18 +}
    2.19 +
    2.20 +enum AccountVerificationResult {
    2.21 +    case ok
    2.22 +    case error(VerificationError)
    2.23 +}
    2.24 +
    2.25 +protocol AccountVerificationServiceDelegate {
    2.26 +    func verified(account: Account, service: VerificationServiceProtocol,
    2.27 +                  result: VerificationResult)
    2.28 +}
    2.29 +
    2.30 +protocol AccountVerificationServiceProtocol: class {
    2.31 +    weak var delegate: VerificationServiceDelegate?
    2.32 +    func verify(account: Account)
    2.33 +}