#include <PrintersConf.h>
Public Member Functions | |
| PrintersConf () | |
| ~PrintersConf () | |
| void | dump () const |
| YCPValue | Read () |
| YCPBoolean | Write (const YCPPath &path, const YCPValue &value, const YCPValue &arg=YCPNull()) |
Private Member Functions | |
| bool | parseFile (const char *fn) |
| bool | completeEntries () |
| void | Clear () |
| bool | modifyPrinter (YCPMap printer) |
| bool | readSettings () |
| bool | getPrinters () |
| list< PrinterEntry >::iterator | getPrinterEntry (const string name) |
| list< PrinterEntry >::iterator | findPrinter (const string name) |
Private Attributes | |
| list< PrinterEntry > | Printers |
| PrintersConf::PrintersConf | ( | ) | [inline] |
Default Constructor.
| PrintersConf::~PrintersConf | ( | ) | [inline] |
Destructor.
| bool PrintersConf::parseFile | ( | const char * | fn | ) | [private] |
Parse file printers.conf.
| fn | File to parse. |
| bool PrintersConf::completeEntries | ( | ) | [private] |
Not all of the settings can be read from file printers.conf. This function reads additional settings via cups library calls.
References getPPD(), PrinterOptions2map(), and Printers.
Referenced by readSettings().
| void PrintersConf::Clear | ( | ) | [inline, private] |
| bool PrintersConf::modifyPrinter | ( | YCPMap | printer | ) | [private] |
Update printer.
References findPrinter(), newPrinter(), Printers, YCPMap::value(), and Y2_ERROR.
Referenced by Write().
| bool PrintersConf::readSettings | ( | ) | [private] |
Read printers.conf file. Build list of printers (Printers).
| fn | filename of the printers.conf. |
References Clear(), completeEntries(), getPrinters(), and Y2_ERROR.
| bool PrintersConf::getPrinters | ( | ) | [private] |
New version of get-classes that works over ipp...
References PrinterEntry::addAllowUsers(), PrinterEntry::addDenyUsers(), PrinterEntry::getPrinter(), Printers, and Y2_DEBUG.
Referenced by readSettings().
| list< PrinterEntry >::iterator PrintersConf::getPrinterEntry | ( | const string | name | ) | [private] |
Returns printer entry by printer name. If the printer does not have an entry, it is created.
| name | Printer name. |
References Printers.
| list< PrinterEntry >::iterator PrintersConf::findPrinter | ( | const string | name | ) | [private] |
Returns printer entry by printer name. If the printer does not have an entry, returns Printers.end().
| name | Printer name. |
References Printers.
Referenced by modifyPrinter().
| void PrintersConf::dump | ( | ) | const |
Dump all printers.
References Printers.
| YCPValue PrintersConf::Read | ( | ) |
Convert PrintersConf to YCPValue
References YCPList::add(), Clear(), Printers, and readSettings().
Referenced by CupsAgent::Read().
| YCPBoolean PrintersConf::Write | ( | const YCPPath & | path, | |
| const YCPValue & | value, | |||
| const YCPValue & | arg = YCPNull() | |||
| ) |
Write printers...
References Clear(), deletePrinter(), modifyPrinter(), readSettings(), and Y2_ERROR.
Referenced by CupsAgent::Write().
list<PrinterEntry> PrintersConf::Printers [private] |
List of PrinterEntries.
Referenced by Clear(), completeEntries(), dump(), findPrinter(), getPrinterEntry(), getPrinters(), modifyPrinter(), and Read().
1.5.5