DirectoryDialog.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Installer *
  23. * *
  24. * $Archive:: /Commando/Code/Installer/DirectoryDialog.h $*
  25. * *
  26. * $Author:: Ian_l $*
  27. * *
  28. * $Modtime:: 11/24/01 8:38p $*
  29. * *
  30. * $Revision:: 5 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef _DIRECTORY_DIALOG_H
  36. #define _DIRECTORY_DIALOG_H
  37. // Includes.
  38. #include "InstallMenuDialog.h"
  39. #include "Installer.h"
  40. // Forward delcarations.
  41. class DirectoryBrowserClass;
  42. // Dialog to set the install directory for the game (GameDirectoryClass) or an
  43. // online component (WOLDirectoryClass).
  44. // Classes.
  45. class DirectoryDialogClass : public InstallMenuDialogClass
  46. {
  47. public:
  48. DirectoryDialogClass() : InstallMenuDialogClass (IDD_DIALOG_DIRECTORY), Browser (NULL), OverwriteDialog (NULL), DriveLetter ('\0') {}
  49. // RTTI.
  50. void *As_DirectoryDialogClass() {return (this);}
  51. void On_Command (int ctrl_id, int message_id, DWORD param);
  52. void Callback (int id, PopupDialogClass *popup);
  53. const WCHAR *Get_Path (WideStringClass &path);
  54. protected:
  55. void Update (bool lazyupdate = false);
  56. void On_Init_Dialog (void) {InstallMenuDialogClass::On_Init_Dialog();}
  57. void On_Activate (bool onoff);
  58. void On_Frame_Update (void);
  59. WCHAR *Megabyte_Format (__int64 bytecount, WideStringClass &outputstring);
  60. virtual __int64 Get_Disk_Space_Needed() = 0;
  61. virtual bool Get_Disk_Space_Available (const WideStringClass &path, __int64 &diskspace) = 0;
  62. DirectoryBrowserClass *Browser;
  63. MessageBoxClass *OverwriteDialog;
  64. WCHAR DriveLetter;
  65. };
  66. class GameDirectoryDialogClass : public DirectoryDialogClass
  67. {
  68. public:
  69. // RTTI.
  70. virtual void *As_GameDirectoryDialogClass() {return (this);}
  71. void On_Command (int ctrl_id, int message_id, DWORD param) {DirectoryDialogClass::On_Command (ctrl_id, message_id, param);}
  72. protected:
  73. void On_Init_Dialog (void);
  74. __int64 Get_Disk_Space_Needed() {return (_Installer.Get_Game_Size (true));}
  75. bool Get_Disk_Space_Available (const WideStringClass &path, __int64 &diskspace) {return (_Installer.Get_Game_Space_Available (path, diskspace));}
  76. };
  77. class WOLDirectoryDialogClass : public DirectoryDialogClass
  78. {
  79. public:
  80. // RTTI.
  81. virtual void *As_WOLDirectoryDialogClass() {return (this);}
  82. void On_Command (int ctrl_id, int message_id, DWORD param);
  83. protected:
  84. void On_Init_Dialog (void);
  85. __int64 Get_Disk_Space_Needed() {return (_Installer.Get_WOL_Size (true));}
  86. bool Get_Disk_Space_Available (const WideStringClass &path, __int64 &diskspace) {return (_Installer.Get_WOL_Space_Available (path, diskspace));}
  87. };
  88. #endif // _DIRECTORY_DIALOG_H