side_menu_items.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef REMOTING_IOS_APP_SIDE_MENU_ITEMS_H_
  5. #define REMOTING_IOS_APP_SIDE_MENU_ITEMS_H_
  6. #import <UIKit/UIKit.h>
  7. typedef void (^SideMenuItemAction)(void);
  8. // Represents an item on the side menu.
  9. @interface SideMenuItem : NSObject
  10. - (instancetype)initWithTitle:(NSString*)title
  11. icon:(UIImage*)icon
  12. action:(SideMenuItemAction)action;
  13. @property(nonatomic, readonly) NSString* title;
  14. @property(nonatomic, readonly) UIImage* icon;
  15. @property(nonatomic, readonly) SideMenuItemAction action;
  16. @end
  17. // Class that provides the list of SideMenuItems to be shown on the side menu.
  18. @interface SideMenuItemsProvider : NSObject
  19. // Each item is located by sideMenuItems[indexPath.section][indexPath.item]
  20. @property(nonatomic, readonly, class)
  21. NSArray<NSArray<SideMenuItem*>*>* sideMenuItems;
  22. @end
  23. #endif // REMOTING_IOS_APP_SIDE_MENU_ITEMS_H_