FLEXExplorerViewController.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // FLEXExplorerViewController.h
  3. // Flipboard
  4. //
  5. // Created by Ryan Olson on 4/4/14.
  6. // Copyright (c) 2014 Flipboard. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.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. - (BOOL)shouldReceiveTouchAtWindowPoint:(CGPoint)pointInWindowCoordinates;
  16. /// @brief Used to present (or dismiss) a modal view controller ("tool"), typically triggered by pressing a button in the toolbar.
  17. ///
  18. /// If a tool is already presented, this method simply dismisses it and calls the completion block.
  19. /// If no tool is presented, @code future() @endcode is presented and the completion block is called.
  20. - (void)toggleToolWithViewControllerProvider:(UINavigationController *(^)(void))future completion:(void(^)(void))completion;
  21. // Keyboard shortcut helpers
  22. - (void)toggleSelectTool;
  23. - (void)toggleMoveTool;
  24. - (void)toggleViewsTool;
  25. - (void)toggleMenuTool;
  26. /// @return YES if the explorer used the key press to perform an action, NO otherwise
  27. - (BOOL)handleDownArrowKeyPressed;
  28. /// @return YES if the explorer used the key press to perform an action, NO otherwise
  29. - (BOOL)handleUpArrowKeyPressed;
  30. /// @return YES if the explorer used the key press to perform an action, NO otherwise
  31. - (BOOL)handleRightArrowKeyPressed;
  32. /// @return YES if the explorer used the key press to perform an action, NO otherwise
  33. - (BOOL)handleLeftArrowKeyPressed;
  34. @end
  35. #pragma mark -
  36. @protocol FLEXExplorerViewControllerDelegate <NSObject>
  37. - (void)explorerViewControllerDidFinish:(FLEXExplorerViewController *)explorerViewController;
  38. @end