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