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 13 class BButton; 14 class BFile; 15 class BGroupLayout; 16 class BScrollView; 17 class BWebDownload; 18 class SettingsMessage; 19 20 21 class DownloadWindow : public BWindow { 22 public: 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 MessageReceived(BMessage* message); 30 virtual bool QuitRequested(); 31 32 bool DownloadsInProgress(); 33 void SetMinimizeOnClose(bool minimize); 34 35 private: 36 void _DownloadStarted(BWebDownload* download); 37 void _DownloadFinished(BWebDownload* download); 38 void _RemoveFinishedDownloads(); 39 void _RemoveMissingDownloads(); 40 void _ValidateButtonStatus(); 41 void _SaveSettings(); 42 void _LoadSettings(); 43 bool _OpenSettingsFile(BFile& file, uint32 mode); 44 45 private: 46 BScrollView* fDownloadsScrollView; 47 BGroupLayout* fDownloadViewsLayout; 48 BButton* fRemoveFinishedButton; 49 BButton* fRemoveMissingButton; 50 BString fDownloadPath; 51 bool fMinimizeOnClose; 52 }; 53 54 #endif // DOWNLOAD_WINDOW_H 55