home *** CD-ROM | disk | FTP | other *** search
- /*===========================================================================*/
- /* Getting Started sample using The Xceed Zip Compression Library 4 */
- /* For C++Builder 4 */
- /* Copyright (c) 1999 Xceed Software Inc. */
- /*===========================================================================*/
-
- #ifndef MainH
- #define MainH
-
- #include <Classes.hpp>
- #include <Controls.hpp>
- #include <StdCtrls.hpp>
- #include <Forms.hpp>
- #include <checklst.hpp>
- #include <ComCtrls.hpp>
- #include <OleCtrls.hpp>
- #include "XceedZipLib_OCX.h"
- #include <CheckLst.hpp>
-
- //
- // TfrmMain : Main form
- //
- class TfrmMain : public TForm
- {
- __published: // IDE-managed Components
- TLabel *Label1;
- TLabel *Label7;
- TPageControl *tabExamples;
- TTabSheet *shtPreview;
- TLabel *Label3;
- TLabel *Label4;
- TLabel *Label5;
- TLabel *Label6;
- TMemo *edtPFilesToProcess;
- TMemo *edtPFilesToExclude;
- TCheckListBox *lstPRequiredFileAttributes;
- TCheckListBox *lstPExcludedFileAttributes;
- TCheckBox *chkPProcessSubfolders;
- TButton *btPreviewFiles;
- TMemo *Memo1;
- TTabSheet *shtZip;
- TLabel *Label8;
- TLabel *Label9;
- TLabel *Label10;
- TLabel *Label11;
- TLabel *Label12;
- TLabel *Label13;
- TEdit *edtZZipFilename;
- TEdit *edtZBasePath;
- TMemo *edtZFilesToProcess;
- TMemo *edtZFilesToExclude;
- TCheckBox *chkZPreservePaths;
- TCheckBox *chkZProcessSubfolders;
- TCheckBox *chkZUseTempFile;
- TEdit *edtZTempFolder;
- TButton *btZip;
- TTabSheet *shtList;
- TLabel *Label14;
- TLabel *Label15;
- TLabel *Label16;
- TLabel *Label17;
- TLabel *Label18;
- TLabel *Label19;
- TLabel *Label20;
- TLabel *Label21;
- TEdit *edtLZipFilename;
- TEdit *edtLMinSizeToProcess;
- TEdit *edtLMaxSizeToProcess;
- TButton *btList;
- TDateTimePicker *dtLMinDateToProcess;
- TDateTimePicker *dtLMaxDateToProcess;
- TTabSheet *shtUnzip;
- TLabel *Label23;
- TLabel *Label24;
- TLabel *Label25;
- TLabel *Label26;
- TEdit *edtUZipFilename;
- TEdit *edtUUnzipToFolder;
- TMemo *edtUFilesToProcess;
- TMemo *edtUFilesToExclude;
- TCheckBox *chkUSkipIfExisting;
- TCheckBox *chkUSkipIfNotExisting;
- TCheckBox *chkUSkipIfOlderDate;
- TCheckBox *chkUSkipIfOlderVersion;
- TButton *btUnzip;
- TMemo *Memo2;
- TTabSheet *shtSFX;
- TLabel *Label29;
- TLabel *Label30;
- TLabel *Label31;
- TLabel *Label32;
- TLabel *Label33;
- TEdit *edtSZipFilename;
- TMemo *edtSFilesToProcess;
- TEdit *edtSSfxBinaryModule;
- TEdit *edtSTitle;
- TButton *btZipSfx;
- TMemo *edtSIntro;
- TMemo *Memo3;
- TStatusBar *StatusBar1;
- TMemo *edtResults;
- TProgressBar *barGlobal;
- TProgressBar *barFile;
- TXceedZip *xZip;
-
- void __fastcall btPreviewFilesClick(TObject *Sender);
- void __fastcall btZipClick(TObject *Sender);
- void __fastcall btListClick(TObject *Sender);
- void __fastcall btUnzipClick(TObject *Sender);
- void __fastcall btZipSfxClick(TObject *Sender);
- void __fastcall xZipFileStatus(TObject *Sender, BSTR sFilename,
- long lSize, long lCompressedSize, long lBytesProcessed,
- short nBytesPercent, short nCompressionRatio,
- TOLEBOOL bFileCompleted);
- void __fastcall xZipGlobalStatus(TObject *Sender, long lFilesTotal,
- long lFilesProcessed, long lFilesSkipped, short nFilesPercent,
- long lBytesTotal, long lBytesProcessed, long lBytesSkipped,
- short nBytesPercent, long lBytesOutput, short nCompressionRatio);
- void __fastcall xZipListingFile(TObject *Sender, BSTR sFilename,
- BSTR sComment, long lSize, long lCompressedSize,
- short nCompressionRatio, xcdFileAttributes xAttributes,
- long lCRC, DATE dtLastModified, DATE dtLastAccessed,
- DATE dtCreated, xcdCompressionMethod xMethod,
- TOLEBOOL bEncrypted, long lDiskNumber, TOLEBOOL bExcluded,
- xcdSkippingReason xReason);
- void __fastcall xZipPreviewingFile(TObject *Sender, BSTR sFilename,
- BSTR sSourceFilename, long lSize, xcdFileAttributes xAttributes,
- DATE dtLastModified, DATE dtLastAccessed, DATE dtCreated,
- TOLEBOOL bExcluded, xcdSkippingReason xReason);
- void __fastcall xZipProcessCompleted(TObject *Sender, long lFilesTotal,
- long lFilesProcessed, long lFilesSkipped, long lBytesTotal,
- long lBytesProcessed, long lBytesSkipped, long lBytesOutput,
- short nCompressionRatio, xcdError xResult);
- void __fastcall xZipSkippingFile(TObject *Sender, BSTR sFilename,
- BSTR sComment, BSTR sFilenameOnDisk, long lSize,
- long lCompressedSize, xcdFileAttributes xAttributes, long lCRC,
- DATE dtLastModified, DATE dtLastAccessed, DATE dtCreated,
- xcdCompressionMethod xMethod, TOLEBOOL bEncrypted,
- xcdSkippingReason xReason);
- void __fastcall xZipWarning(TObject *Sender, BSTR sFilename,
- xcdWarning xWarning);
- void __fastcall xZipZipContentsStatus(TObject *Sender, long lFilesRead,
- long lFilesTotal, short nFilesPercent);
- void __fastcall xZipInsertDisk(TObject *Sender, long lDiskNumber,
- TOLEBOOL *bDiskInserted);
- void __fastcall xZipReplacingFile(TObject *Sender, BSTR sFilename,
- BSTR sComment, long lSize, xcdFileAttributes xAttributes,
- DATE dtLastModified, DATE dtLastAccessed, DATE dtCreated,
- BSTR sOrigFilename, long lOrigSize,
- xcdFileAttributes xOrigAttributes, DATE dtOrigLastModified,
- DATE dtOrigLastAccessed, DATE dtOrigCreated,
- TOLEBOOL *bReplaceFile);
- private:
- //
- // Utility methods
- //
- void UpdateFieldHints( void );
- void FillAttributeList( TCheckListBox* pList );
- xcdFileAttributes GetSelectedAttributes( TCheckListBox* pList );
- void SetSelectedAttributes( TCheckListBox* pList,
- xcdFileAttributes xAttribs );
-
- void ResetDefaultXceedZipProperties( TXceedZipProxy* pZip );
-
- public:
- __fastcall TfrmMain(TComponent* Owner);
- };
-
- //
- // Global variable decalration
- //
- extern PACKAGE TfrmMain *frmMain;
-
- #endif
-
-