1/*
2 * Copyright 2001-2010, Haiku.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Michael Pfeiffer
7 */
8#ifndef _JOB_LISTVIEW_H
9#define _JOB_LISTVIEW_H
10
11
12#include <Bitmap.h>
13#include <ListItem.h>
14#include <ListView.h>
15#include <String.h>
16
17
18class Job;
19class JobItem;
20class SpoolFolder;
21
22
23class JobListView : public BListView {
24	typedef BListView Inherited;
25public:
26								JobListView(BRect frame);
27								~JobListView();
28
29			void				AttachedToWindow();
30			void				SetSpoolFolder(SpoolFolder* folder);
31
32			void				AddJob(Job* job);
33			void				RemoveJob(Job* job);
34			void				UpdateJob(Job* job);
35
36			JobItem* 			SelectedItem() const;
37
38			void				RestartJob();
39			void				CancelJob();
40
41private:
42			JobItem* 			FindJob(Job* job) const;
43};
44
45
46class JobItem : public BListItem {
47public:
48								JobItem(Job* job);
49								~JobItem();
50
51			void				Update();
52
53			void				Update(BView *owner, const BFont *font);
54			void				DrawItem(BView *owner, BRect bounds,
55									bool complete);
56
57			Job* 				GetJob() const { return fJob; }
58
59private:
60			Job*				fJob;
61			BBitmap*			fIcon;
62			BString				fName;
63			BString				fPages;
64			BString				fStatus;
65			BString				fSize;
66};
67
68#endif // _JOB_LISTVIEW_H
69