OpenFlipperThread.hh

00001 //=============================================================================
00002 //
00003 //                               OpenFlipper
00004 //        Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
00005 //                           www.openflipper.org
00006 //
00007 //-----------------------------------------------------------------------------
00008 //
00009 //                                License
00010 //
00011 //  OpenFlipper is free software: you can redistribute it and/or modify
00012 //  it under the terms of the GNU Lesser General Public License as published by
00013 //  the Free Software Foundation, either version 3 of the License, or
00014 //  (at your option) any later version.
00015 //
00016 //  OpenFlipper is distributed in the hope that it will be useful,
00017 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 //  GNU Lesser General Public License for more details.
00020 //
00021 //  You should have received a copy of the GNU Lesser General Public License
00022 //  along with OpenFlipper.  If not, see <http://www.gnu.org/licenses/>.
00023 //
00024 //-----------------------------------------------------------------------------
00025 //
00026 //   $Revision: 5074 $
00027 //   $Author: wilden $
00028 //   $Date: 2009-02-25 18:27:57 +0100 (Mi, 25. Feb 2009) $
00029 //
00030 //=============================================================================
00031 
00032 
00033 
00034 
00035 #ifndef OPENFLIPPERTHREAD_HH
00036 #define OPENFLIPPERTHREAD_HH
00037 
00038 #include <QThread>
00039 #include <QMutex>
00040 #include <QProgressDialog>
00041 
00042 #include <OpenFlipper/common/GlobalDefines.hh>
00043 
00044 
00045 
00046 class OpenFlipperJob;
00047 
00048 class DLLEXPORT OpenFlipperThread : public QThread
00049 {
00050   Q_OBJECT
00051   
00052   public:
00053     OpenFlipperThread( QString _jobId );
00054     ~OpenFlipperThread();
00055     
00056   //===========================================================================
00059   //===========================================================================
00060   public:
00061     
00067     virtual void run();
00068     
00075     virtual void cancel();   
00076     
00077   public slots:
00082     void slotCancel( QString _jobId);
00083     
00084   signals:
00090     void state( QString _jobId, int _state );
00091     
00095   //===========================================================================
00098   //===========================================================================
00099     
00100   signals:
00117     void function();
00118     
00124     void finished( QString _jobId );
00125     
00126     
00127     
00128   public slots:
00133     void startProcessing();
00134     
00138   private slots:
00143     void slotJobFinished();
00144   
00145   signals:
00151     void startProcessingInternal();
00152     
00153   private: 
00162     OpenFlipperJob* job_;
00163     
00169     QString jobId_;
00170     
00171     QMutex startup_;
00172 
00173     
00174 };
00175 
00176 
00177 // ================================================================================
00178 // Job wrapper
00179 // ================================================================================
00180 
00191 class DLLEXPORT OpenFlipperJob : public QObject
00192 {
00193   Q_OBJECT
00194   
00195   public:
00196     OpenFlipperJob() {}
00197     ~OpenFlipperJob();
00198   
00199   signals:
00207     void process();
00208     
00213     void finished();
00214     
00215   public slots:
00221     void startJobProcessing();
00222     
00223 };
00224 
00225 
00226 
00227 #endif //OPENFLIPPERTHREAD_HH

acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .