JobLine Class ReferenceOne "job", e.g. More...
Public Member Functions
|If the JobLine was in a needTicks() state, jobList()->unregisterTicks() is called by this dtor. |
|virtual bool||run ()=0|
|Start/restart this job. |
|virtual void||selectRow ()=0|
|Called when the JobLine's line is selected in the list. |
|virtual bool||paused () const =0|
|Is the job currently paused? |
|virtual void||pause ()=0|
|Pause the job. |
|virtual void||cont ()=0|
|Continue executing the job. |
|virtual void||stop ()=0|
|Stop executing the job. |
|virtual void||percentDone (uint64 *cur, uint64 *total)=0|
|When called, must fill in current nr of bytes downloaded and total nr of bytes. |
Static Public Member Functions
|static void||create (const char *uri, const char *dest)|
|Kind of a JobLine factory, called when the user clicks on OK to start a new download. |
|typedef void(JobLine::*||TickHandler )()|
Protected Member Functions
|JobList *||jobList () const|
|Pointer to JobList. |
|GtkTreeIter *||row ()|
|Iterator for our row in the list. |
|void||callRegularly (TickHandler handler)|
|Register a tick handler. |
|TickHandler||getHandler () const|
|Return current tick handler. |
|bool||needTicks () const|
|Does this object need to be called regularly? |
|void||callRegularlyLater (const int milliSec, TickHandler handler)|
|Wait appropriate nr of ticks, then register the supplied handler. |
Detailed DescriptionOne "job", e.g.
file download, scanning through files, or image download (which has many file downloads as children). Virtual class.
Member Typedef Documentation
|typedef void(JobLine::* JobLine::TickHandler)()
Constructor & Destructor Documentation
Member Function Documentation
|virtual bool JobLine::run||(||)||
Start/restart this job.
When called, must also create GUI elements for this Job in row number row() of GtkTreeView jobList()->view(). Is called after Job is added to the list, and when it is restarted (if at all). Child classes should provide an implementation.
- SUCCESS if everything OK, FAILURE if this object has deleted itself.
|virtual void JobLine::selectRow||(||)||
|virtual bool JobLine::paused||(||)|| const
|virtual void JobLine::pause||(||)||
|virtual void JobLine::cont||(||)||
|virtual void JobLine::stop||(||)||
|virtual void JobLine::percentDone||(||uint64 *||cur,|
|void JobLine::create||(||const char *||uri,|
|const char *||dest|
Kind of a JobLine factory, called when the user clicks on OK to start a new download.
It decides whether a normal file download or a .jigdo download is needed and creates the appropriate object. Additionally, the Job is appended to the list of jobs, and run.
uri What to download (if it ends in ".jigdo" and dest is a directory, will start jigdo processing) dest Where to put downloaded data, either a dir or a file.
References _, MessageBox::addButton(), compareEnd(), MessageBox::ERROR, MessageBox::INFO, GUI::jobList, Error::message, MessageBox::NONE, MessageBox::OK, JobList::prepend(), GtkMakeImage::run(), GtkSingleUrl::run(), MessageBox::show(), and subst.
|JobList * JobLine::jobList||(||)|| const
|GtkTreeIter * JobLine::row||(||)||
Iterator for our row in the list.
Do not modify the returned value, copy it instead! (It is non-const because various gtk functions which read it are incorrectly(?) declared non-const.) NB: The returned iter is UNINITIALIZED until the JobLine is added to a JobList!
Register a tick handler.
The handler will be called every JobList::TICK_INTERVAL milliseconds by a GTK+ callback function that JobList registers. Handy for updating progress reports at regular intervals. Only register a handler if you really need it. Otherwise, pass 0 as the handler function pointer - if no JobLine at all registers a tick handler, the callback fnc will not be registered at all, saving some CPU time.
|TickHandler JobLine::getHandler||(||)|| const
Return current tick handler.
|bool JobLine::needTicks||(||)|| const
|void JobLine::callRegularlyLater||(||const int||milliSec,|
Wait appropriate nr of ticks, then register the supplied handler.
Effectively, this means the JobLine pauses for a while - e.g. so the user can read some status report.
Friends And Related Function Documentation
|friend class JobList
The documentation for this class was generated from the following files:
Generated on Tue Sep 23 14:27:42 2008 for jigdo by 1.5.6