|
//
|
|
// PEPMacOSAdapterProtocol.h
|
|
// pEpMacOSAdapter
|
|
//
|
|
// Created by Volker Birk on 20.04.20.
|
|
// Copyleft © 2020 p≡p foundation.
|
|
// This file is under GNU General Public License 3.0
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
/// Notification types
|
|
typedef enum { ready = 0, downloading, downloadArrived, noDownloadAvailable } DNType;
|
|
|
|
/// Callback protocol to notify about download events
|
|
@protocol PEPNotificationProtocol
|
|
|
|
/// notification about download events
|
|
- (void)notifyDownload:(int)type withName:(NSString*)name withFilename:(NSString*)filename;
|
|
|
|
@end
|
|
|
|
/// This is the object from the client where we deliver notifications to
|
|
@interface PEPNotification : NSObject <PEPNotificationProtocol>
|
|
@end
|
|
|
|
/// This protocol is providing the XPC interface to the User Interface program pEpNotifications
|
|
@protocol PEPMacOSAdapterProtocol
|
|
|
|
/**
|
|
subscribe to the published notifications about downloads arriving
|
|
|
|
- Parameter downloading: block to call back when a download is going to happen
|
|
- Parameter downloadArrived: block to call back when a download arrived
|
|
*/
|
|
- (void)subscribeForUpdate:(NSXPCListenerEndpoint*)endpoint;
|
|
|
|
/// unsubscribe from receiving notifications about downloads arriving
|
|
- (void)unsubscribeForUpdate;
|
|
|
|
/// search for immediate updates
|
|
- (void)updateNow;
|
|
|
|
/// schedules updates each 2 hours
|
|
- (void)scheduleUpdates;
|
|
|
|
/// stop auto updates
|
|
- (void)stopUpdates;
|
|
|
|
@end
|