diff --git a/src/PEPTransport.h b/src/PEPTransport.h index fadb5e2..a4d3392 100644 --- a/src/PEPTransport.h +++ b/src/PEPTransport.h @@ -3,32 +3,33 @@ @import PEPObjCTypes_macOS; @class PEPTransportConfig; +@class PEPSession; @class PEPTransport; @class PEPMessage; NS_ASSUME_NONNULL_BEGIN -@protocol PEPSendResultDelegate +@protocol PEPTransportSendToResultDelegate -- (BOOL)signalSendMessageResultWithTransportID:(PEPTransportID)transportID - messageID:(NSString *)messageID - address:(NSString *)address - statusCode:(PEPTransportStatusCode *)statusCode - error:(NSError * _Nullable * _Nullable)error; +- (BOOL)signalSendToResultWithTransportID:(PEPTransportID)transportID + messageID:(NSString *)messageID + address:(NSString *)address + statusCode:(PEPTransportStatusCode *)statusCode + error:(NSError * _Nullable * _Nullable)error; @end -@protocol PEPIncomingMessageDelegate +@protocol PEPTransportIncomingMessageDelegate -- (BOOL)signalNewIncomingMessageWithTransportID:(PEPTransportID)transportID - statusCode:(PEPTransportStatusCode *)statusCode - error:(NSError * _Nullable * _Nullable)error; +- (BOOL)signalIncomingMessageWithTransportID:(PEPTransportID)transportID + statusCode:(PEPTransportStatusCode *)statusCode + error:(NSError * _Nullable * _Nullable)error; @end -@protocol PEPStatusChangeDelegate +@protocol PEPTransportStatusChangeDelegate -- (BOOL)statusChangedWithTransportID:(PEPTransportID)transportID - statusCode:(PEPTransportStatusCode *)statusCode - error:(NSError * _Nullable * _Nullable)error; +- (BOOL)signalStatusChangeWithTransportID:(PEPTransportID)transportID + statusCode:(PEPTransportStatusCode *)statusCode + error:(NSError * _Nullable * _Nullable)error; @end /// Idea in a nutshell: @@ -39,45 +40,44 @@ NS_ASSUME_NONNULL_BEGIN /// - use it: /// - send message /// - listen to- and handle sendMessageResult (e.g. done sending aka "PEPTransportStatusCodeMessageDelivered") -/// - listen to newIncommingMessage delegate +/// - listen to incomingMessage delegate /// - call nextMessage to get it /// shutdown @protocol PEPTransport +@property (weak, nonatomic) id signalSendToResultDelegate; +@property (weak, nonatomic) id signalIncomingMessageDelegate; +@property (weak, nonatomic) id signalStatusChangeDelegate; + - (instancetype)init; /// Convenience initializer. -- (_Nullable instancetype)initWithChangeDelegate:(id _Nullable)statusChangeDelegate - signalSendResultDelegate:(id _Nullable)signalSendResultDelegate - signalIncomingMessageDelegate:(id _Nullable)signalIncomingMessageDelegate - callbackExecutionType:(PEPCallbackExcecutionType)callbackExecutionType - error:(NSError * _Nullable * _Nullable)error; - -- (BOOL)notifyWithChangeDelegate:(id _Nullable)statusChangeDelegate - signalSendResultDelegate:(id _Nullable)signalSendResultDelegate - signalIncomingMessageDelegate:(id _Nullable)signalIncomingMessageDelegate - callbackExecutionType:(PEPCallbackExcecutionType)callbackExecutionType - error:(NSError * _Nullable * _Nullable)error; - -- (BOOL)configure:(PEPTransport * _Nullable)pEptransport - withConfig:(PEPTransportConfig *)config -transportStatusCode:(out PEPTransportStatusCode * _Nullable)tsc - error:(NSError * _Nullable * _Nullable)error; - -- (BOOL)startup:(PEPTransport * _Nullable)pEptransport -transportStatusCode:(out PEPTransportStatusCode*)tsc - error:(NSError * _Nullable * _Nullable)error; - -- (BOOL)shutdown:(PEPTransport * _Nullable)pEptransport -transportStatusCode:(out PEPTransportStatusCode * _Nullable)tsc - error:(NSError * _Nullable * _Nullable)error; - -- (BOOL)sendMessage:(PEPMessage *)msg -transportStatusCode:(out PEPTransportStatusCode * _Nullable)tsc - error:(NSError * _Nullable * _Nullable)error; - -- (PEPMessage * _Nullable)nextMessageWithTransportStatusCode:(out PEPTransportStatusCode * _Nullable)tsc +- (_Nullable instancetype)initWithSignalStatusChangeDelegate:(id _Nullable)signalStatusChangeDelegate + signalSendToResultDelegate:(id _Nullable)signalSendToResultDelegate + signalIncomingMessageDelegate:(id _Nullable)signalIncomingMessageDelegate + callbackExecutionType:(PEPTransportCallbackExcecutionType)callbackExecutionType error:(NSError * _Nullable * _Nullable)error; + +- (BOOL) configure:(PEPTransport * _Nullable)pEptransport + withConfig:(PEPTransportConfig *)config + transportStatusCode:(out PEPTransportStatusCode * _Nullable)tsc + error:(NSError * _Nullable * _Nullable)error; + +- (BOOL) startup:(PEPTransport * _Nullable)pEptransport + transportStatusCode:(out PEPTransportStatusCode*)tsc + error:(NSError * _Nullable * _Nullable)error; + +- (BOOL) shutdown:(PEPTransport * _Nullable)pEptransport + transportStatusCode:(out PEPTransportStatusCode * _Nullable)tsc + error:(NSError * _Nullable * _Nullable)error; + +- (BOOL) sendMessage:(PEPMessage *)msg pEpSession:(PEPSession * _Nullable)pEpSession + transportStatusCode:(out PEPTransportStatusCode * _Nullable)tsc + error:(NSError * _Nullable * _Nullable)error; + +- (PEPMessage * _Nullable)nextMessageWithPEPSession:(PEPSession * _Nullable)pEpsession + transportStatusCode:(out PEPTransportStatusCode * _Nullable)tsc + error:(NSError * _Nullable * _Nullable)error; @end NS_ASSUME_NONNULL_END