pEpObjCAdapterFramework/PEPSync.h
author Dirk Zimmermann <dz@pep.security>
Thu, 12 Sep 2019 16:41:52 +0200
branchIOSAD-141
changeset 1244 d780d1356405
parent 1119 fde45735c424
child 1341 6e875190cd43
permissions -rw-r--r--
IOSAD-141 Give the threads a name.
dirk@681
     1
//
dirk@681
     2
//  PEPSync.h
dirk@681
     3
//  pEpObjCAdapter
dirk@681
     4
//
dirk@681
     5
//  Created by Dirk Zimmermann on 04.10.18.
dirk@681
     6
//  Copyright © 2018 p≡p. All rights reserved.
dirk@681
     7
//
dirk@681
     8
dirk@681
     9
#import <Foundation/Foundation.h>
dirk@681
    10
dirk@732
    11
#import "PEPSendMessageDelegate.h"
dirk@708
    12
#import "PEPNotifyHandshakeDelegate.h"
dirk@695
    13
dirk@686
    14
@class PEPSyncSendMessageDelegate;
dirk@686
    15
dirk@690
    16
/**
dz@1119
    17
 Manages the key-sync loop.
dirk@690
    18
 */
dirk@681
    19
@interface PEPSync : NSObject
dirk@681
    20
andreas@1021
    21
@property (nonatomic, nullable, weak) id<PEPSendMessageDelegate> sendMessageDelegate;
andreas@1022
    22
@property (nonatomic, nullable, weak) id<PEPNotifyHandshakeDelegate> notifyHandshakeDelegate;
andreas@1021
    23
dz@1119
    24
/**
dz@1119
    25
 Manages the key-sync loop, and other key-sync related elements.
dz@1119
    26
dz@1119
    27
 @note This object should only exist once per app.
dz@1119
    28
dz@1119
    29
 @param sendMessageDelegate Will be called on behalf of the engine for outgoing messages,
dz@1119
    30
                            needed e.g. in case of key rest, or for key-sync.
dz@1119
    31
 @param notifyHandshakeDelegate Called whever there is a key-sync related information that
dz@1119
    32
                                should be displayed to the user.
dz@1119
    33
 @return The object that binds the delegates given in the constructor and can be used to control
dz@1119
    34
         the key-sync loop.
dz@1119
    35
 */
dz@942
    36
- (instancetype _Nonnull)initWithSendMessageDelegate:(id <PEPSendMessageDelegate>
andreas@1021
    37
                                                      _Nullable)sendMessageDelegate
dz@942
    38
                             notifyHandshakeDelegate:(id<PEPNotifyHandshakeDelegate>
andreas@1022
    39
                                                      _Nullable)notifyHandshakeDelegate;
dirk@720
    40
dz@1119
    41
/**
dz@1119
    42
 Start the key-sync loop in its own, separate thread.
dz@1119
    43
 */
dirk@720
    44
- (void)startup;
dirk@720
    45
dz@1119
    46
/**
dz@1119
    47
 Shuts the key-sync loop down.
dz@1119
    48
 */
dirk@701
    49
- (void)shutdown;
dirk@695
    50
dirk@681
    51
@end