1 /* 2 * Copyright 2005, Jérôme DUVAL. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 #ifndef _InstallerWindow_h 7 #define _InstallerWindow_h 8 9 #include <Box.h> 10 #include <Button.h> 11 #include <Menu.h> 12 #include <MenuField.h> 13 #include <ScrollView.h> 14 #include <String.h> 15 #include <TextView.h> 16 #include <Window.h> 17 #include "CopyEngine.h" 18 #include "DrawButton.h" 19 #include "PackageViews.h" 20 21 #define INSTALLER_RIGHT 402 22 23 enum InstallStatus { 24 kReadyForInstall, 25 kInstalling, 26 kFinished, 27 kCancelled 28 }; 29 30 const uint32 STATUS_MESSAGE = 'iSTM'; 31 const uint32 INSTALL_FINISHED = 'iIFN'; 32 const uint32 RESET_INSTALL = 'iRSI'; 33 const char PACKAGES_DIRECTORY[] = "_packages_"; 34 35 class InstallerWindow : public BWindow { 36 public: 37 InstallerWindow(BRect frameRect); 38 virtual ~InstallerWindow(); 39 40 virtual void MessageReceived(BMessage *msg); 41 virtual bool QuitRequested(); 42 BMenu *GetSourceMenu() { return fSrcMenu; }; 43 BMenu *GetTargetMenu() { return fDestMenu; }; 44 private: 45 void DisableInterface(bool disable); 46 void LaunchDriveSetup(); 47 void PublishPackages(); 48 void ShowBottom(); 49 void StartScan(); 50 void AdjustMenus(); 51 void SetStatusMessage(const char *text); 52 static int ComparePackages(const void *firstArg, const void *secondArg); 53 BBox *fBackBox; 54 BButton *fBeginButton, *fSetupButton; 55 DrawButton *fDrawButton; 56 bool fDriveSetupLaunched; 57 InstallStatus fInstallStatus; 58 BTextView *fStatusView; 59 BMenu* fSrcMenu, *fDestMenu; 60 BMenuField* fSrcMenuField, *fDestMenuField; 61 PackagesView *fPackagesView; 62 BScrollView *fPackagesScrollView; 63 BStringView *fSizeView; 64 65 BBitmap *fLogo; 66 BPoint fDrawPoint; 67 CopyEngine *fCopyEngine; 68 BString fLastStatus; 69 BMenuItem *fLastSrcItem, *fLastTargetItem; 70 }; 71 72 #endif /* _InstallerWindow_h */ 73