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 const uint32 STATUS_MESSAGE = 'iSTM'; 24 const uint32 INSTALL_FINISHED = 'iIFN'; 25 const char PACKAGES_DIRECTORY[] = "_packages_"; 26 27 class InstallerWindow : public BWindow { 28 public: 29 InstallerWindow(BRect frameRect); 30 virtual ~InstallerWindow(); 31 32 virtual void MessageReceived(BMessage *msg); 33 virtual bool QuitRequested(); 34 BMenu *GetSourceMenu() { return fSrcMenu; }; 35 BMenu *GetTargetMenu() { return fDestMenu; }; 36 private: 37 void DisableInterface(bool disable); 38 void LaunchDriveSetup(); 39 void PublishPackages(); 40 void ShowBottom(); 41 void StartScan(); 42 void AdjustMenus(); 43 void SetStatusMessage(const char *text); 44 static int ComparePackages(const void *firstArg, const void *secondArg); 45 BBox *fBackBox; 46 BButton *fBeginButton, *fSetupButton; 47 DrawButton *fDrawButton; 48 bool fDriveSetupLaunched; 49 BTextView *fStatusView; 50 BMenu* fSrcMenu, *fDestMenu; 51 BMenuField* fSrcMenuField, *fDestMenuField; 52 PackagesView *fPackagesView; 53 BScrollView *fPackagesScrollView; 54 BStringView *fSizeView; 55 56 BBitmap *fLogo; 57 BPoint fDrawPoint; 58 CopyEngine *fCopyEngine; 59 BString fLastStatus; 60 BMenuItem *fLastSrcItem, *fLastTargetItem; 61 }; 62 63 #endif /* _InstallerWindow_h */ 64