1
/***************************************************************************
2
smb4kprint_p - This file contains private helpers for the
6
copyright : (C) 2008-2011 by Alexander Reinholdt
7
email : alexander.reinholdt@kdemail.net
8
***************************************************************************/
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. *
16
* This program is distributed in the hope that it will be useful, but *
17
* WITHOUT ANY WARRANTY; without even the implied warranty of *
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19
* General Public License for more details. *
21
* You should have received a copy of the GNU General Public License *
22
* along with this program; if not, write to the *
23
* Free Software Foundation, 51 Franklin Street, Suite 500, Boston, *
24
* MA 02110-1335, USA *
25
***************************************************************************/
27
#ifndef SMB4KPRINT_P_H
28
#define SMB4KPRINT_P_H
39
#include <kurlrequester.h>
40
#include <knuminput.h>
45
// application specific includes
46
#include <smb4kprint.h>
47
#include <smb4kprocess.h>
49
// forward declarations
54
class Smb4KPrintJob : public KJob
62
Smb4KPrintJob( QObject *parent = 0 );
70
* Returns TRUE if the job has been started and FALSE otherwise
72
* @returns TRUE if the job has been started
74
bool isStarted() { return m_started; }
82
* Setup the printing process. You need to set the printer, the parent
85
* You must run this function before start() is called.
87
* @param printer The printer
89
* @param parentWidget The parent widget
91
void setupPrinting( Smb4KShare *printer,
92
QWidget *parentWidget = 0 );
95
* Returns the printer share object
97
* @returns the printer share object
99
Smb4KShare *printer() { return m_share; }
102
* Returns the parent widget
104
* @returns the parent widget
106
QWidget *parentWidget() { return m_parent_widget; }
110
* Emitted when an authentication error happened.
112
void authError( Smb4KPrintJob *job );
115
* Emitted when the printing is about to begin.
117
void aboutToStart( Smb4KShare *share );
120
* Emitted after the printing finished.
122
void finished( Smb4KShare *share );
126
* Reimplemented from KJob. Kills the internal process and
127
* then the job itself.
132
void slotStartPrinting();
133
void slotReadStandardOutput();
134
void slotReadStandardError();
135
void slotProcessFinished( int exitCode, QProcess::ExitStatus status );
139
Smb4KProcess *m_proc;
141
QWidget *m_parent_widget;
146
class Smb4KPrintDialog : public KDialog
154
* @param share The Smb4KShare item representing the printer.
156
* @param parent The parent widget of this dialog.P
158
Smb4KPrintDialog( Smb4KShare *share,
160
QWidget *parent = 0 );
168
* Returns the URL of the file that was chosen to be printed.
170
* @returns the URL of the file
172
const KUrl &fileURL() { return m_url; }
175
* Returns the QPrinter object
177
* @returns the QPrinter object
179
QPrinter *printer() { return m_printer; }
183
* This slot is called when the User1 (i.e. the "Close") button
186
void slotUser1Clicked();
189
* This slot is called when the User2 (i.e. the "Print") button has been clicked.
191
void slotUser2Clicked();
194
* This slot is being enabled if there is input text.
196
* @param text The input text.
198
void slotInputValueChanged( const QString &text );
204
void setupView( Smb4KShare *share );
214
KUrlRequester *m_file;
219
KIntNumInput *m_copies;
228
class Smb4KPrintPrivate
232
~Smb4KPrintPrivate();