2 * This file is part of RawTherapee.
4 * Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
6 * RawTherapee is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * RawTherapee is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
23 #include <batchqueueentry.h>
26 #include <lwbuttonset.h>
27 #include <thumbbrowserbase.h>
29 class BatchQueueListener
{
32 virtual void queueSizeChanged (int qsize
) {}
33 virtual void imageProcessingReady (Glib::ustring fname
) {}
34 virtual void queueEmpty () {}
35 virtual bool canStartNext () {}
39 class BatchQueue
: public ThumbBrowserBase
,
40 public rtengine::BatchProcessingListener
,
41 public LWButtonListener
{
45 BatchQueueEntry
* processing
;
47 Glib::ustring nameTemplate
;
49 Gtk::MenuItem
* cancel
;
52 Gtk::MenuItem
* selall
;
55 BatchQueueListener
* listener
;
57 Glib::ustring
obtainFileName (const Glib::ustring
& origFileName
);
58 Glib::ustring
autoCompleteFileName (const Glib::ustring
& fileName
, const Glib::ustring
& format
);
63 void addEntry (BatchQueueEntry
* entry
, bool head
=false);
65 void cancelItems (std::vector
<ThumbBrowserEntryBase
*>* items
);
66 void headItems (std::vector
<ThumbBrowserEntryBase
*>* items
);
67 void tailItems (std::vector
<ThumbBrowserEntryBase
*>* items
);
70 void startProcessing ();
72 bool hasJobs () { return fd
.size()>0; }
74 rtengine::ProcessingJob
* imageReady (rtengine::IImage16
* img
);
75 void setProgress (double p
);
76 void rightClicked (ThumbBrowserEntryBase
* entry
);
77 void buttonPressed (LWButton
* button
, int actionCode
, void* actionData
);
78 void redrawNeeded (LWButton
* button
);
80 void setBatchQueueListener (BatchQueueListener
* l
) { listener
= l
; }
81 void notifyListener ();