jigdo API
Last update by Admin on 2010-05-23
gtk/gtk-makeimage.hh
Go to the documentation of this file.00001 /* $Id: gtk-makeimage.hh,v 1.5 2003/09/12 23:08:01 atterer Exp $ -*- C++ -*- 00002 __ _ 00003 |_) /| Copyright (C) 2003 | richard@ 00004 | \/¯| Richard Atterer | atterer.net 00005 ¯ '` ¯ 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License, version 2. See 00008 the file COPYING for details. 00009 00010 */ 00021 #ifndef GTK_MAKEIMAGE_HH 00022 #define GTK_MAKEIMAGE_HH 00023 00024 #include <config.h> 00025 00026 #include <jobline.hh> 00027 #include <makeimagedl.hh> 00028 //______________________________________________________________________ 00029 00031 class GtkMakeImage : public JobLine, private Job::MakeImageDl::IO { 00032 public: 00033 GtkMakeImage(const string& uriStr, const string& destDir); 00034 virtual ~GtkMakeImage(); 00035 00036 // Virtual methods from JobLine 00037 virtual bool run(); 00038 virtual void selectRow(); 00039 virtual bool paused() const; 00040 virtual void pause(); 00041 virtual void cont(); 00042 virtual void stop(); 00043 virtual void percentDone(uint64* cur, uint64* total); 00044 00045 typedef void (GtkMakeImage::*TickHandler)(); 00046 inline void callRegularly(TickHandler handler); 00047 inline void callRegularlyLater(const int milliSec, TickHandler handler); 00048 00049 // Called from gui.cc 00050 void on_startButton_clicked(); 00051 void on_pauseButton_clicked(); 00052 void on_stopButton_clicked(); 00053 void on_restartButton_clicked(); 00054 void on_closeButton_clicked(); 00055 00056 private: 00057 // Virtual methods from Job::MakeImageDl::IO: 00058 virtual void job_deleted(); 00059 virtual void job_succeeded(); 00060 virtual void job_failed(const string& message); 00061 virtual void job_message(const string& message); 00062 virtual void makeImageDl_new(Job::DataSource* childDownload, 00063 const string& uri, const string& destDesc); 00064 virtual void makeImageDl_finished(Job::DataSource* childDownload); 00065 virtual void makeImageDl_haveImageSection(); 00066 00067 // Update info in main window 00068 void updateWindow(); 00069 00070 string progress, status; // Lines to display in main window 00071 string treeViewStatus; // Status section in the list of jobs 00072 string dest; // Destination dirname (filename once mid.haveImageSection()) 00073 00074 /* Same as mid.imageInfo(), except that <br> is replaced with \n and <p> is 00075 replaced with \n\n */ 00076 string imageInfo; 00077 string imageShortInfo; 00078 00079 Job::MakeImageDl mid; 00080 }; 00081 //______________________________________________________________________ 00082 00083 /* The static_cast from GtkMakeImage::* to JobLine::* (i.e. member fnc of 00084 base class) is OK because we know for certain that the handler will only 00085 be invoked on SingleUrl objects. */ 00086 void GtkMakeImage::callRegularly(TickHandler handler) { 00087 JobLine::callRegularly(static_cast<JobLine::TickHandler>(handler)); 00088 } 00089 void GtkMakeImage::callRegularlyLater(const int milliSec, 00090 TickHandler handler) { 00091 JobLine::callRegularlyLater(milliSec, 00092 static_cast<JobLine::TickHandler>(handler)); 00093 } 00094 00095 #endif
Generated on Tue Sep 23 14:27:41 2008 for jigdo by
