lpdtools.h
00001 /* 00002 * This file is part of the KDE libraries 00003 * Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License version 2 as published by the Free Software Foundation. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this library; see the file COPYING.LIB. If not, write to 00016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 **/ 00019 #ifndef LPDTOOLS_H 00020 #define LPDTOOLS_H 00021 00022 #include <qstring.h> 00023 #include <qmap.h> 00024 #include <qptrlist.h> 00025 #include <qtextstream.h> 00026 00027 class KMLpdManager; 00028 class DrMain; 00029 class KMPrinter; 00030 00031 class PrintcapEntry 00032 { 00033 friend class KMLpdManager; 00034 public: 00035 bool readLine(const QString& line); 00036 void writeEntry(QTextStream&); 00037 KMPrinter* createPrinter(); 00038 QString arg(const QString& key) const { return m_args[key]; } 00039 QString comment(int i); 00040 private: 00041 QString m_name; 00042 QString m_comment; 00043 QMap<QString,QString> m_args; 00044 }; 00045 00046 //***************************************************************************************************** 00047 00048 struct Resolution 00049 { 00050 int xdpi, ydpi; 00051 QString comment; 00052 }; 00053 00054 struct BitsPerPixel 00055 { 00056 QString bpp; 00057 QString comment; 00058 }; 00059 00060 class PrinttoolEntry 00061 { 00062 friend class KMLpdManager; 00063 public: 00064 bool readEntry(QTextStream& t); 00065 DrMain* createDriver(); 00066 private: 00067 QString m_name, m_gsdriver, m_description, m_about; 00068 QPtrList<Resolution> m_resolutions; 00069 QPtrList<BitsPerPixel> m_depths; 00070 }; 00071 00072 //***************************************************************************************************** 00073 00074 QString getPrintcapLine(QTextStream& t, QString *lastcomment = NULL); 00075 00076 #endif // LPDTOOLS_H