kdeprint Library API Documentation

kprinterimpl.h

00001 /*
00002  *  This file is part of the KDE libraries
00003  *  Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
00004  *
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Library General Public
00008  *  License version 2 as published by the Free Software Foundation.
00009  *
00010  *  This library is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  *  Library General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Library General Public License
00016  *  along with this library; see the file COPYING.LIB.  If not, write to
00017  *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018  *  Boston, MA 02111-1307, USA.
00019  **/
00020 
00021 #ifndef KPRINTERIMPL_H
00022 #define KPRINTERIMPL_H
00023 
00024 #include <qobject.h>
00025 #include <qstringlist.h>
00026 #include <qmap.h>
00027 #include <qptrlist.h>
00028 
00029 class KPrinter;
00030 class KMPrinter;
00031 
00032 class KPrinterImpl : public QObject
00033 {
00034     Q_OBJECT
00035 public:
00036     KPrinterImpl(QObject *parent = 0, const char *name = 0);
00037     virtual ~KPrinterImpl();
00038 
00039     virtual bool setupCommand(QString& cmd, KPrinter*);
00040     virtual void preparePrinting(KPrinter*);
00041     virtual void broadcastOption(const QString& key, const QString& value);
00042 
00043     bool printFiles(KPrinter*, const QStringList&, bool removeflag = false);
00044     // result:
00045     //  -1  ->  error
00046     //  0   ->  nothing happened
00047     //  1   ->  files filterd
00048     int filterFiles(KPrinter*, QStringList&, bool removeflag = false);
00049     int autoConvertFiles(KPrinter*, QStringList&, bool removeflag = false);
00050     void saveOptions(const QMap<QString,QString>& opts);
00051     const QMap<QString,QString>& loadOptions() const    { return m_options; }
00052     QString tempFile();
00053     QString quote(const QString&);
00054     void statusMessage(const QString&, KPrinter* = 0);
00055 
00056 protected:
00057     bool startPrinting(const QString& cmd, KPrinter *printer, const QStringList& files, bool removeflag = false);
00058     int dcopPrint(const QString& cmd, const QStringList& files, bool removeflag = false);
00059     bool setupSpecialCommand(QString&, KPrinter*, const QStringList&);
00060     int doFilterFiles(KPrinter* pr, QStringList& files, const QStringList& flist, const QMap<QString,QString>& opts, bool removeflag = false);
00061     void loadAppOptions();
00062     void saveAppOptions();
00063 
00064 protected:
00065     QMap<QString,QString>   m_options;  // use to save current options
00066 };
00067 
00068 #endif
KDE Logo
This file is part of the documentation for kdeprint Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed May 5 07:21:41 2004 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003