home *** CD-ROM | disk | FTP | other *** search
/ ftp.rarlab.com / 2014.05.ftp.rarlab.com.tar / ftp.rarlab.com / rar / UnrarGUI.zip / UnrarDll.h < prev    next >
C/C++ Source or Header  |  2003-12-29  |  2KB  |  56 lines

  1. //---------------------------------------------------------------------------
  2.  
  3. #ifndef UnrarDllH
  4. #define UnrarDllH
  5. //---------------------------------------------------------------------------
  6. #include <Classes.hpp>
  7. #include "DLLMan.h"
  8. //---------------------------------------------------------------------------
  9. /*
  10.   Question about this library <zhangihome@netscape.net>
  11.   Example:
  12.  
  13.     if ( OpenDialog->Execute() ) {
  14.         RarDll *rar = new RarDll();
  15.         char *err = rar->GUI(OpenDialog->FileName.c_str());
  16.         if (err) {
  17.             MessageBox(NULL, err, "Load fail.", MB_OK);
  18.         } else {
  19.             RichEdit->Lines->LoadFromStream(rar->Expanded);
  20.         }
  21.         // Do something if you use the rar->FileName.
  22.         delete rar;
  23.     }
  24. */
  25. class RarDll : public DLLMan {
  26. public:
  27.     // Pop up a message box with a OK button. 
  28.     void Comment(char *Content, char *Caption);
  29.  
  30.     bool Ask;
  31.     // Pop up window Ask password and next volume when need.
  32.     // On startup, Ask = Popup;
  33.     RarDll(bool Popup = true);
  34.     ~RarDll();
  35.  
  36.     // Return null if succeed, or a message for what error.
  37.     // Same for List() and GUI() return.
  38.     char *Extract(char *PakName, char *AskName, char *Passw = "");
  39.     TMemoryStream *Expanded;
  40.  
  41.     // Get files list in package.
  42.     char *List(char *PakName);
  43.     // Files->Objects[Index] is a number of file size(not pointer).
  44.     // Files->Strings[Index] is a string of file name.
  45.     TStringList *Files;
  46.  
  47.     // GUI show a package view window. if a file has be picked.
  48.     // return Extract(ThePackage, TheFile).
  49.     char *GUI(char *PakName, bool Detail = false);
  50.     AnsiString FileName;
  51. };
  52.  
  53. typedef RarDll * RarDllP;
  54.  
  55. #endif
  56.