ClassEntry Class Reference

One entry in classes.conf file. More...

#include <ClassesConf.h>

List of all members.

Public Member Functions

 ClassEntry ()
 ~ClassEntry ()
void setSaved ()
void clearSaved ()
bool isSaved ()
 CREATE_SET (Name, char *)
 CREATE_SET (Default, bool)
 CREATE_SET (Info, char *)
 CREATE_SET (Location, char *)
 CREATE_SET (Uri, char *)
 CREATE_SET (State, char *)
 CREATE_SET (StateMessage, char *)
 CREATE_SET (Accepting, bool)
 CREATE_SET (BannerStart, char *)
 CREATE_SET (BannerEnd, char *)
 CREATE_SET (ppd, char *)
void addAllowUsers (const string u)
void addDenyUsers (const string u)
void addPrinters (const string p)
void addOption (const string name, const string value)
void delAllowUsers (const string u)
void delDenyUsers (const string u)
void delOption (const string s)
string getClass () const
const char * getClass_str () const
map< string, string > & getOptions ()
int getPrintersSize ()
void dump () const
YCPValue Read () const
bool changeClass (const YCPValue &value)
bool newClass (const YCPValue &value)

Private Attributes

string Name
bool Default
string Info
string Location
string Uri
string State
string StateMessage
bool Accepting
string BannerStart
string BannerEnd
set< string > AllowUsers
set< string > DenyUsers
set< string > Printers
string ppd
map< string, string > options
bool saved


Detailed Description

One entry in classes.conf file.

This contains one entry from the classes.conf file

Author:
Petr Blahos <pblahos@suse.cz>
Version:
Id
ClassesConf.h 19894 2004-10-19 15:58:12Z jsrain

Constructor & Destructor Documentation

ClassEntry::ClassEntry (  )  [inline]

Default constructor.

ClassEntry::~ClassEntry (  )  [inline]

Destructor.


Member Function Documentation

void ClassEntry::setSaved (  )  [inline]

References saved.

Referenced by changeClass().

void ClassEntry::clearSaved (  )  [inline]

References saved.

bool ClassEntry::isSaved (  )  [inline]

References saved.

ClassEntry::CREATE_SET ( Name  ,
char *   
)

ClassEntry::CREATE_SET ( Default  ,
bool   
)

ClassEntry::CREATE_SET ( Info  ,
char *   
)

ClassEntry::CREATE_SET ( Location  ,
char *   
)

ClassEntry::CREATE_SET ( Uri  ,
char *   
)

ClassEntry::CREATE_SET ( State  ,
char *   
)

ClassEntry::CREATE_SET ( StateMessage  ,
char *   
)

ClassEntry::CREATE_SET ( Accepting  ,
bool   
)

ClassEntry::CREATE_SET ( BannerStart  ,
char *   
)

ClassEntry::CREATE_SET ( BannerEnd  ,
char *   
)

ClassEntry::CREATE_SET ( ppd  ,
char *   
)

void ClassEntry::addAllowUsers ( const string  u  )  [inline]

add* functions to add items to set/map

Parameters:
u username.

References AllowUsers.

Referenced by ClassesConf::getClasses().

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

References DenyUsers.

Referenced by ClassesConf::getClasses().

void ClassEntry::addPrinters ( const string  p  )  [inline]

References Printers.

Referenced by ClassesConf::getClasses().

void ClassEntry::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 ClassEntry::delAllowUsers ( const string  u  )  [inline]

delete user from AllowUsers

Parameters:
u username.

References AllowUsers.

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

delete user from DenyUsers

References DenyUsers.

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

delete option

Parameters:
s Option name to delete.

References options.

string ClassEntry::getClass (  )  const [inline]

Get class name.

Returns:
Class name.

References Name.

Referenced by ClassesConf::getClasses().

const char* ClassEntry::getClass_str (  )  const [inline]

Get class name.

Returns:
Class name as string.

References Name.

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

Get reference to the map of the options.

Returns:
Map of the options.

References options.

int ClassEntry::getPrintersSize (  )  [inline]

References Printers.

Referenced by ClassesConf::getClasses().

void ClassEntry::dump (  )  const

Dump values, for debugging purposes.

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

YCPValue ClassEntry::Read (  )  const

Convert ClassEntry to YCPValue

Returns:
Class settings as described in cups.txt (.cups.classes)

References Accepting, YCPMap::add(), ADD_MAP, AllowUsers, BannerEnd, BannerStart, Default, DenyUsers, Info, Location, map2YCPMap(), Name, options, Printers, set2YCPList(), State, and StateMessage.

bool ClassEntry::changeClass ( const YCPValue value  ) 

Helper function for Write. Update class definition in cups system. Updates class entry (this). Saves only changed items.

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

References Accepting, AllowUsers, BannerEnd, BannerStart, DenyUsers, Info, YCPElement::isNull(), Location, ppd, Printers, setClass(), setClassOptions(), setSaved(), State, StateMessage, Uri, YCPMap::value(), Y2_DEBUG, Y2_ERROR, and YCPList2set().

bool ClassEntry::newClass ( const YCPValue value  ) 

Add new class. Replace


Member Data Documentation

string ClassEntry::Name [private]

Referenced by dump(), getClass(), getClass_str(), and Read().

bool ClassEntry::Default [private]

Referenced by dump(), and Read().

string ClassEntry::Info [private]

Referenced by changeClass(), dump(), and Read().

string ClassEntry::Location [private]

Referenced by changeClass(), dump(), and Read().

string ClassEntry::Uri [private]

Referenced by changeClass(), and dump().

string ClassEntry::State [private]

Referenced by changeClass(), and Read().

string ClassEntry::StateMessage [private]

Referenced by changeClass(), and Read().

bool ClassEntry::Accepting [private]

Referenced by changeClass(), and Read().

string ClassEntry::BannerStart [private]

Referenced by changeClass(), and Read().

string ClassEntry::BannerEnd [private]

Referenced by changeClass(), and Read().

set<string> ClassEntry::AllowUsers [private]

set<string> ClassEntry::DenyUsers [private]

set<string> ClassEntry::Printers [private]

string ClassEntry::ppd [private]

Referenced by changeClass().

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

bool ClassEntry::saved [private]

This value indicates if classes was saved in ClassesConf::Write. ClassesConf::Write clears saved for all classes. ClassesConf::Write sets saved for each classes it saves. Classes 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 07:12:58 2008 for yast2-printer by  doxygen 1.5.5