struct PrinterInfo : JobData
{ // basename of PPD
OUString m_aDriverName; // can be the queue
OUString m_aLocation; // a user defined comment
OUString m_aComment; // a command line to pipe a PS-file to
OUString m_aCommand; // a command line to pipe a PS-file to in case of direct print
OUString m_aQuickCommand; // a list of special features separated by ',' not used by psprint // but assigned from the outside (currently for "fax","pdf=","autoqueue","external_dialog")
OUString m_aFeatures; // auth-info-required, potential [domain],[username],[password] to prompt for to authenticate printing
OUString m_aAuthInfoRequired;
PrinterSetupMode meSetupMode;
class VCL_DLLPUBLIC PrinterInfoManager
{ public: enumclass Type { Default = 0, CUPS = 1, CPD = 2 };
struct SystemPrintQueue
{
OUString m_aQueue;
OUString m_aLocation;
OUString m_aComment;
}; protected: // needed for checkPrintersChanged: files (not necessarily existent) // and their last known modification time struct WatchFile
{ // the file in question
OUString m_aFilePath; // the last know modification time or 0, if file did not exist
TimeValue m_aModified;
};
// internal data to describe a printer struct Printer
{ // configuration file containing this printer // empty means a freshly added printer that has to be saved yet
OUString m_aFile; // details other config files that have this printer // in case of removal all have to be removed
std::unordered_set< OUString > m_aAlternateFiles; // the corresponding info and job data
PrinterInfo m_aInfo;
};
// fill default paper if not configured in config file // default paper is e.g. locale dependent // if a paper is already set it will not be overwritten void setDefaultPaper( PPDContext& rInfo ) const;
public:
// there can only be one static PrinterInfoManager& get();
// get PrinterInfoManager type
Type getType() const { return m_eType; }
// lists the names of all known printers void listPrinters( std::vector< OUString >& rVector ) const;
// gets info about a named printer const PrinterInfo& getPrinterInfo( const OUString& rPrinter ) const;
// gets the name of the default printer const OUString& getDefaultPrinter() const { return m_aDefaultPrinter; }
// check if the printer configuration has changed // if bwait is true, then this method waits for eventual asynchronous // printer discovery to finish virtualbool checkPrintersChanged( bool bWait );
// abstract print command // returns a stdio FILE* that a postscript file may be written to // this may either be a regular file or the result of popen() virtual FILE* startSpool( const OUString& rPrinterName, bool bQuickCommand ); // close the FILE* returned by startSpool and does the actual spooling // set bBanner to "false" will attempt to suppress banner printing // set bBanner to "true" will rely on the system default // returns true on success virtualbool endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner, const OUString &rFaxNumber );
// check whether a printer's feature string contains a subfeature bool checkFeatureToken( const OUString& rPrinterName, std::string_view pToken ) const;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.