24 #include <tqstringlist.h>
25 #include <tqptrlist.h>
26 #include <tqtextstream.h>
29 #include "cupsdcomment.h"
31 enum LogLevelType { LOGLEVEL_DEBUG2 = 0, LOGLEVEL_DEBUG, LOGLEVEL_INFO, LOGLEVEL_WARN, LOGLEVEL_ERROR, LOGLEVEL_NONE };
32 enum OrderType { ORDER_ALLOW_DENY = 0, ORDER_DENY_ALLOW };
33 enum AuthTypeType { AUTHTYPE_NONE = 0, AUTHTYPE_BASIC, AUTHTYPE_DIGEST };
34 enum AuthClassType { AUTHCLASS_ANONYMOUS = 0, AUTHCLASS_USER, AUTHCLASS_SYSTEM, AUTHCLASS_GROUP };
35 enum EncryptionType { ENCRYPT_ALWAYS = 0, ENCRYPT_NEVER, ENCRYPT_REQUIRED, ENCRYPT_IFREQUESTED };
36 enum BrowseProtocolType { BROWSE_ALL = 0, BROWSE_CUPS, BROWSE_SLP };
37 enum PrintcapFormatType { PRINTCAP_BSD = 0, PRINTCAP_SOLARIS };
38 enum HostnameLookupType { HOSTNAME_OFF = 0, HOSTNAME_ON, HOSTNAME_DOUBLE };
39 enum ClassificationType { CLASS_NONE = 0, CLASS_CLASSIFIED, CLASS_CONFIDENTIAL, CLASS_SECRET, CLASS_TOPSECRET, CLASS_UNCLASSIFIED, CLASS_OTHER };
40 enum SatisfyType { SATISFY_ALL = 0, SATISFY_ANY };
41 enum UnitType { UNIT_KB = 0, UNIT_MB, UNIT_GB, UNIT_TILE };
45 enum ResourceType { RESOURCE_GLOBAL, RESOURCE_PRINTER, RESOURCE_CLASS, RESOURCE_ADMIN };
53 bool loadFromFile(
const TQString& filename);
54 bool saveToFile(
const TQString& filename);
55 bool parseOption(
const TQString& line);
56 bool parseLocation(CupsLocation *location, TQTextStream& file);
58 bool loadAvailableResources();
60 static CupsdConf* get();
61 static void release();
64 static CupsdConf *unique_;
68 TQString serveradmin_;
70 TQString otherclassname_;
79 TQString systemgroup_;
80 TQString encryptcert_;
82 TQPtrList<CupsLocation> locations_;
83 TQPtrList<CupsResource> resources_;
88 int keepalivetimeout_;
90 TQString maxrequestsize_;
92 TQStringList listenaddresses_;
102 bool keepjobhistory_;
106 int maxjobsperprinter_;
117 TQString documentdir_;
118 TQStringList fontpath_;
119 TQString requestdir_;
121 TQString serverfiles_;
126 TQStringList browseprotocols_;
130 TQStringList browseaddresses_;
132 bool useimplicitclasses_;
133 bool hideimplicitmembers_;
138 CupsdComment comments_;
141 TQValueList< TQPair<TQString,TQString> > unknown_;
147 CupsLocation(
const CupsLocation& loc);
149 bool parseOption(
const TQString& line);
150 bool parseResource(
const TQString& line);
152 CupsResource *resource_;
153 TQString resourcename_;
160 TQStringList addresses_;
166 CupsResource(
const TQString& path);
168 void setPath(
const TQString& path);
174 static TQString textToPath(
const TQString& text);
175 static TQString pathToText(
const TQString& path);
176 static int typeFromPath(
const TQString& path);
177 static int typeFromText(
const TQString& text);
178 static TQString typeToIconName(
int type);