• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeprint
 

tdeprint

  • tdeprint
  • cups
  • cupsdconf2
cupsdconf.h
1/*
2 * This file is part of the KDE libraries
3 * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License version 2 as published by the Free Software Foundation.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 **/
19
20#ifndef CUPSDCONF_H
21#define CUPSDCONF_H
22
23#include <tqstring.h>
24#include <tqstringlist.h>
25#include <tqptrlist.h>
26#include <tqtextstream.h>
27#include <tqpair.h>
28
29#include "cupsdcomment.h"
30
31enum LogLevelType { LOGLEVEL_DEBUG2 = 0, LOGLEVEL_DEBUG, LOGLEVEL_INFO, LOGLEVEL_WARN, LOGLEVEL_ERROR, LOGLEVEL_NONE };
32enum OrderType { ORDER_ALLOW_DENY = 0, ORDER_DENY_ALLOW };
33enum AuthTypeType { AUTHTYPE_NONE = 0, AUTHTYPE_BASIC, AUTHTYPE_DIGEST };
34enum AuthClassType { AUTHCLASS_ANONYMOUS = 0, AUTHCLASS_USER, AUTHCLASS_SYSTEM, AUTHCLASS_GROUP };
35enum EncryptionType { ENCRYPT_ALWAYS = 0, ENCRYPT_NEVER, ENCRYPT_REQUIRED, ENCRYPT_IFREQUESTED };
36enum BrowseProtocolType { BROWSE_ALL = 0, BROWSE_CUPS, BROWSE_SLP };
37enum PrintcapFormatType { PRINTCAP_BSD = 0, PRINTCAP_SOLARIS };
38enum HostnameLookupType { HOSTNAME_OFF = 0, HOSTNAME_ON, HOSTNAME_DOUBLE };
39enum ClassificationType { CLASS_NONE = 0, CLASS_CLASSIFIED, CLASS_CONFIDENTIAL, CLASS_SECRET, CLASS_TOPSECRET, CLASS_UNCLASSIFIED, CLASS_OTHER };
40enum SatisfyType { SATISFY_ALL = 0, SATISFY_ANY };
41enum UnitType { UNIT_KB = 0, UNIT_MB, UNIT_GB, UNIT_TILE };
42
43struct CupsLocation;
44struct CupsResource;
45enum ResourceType { RESOURCE_GLOBAL, RESOURCE_PRINTER, RESOURCE_CLASS, RESOURCE_ADMIN };
46
47struct CupsdConf
48{
49// functions member
50 CupsdConf();
51 ~CupsdConf();
52
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);
57
58 bool loadAvailableResources();
59
60 static CupsdConf* get();
61 static void release();
62
63// data members
64 static CupsdConf *unique_;
65
66 // Server
67 TQString servername_;
68 TQString serveradmin_;
69 int classification_;
70 TQString otherclassname_;
71 bool classoverride_;
72 TQString charset_;
73 TQString language_;
74 TQString printcap_;
75 int printcapformat_;
76
77 // Security
78 TQString remoteroot_;
79 TQString systemgroup_;
80 TQString encryptcert_;
81 TQString encryptkey_;
82 TQPtrList<CupsLocation> locations_;
83 TQPtrList<CupsResource> resources_;
84
85 // Network
86 int hostnamelookup_;
87 bool keepalive_;
88 int keepalivetimeout_;
89 int maxclients_;
90 TQString maxrequestsize_;
91 int clienttimeout_;
92 TQStringList listenaddresses_;
93
94 // Log
95 TQString accesslog_;
96 TQString errorlog_;
97 TQString pagelog_;
98 TQString maxlogsize_;
99 int loglevel_;
100
101 // Jobs
102 bool keepjobhistory_;
103 bool keepjobfiles_;
104 bool autopurgejobs_;
105 int maxjobs_;
106 int maxjobsperprinter_;
107 int maxjobsperuser_;
108
109 // Filter
110 TQString user_;
111 TQString group_;
112 TQString ripcache_;
113 int filterlimit_;
114
115 // Directories
116 TQString datadir_;
117 TQString documentdir_;
118 TQStringList fontpath_;
119 TQString requestdir_;
120 TQString serverbin_;
121 TQString serverfiles_;
122 TQString tmpfiles_;
123
124 // Browsing
125 bool browsing_;
126 TQStringList browseprotocols_;
127 int browseport_;
128 int browseinterval_;
129 int browsetimeout_;
130 TQStringList browseaddresses_;
131 int browseorder_;
132 bool useimplicitclasses_;
133 bool hideimplicitmembers_;
134 bool useshortnames_;
135 bool useanyclasses_;
136
137 // cupsd.conf file comments
138 CupsdComment comments_;
139
140 // unrecognized options
141 TQValueList< TQPair<TQString,TQString> > unknown_;
142};
143
144struct CupsLocation
145{
146 CupsLocation();
147 CupsLocation(const CupsLocation& loc);
148
149 bool parseOption(const TQString& line);
150 bool parseResource(const TQString& line);
151
152 CupsResource *resource_;
153 TQString resourcename_;
154 int authtype_;
155 int authclass_;
156 TQString authname_;
157 int encryption_;
158 int satisfy_;
159 int order_;
160 TQStringList addresses_;
161};
162
163struct CupsResource
164{
165 CupsResource();
166 CupsResource(const TQString& path);
167
168 void setPath(const TQString& path);
169
170 int type_;
171 TQString path_;
172 TQString text_;
173
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);
179};
180
181#endif

tdeprint

Skip menu "tdeprint"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeprint

Skip menu "tdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.9.4
This website is maintained by Timothy Pearson.