PrinterEntry Class Reference

One entry in printers.conf file. More...

#include <PrintersConf.h>

List of all members.

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


Detailed Description

One entry in printers.conf file.

This contains one entry from the printers.conf file

Author:
Petr Blahos <pblahos@suse.cz>
Version:
Id
PrintersConf.h 34512 2006-11-21 08:32:44Z mzugec

Constructor & Destructor Documentation

PrinterEntry::PrinterEntry (  )  [inline]

Default constructor.

PrinterEntry::~PrinterEntry (  )  [inline]

Destructor.


Member Function Documentation

void PrinterEntry::setSaved (  )  [inline]

References saved.

Referenced by changePrinter().

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

Parameters:
u username.

References AllowUsers.

Referenced by PrintersConf::getPrinters().

void PrinterEntry::addDenyUsers ( const string  u  )  [inline]

References DenyUsers.

Referenced by PrintersConf::getPrinters().

void PrinterEntry::addOption ( const string  name,
const string  value 
) [inline]

Add or change option

Parameters:
name Name of the option.
value Value of the option.

References options.

void PrinterEntry::delAllowUsers ( const string  u  )  [inline]

delete user from AllowUsers

Parameters:
u username.

References AllowUsers.

void PrinterEntry::delDenyUsers ( const string  u  )  [inline]

delete user from DenyUsers

References DenyUsers.

void PrinterEntry::delOption ( const string  s  )  [inline]

delete option

Parameters:
s Option name to delete.

References options.

string PrinterEntry::getPrinter (  )  const [inline]

Get printer name.

Returns:
Printer name.

References Name.

Referenced by PrintersConf::getPrinters().

const char* PrinterEntry::getPrinter_str (  )  const [inline]

Get printer name.

Returns:
Printer name as string.

References Name.

map<string,string>& PrinterEntry::getOptions (  )  [inline]

Get reference to the map of the options.

Returns:
Map of the options.

References options.

void PrinterEntry::dump (  )  const

Dump values, for debugging purposes.

References Default, Info, Location, Name, Uri, and Y2_DEBUG.

YCPValue PrinterEntry::Read (  )  const

Convert PrinterEntry to YCPValue

Returns:
Printer settings as described in cups.txt (.cups.printers)

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.

Parameters:
value New value of PrinterEntry.
Returns:
Success state.

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


Member Data Documentation

string PrinterEntry::Name [private]

Referenced by dump(), getPrinter(), getPrinter_str(), and Read().

bool PrinterEntry::Default [private]

Referenced by dump(), and Read().

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]

set<string> PrinterEntry::DenyUsers [private]

string PrinterEntry::ppd [private]

Referenced by changePrinter(), and Read().

map<string,string> PrinterEntry::options [private]

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().


The documentation for this class was generated from the following files:

Generated on Sat Jun 7 05:15:31 2008 for yast2-printer by  doxygen 1.5.5