INativeApp.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using MediaBrowser.Common.Net;
  2. using MediaBrowser.Model.Logging;
  3. using System.Collections.Generic;
  4. using System.Reflection;
  5. using MediaBrowser.Controller.Power;
  6. using MediaBrowser.Server.Implementations.Persistence;
  7. using MediaBrowser.Server.Startup.Common.FFMpeg;
  8. namespace MediaBrowser.Server.Startup.Common
  9. {
  10. public interface INativeApp
  11. {
  12. /// <summary>
  13. /// Gets the assemblies with parts.
  14. /// </summary>
  15. /// <returns>List&lt;Assembly&gt;.</returns>
  16. List<Assembly> GetAssembliesWithParts();
  17. /// <summary>
  18. /// Authorizes the server.
  19. /// </summary>
  20. /// <param name="udpPort">The UDP port.</param>
  21. /// <param name="httpServerPort">The HTTP server port.</param>
  22. /// <param name="httpsServerPort">The HTTPS server port.</param>
  23. /// <param name="tempDirectory">The temporary directory.</param>
  24. void AuthorizeServer(int udpPort, int httpServerPort, int httpsServerPort, string applicationPath, string tempDirectory);
  25. bool PortsRequireAuthorization(string applicationPath);
  26. /// <summary>
  27. /// Gets the environment.
  28. /// </summary>
  29. /// <value>The environment.</value>
  30. NativeEnvironment Environment { get; }
  31. /// <summary>
  32. /// Gets a value indicating whether [supports running as service].
  33. /// </summary>
  34. /// <value><c>true</c> if [supports running as service]; otherwise, <c>false</c>.</value>
  35. bool SupportsRunningAsService { get; }
  36. /// <summary>
  37. /// Gets a value indicating whether this instance is running as service.
  38. /// </summary>
  39. /// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
  40. bool IsRunningAsService { get; }
  41. /// <summary>
  42. /// Gets a value indicating whether this instance can self restart.
  43. /// </summary>
  44. /// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
  45. bool CanSelfRestart { get; }
  46. /// <summary>
  47. /// Gets a value indicating whether [supports autorun at startup].
  48. /// </summary>
  49. /// <value><c>true</c> if [supports autorun at startup]; otherwise, <c>false</c>.</value>
  50. bool SupportsAutoRunAtStartup { get; }
  51. /// <summary>
  52. /// Gets a value indicating whether [supports library monitor].
  53. /// </summary>
  54. /// <value><c>true</c> if [supports library monitor]; otherwise, <c>false</c>.</value>
  55. bool SupportsLibraryMonitor { get; }
  56. /// <summary>
  57. /// Gets a value indicating whether this instance can self update.
  58. /// </summary>
  59. /// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
  60. bool CanSelfUpdate { get; }
  61. /// <summary>
  62. /// Shutdowns this instance.
  63. /// </summary>
  64. void Shutdown();
  65. /// <summary>
  66. /// Restarts this instance.
  67. /// </summary>
  68. void Restart(StartupOptions startupOptions);
  69. /// <summary>
  70. /// Configures the automatic run.
  71. /// </summary>
  72. /// <param name="autorun">if set to <c>true</c> [autorun].</param>
  73. void ConfigureAutoRun(bool autorun);
  74. /// <summary>
  75. /// Gets the network manager.
  76. /// </summary>
  77. /// <returns>INetworkManager.</returns>
  78. INetworkManager CreateNetworkManager(ILogger logger);
  79. /// <summary>
  80. /// Prevents the system stand by.
  81. /// </summary>
  82. void PreventSystemStandby();
  83. void AllowSystemStandby();
  84. /// <summary>
  85. /// Gets the power management.
  86. /// </summary>
  87. /// <returns>IPowerManagement.</returns>
  88. IPowerManagement GetPowerManagement();
  89. FFMpegInstallInfo GetFfmpegInstallInfo();
  90. void LaunchUrl(string url);
  91. IDbConnector GetDbConnector();
  92. void EnableLoopback(string appName);
  93. }
  94. }