xref: /expo/ios/Client/Menu/EXDevMenuManager.h (revision f67462bc)
1*f67462bcSTomasz Sapeta // Copyright 2015-present 650 Industries. All rights reserved.
2*f67462bcSTomasz Sapeta 
3*f67462bcSTomasz Sapeta #import <Foundation/Foundation.h>
4*f67462bcSTomasz Sapeta 
5*f67462bcSTomasz Sapeta #import "EXDevMenuDelegateProtocol.h"
6*f67462bcSTomasz Sapeta #import "EXDevMenuGestureRecognizer.h"
7*f67462bcSTomasz Sapeta 
8*f67462bcSTomasz Sapeta @interface EXDevMenuManager : NSObject
9*f67462bcSTomasz Sapeta 
10*f67462bcSTomasz Sapeta @property (nullable, nonatomic, strong) id<EXDevMenuDelegateProtocol> delegate;
11*f67462bcSTomasz Sapeta @property (readwrite, nonatomic, assign) BOOL interceptMotionGesture;
12*f67462bcSTomasz Sapeta @property (readwrite, nonatomic, assign) BOOL interceptTouchGesture;
13*f67462bcSTomasz Sapeta 
14*f67462bcSTomasz Sapeta /**
15*f67462bcSTomasz Sapeta  * Returns singleton instance of the manager.
16*f67462bcSTomasz Sapeta  */
17*f67462bcSTomasz Sapeta + (nonnull instancetype)sharedInstance;
18*f67462bcSTomasz Sapeta 
19*f67462bcSTomasz Sapeta /**
20*f67462bcSTomasz Sapeta  * Returns the bridge to which the dev menu is hooked.
21*f67462bcSTomasz Sapeta  * TODO: (@tsapeta) It's gonna be removed once the dev menu moves to have its own bridge.
22*f67462bcSTomasz Sapeta  */
23*f67462bcSTomasz Sapeta - (nullable RCTBridge *)mainBridge;
24*f67462bcSTomasz Sapeta 
25*f67462bcSTomasz Sapeta /**
26*f67462bcSTomasz Sapeta  * Returns bool value whether the dev menu is visible.
27*f67462bcSTomasz Sapeta  */
28*f67462bcSTomasz Sapeta - (BOOL)isVisible;
29*f67462bcSTomasz Sapeta 
30*f67462bcSTomasz Sapeta /**
31*f67462bcSTomasz Sapeta  * Opens the dev menu. Returns `YES` if it succeeded or `NO` if the desired state is already set or its change has been rejected by the delegate.
32*f67462bcSTomasz Sapeta  */
33*f67462bcSTomasz Sapeta - (BOOL)open;
34*f67462bcSTomasz Sapeta 
35*f67462bcSTomasz Sapeta /**
36*f67462bcSTomasz Sapeta  * Closes the dev menu with the animation applied on the JS side. Returns `YES` if it succeeded or `NO` if the desired state is already set or its change has been rejected by the delegate.
37*f67462bcSTomasz Sapeta  */
38*f67462bcSTomasz Sapeta - (BOOL)close;
39*f67462bcSTomasz Sapeta 
40*f67462bcSTomasz Sapeta /**
41*f67462bcSTomasz Sapeta  * Toggles the visibility of the dev menu. Returns `YES` if it succeeded or `NO` if the desired state is already set or its change has been rejected by the delegate.
42*f67462bcSTomasz Sapeta  */
43*f67462bcSTomasz Sapeta - (BOOL)toggle;
44*f67462bcSTomasz Sapeta 
45*f67462bcSTomasz Sapeta /**
46*f67462bcSTomasz Sapeta  * Closes the dev menu but skips JS animation and doesn't return any value as it always succeeds - the delegate can't reject it.
47*f67462bcSTomasz Sapeta  */
48*f67462bcSTomasz Sapeta - (void)closeWithoutAnimation;
49*f67462bcSTomasz Sapeta 
50*f67462bcSTomasz Sapeta @end
51