1 /***************************************************************************
2                           rkprintagent  -  description
3                              -------------------
4     begin                : Mon Aug 01 2011
5     copyright            : (C) 2011 by Thomas Friedrichsmeier
6     email                : thomas.friedrichsmeier@kdemail.net
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 
18 #ifndef RKPRINTAGENT_H
19 #define RKPRINTAGENT_H
20 
21 #include <QObject>
22 #include <kparts/readonlypart.h>
23 
24 /** The main purpose of this class is to cope with the lack of kprinter in KDE 4. Tries
25  *  to offer a KDE print dialog for an existing postscript file. */
26 class RKPrintAgent : public QObject {
27 	Q_OBJECT
28 public:
29 	/** print the given postscript file.
30 	 *  @param delete_file : Try to delete the file after printing. Note: This is not guaranteed to work. */
31 	static void printPostscript (const QString &file, bool delete_file=false);
32 protected:
33 	RKPrintAgent ();
34 	~RKPrintAgent ();
35 
36 	QString file;
37 	KParts::ReadOnlyPart *provider;
38 	bool delete_file;
39 };
40 
41 #endif
42