Files
tbd-station-14/Content.Shared/Fax/SharedFax.cs
exincore faa7f3461c feat(fax): Fax machines print, copy, and send paper labels (#25979)
* feat(fax): Client fax file-print parses and stores label

* feat(fax): Fax machines print, copy, and send paper labels

* style(Fax): Comments and formatting

* feat(fax): Make fax admin logging more consistent and clear

* refactor(fax): Replace ternary with a simpler null coalescing

* refactor(fax): Make FaxSystem Send method signature consistent with Copy, PrintFile

* refactor(fax): Read entire file and process later instead of peeking first

* refactor(fax): Remove local variables only used for style

* style(fax): Fix some nearby style errors

* fix(fax): Undo an inaccurate change to admin log formatting

* refactor(fax): Separate `firstLine` variable

* fix(fax): Use Environment.NewLine

* bienvenidos

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2024-04-28 16:12:45 +10:00

83 lines
2.0 KiB
C#

using Robust.Shared.Serialization;
namespace Content.Shared.Fax;
[Serializable, NetSerializable]
public enum FaxUiKey : byte
{
Key
}
[Serializable, NetSerializable]
public sealed class FaxUiState : BoundUserInterfaceState
{
public string DeviceName { get; }
public Dictionary<string, string> AvailablePeers { get; }
public string? DestinationAddress { get; }
public bool IsPaperInserted { get; }
public bool CanSend { get; }
public bool CanCopy { get; }
public FaxUiState(string deviceName,
Dictionary<string, string> peers,
bool canSend,
bool canCopy,
bool isPaperInserted,
string? destAddress)
{
DeviceName = deviceName;
AvailablePeers = peers;
IsPaperInserted = isPaperInserted;
CanSend = canSend;
CanCopy = canCopy;
DestinationAddress = destAddress;
}
}
[Serializable, NetSerializable]
public sealed class FaxFileMessage : BoundUserInterfaceMessage
{
public string? Label;
public string Content;
public bool OfficePaper;
public FaxFileMessage(string? label, string content, bool officePaper)
{
Label = label;
Content = content;
OfficePaper = officePaper;
}
}
public static class FaxFileMessageValidation
{
public const int MaxLabelSize = 50; // parity with Content.Server.Labels.Components.HandLabelerComponent.MaxLabelChars
public const int MaxContentSize = 10000;
}
[Serializable, NetSerializable]
public sealed class FaxCopyMessage : BoundUserInterfaceMessage
{
}
[Serializable, NetSerializable]
public sealed class FaxSendMessage : BoundUserInterfaceMessage
{
}
[Serializable, NetSerializable]
public sealed class FaxRefreshMessage : BoundUserInterfaceMessage
{
}
[Serializable, NetSerializable]
public sealed class FaxDestinationMessage : BoundUserInterfaceMessage
{
public string Address { get; }
public FaxDestinationMessage(string address)
{
Address = address;
}
}