FLEXExplorerViewController.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // FLEXExplorerViewController.h
  3. // Flipboard
  4. //
  5. // Created by Ryan Olson on 4/4/14.
  6. // Copyright (c) 2020 FLEX Team. All rights reserved.
  7. //
  8. #import "FLEXExplorerToolbar.h"
  9. @class FLEXWindow;
  10. @protocol FLEXExplorerViewControllerDelegate;
  11. /// A view controller that manages the FLEX toolbar.
  12. @interface FLEXExplorerViewController : UIViewController
  13. @property (nonatomic, weak) id <FLEXExplorerViewControllerDelegate> delegate;
  14. @property (nonatomic, readonly) BOOL wantsWindowToBecomeKey;
  15. @property (nonatomic, readonly) FLEXExplorerToolbar *explorerToolbar;
  16. - (BOOL)shouldReceiveTouchAtWindowPoint:(CGPoint)pointInWindowCoordinates;
  17. /// @brief Used to present (or dismiss) a modal view controller ("tool"), typically triggered by pressing a button in the toolbar.
  18. ///
  19. /// If a tool is already presented, this method simply dismisses it and calls the completion block.
  20. /// If no tool is presented, @code future() @endcode is presented and the completion block is called.
  21. - (void)toggleToolWithViewControllerProvider:(UINavigationController *(^)(void))future completion:(void(^)(void))completion;
  22. // Keyboard shortcut helpers
  23. - (void)toggleSelectTool;
  24. - (void)toggleMoveTool;
  25. - (void)toggleViewsTool;
  26. - (void)toggleMenuTool;
  27. /// @return YES if the explorer used the key press to perform an action, NO otherwise
  28. - (BOOL)handleDownArrowKeyPressed;
  29. /// @return YES if the explorer used the key press to perform an action, NO otherwise
  30. - (BOOL)handleUpArrowKeyPressed;
  31. /// @return YES if the explorer used the key press to perform an action, NO otherwise
  32. - (BOOL)handleRightArrowKeyPressed;
  33. /// @return YES if the explorer used the key press to perform an action, NO otherwise
  34. - (BOOL)handleLeftArrowKeyPressed;
  35. @end
  36. #pragma mark -
  37. @protocol FLEXExplorerViewControllerDelegate <NSObject>
  38. - (void)explorerViewControllerDidFinish:(FLEXExplorerViewController *)explorerViewController;
  39. @end