VLCWatchTableController.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*****************************************************************************
  2. * VLCWatchTableController.h
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2015 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Author: Tobias Conradi <videolan # tobias-conradi.de>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. #import <WatchKit/WatchKit.h>
  13. typedef NSString *(^VLCWatchTableControllerRowTypeForObjectBlock)(id object);
  14. typedef void(^VLCWatchTableControllerConfigureRowControllerWithObjectBlock)(id rowController, id object);
  15. @interface VLCWatchTableController : NSObject
  16. @property (nonatomic, weak) IBOutlet WKInterfaceTable *table;
  17. /*
  18. * previous and next buttons are automatically hidden/shown depening on number
  19. * of objects, page size and the current page
  20. */
  21. @property (nonatomic, weak) IBOutlet WKInterfaceButton *previousPageButton;
  22. @property (nonatomic, weak) IBOutlet WKInterfaceButton *nextPageButton;
  23. /*
  24. * set eigher rowType if every row should have the same rowType or the
  25. * rowTypeForObjectBlock which returns the matching row type for an object
  26. */
  27. @property (nonatomic, copy) NSString *rowType;
  28. @property (nonatomic, copy) VLCWatchTableControllerRowTypeForObjectBlock rowTypeForObjectBlock;
  29. @property (nonatomic, copy) VLCWatchTableControllerConfigureRowControllerWithObjectBlock configureRowControllerWithObjectBlock;
  30. @property (nonatomic, copy, readonly) NSArray *displayedObjects;
  31. @property (nonatomic, copy, readonly) NSIndexSet *displayedIndexes;
  32. /* does setting these does not trigger table update call updateTable manually to update table */
  33. @property (nonatomic, assign) NSUInteger pageSize;
  34. @property (nonatomic, assign) NSUInteger currentPage;
  35. /*
  36. * When the objects array changes it will figure out inserted and removed objects
  37. * and updates the table accoringly.
  38. */
  39. @property (nonatomic, copy) NSArray *objects;
  40. /* updates the table with the current configuration (pagesize, page, objects) */
  41. - (void)updateTable;
  42. - (IBAction)previousPageButtonPressed;
  43. - (IBAction)nextPageButtonPressed;
  44. @end