Quantum GIS API Documentation  1.7.4
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 /* $Id$ */
00020 #ifndef QGSCONTEXTHELP_H
00021 #define QGSCONTEXTHELP_H
00022 #include <QObject>
00023 
00024 class QProcess;
00025 class QTcpSocket;
00026 
00027 #ifdef Q_OS_MACX
00028 #define QGSCONTEXTHELP_REUSE 1
00029 #endif
00030 
00044 class CORE_EXPORT QgsContextHelp : public QObject
00045 {
00046     Q_OBJECT
00047   public:
00048     static void run( QString context );
00049 
00050   private slots:
00051     void readPort();
00052     void processExited();
00053 
00054   private:
00056     QgsContextHelp( QString context );
00058     ~QgsContextHelp();
00059 
00060     QProcess *start( QString context );
00061     void showContext( QString context );
00062 
00063     static QgsContextHelp *gContextHelp; // Singleton instance
00064     QProcess *mProcess;
00065 #ifdef QGSCONTEXTHELP_REUSE
00066     // Communications socket when reusing existing process
00067     QTcpSocket *mSocket;
00068 #else
00069     // Replacement process when terminating and restarting
00070     QProcess *mNextProcess;
00071 #endif
00072 };
00073 
00074 #endif //QGSCONTEXTHELP_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines