#include <PrintersConf.h>
Public Member Functions | |
| PrinterEntry () | |
| ~PrinterEntry () | |
| void | setSaved () |
| void | clearSaved () |
| bool | isSaved () |
| CREATE_SET (Name, string) | |
| CREATE_SET (Default, bool) | |
| CREATE_SET (Shared, bool) | |
| CREATE_SET (Info, string) | |
| CREATE_SET (Location, string) | |
| CREATE_SET (Uri, string) | |
| CREATE_SET (State, string) | |
| CREATE_SET (StateMessage, string) | |
| CREATE_SET (Accepting, bool) | |
| CREATE_SET (BannerStart, string) | |
| CREATE_SET (BannerEnd, string) | |
| CREATE_SET (ppd, string) | |
| void | addAllowUsers (const string u) |
| void | addDenyUsers (const string u) |
| void | addOption (const string name, const string value) |
| void | delAllowUsers (const string u) |
| void | delDenyUsers (const string u) |
| void | delOption (const string s) |
| string | getPrinter () const |
| const char * | getPrinter_str () const |
| map< string, string > & | getOptions () |
| void | dump () const |
| YCPValue | Read () const |
| bool | changePrinter (const YCPValue &value) |
| bool | newPrinter (const YCPValue &value) |
Private Attributes | |
| string | Name |
| bool | Default |
| string | Info |
| string | Location |
| string | Uri |
| string | State |
| string | StateMessage |
| bool | Shared |
| bool | Accepting |
| string | BannerStart |
| string | BannerEnd |
| set< string > | AllowUsers |
| set< string > | DenyUsers |
| string | ppd |
| map< string, string > | options |
| bool | saved |
This contains one entry from the printers.conf file
| PrinterEntry::PrinterEntry | ( | ) | [inline] |
Default constructor.
| PrinterEntry::~PrinterEntry | ( | ) | [inline] |
Destructor.
| void PrinterEntry::setSaved | ( | ) | [inline] |
| void PrinterEntry::clearSaved | ( | ) | [inline] |
References saved.
| bool PrinterEntry::isSaved | ( | ) | [inline] |
References saved.
| PrinterEntry::CREATE_SET | ( | Name | , | |
| string | ||||
| ) |
| PrinterEntry::CREATE_SET | ( | Default | , | |
| bool | ||||
| ) |
| PrinterEntry::CREATE_SET | ( | Shared | , | |
| bool | ||||
| ) |
| PrinterEntry::CREATE_SET | ( | Info | , | |
| string | ||||
| ) |
| PrinterEntry::CREATE_SET | ( | Location | , | |
| string | ||||
| ) |
| PrinterEntry::CREATE_SET | ( | Uri | , | |
| string | ||||
| ) |
| PrinterEntry::CREATE_SET | ( | State | , | |
| string | ||||
| ) |
| PrinterEntry::CREATE_SET | ( | StateMessage | , | |
| string | ||||
| ) |
| PrinterEntry::CREATE_SET | ( | Accepting | , | |
| bool | ||||
| ) |
| PrinterEntry::CREATE_SET | ( | BannerStart | , | |
| string | ||||
| ) |
| PrinterEntry::CREATE_SET | ( | BannerEnd | , | |
| string | ||||
| ) |
| PrinterEntry::CREATE_SET | ( | ppd | , | |
| string | ||||
| ) |
| void PrinterEntry::addAllowUsers | ( | const string | u | ) | [inline] |
add* functions to add items to set/map
| u | username. |
References AllowUsers.
Referenced by PrintersConf::getPrinters().
| void PrinterEntry::addDenyUsers | ( | const string | u | ) | [inline] |
| void PrinterEntry::addOption | ( | const string | name, | |
| const string | value | |||
| ) | [inline] |
Add or change option
| name | Name of the option. | |
| value | Value of the option. |
References options.
| void PrinterEntry::delAllowUsers | ( | const string | u | ) | [inline] |
| void PrinterEntry::delDenyUsers | ( | const string | u | ) | [inline] |
delete user from DenyUsers
References DenyUsers.
| void PrinterEntry::delOption | ( | const string | s | ) | [inline] |
| string PrinterEntry::getPrinter | ( | ) | const [inline] |
| const char* PrinterEntry::getPrinter_str | ( | ) | const [inline] |
| map<string,string>& PrinterEntry::getOptions | ( | ) | [inline] |
| void PrinterEntry::dump | ( | ) | const |
| YCPValue PrinterEntry::Read | ( | ) | const |
Convert PrinterEntry to YCPValue
References Accepting, YCPMap::add(), ADD_MAP, AllowUsers, BannerEnd, BannerStart, Default, DenyUsers, Info, Location, map2YCPMap(), Name, options, ppd, set2YCPList(), Shared, State, StateMessage, and Uri.
| bool PrinterEntry::changePrinter | ( | const YCPValue & | value | ) |
Helper function for Write. Update printer definition in cups system. Updates printer entry (this). Saves only changed items.
| value | New value of PrinterEntry. |
References Accepting, AllowUsers, BannerEnd, BannerStart, DenyUsers, Info, YCPElement::isNull(), Location, ppd, setPrinter(), setPrinterOptions(), setSaved(), State, StateMessage, Uri, YCPMap::value(), Y2_DEBUG, Y2_ERROR, and YCPList2set().
| bool PrinterEntry::newPrinter | ( | const YCPValue & | value | ) |
Add new printer. Replace
string PrinterEntry::Name [private] |
Referenced by dump(), getPrinter(), getPrinter_str(), and Read().
bool PrinterEntry::Default [private] |
string PrinterEntry::Info [private] |
Referenced by changePrinter(), dump(), and Read().
string PrinterEntry::Location [private] |
Referenced by changePrinter(), dump(), and Read().
string PrinterEntry::Uri [private] |
Referenced by changePrinter(), dump(), and Read().
string PrinterEntry::State [private] |
Referenced by changePrinter(), and Read().
string PrinterEntry::StateMessage [private] |
Referenced by changePrinter(), and Read().
bool PrinterEntry::Shared [private] |
Referenced by Read().
bool PrinterEntry::Accepting [private] |
Referenced by changePrinter(), and Read().
string PrinterEntry::BannerStart [private] |
Referenced by changePrinter(), and Read().
string PrinterEntry::BannerEnd [private] |
Referenced by changePrinter(), and Read().
set<string> PrinterEntry::AllowUsers [private] |
Referenced by addAllowUsers(), changePrinter(), delAllowUsers(), and Read().
set<string> PrinterEntry::DenyUsers [private] |
Referenced by addDenyUsers(), changePrinter(), delDenyUsers(), and Read().
string PrinterEntry::ppd [private] |
Referenced by changePrinter(), and Read().
map<string,string> PrinterEntry::options [private] |
Referenced by addOption(), delOption(), getOptions(), Read(), and setPrinterOptions().
bool PrinterEntry::saved [private] |
This value indicates if printer was saved in PrintersConf::Write. PrintersConf::Write clears saved for all printers. PrintersConf::Write sets saved for each printers it saves. Printers that do not have saved bit set were not saved and must be deleted.
Referenced by clearSaved(), isSaved(), and setSaved().
1.5.5