Files
transmission/macosx/PowerManager.h
Dzmitry Neviadomski 85a325ed71 feat: Introduce PowerManager on macOS (#7543)
- 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>
2025-11-02 14:41:22 -06:00

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