27 lines
1.4 KiB
C#
27 lines
1.4 KiB
C#
|
|
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();
|
||
|
|
}
|