blackberry.com
BlackBerry Dynamics
Runtime library for iOS applications
from the application developer portal

GDServices.h

Go to the documentation of this file.
00001 /*
00002  * (c) 2017 BlackBerry Limited. All rights reserved.
00003  * 
00004  * The documentation in this file is also used elsewhere.
00005  */
00006 
00007 #ifndef __GD_SERVICES_H__
00008 #define __GD_SERVICES_H__
00009 
00010 #import <Foundation/Foundation.h>
00011 #import "GDPortability.h"
00012 
00013 #if __has_extension(attribute_deprecated_with_message)
00014 #   define DEPRECATE_BRINGTOFRONTWITHOUTCOMPLETION __attribute((deprecated("Use bringToFront:completion:error:")))
00015 #else
00016 #   define DEPRECATE_BRINGTOFRONTWITHOUTCOMPLETION __attribute((deprecated))
00017 #endif
00018 
00019 GD_NS_ASSUME_NONNULL_BEGIN
00020 
00065 extern NSString* const GDServicesErrorDomain;
00066 
00069 extern NSInteger const GDServicesErrorGeneral; 
00070 
00074 extern NSInteger const GDServicesErrorApplicationNotFound; 
00075 
00079 extern NSInteger const GDServicesErrorServiceNotFound;
00080 
00084 extern NSInteger const GDServicesErrorServiceVersionNotFound;
00085 
00089 extern NSInteger const GDServicesErrorMethodNotFound;
00090 
00094 extern NSInteger const GDServicesErrorNotAllowed;
00095 
00099 extern NSInteger const GDServicesErrorInvalidParams;
00100 
00104 extern NSInteger const GDServicesErrorCertificateNotFound;
00105 
00109 extern NSInteger const GDServicesMethodDisabled;
00110 
00114 extern NSInteger const GDServicesVersionDisabled;
00115 
00119 extern NSInteger const GDServicesServiceDisabled;
00120 
00124 extern NSInteger const GDServicesErrorEnterpriseUserNotMatch;
00125 
00146 typedef NS_ENUM(NSInteger, GDTForegroundOption)
00147 {
00149     GDEPreferMeInForeground,
00150     
00152     GDEPreferPeerInForeground,
00153     
00155     GDENoForegroundPreference
00156     
00157 };
00158 
00165 extern NSString* const GDFrontRequestService;
00166 
00173 extern NSString* const GDFrontRequestMethod;
00174 
00211 @protocol GDServiceClientDelegate<NSObject>
00212 @required
00269 - (void) GDServiceClientDidReceiveFrom:(NSString*)application
00270                             withParams:(id)params
00271                        withAttachments:(GD_NSArray(NSString *) *)attachments
00272               correspondingToRequestID:(NSString*)requestID;
00273 
00274 @optional
00301 - (void) GDServiceClientDidStartSendingTo:(NSString*)application withFilename:(NSString*)filename correspondingToRequestID:(NSString*)requestID;
00302 
00303 @optional
00332 - (void) GDServiceClientDidFinishSendingTo:(NSString*)application withAttachments:(GD_NSArray(NSString *) *)attachments withParams:(id)params correspondingToRequestID:(NSString*)requestID;
00333 
00334 @optional
00362 - (void) GDServiceClientWillStartReceivingFrom:(NSString*)application
00363                            numberOfAttachments:(NSUInteger)attachments
00364                                   forRequestID:(NSString*)requestID;
00365 
00366 @optional
00398 - (void) GDServiceClientWillStartReceivingFrom:(NSString*)application
00399                                 attachmentPath:(NSString*)path
00400                                       fileSize:(NSNumber*)size
00401                                   forRequestID:(NSString*)requestID;
00402 
00403 @end
00404 
00405 
00441 @interface GDServiceClient : NSObject
00442 
00512 + (BOOL) sendTo:(NSString*)application
00513     withService:(NSString*)service
00514     withVersion:(NSString*)version
00515      withMethod:(NSString*)method
00516      withParams:(GD_NSNULLABLE id)params
00517 withAttachments:(GD_NSNULLABLE GD_NSArray(NSString *) *)attachments
00518 bringServiceToFront:(GDTForegroundOption)option
00519       requestID:(NSString * GD_NSNULLABLE_POINTER * GD_NSNULLABLE_POINTER)requestID
00520           error:(NSError**)error;
00521 
00557 + (BOOL) cancelRequest:(NSString*)requestID toApplication:(NSString*)application;
00558 
00589 + (BOOL) bringToFront:(GD_NSNON_NULL NSString*)application completion:( void(^)(BOOL) )completion error:(NSError**)error;
00590 
00613 + (BOOL) bringToFront:(NSString*)application error:(NSError**)error DEPRECATE_BRINGTOFRONTWITHOUTCOMPLETION;
00614 
00632 @property (GD_NSNULLABLE_PROP weak, getter = getDelegate, setter = setDelegate:) id<GDServiceClientDelegate> delegate;
00633 
00634 @end
00635 
00674 @protocol GDServiceDelegate<NSObject>
00675 
00676 @required
00746 - (void) GDServiceDidReceiveFrom:(NSString*)application
00747                       forService:(NSString*)service
00748                      withVersion:(NSString*)version
00749                        forMethod:(NSString*)method
00750                       withParams:(id)params
00751                  withAttachments:(GD_NSArray(NSString *) *)attachments
00752                     forRequestID:(NSString*)requestID;
00753 
00754 @optional
00755 
00782 - (void) GDServiceDidStartSendingTo:(NSString*)application withFilename:(NSString*)filename correspondingToRequestID:(NSString*)requestID;
00783 
00813 - (void) GDServiceDidFinishSendingTo:(NSString*)application withAttachments:(GD_NSArray(NSString *) *)attachments withParams:(id)params correspondingToRequestID:(NSString*)requestID;
00814 
00815 @optional
00842 - (void) GDServiceWillStartReceivingFrom:(NSString*)application
00843                      numberOfAttachments:(NSUInteger)attachments
00844                             forRequestID:(NSString*)requestID;
00845 
00846 @optional
00877 - (void) GDServiceWillStartReceivingFrom:(NSString*)application
00878                           attachmentPath:(NSString*)path
00879                                 fileSize:(NSNumber*)size
00880                             forRequestID:(NSString*)requestID;
00881 
00882 @end
00883 
01289 @interface GDService : NSObject
01290 
01349 + (BOOL) replyTo:(GD_NSNULLABLE NSString*)application
01350       withParams:(GD_NSNULLABLE id)params
01351 bringClientToFront:(GDTForegroundOption)option
01352  withAttachments:(GD_NSNULLABLE GD_NSArray(NSString *) *)attachments
01353        requestID:(NSString*)requestID
01354            error:(NSError**)error;
01355 
01385 + (BOOL) bringToFront:(GD_NSNON_NULL NSString *)application completion:( void(^)(BOOL) )completion error:(NSError**)error;
01386 
01408 + (BOOL) bringToFront:(GD_NSNON_NULL NSString *)application error:(NSError**)error DEPRECATE_BRINGTOFRONTWITHOUTCOMPLETION;
01409 
01427 @property (GD_NSNULLABLE_PROP weak, getter = getDelegate, setter = setDelegate:) id<GDServiceDelegate> delegate;
01428 
01429 @end
01430 
01431 GD_NS_ASSUME_NONNULL_END
01432 
01433 #endif