-
Notifications
You must be signed in to change notification settings - Fork 808
Expand file tree
/
Copy pathIPackage.cs
More file actions
156 lines (135 loc) · 6.59 KB
/
IPackage.cs
File metadata and controls
156 lines (135 loc) · 6.59 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
using System.ComponentModel;
using UniGetUI.Core.Tools;
using UniGetUI.Interface.Enums;
using UniGetUI.PackageEngine.Classes.Serializable;
using UniGetUI.PackageEngine.Structs;
namespace UniGetUI.PackageEngine.Interfaces
{
public interface IPackage : INotifyPropertyChanged, IEquatable<IPackage>
{
public IPackageDetails Details { get; }
public PackageTag Tag { get; set; }
public bool IsChecked { get; set; }
public string Name { get; }
public string Id { get; }
public string VersionString { get; }
public CoreTools.Version NormalizedVersion { get; }
public CoreTools.Version NormalizedNewVersion { get; }
public IManagerSource Source { get; }
public IPackageManager Manager { get; }
public string NewVersionString { get; }
public bool IsUpgradable { get; }
public ref OverridenInstallationOptions OverridenOptions { get; }
public string AutomationName { get; }
/// <summary>
/// Returns an identifier that can be used to compare different package instances that refer to the same package.
/// What is taken into account:
/// - Manager and Source
/// - Package Identifier
/// For more specific comparison use GetVersionedHash()
/// </summary>
public long GetHash();
/// <summary>
/// Returns an identifier that can be used to compare different package instances that refer to the same package.
/// What is taken into account:
/// - Manager and Source
/// - Package Identifier
/// - Package version
/// - Package new version (if any)
/// </summary>
public long GetVersionedHash();
/// <summary>
/// Check whether two packages are **REALLY** the same package.
/// What is taken into account:
/// - Manager and Source
/// - Package Identifier
/// - Package version
/// - Package new version (if any)
/// </summary>
public bool Equals(object? other);
/// <summary>
/// Check whether two package instances represent the same package.
/// What is taken into account:
/// - Manager and Source
/// - Package Identifier
/// For more specific comparison use package.Equals(object? other)
/// </summary>
/// <param name="other">A package</param>
/// <returns>Whether the two instances refer to the same instance</returns>
public bool IsEquivalentTo(IPackage? other);
/// <summary>
/// Load the package's normalized icon id,
/// </summary>
/// <returns>a string with the package's normalized icon id</returns>
public string GetIconId();
/// <summary>
/// Get the package's icon url. If the package has no icon, a fallback image is returned.
/// After calling this method, the returned URL points to a location on the local machine
/// </summary>
/// <returns>An always-valid URI object, pointing to a file:// or to a ms-appx:// URL</returns>
public Uri GetIconUrl();
/// <summary>
/// Get the package's icon url. If the package has no icon, null is returned.
/// After calling this method, the returned URL (if any) points to a location on the local machine
/// </summary>
/// <returns>An always-valid URI object, pointing to a file:// or to a ms-appx:// URL</returns>
public Uri? GetIconUrlIfAny();
/// <summary>
/// Retrieves a list og URIs representing the available screenshots for this package.
/// </summary>
public IReadOnlyList<Uri> GetScreenshots();
/// <summary>
/// Adds the package to the ignored updates list. If no version is provided, all updates are ignored.
/// Calling this method will override older ignored updates.
/// </summary>
public Task AddToIgnoredUpdatesAsync(string version = "*");
/// <summary>
/// Removes the package from the ignored updates list, either if it is ignored for all updates or for a specific version only.
/// </summary>
public Task RemoveFromIgnoredUpdatesAsync();
/// <summary>
/// Returns true if the package's updates are ignored. If the version parameter
/// is passed it will be checked if that version is ignored. Please note that if
/// all updates are ignored, calling this method with a specific version will
/// still return true, although the passed version is not explicitly ignored.
/// </summary>
public Task<bool> HasUpdatesIgnoredAsync(string version = "*");
/// <summary>
/// Returns (as a string) the version for which a package has been ignored. When no versions
/// are ignored, an empty string will be returned; and when all versions are ignored an asterisk
/// will be returned.
/// </summary>
public Task<string> GetIgnoredUpdatesVersionAsync();
/// <summary>
/// Returns the corresponding installed Package object. Will return null if not applicable
/// </summary>
/// <returns>a Package object if found, null if not</returns>
public IPackage? GetInstalledPackage();
/// <summary>
/// Returns the corresponding available Package object. Will return null if not applicable
/// </summary>
/// <returns>a Package object if found, null if not</returns>
public IPackage? GetAvailablePackage();
/// <summary>
/// Returns the corresponding upgradable Package object. Will return null if not applicable
/// </summary>
/// <returns>a Package object if found, null if not</returns>
public IPackage? GetUpgradablePackage();
/// <summary>
/// Sets the package tag. You may as well use the Tag property.
/// This function is used for compatibility with the ? operator
/// </summary>
public void SetTag(PackageTag tag);
/// <summary>
/// Checks whether a new version of this package is installed
/// </summary>
public bool NewerVersionIsInstalled();
/// <summary>
/// Checks whether a new update of this package is a minor update or not (0.0.x)
/// </summary>
/// <returns>False if the update is a major update or the update doesn't exist, true if it's a minor update</returns>
public bool IsUpdateMinor();
public Task<SerializablePackage> AsSerializableAsync();
public SerializableIncompatiblePackage AsSerializable_Incompatible();
}
}