Add methods for NSFontAssetRequest.

This commit is contained in:
Gregory John Casamento 2020-04-14 13:41:27 -04:00
parent a761a01eb5
commit 8bdb4ffe16
2 changed files with 41 additions and 1 deletions

View file

@ -26,6 +26,8 @@
#define _NSFontAssetRequest_h_GNUSTEP_GUI_INCLUDE
#import <Foundation/NSObject.h>
#import <Foundation/NSProgress.h>
#import <Foundation/NSError.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_13, GS_API_LATEST)
@ -33,7 +35,23 @@
extern "C" {
#endif
@interface NSFontAssetRequest : NSObject
enum {
NSFontAssetRequestOptionUsesStandardUI = 1 << 0, // Use standard system UI for downloading.
};
typedef NSUInteger NSFontAssetRequestOptions;
DEFINE_BLOCK_TYPE(GSFontAssetCompletionHandler, BOOL, NSError*);
@interface NSFontAssetRequest : NSObject <NSProgressReporting>
- (instancetype) initWithFontDescriptors: (NSArray *)fontDescriptors
options: (NSFontAssetRequestOptions)options;
- (NSArray *) downloadedFontDescriptors;
- (NSProgress *) progress;
- (void)downloadFontAssetsWithCompletionHandler: (GSFontAssetCompletionHandler)completionHandler;
@end

View file

@ -26,5 +26,27 @@
@implementation NSFontAssetRequest
- (instancetype) initWithFontDescriptors: (NSArray *)fontDescriptors
options: (NSFontAssetRequestOptions)options
{
return [super init];
}
- (NSArray *) downloadedFontDescriptors
{
return nil;
}
- (NSProgress *) progress
{
return [NSProgress progressWithTotalUnitCount: 0.0];
}
- (void)downloadFontAssetsWithCompletionHandler: (GSFontAssetCompletionHandler)completionHandler
{
NSError *error = nil;
CALL_BLOCK(completionHandler, error);
}
@end