|
|
|
@ -3,32 +3,33 @@
|
|
|
|
|
@import PEPObjCTypes_macOS;
|
|
|
|
|
|
|
|
|
|
@class PEPTransportConfig;
|
|
|
|
|
@class PEPSession;
|
|
|
|
|
@class PEPTransport;
|
|
|
|
|
@class PEPMessage;
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
@protocol PEPSendResultDelegate <NSObject>
|
|
|
|
|
@protocol PEPTransportSendToResultDelegate <NSObject>
|
|
|
|
|
|
|
|
|
|
- (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 <NSObject>
|
|
|
|
|
@protocol PEPTransportIncomingMessageDelegate <NSObject>
|
|
|
|
|
|
|
|
|
|
- (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 <NSObject>
|
|
|
|
|
@protocol PEPTransportStatusChangeDelegate <NSObject>
|
|
|
|
|
|
|
|
|
|
- (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 <NSObject>
|
|
|
|
|
|
|
|
|
|
@property (weak, nonatomic) id<PEPTransportSendToResultDelegate> signalSendToResultDelegate;
|
|
|
|
|
@property (weak, nonatomic) id<PEPTransportIncomingMessageDelegate> signalIncomingMessageDelegate;
|
|
|
|
|
@property (weak, nonatomic) id<PEPTransportStatusChangeDelegate> signalStatusChangeDelegate;
|
|
|
|
|
|
|
|
|
|
- (instancetype)init;
|
|
|
|
|
|
|
|
|
|
/// Convenience initializer.
|
|
|
|
|
- (_Nullable instancetype)initWithChangeDelegate:(id<PEPStatusChangeDelegate> _Nullable)statusChangeDelegate
|
|
|
|
|
signalSendResultDelegate:(id<PEPSendResultDelegate> _Nullable)signalSendResultDelegate
|
|
|
|
|
signalIncomingMessageDelegate:(id<PEPIncomingMessageDelegate> _Nullable)signalIncomingMessageDelegate
|
|
|
|
|
callbackExecutionType:(PEPCallbackExcecutionType)callbackExecutionType
|
|
|
|
|
error:(NSError * _Nullable * _Nullable)error;
|
|
|
|
|
|
|
|
|
|
- (BOOL)notifyWithChangeDelegate:(id<PEPStatusChangeDelegate> _Nullable)statusChangeDelegate
|
|
|
|
|
signalSendResultDelegate:(id<PEPSendResultDelegate> _Nullable)signalSendResultDelegate
|
|
|
|
|
signalIncomingMessageDelegate:(id<PEPIncomingMessageDelegate> _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<PEPTransportStatusChangeDelegate> _Nullable)signalStatusChangeDelegate
|
|
|
|
|
signalSendToResultDelegate:(id<PEPTransportSendToResultDelegate> _Nullable)signalSendToResultDelegate
|
|
|
|
|
signalIncomingMessageDelegate:(id<PEPTransportIncomingMessageDelegate> _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
|
|
|
|
|