VLCDialogProvider.m 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*****************************************************************************
  2. * VLCDialogProvider.m: an implementation of the libvlc dialog API
  3. *****************************************************************************
  4. * Copyright (C) 2016 VideoLabs SAS
  5. * $Id$
  6. *
  7. * Authors: Felix Paul Kühne <fkuehne # videolan.org>
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU Lesser General Public License as published by
  11. * the Free Software Foundation; either version 2.1 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public License
  20. * along with this program; if not, write to the Free Software Foundation,
  21. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  22. *****************************************************************************/
  23. #import "VLCDialogProvider.h"
  24. #import "VLCiOSLegacyDialogProvider.h"
  25. #import "VLCEmbeddedDialogProvider.h"
  26. #import "VLCCustomDialogProvider.h"
  27. /* We are the root of a class cluster, not much to see */
  28. @implementation VLCDialogProvider
  29. - (instancetype)initWithLibrary:(VLCLibrary *)library customUI:(BOOL)customUI
  30. {
  31. #if TARGET_OS_IPHONE
  32. #if !TARGET_OS_TV
  33. if (customUI)
  34. return [[VLCCustomDialogProvider alloc] initWithLibrary:library];
  35. if (!SYSTEM_RUNS_IOS8_OR_LATER) {
  36. return [[VLCEmbeddedDialogProvider alloc] initWithLibrary:library];
  37. } else {
  38. return [[VLCiOSLegacyDialogProvider alloc] initWithLibrary:library];
  39. }
  40. #else
  41. if (customUI)
  42. return [[VLCCustomDialogProvider alloc] initWithLibrary:library];
  43. return [[VLCEmbeddedDialogProvider alloc] initWithLibrary:library];
  44. #endif
  45. #else
  46. if (customUI)
  47. return [[VLCCustomDialogProvider alloc] initWithLibrary:library];
  48. else
  49. NSLog(@"YOU NEED TO IMPLEMENT YOUR UI YOURSELF ON THE MAC");
  50. #endif
  51. }
  52. - (void)postAction:(int)buttonNumber forDialogReference:(NSValue *)dialogReference
  53. {
  54. // implemented by respective child class
  55. }
  56. - (void)postUsername:(NSString *)username andPassword:(NSString *)password forDialogReference:(NSValue *)dialogReference store:(BOOL)store
  57. {
  58. // implemented by respective child class
  59. }
  60. - (void)dismissDialogWithReference:(NSValue *)dialogReference
  61. {
  62. // implemented by respective child class
  63. }
  64. @end