1 | /**********************************************************************
|
---|
2 | ** Copyright (C) 2002 Trolltech AS. All rights reserved.
|
---|
3 | **
|
---|
4 | ** This file is part of the QAssistantClient library.
|
---|
5 | **
|
---|
6 | ** This file may be distributed and/or modified under the terms of the
|
---|
7 | ** GNU General Public License version 2 as published by the Free Software
|
---|
8 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
9 | ** packaging of this file.
|
---|
10 | **
|
---|
11 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
12 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
13 | ** Agreement provided with the Software.
|
---|
14 | **
|
---|
15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
17 | **
|
---|
18 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
19 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
20 | ** information about Qt Commercial License Agreements.
|
---|
21 | **
|
---|
22 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
23 | ** not clear to you.
|
---|
24 | **
|
---|
25 | **********************************************************************/
|
---|
26 |
|
---|
27 | #ifndef QASSISTANTCLIENT_H
|
---|
28 | #define QASSISTANTCLIENT_H
|
---|
29 |
|
---|
30 | #include <qobject.h>
|
---|
31 |
|
---|
32 | class QSocket;
|
---|
33 | class QProcess;
|
---|
34 |
|
---|
35 | class QAssistantClient : public QObject
|
---|
36 | {
|
---|
37 | Q_OBJECT
|
---|
38 | Q_PROPERTY( bool open READ isOpen )
|
---|
39 |
|
---|
40 | public:
|
---|
41 | QAssistantClient( const QString &path, QObject *parent = 0, const char *name = 0 );
|
---|
42 | ~QAssistantClient();
|
---|
43 |
|
---|
44 | bool isOpen() const;
|
---|
45 |
|
---|
46 | void setArguments( const QStringList &args );
|
---|
47 |
|
---|
48 | public slots:
|
---|
49 | virtual void openAssistant();
|
---|
50 | virtual void closeAssistant();
|
---|
51 | virtual void showPage( const QString &page );
|
---|
52 |
|
---|
53 | signals:
|
---|
54 | void assistantOpened();
|
---|
55 | void assistantClosed();
|
---|
56 | void error( const QString &msg );
|
---|
57 |
|
---|
58 | private slots:
|
---|
59 | void socketConnected();
|
---|
60 | void socketConnectionClosed();
|
---|
61 | void readPort();
|
---|
62 | void socketError( int );
|
---|
63 | void readStdError();
|
---|
64 |
|
---|
65 | private:
|
---|
66 | QSocket *socket;
|
---|
67 | QProcess *proc;
|
---|
68 | Q_UINT16 port;
|
---|
69 | QString host, assistantCommand, pageBuffer;
|
---|
70 | bool opened;
|
---|
71 | };
|
---|
72 |
|
---|
73 | #endif
|
---|