1/*
2 * Copyright 2011, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _PACKAGE__REQUEST_H_
6#define _PACKAGE__REQUEST_H_
7
8
9#include <SupportDefs.h>
10
11#include <package/Job.h>
12
13
14namespace BPackageKit {
15
16
17class BContext;
18namespace BPrivate {
19	class JobQueue;
20}
21using BPrivate::JobQueue;
22
23
24class BRequest : protected BJobStateListener {
25public:
26								BRequest(const BContext& context);
27	virtual						~BRequest();
28
29			status_t			InitCheck() const;
30
31	virtual	status_t			CreateInitialJobs() = 0;
32
33			BJob*				PopRunnableJob();
34
35protected:
36			status_t			QueueJob(BJob* job);
37
38			const BContext&		fContext;
39
40private:
41			status_t			fInitStatus;
42			JobQueue*			fJobQueue;
43};
44
45
46}	// namespace BPackageKit
47
48
49#endif // _PACKAGE__REQUEST_H_
50