VLCServerBrowsingController.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*****************************************************************************
  2. * VLC for iOS
  3. *****************************************************************************
  4. * Copyright (c) 2015 VideoLAN. All rights reserved.
  5. * $Id$
  6. *
  7. * Authors: Tobias Conradi <videolan # tobias-conradi.de>
  8. *
  9. * Refer to the COPYING file of the official project for license.
  10. *****************************************************************************/
  11. #import <UIKit/UIKit.h>
  12. #import "VLCNetworkServerBrowser-Protocol.h"
  13. #define DOWNLOAD_SUPPORTED TARGET_OS_IOS
  14. NS_ASSUME_NONNULL_BEGIN
  15. @protocol VLCServerBrowsingCell <NSObject>
  16. @property (nonatomic, nullable) NSString *title;
  17. @property (nonatomic, nullable) NSString *subtitle;
  18. @property (nonatomic, nullable) UIImage *thumbnailImage;
  19. @property (nonatomic, nullable) NSURL *thumbnailURL;
  20. @property (nonatomic) BOOL isDirectory;
  21. #if DOWNLOAD_SUPPORTED
  22. @property (nonatomic) BOOL isDownloadable;
  23. #endif
  24. @end
  25. @interface VLCServerBrowsingController : NSObject
  26. @property (nonatomic, nullable) NSByteCountFormatter *byteCountFormatter;
  27. @property (nonatomic, nullable) UIImage *folderImage;
  28. @property (nonatomic, nullable) UIImage *genericFileImage;
  29. #if DOWNLOAD_SUPPORTED
  30. @property (nonatomic) BOOL allowsFileDownload;
  31. #endif
  32. @property (nonatomic, readonly) id<VLCNetworkServerBrowser> serverBrowser;
  33. @property (nonatomic, weak, nullable, readonly) UIViewController *viewController;
  34. - (instancetype)initWithViewController:(UIViewController *)viewController serverBrowser:(id<VLCNetworkServerBrowser>)browser;
  35. - (void)configureCell:(id<VLCServerBrowsingCell>)cell withItem:(id<VLCNetworkServerBrowserItem>)item;
  36. #pragma mark - Subtitles
  37. - (void)configureSubtitlesInMediaList:(VLCMediaList *)mediaList;
  38. #pragma mark - Streaming
  39. - (void)streamFileForItem:(id<VLCNetworkServerBrowserItem>)item;
  40. - (void)streamMediaList:(VLCMediaList *)mediaList startingAtIndex:(NSInteger)startIndex;
  41. #if DOWNLOAD_SUPPORTED
  42. - (BOOL)triggerDownloadForItem:(id<VLCNetworkServerBrowserItem>)item;
  43. #endif
  44. @end
  45. NS_ASSUME_NONNULL_END