Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for listing cups printers #8

Merged
merged 5 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
filled in printertype from docs
  • Loading branch information
BlackHeart-TF committed May 12, 2022
commit f86e575b5d2650f89b7b2ae6b4453904ecf41246
38 changes: 32 additions & 6 deletions SharpIpp/Model/CUPSGetPrintersRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,40 @@ public class CUPSGetPrintersRequest : IIppPrinterRequest
}

///<summary>
///The type of printer returned.
///<para>Type flags for requesting specific types of printers.</para>
///<para><see href="https://www.cups.org/doc/spec-ipp.html#printer-type">See here</see> for docs</para>
///</summary>
///<remarks>
///Cups documentation says its an enum, but fails to mention possible values
///<seealso href="http://www.cups.org/doc/spec-ipp.html#CUPS_GET_PRINTERS"/>
///</remarks>
///
[Flags]
public enum PrinterType
Zelenov marked this conversation as resolved.
Show resolved Hide resolved
{
Printer
PrinterClass = 0x1,
RemoteDestination = 0x2,
PrintsBlack = 0x4,
PrintsColor = 0x8,
TwoSidedPrinting = 0x10,
Stapler = 0x20,
FastCopies = 0x40,
FastCopyCollation = 0x80,
HolePunch = 0x100,
Cover = 0x200,
Binding = 0x400,
Sorting = 0x800,
MediaToUSLegalA4 = 0x1000,
MediaLegalToISOcA2 = 0x2000,
MediaOverA2= 0x4000,
MediaUserDefined = 0x8000,
ImplicitClass = 0x10000,
DefaultPrinter = 20000,
FacsimileDevice = 0x40000,
RejectingJobs = 0x80000,
DeleteQueue = 0x100000,
QueueNotShared = 0x200000,
RequiresAuthentication = 0x400000,
SupportsCUPSCommandFiles = 0x800000,
AutomaticallyDescovered = 0x1000000,
ScannerNoPrint = 0x2000000,
ScannerPrints = 0x4000000,
PrinterIs3D = 80000000
}
}
1 change: 1 addition & 0 deletions SharpIpp/Protocol/IppProtocol.Mapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ static IppProtocol()
Mapper.CreateIppMap<int, PrinterState>((src, map) => (PrinterState) src);
Mapper.CreateIppMap<int, PrintQuality>((src, map) => (PrintQuality) src);
Mapper.CreateIppMap<int, ResolutionUnit>((src, map) => (ResolutionUnit) src);
Mapper.CreateIppMap<int, PrinterType>((src, map) => (PrinterType)src);

//All name parameters can come as StringWithLanguage or string
//Mappers for string\language mapping
Expand Down