2020-11-11 06:30:54 +01:00
|
|
|
#import <Foundation/Foundation.h>
|
2018-09-17 15:27:58 +02:00
|
|
|
|
2018-10-23 02:55:39 +02:00
|
|
|
@class OWSAudioSession;
|
2018-09-17 15:27:58 +02:00
|
|
|
@class OWSPreferences;
|
2018-10-12 22:39:40 +02:00
|
|
|
@class OWSSounds;
|
|
|
|
@class OWSWindowManager;
|
2015-08-23 00:00:39 +02:00
|
|
|
|
2018-10-24 22:38:05 +02:00
|
|
|
@protocol OWSProximityMonitoringManager;
|
|
|
|
|
2014-05-06 19:41:08 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Environment is a data and data accessor class.
|
|
|
|
* It handles application-level component wiring in order to support mocks for testing.
|
|
|
|
* It also handles network configuration for testing/deployment server configurations.
|
2014-07-30 08:05:36 +02:00
|
|
|
*
|
2014-05-06 19:41:08 +02:00
|
|
|
**/
|
|
|
|
@interface Environment : NSObject
|
2016-10-14 22:59:58 +02:00
|
|
|
|
2018-09-17 15:27:58 +02:00
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
|
|
|
2018-10-23 02:55:39 +02:00
|
|
|
- (instancetype)initWithAudioSession:(OWSAudioSession *)audioSession
|
|
|
|
preferences:(OWSPreferences *)preferences
|
2018-10-24 22:38:05 +02:00
|
|
|
proximityMonitoringManager:(id<OWSProximityMonitoringManager>)proximityMonitoringManager
|
2018-10-23 02:55:39 +02:00
|
|
|
sounds:(OWSSounds *)sounds
|
|
|
|
windowManager:(OWSWindowManager *)windowManager;
|
2016-10-14 22:59:58 +02:00
|
|
|
|
2018-10-23 02:55:39 +02:00
|
|
|
@property (nonatomic, readonly) OWSAudioSession *audioSession;
|
2018-10-24 22:38:05 +02:00
|
|
|
@property (nonatomic, readonly) id<OWSProximityMonitoringManager> proximityMonitoringManager;
|
2017-09-14 21:45:04 +02:00
|
|
|
@property (nonatomic, readonly) OWSPreferences *preferences;
|
2018-10-12 22:39:40 +02:00
|
|
|
@property (nonatomic, readonly) OWSSounds *sounds;
|
|
|
|
@property (nonatomic, readonly) OWSWindowManager *windowManager;
|
2014-05-06 19:41:08 +02:00
|
|
|
|
2018-09-07 22:25:10 +02:00
|
|
|
@property (class, nonatomic) Environment *shared;
|
2018-08-31 19:16:31 +02:00
|
|
|
|
2018-09-17 15:27:58 +02:00
|
|
|
#ifdef DEBUG
|
2017-12-05 19:42:50 +01:00
|
|
|
// Should only be called by tests.
|
2018-09-07 23:19:24 +02:00
|
|
|
+ (void)clearSharedForTests;
|
2018-09-17 15:27:58 +02:00
|
|
|
#endif
|
2014-05-06 19:41:08 +02:00
|
|
|
|
|
|
|
@end
|