1 /*  HBQueueWorker.h
2 
3  This file is part of the HandBrake source code.
4  Homepage: <http://handbrake.fr/>.
5  It may be used under the terms of the GNU General Public License. */
6 
7 #import <Foundation/Foundation.h>
8 
9 #import "HBQueueJobItem.h"
10 
11 NS_ASSUME_NONNULL_BEGIN
12 
13 extern NSString * const HBQueueWorkerDidChangeStateNotification;
14 
15 extern NSString * const HBQueueWorkerProgressNotification;
16 extern NSString * const HBQueueWorkerProgressNotificationPercentKey;       // NSNumber - double
17 extern NSString * const HBQueueWorkerProgressNotificationHoursKey;         // NSNumber - double
18 extern NSString * const HBQueueWorkerProgressNotificationMinutesKey;       // NSNumber - double
19 extern NSString * const HBQueueWorkerProgressNotificationSecondsKey;       // NSNumber - double
20 extern NSString * const HBQueueWorkerProgressNotificationInfoKey;          // NSString
21 
22 extern NSString * const HBQueueWorkerDidStartItemNotification;
23 extern NSString * const HBQueueWorkerDidCompleteItemNotification;
24 extern NSString * const HBQueueWorkerItemNotificationItemKey;              // HBQueueItem
25 
26 @interface HBQueueWorker : NSObject
27 
28 - (instancetype)init NS_UNAVAILABLE;
29 - (instancetype)initWithXPCServiceName:(NSString *)serviceName;
30 
31 @property (nonatomic, nullable, readonly) HBQueueJobItem *item;
32 
33 - (void)encodeItem:(HBQueueJobItem *)item;
34 - (void)cancel;
35 
36 @property (nonatomic, readonly) BOOL canEncode;
37 @property (nonatomic, readonly) BOOL isEncoding;
38 
39 @property (nonatomic, readonly) BOOL canPause;
40 - (void)pause;
41 
42 @property (nonatomic, readonly) BOOL canResume;
43 - (void)resume;
44 
45 @end
46 
47 NS_ASSUME_NONNULL_END
48