1/*
2 * Copyright (C) 2010 Stephan A��mus <superstippi@gmx.de>
3 *
4 * All rights reserved. Distributed under the terms of the MIT License.
5 */
6#ifndef DOWNLOAD_WINDOW_H
7#define DOWNLOAD_WINDOW_H
8
9
10#include <String.h>
11#include <Window.h>
12
13class BButton;
14class BFile;
15class BGroupLayout;
16class BScrollView;
17class BWebDownload;
18class SettingsMessage;
19
20
21class DownloadWindow : public BWindow {
22public:
23								DownloadWindow(BRect frame, bool visible,
24									SettingsMessage* settings);
25	virtual						~DownloadWindow();
26
27	virtual	void				DispatchMessage(BMessage* message,
28									BHandler* target);
29	virtual void				FrameResized(float newWidth, float newHeight);
30	virtual	void				MessageReceived(BMessage* message);
31	virtual	bool				QuitRequested();
32
33			bool				DownloadsInProgress();
34			void				SetMinimizeOnClose(bool minimize);
35
36private:
37			void				_DownloadStarted(BWebDownload* download);
38			void				_DownloadFinished(BWebDownload* download);
39			void				_RemoveFinishedDownloads();
40			void				_RemoveMissingDownloads();
41			void				_ValidateButtonStatus();
42			void				_SaveSettings();
43			void				_LoadSettings();
44			bool				_OpenSettingsFile(BFile& file, uint32 mode);
45
46private:
47			BScrollView*		fDownloadsScrollView;
48			BGroupLayout*		fDownloadViewsLayout;
49			BButton*			fRemoveFinishedButton;
50			BButton*			fRemoveMissingButton;
51			BString				fDownloadPath;
52			bool				fMinimizeOnClose;
53};
54
55#endif // DOWNLOAD_WINDOW_H
56