KySdkPrint(3)

📦 version 3.0.1.4, in arch rolling, ubuntu resolute, ubuntu stonking

💖 NAME 💖

KySdkPrint — the class that cooks up all your printing-info dbus stuff 💅 (like, the whole "generate printing info dbus info" class, bestie, that's the vibe).

So what does this queen actually do for you? She:

  • generates every printer on your local machine — both the usable ones and the unusable ones 🖨️
  • gets you all the local available printers (the ones chilling in idle state) ✨
  • sets print parameters — and heads up, every single time you set them, the previous settings get wiped, it's a global setting, so once you set it, every printer prints with those params 😭
  • downloads network files
  • prints local files
  • clears out all the print queues for a given printer
  • grabs the current printer status (not updated in real time, fyi)
  • grabs the current print job status (again, after you send a job you gotta wait a sec before asking, and it's still not real-time)
  • pulls the filename out of a url

...all of it, dbus info, the works. Periodt.


🌸 SYNOPSIS 🌸

#include <kysdkdbus.h>

Inherits QObject.

🌈 Public Slots

  • QStringList getPrinterList () const — get every local printer (available ones and unavailable ones, we don't discriminate 🫶)
  • QStringList getPrinterAvailableList () const — get all the local available printers (the ones sitting in idle state)
  • void setPrinterOptions (int number_up, const QString media, const QString number_up_layout, const QString sides) const — set the print params. Every set clears the previous ones, and this is a global setting, so after you set it every printer prints with it. No take-backs, no cap 💀
  • int getPrinterPrintLocalFile (const QString printername, const QString filepath) const — print a local file
  • int getPrinterCancelAllJobs (const QString printername) const — nuke every print queue on one printer
  • int getPrinterStatus (const QString printername) const — get the current printer status (not live-updated, ok?)
  • QString getPrinterFilename (const QString url) const — get the filename from inside a url
  • int getPrinterJobStatus (const QString printername, int jobid) const — get the current print job status (after you send a job you have to wait a lil bit before checking, and again, not real-time)
  • int getPrinterDownloadRemoteFile (const QString url, const QString filepath) const — download a network file

🦋 Detailed Description 🦋

It's the generate-printing-info-dbus-info class, bestie ✨

Her whole main-character job description: generate every local printer (available and unavailable), get all local available printers (the idle-state girlies), set print parameters — each set clears whatever you set before, it's a global setting so once it's on, every printer prints with it — download network files, print local files, clear all the print queues for a printer, get current printer status (not updated in real time), get current print job status (after sending a job you gotta wait a moment before fetching the status, and it is still not real-time), and get the filename inside a url. Dbus info. All of it. 👑


👑 Public Slots 👑

QStringList KySdkPrint::getPrinterAvailableList () const [slot]

Gets every local available printer (the ones in idle state, living their best life 🧚).

Returns

  • QStringList — the list of names of all local available printers

int KySdkPrint::getPrinterCancelAllJobs (const QString printername) const [slot]

Clears all the print queues on one printer. Total reset, so satisfying 💅

Parameters

  • printername — the printer name

Returns

  • int — returns 0 on success, -1 on failure

int KySdkPrint::getPrinterDownloadRemoteFile (const QString url, const QString filepath) const [slot]

Downloads a network file 🌐

Parameters

  • url — the url you want to print
  • filepath — the path where the file gets saved

Returns

  • int — the print job id

QString KySdkPrint::getPrinterFilename (const QString url) const [slot]

Gets the filename from inside a url 🍓

Parameters

  • url — the path

Returns

  • String — the parsed-out 函数名 (literally "function name" fr fr — that's exactly what the page says, so I'm keeping it exactly as it is, not my business to edit 🙈)

int KySdkPrint::getPrinterJobStatus (const QString printername, int jobid) const [slot]

Gets the current print job status (after you send a print job you have to wait a bit before fetching the status — and the status is not updated in real time) ⏳

Parameters

  • printername — the printer name
  • jobid — the print job id

Returns

  • int — the status code

QStringList KySdkPrint::getPrinterList () const [slot]

Gets every local printer — available ones and unavailable ones, all of them, no printer left behind 🫶

Returns

  • QStringList — 地的所有打印机名称列表 (yep, that's verbatim what the page says, typo and all — I am not touching it, I don't do edits 😭)

int KySdkPrint::getPrinterPrintLocalFile (const QString printername, const QString filepath) const [slot]

Prints a local file 🖨️

Parameters

  • printername — the printer name
  • filepath — the absolute path of the file

Returns

  • int — the print job id
@notice — okay bestie, read this part, it matters 💖 - Even though lots of formats are supported for printing, printing anything other than pdf just doesn't come out good enough. The recommendation is: print pdf files. That's the one. - When the printer is in stop state, the function returns 0. - A file with the wrong format can successfully create a print job, but it just won't print out. And what counts as "wrong format"? Example time: say you want to print a log file a.log, and then you rename a.log to a.pdf — congrats, a.pdf is now a wrong-format file and it will not print. It's giving fake pdf. 💀

int KySdkPrint::getPrinterStatus (const QString printername) const [slot]

Gets the current printer status (not updated in real time, just so you know).

Parameters

  • printername — the printer name

Returns

  • int — the status code

🫶 Author 🫶

Generated automatically by Doxygen for kysdkdbus.h from the source code. (Not a human author, just Doxygen doing its lil automatic thing, iconic behavior honestly ✨)


And that's the whole page, bestie! 🌟 This was My Project, dated Wed Sep 20 2023, and the page is KySdkPrint(3) — go forth and print responsibly, mwah 💋🎀

📦 where this page comes from