feat: 初始功能
This commit is contained in:
27
Services/Abstractions/IPrintBackendClient.cs
Normal file
27
Services/Abstractions/IPrintBackendClient.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using CloudPrint.Client.Models;
|
||||
|
||||
namespace CloudPrint.Client.Services.Abstractions;
|
||||
|
||||
public interface IPrintBackendClient : IAsyncDisposable
|
||||
{
|
||||
event EventHandler<PrintJobReceivedEventArgs>? PrintJobReceived;
|
||||
event EventHandler<AppLogEntry>? LogReceived;
|
||||
|
||||
bool IsConnected { get; }
|
||||
int PrinterId { get; }
|
||||
string Token { get; }
|
||||
AdminSession AdminSession { get; }
|
||||
|
||||
Task ConnectAsync(string address, string apiKey, CancellationToken cancellationToken = default);
|
||||
Task<AdminSession> LoginAdminAsync(string username, string password, CancellationToken cancellationToken = default);
|
||||
void SetAdminToken(string username, string accessToken);
|
||||
void LogoutAdmin();
|
||||
Task RegisterPrinterAsync(PrinterInfo printer, string apiKey, CancellationToken cancellationToken = default);
|
||||
Task SubscribePrintJobsAsync(PrinterInfo printer, CancellationToken cancellationToken = default);
|
||||
Task<string> DownloadPrintFileAsync(PrintJob job, string cacheRoot, CancellationToken cancellationToken = default);
|
||||
Task UploadLibraryDocumentAsync(CloudPrintDocument document, CancellationToken cancellationToken = default);
|
||||
Task CancelPrintJobAsync(PrintJob job, CancellationToken cancellationToken = default);
|
||||
Task SendStatusUpdateAsync(PrintJob job, CancellationToken cancellationToken = default);
|
||||
Task SendHeartbeatAsync(PrinterInfo printer, CancellationToken cancellationToken = default);
|
||||
void Disconnect();
|
||||
}
|
||||
Reference in New Issue
Block a user