Quantum GIS API Documentation  1.8
src/core/qgscontexthelp.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                           qgscontexthelp.h
00003                Display context help for a dialog by invoking the
00004                                  QgsHelpViewer
00005                              -------------------
00006     begin                : 2005-06-19
00007     copyright            : (C) 2005 by Gary E.Sherman
00008     email                : sherman at mrcc.com
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *   This program is free software; you can redistribute it and/or modify  *
00014  *   it under the terms of the GNU General Public License as published by  *
00015  *   the Free Software Foundation; either version 2 of the License, or     *
00016  *   (at your option) any later version.                                   *
00017  *                                                                         *
00018  ***************************************************************************/
00019 #ifndef QGSCONTEXTHELP_H
00020 #define QGSCONTEXTHELP_H
00021 #include <QObject>
00022 
00023 class QProcess;
00024 class QTcpSocket;
00025 
00026 #ifdef Q_OS_MACX
00027 #define QGSCONTEXTHELP_REUSE 1
00028 #endif
00029 
00043 class CORE_EXPORT QgsContextHelp : public QObject
00044 {
00045     Q_OBJECT
00046   public:
00047     static void run( QString context );
00048 
00049   private slots:
00050     void readPort();
00051     void processExited();
00052 
00053   private:
00055     QgsContextHelp( QString context );
00057     ~QgsContextHelp();
00058 
00059     QProcess *start( QString context );
00060     void showContext( QString context );
00061 
00062     static QgsContextHelp *gContextHelp; // Singleton instance
00063     QProcess *mProcess;
00064 #ifdef QGSCONTEXTHELP_REUSE
00065     // Communications socket when reusing existing process
00066     QTcpSocket *mSocket;
00067 #else
00068     // Replacement process when terminating and restarting
00069     QProcess *mNextProcess;
00070 #endif
00071 };
00072 
00073 #endif //QGSCONTEXTHELP_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines