lprhandler.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 
00020 #ifndef LPRHANDLER_H
00021 #define LPRHANDLER_H
00022 
00023 #if !defined( _KDEPRINT_COMPILE ) && defined( __GNUC__ )
00024 #warning internal header, do not use except if you are a KDEPrint developer
00025 #endif
00026 
00027 #include <qstring.h>
00028 
00029 class PrintcapEntry;
00030 class KMPrinter;
00031 class DrMain;
00032 class KMManager;
00033 class KPrinter;
00034 
00042 class LprHandler
00043 {
00044 public:
00045     LprHandler(const QString& name, KMManager *mgr = 0);
00046     virtual ~LprHandler();
00047 
00048     virtual bool validate(PrintcapEntry*);
00049     virtual KMPrinter* createPrinter(PrintcapEntry*);
00050     virtual bool completePrinter(KMPrinter*, PrintcapEntry*, bool shortmode = true);
00051     virtual DrMain* loadDriver(KMPrinter*, PrintcapEntry*, bool = false);
00052     virtual DrMain* loadDbDriver(const QString&);
00053     virtual bool savePrinterDriver(KMPrinter*, PrintcapEntry*, DrMain*, bool* = 0);
00054     virtual PrintcapEntry* createEntry(KMPrinter*);
00055     virtual bool removePrinter(KMPrinter*, PrintcapEntry*);
00056     virtual QString printOptions(KPrinter*);
00057     virtual void reset();
00058 
00059     QString name() const;
00060     KMManager* manager() const;
00061     QString driverDirectory();
00062 
00063 protected:
00064     DrMain* loadToolDriver(const QString&);
00065     QString locateDir(const QString& dirname, const QString& paths);
00066     QString cachedDriverDir() const;
00067     void setCachedDriverDir(const QString&);
00068     virtual QString driverDirInternal();
00069 
00070 protected:
00071     QString m_name;
00072     KMManager   *m_manager;
00073     QString m_cacheddriverdir;
00074 };
00075 
00076 inline QString LprHandler::name() const
00077 { return m_name; }
00078 
00079 inline KMManager* LprHandler::manager() const
00080 { return m_manager; }
00081 
00082 inline QString LprHandler::cachedDriverDir() const
00083 { return m_cacheddriverdir; }
00084 
00085 inline void LprHandler::setCachedDriverDir(const QString& s)
00086 { m_cacheddriverdir = s; }
00087 
00088 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys