1/*
2 * Copyright (c) 2007, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
4 *
5 * Author:
6 *		Łukasz 'Sil2100' Zemczak <sil2100@vexillium.org>
7 */
8#ifndef PACKAGESTATUS_H
9#define PACKAGESTATUS_H
10
11#include <Window.h>
12#include <View.h>
13#include <Button.h>
14#include <StatusBar.h>
15
16
17enum {
18	P_MSG_NEXT_STAGE = 'psne',
19	P_MSG_STOP,
20	P_MSG_RESET
21};
22
23
24class StopButton : public BButton {
25	public:
26		StopButton();
27		virtual void Draw(BRect);
28};
29
30
31class PackageStatus : public BWindow {
32	public:
33		PackageStatus(const char *title, const char *label = NULL,
34				const char *trailing = NULL, BHandler *parent = NULL);
35		~PackageStatus();
36
37		void MessageReceived(BMessage *msg);
38		void Reset(uint32 stages, const char *label = NULL,
39				const char *trailing = NULL);
40		void StageStep(uint32 count, const char *text = NULL,
41				const char *trailing = NULL);
42		bool Stopped();
43
44	private:
45		BStatusBar *fStatus;
46		StopButton *fButton;
47		bool fIsStopped;
48		BHandler *fParent;
49};
50
51
52#endif
53
54