aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common/INativeApp.cs
blob: d2e278a3bb0d46d52f7b071ff14d3dedee90fd37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
using MediaBrowser.Common.Net;
using MediaBrowser.Model.Logging;
using System.Collections.Generic;
using System.Reflection;
using MediaBrowser.Controller.Power;
using MediaBrowser.Server.Implementations.Persistence;
using MediaBrowser.Server.Startup.Common.FFMpeg;

namespace MediaBrowser.Server.Startup.Common
{
    public interface INativeApp
    {
        /// <summary>
        /// Gets the assemblies with parts.
        /// </summary>
        /// <returns>List&lt;Assembly&gt;.</returns>
        List<Assembly> GetAssembliesWithParts();

        /// <summary>
        /// Authorizes the server.
        /// </summary>
        /// <param name="udpPort">The UDP port.</param>
        /// <param name="httpServerPort">The HTTP server port.</param>
        /// <param name="httpsServerPort">The HTTPS server port.</param>
        /// <param name="tempDirectory">The temporary directory.</param>
        void AuthorizeServer(int udpPort, int httpServerPort, int httpsServerPort, string applicationPath, string tempDirectory);

        /// <summary>
        /// Gets the environment.
        /// </summary>
        /// <value>The environment.</value>
        NativeEnvironment Environment { get; }

        /// <summary>
        /// Gets a value indicating whether [supports running as service].
        /// </summary>
        /// <value><c>true</c> if [supports running as service]; otherwise, <c>false</c>.</value>
        bool SupportsRunningAsService { get; }

        /// <summary>
        /// Gets a value indicating whether this instance is running as service.
        /// </summary>
        /// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
        bool IsRunningAsService { get; }

        /// <summary>
        /// Gets a value indicating whether this instance can self restart.
        /// </summary>
        /// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
        bool CanSelfRestart { get; }

        /// <summary>
        /// Gets a value indicating whether [supports autorun at startup].
        /// </summary>
        /// <value><c>true</c> if [supports autorun at startup]; otherwise, <c>false</c>.</value>
        bool SupportsAutoRunAtStartup { get; }

        /// <summary>
        /// Gets a value indicating whether [supports library monitor].
        /// </summary>
        /// <value><c>true</c> if [supports library monitor]; otherwise, <c>false</c>.</value>
        bool SupportsLibraryMonitor { get; }
        
        /// <summary>
        /// Gets a value indicating whether this instance can self update.
        /// </summary>
        /// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
        bool CanSelfUpdate { get; }

        /// <summary>
        /// Shutdowns this instance.
        /// </summary>
        void Shutdown();

        /// <summary>
        /// Restarts this instance.
        /// </summary>
        void Restart(StartupOptions startupOptions);

        /// <summary>
        /// Configures the automatic run.
        /// </summary>
        /// <param name="autorun">if set to <c>true</c> [autorun].</param>
        void ConfigureAutoRun(bool autorun);

        /// <summary>
        /// Gets the network manager.
        /// </summary>
        /// <returns>INetworkManager.</returns>
        INetworkManager CreateNetworkManager(ILogger logger);

        /// <summary>
        /// Prevents the system stand by.
        /// </summary>
        void PreventSystemStandby();

        void AllowSystemStandby();

        /// <summary>
        /// Gets the power management.
        /// </summary>
        /// <returns>IPowerManagement.</returns>
        IPowerManagement GetPowerManagement();

        FFMpegInstallInfo GetFfmpegInstallInfo();

        void LaunchUrl(string url);

        IDbConnector GetDbConnector();

        void EnableLoopback(string appName);
    }
}