mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 10:28:32 +00:00
- Use modern APIs to prevent idle system sleep. - Consolidate all related logic. - Make Controller class a little bit less huge. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
27 lines
578 B
Objective-C
27 lines
578 B
Objective-C
// This file Copyright © Transmission authors and contributors.
|
|
// It may be used under the MIT (SPDX: MIT) license.
|
|
// License text can be found in the licenses/ folder.
|
|
|
|
#import <AppKit/AppKit.h>
|
|
|
|
@protocol PowerManagerDelegate<NSObject>
|
|
|
|
- (void)systemWillSleep;
|
|
- (void)systemDidWakeUp;
|
|
|
|
@end
|
|
|
|
@interface PowerManager : NSObject
|
|
|
|
@property(nonatomic, class, readonly) PowerManager* shared;
|
|
|
|
@property(nonatomic, weak) id<PowerManagerDelegate> delegate;
|
|
@property(nonatomic) BOOL shouldPreventSleep;
|
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
|
|
- (void)start;
|
|
- (void)stop;
|
|
|
|
@end
|