2018-04-10 23:37:06 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#import <memory>
|
|
|
|
|
|
|
|
#import <React/RCTBridge.h>
|
2018-06-15 03:39:44 +00:00
|
|
|
#import <React/RCTPrimitives.h>
|
2018-04-10 23:37:06 +00:00
|
|
|
#import <fabric/uimanager/FabricUIManager.h>
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
@class RCTFabricSurface;
|
|
|
|
@class RCTMountingManager;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Coordinates presenting of React Native Surfaces and represents application
|
|
|
|
* facing interface of running React Native core.
|
|
|
|
* SurfacePresenter incapsulates a bridge object inside and discourage direct
|
|
|
|
* access to it.
|
|
|
|
*/
|
|
|
|
@interface RCTSurfacePresenter : NSObject
|
|
|
|
|
|
|
|
- (instancetype)initWithBridge:(RCTBridge *)bridge;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2018-05-09 05:56:27 +00:00
|
|
|
@interface RCTSurfacePresenter (Surface)
|
2018-04-10 23:37:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Surface uses those methods to register itself in the Presenter.
|
|
|
|
* Registering initiates running, rendering and mounting processes.
|
|
|
|
*/
|
|
|
|
- (void)registerSurface:(RCTFabricSurface *)surface;
|
|
|
|
- (void)unregisterSurface:(RCTFabricSurface *)surface;
|
2018-06-15 03:39:44 +00:00
|
|
|
- (nullable RCTFabricSurface *)surfaceForRootTag:(ReactTag)rootTag;
|
2018-04-10 23:37:06 +00:00
|
|
|
|
2018-05-09 05:56:27 +00:00
|
|
|
/**
|
|
|
|
* Measures the Surface with given constraints.
|
|
|
|
*/
|
|
|
|
- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize
|
|
|
|
maximumSize:(CGSize)maximumSize
|
|
|
|
surface:(RCTFabricSurface *)surface;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets `minimumSize` and `maximumSize` layout constraints for the Surface.
|
|
|
|
*/
|
|
|
|
- (void)setMinimumSize:(CGSize)minimumSize
|
|
|
|
maximumSize:(CGSize)maximumSize
|
|
|
|
surface:(RCTFabricSurface *)surface;
|
2018-06-15 03:39:44 +00:00
|
|
|
|
2018-04-10 23:37:06 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface RCTSurfacePresenter (Deprecated)
|
|
|
|
|
|
|
|
/**
|
2018-05-15 03:34:35 +00:00
|
|
|
* We need to expose `uiManager` for registration
|
2018-04-10 23:37:06 +00:00
|
|
|
* purposes. Eventually, we will move this down to C++ side.
|
|
|
|
*/
|
|
|
|
- (std::shared_ptr<facebook::react::FabricUIManager>)uiManager_DO_NOT_USE;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface RCTBridge (RCTSurfacePresenter)
|
|
|
|
|
|
|
|
- (RCTSurfacePresenter *)surfacePresenter;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|