VLCOneDriveController.m 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*****************************************************************************
  2. * VLCOneDriveController.m
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2014 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Felix Paul Kühne <fkuehne # videolan.org>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. #import "VLCOneDriveController.h"
  13. #import "VLCOneDriveConstants.h"
  14. /* the Live SDK doesn't have an umbrella header so we need to import what we need */
  15. #import <LiveSDK/LiveConnectClient.h>
  16. /* include private API headers */
  17. #import <LiveSDK/LiveApiHelper.h>
  18. @interface VLCOneDriveController () <LiveAuthDelegate, LiveDownloadOperationDelegate, LiveOperationDelegate>
  19. {
  20. LiveConnectClient *_liveClient;
  21. NSArray *_liveScopes;
  22. }
  23. @end
  24. @implementation VLCOneDriveController
  25. + (VLCOneDriveController *)sharedInstance
  26. {
  27. static VLCOneDriveController *sharedInstance = nil;
  28. static dispatch_once_t pred;
  29. dispatch_once(&pred, ^{
  30. sharedInstance = [[self alloc] init];
  31. });
  32. return sharedInstance;
  33. }
  34. - (instancetype)init
  35. {
  36. self = [super init];
  37. if (!self)
  38. return self;
  39. _liveScopes = @[@"wl.signin",@"wl.basic",@"wl.skydrive"];
  40. _liveClient = [[LiveConnectClient alloc] initWithClientId:kVLCOneDriveClientID
  41. scopes:_liveScopes
  42. delegate:self
  43. userState:@"init"];
  44. return self;
  45. }
  46. #pragma mark - authentication
  47. - (void)login
  48. {
  49. [_liveClient login:self.delegate
  50. scopes:_liveScopes
  51. delegate:self
  52. userState:@"login"];
  53. }
  54. - (void)logout
  55. {
  56. [_liveClient logoutWithDelegate:self userState:@"logout"];
  57. }
  58. - (void)authCompleted:(LiveConnectSessionStatus)status session:(LiveConnectSession *)session userState:(id)userState
  59. {
  60. }
  61. - (void)authFailed:(NSError *)error userState:(id)userState
  62. {
  63. }
  64. #pragma mark - listing
  65. - (void)requestDirectoryListingAtPath:(NSString *)path
  66. {
  67. }
  68. - (void)liveOperationSucceeded:(LiveOperation *)operation
  69. {
  70. }
  71. - (void)liveOperationFailed:(NSError *)error operation:(LiveOperation *)operation
  72. {
  73. }
  74. #pragma mark - file handling
  75. - (void)downloadFileWithPath:(NSString *)path
  76. {
  77. }
  78. - (void)liveDownloadOperationProgressed:(LiveOperationProgress *)progress
  79. data:(NSData *)receivedData
  80. operation:(LiveDownloadOperation *)operation
  81. {
  82. }
  83. - (void)streamFileWithPath:(NSString *)path
  84. {
  85. }
  86. @end