VLCDialogProvider.m 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 "VLCCustomDialogProvider.h"
  25. #if TARGET_OS_IPHONE
  26. #import "VLCiOSLegacyDialogProvider.h"
  27. #import "VLCEmbeddedDialogProvider.h"
  28. #endif
  29. /* We are the root of a class cluster, not much to see */
  30. @implementation VLCDialogProvider
  31. - (instancetype)initWithLibrary:(VLCLibrary *)library customUI:(BOOL)customUI
  32. {
  33. #if TARGET_OS_IPHONE
  34. #if !TARGET_OS_TV
  35. if (customUI)
  36. return [[VLCCustomDialogProvider alloc] initWithLibrary:library];
  37. if (!SYSTEM_RUNS_IOS8_OR_LATER) {
  38. return [[VLCEmbeddedDialogProvider alloc] initWithLibrary:library];
  39. } else {
  40. return [[VLCiOSLegacyDialogProvider alloc] initWithLibrary:library];
  41. }
  42. #else
  43. if (customUI)
  44. return [[VLCCustomDialogProvider alloc] initWithLibrary:library];
  45. return [[VLCEmbeddedDialogProvider alloc] initWithLibrary:library];
  46. #endif
  47. #else
  48. if (customUI)
  49. return [[VLCCustomDialogProvider alloc] initWithLibrary:library];
  50. else {
  51. NSLog(@"YOU NEED TO IMPLEMENT YOUR UI YOURSELF ON THE MAC");
  52. return nil;
  53. }
  54. #endif
  55. }
  56. - (void)postAction:(int)buttonNumber forDialogReference:(NSValue *)dialogReference
  57. {
  58. // implemented by respective child class
  59. }
  60. - (void)postUsername:(NSString *)username andPassword:(NSString *)password forDialogReference:(NSValue *)dialogReference store:(BOOL)store
  61. {
  62. // implemented by respective child class
  63. }
  64. - (void)dismissDialogWithReference:(NSValue *)dialogReference
  65. {
  66. // implemented by respective child class
  67. }
  68. @end