Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #ifndef __GD_SERVICES_H__
00008 #define __GD_SERVICES_H__
00009
00010 #import <Foundation/Foundation.h>
00011 #import "GDPortability.h"
00012
00013 GD_NS_ASSUME_NONNULL_BEGIN
00014
00059 extern NSString* const GDServicesErrorDomain;
00060
00063 extern NSInteger const GDServicesErrorGeneral;
00064
00068 extern NSInteger const GDServicesErrorApplicationNotFound;
00069
00073 extern NSInteger const GDServicesErrorServiceNotFound;
00074
00078 extern NSInteger const GDServicesErrorServiceVersionNotFound;
00079
00083 extern NSInteger const GDServicesErrorMethodNotFound;
00084
00088 extern NSInteger const GDServicesErrorNotAllowed;
00089
00093 extern NSInteger const GDServicesErrorInvalidParams;
00094
00098 extern NSInteger const GDServicesErrorCertificateNotFound;
00099
00103 extern NSInteger const GDServicesMethodDisabled;
00104
00108 extern NSInteger const GDServicesVersionDisabled;
00109
00113 extern NSInteger const GDServicesServiceDisabled;
00114
00118 extern NSInteger const GDServicesErrorEnterpriseUserNotMatch;
00119
00140 typedef NS_ENUM(NSInteger, GDTForegroundOption)
00141 {
00143 GDEPreferMeInForeground,
00144
00146 GDEPreferPeerInForeground,
00147
00149 GDENoForegroundPreference
00150
00151 };
00152
00159 extern NSString* const GDFrontRequestService;
00160
00167 extern NSString* const GDFrontRequestMethod;
00168
00201 @protocol GDServiceClientDelegate<NSObject>
00202 @required
00259 - (void) GDServiceClientDidReceiveFrom:(NSString*)application
00260 withParams:(id)params
00261 withAttachments:(GD_NSArray(NSString *) *)attachments
00262 correspondingToRequestID:(NSString*)requestID;
00263
00264 @optional
00291 - (void) GDServiceClientDidStartSendingTo:(NSString*)application withFilename:(NSString*)filename correspondingToRequestID:(NSString*)requestID;
00292
00293 @optional
00322 - (void) GDServiceClientDidFinishSendingTo:(NSString*)application withAttachments:(GD_NSArray(NSString *) *)attachments withParams:(id)params correspondingToRequestID:(NSString*)requestID;
00323
00324 @optional
00348 - (void) GDServiceClientWillStartReceivingFrom:(NSString*)application
00349 numberOfAttachments:(NSUInteger)attachments
00350 forRequestID:(NSString*)requestID;
00351
00352 @optional
00380 - (void) GDServiceClientWillStartReceivingFrom:(NSString*)application
00381 attachmentPath:(NSString*)path
00382 fileSize:(NSNumber*)size
00383 forRequestID:(NSString*)requestID;
00384
00385 @end
00386
00387
00423 @interface GDServiceClient : NSObject
00424
00494 + (BOOL) sendTo:(NSString*)application
00495 withService:(NSString*)service
00496 withVersion:(NSString*)version
00497 withMethod:(NSString*)method
00498 withParams:(GD_NSNULLABLE id)params
00499 withAttachments:(GD_NSNULLABLE GD_NSArray(NSString *) *)attachments
00500 bringServiceToFront:(GDTForegroundOption)option
00501 requestID:(NSString * GD_NSNULLABLE_POINTER * GD_NSNULLABLE_POINTER)requestID
00502 error:(NSError**)error;
00503
00539 + (BOOL) cancelRequest:(NSString*)requestID toApplication:(NSString*)application;
00540
00560 + (BOOL) bringToFront:(NSString*)application error:(NSError**)error;
00561
00579 @property (GD_NSNULLABLE_PROP weak, getter = getDelegate, setter = setDelegate:) id<GDServiceClientDelegate> delegate;
00580
00581 @end
00582
00617 @protocol GDServiceDelegate<NSObject>
00618
00619 @required
00689 - (void) GDServiceDidReceiveFrom:(NSString*)application
00690 forService:(NSString*)service
00691 withVersion:(NSString*)version
00692 forMethod:(NSString*)method
00693 withParams:(id)params
00694 withAttachments:(GD_NSArray(NSString *) *)attachments
00695 forRequestID:(NSString*)requestID;
00696
00697 @optional
00698
00725 - (void) GDServiceDidStartSendingTo:(NSString*)application withFilename:(NSString*)filename correspondingToRequestID:(NSString*)requestID;
00726
00756 - (void) GDServiceDidFinishSendingTo:(NSString*)application withAttachments:(GD_NSArray(NSString *) *)attachments withParams:(id)params correspondingToRequestID:(NSString*)requestID;
00757
00758 @optional
00781 - (void) GDServiceWillStartReceivingFrom:(NSString*)application
00782 numberOfAttachments:(NSUInteger)attachments
00783 forRequestID:(NSString*)requestID;
00784
00785 @optional
00812 - (void) GDServiceWillStartReceivingFrom:(NSString*)application
00813 attachmentPath:(NSString*)path
00814 fileSize:(NSNumber*)size
00815 forRequestID:(NSString*)requestID;
00816
00817 @end
00818
01224 @interface GDService : NSObject
01225
01284 + (BOOL) replyTo:(GD_NSNULLABLE NSString*)application
01285 withParams:(GD_NSNULLABLE id)params
01286 bringClientToFront:(GDTForegroundOption)option
01287 withAttachments:(GD_NSNULLABLE GD_NSArray(NSString *) *)attachments
01288 requestID:(NSString*)requestID
01289 error:(NSError**)error;
01290
01309 + (BOOL) bringToFront:(NSString*)application error:(NSError**)error;
01310
01328 @property (GD_NSNULLABLE_PROP weak, getter = getDelegate, setter = setDelegate:) id<GDServiceDelegate> delegate;
01329
01330 @end
01331
01332 GD_NS_ASSUME_NONNULL_END
01333
01334 #endif