//--------------------------------------------------------------------------- #ifndef MainFrmH #define MainFrmH //--------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include //#include //#include #include #include #include #include using namespace std; using namespace sword; class InstallSourceTab : public TControl { public: __fastcall InstallSourceTab(TComponent *Owner, InstallSource *is); __fastcall ~InstallSourceTab(); InstallSource *is; TTntTreeView *tree; }; class WinStatusReporter : public StatusReporter { virtual void statusUpdate(double dltotal, double dlnow); virtual void preStatus(long totalBytes, long completedBytes, const char *message); }; class InstallMgrWin : public InstallMgr { public: bool termed; InstallMgrWin(const char *privatePath = "./", StatusReporter *statusReporter = 0) : InstallMgr(privatePath, statusReporter) {} virtual int ftpCopy(InstallSource *is, const char *src, const char *dest, bool dirTransfer = false, const char *suffix = ""); virtual bool getCipherCode(const char *modName, SWConfig *config); virtual bool isUserDisclaimerConfirmed() const; }; //--------------------------------------------------------------------------- class TMainForm : public TForm { class TWebThread; friend class TWebThread; __published: // IDE-managed Components TMainMenu *MainMenu1; TMenuItem *File1; TMenuItem *Exit1; TMenuItem *Option1; TMenuItem *LocalPath1; TOpenDialog *localPathDlg; TPanel *Panel1; TMediaPlayer *MediaPlayer1; TImage *Image1; TPanel *pnlAvailable; TPanel *pnlInstalled; TSplitter *Splitter1; TPanel *Panel2; TPanel *Panel5; TPageControl *PageControl1; TTabSheet *TabSheet1; TPanel *Panel8; TPanel *Panel7; TPanel *Panel6; TTimer *Timer1; TLabel *Label1; TImageList *ImageList1; TPanel *Panel3; TImageList *ImageList2; TPanel *statusBar; TPanel *Panel4; TProgressBar *progressBar; TSpeedButton *SpeedButton2; TImage *Image2; TLabel *Label2; TMenuItem *ManageRemoteSources1; TSpeedButton *SpeedButton1; TSpeedButton *SpeedButton3; TSpeedButton *SpeedButton4; TSpeedButton *SpeedButton5; TSpeedButton *SpeedButton6; TSpeedButton *SpeedButton7; TMenuItem *View1; TMenuItem *LockedModules1; TMenuItem *Help1; TMenuItem *Contents1; TMenuItem *Tool1; TMenuItem *BuildPortableApp1; TMenuItem *MigrateBookLibraryPubliclytoLocalMachine1; void __fastcall LocalPath1Click(TObject *Sender); void __fastcall FormCreate(TObject *Sender); void __fastcall Button5Click(TObject *Sender); void __fastcall localTreeDblClick(TObject *Sender); void __fastcall Button6Click(TObject *Sender); void __fastcall Image1Click(TObject *Sender); void __fastcall Button4Click(TObject *Sender); void __fastcall Button2Click(TObject *Sender); void __fastcall SpeedButton1Click(TObject *Sender); void __fastcall SpeedButton5Click(TObject *Sender); void __fastcall Exit1Click(TObject *Sender); void __fastcall FormShow(TObject *Sender); void __fastcall LockedModules1Click(TObject *Sender); void __fastcall Contents1Click(TObject *Sender); void __fastcall FormClose(TObject *Sender, TCloseAction &Action); void __fastcall BuildPortableApp1Click(TObject *Sender); void __fastcall MigrateBookLibraryPubliclytoLocalMachine1Click( TObject *Sender); private: // User declarations SWMgr *manager; int installCnt; bool defSelected; const char *getLocalDir(); void setLocalDir(const char *idir); void refreshPageControl(); void addSource(InstallSourceTab *ist); void fillAllSourceTrees(); void deleteAllModules(); public: // User declarations __fastcall TMainForm(TComponent* Owner); __fastcall ~TMainForm(); void __fastcall RefreshRemoteSource(TObject *Sender); int selectAll(TTntTreeView *tree, bool sel); SWBuf getDataRootPath(bool forceRefresh = false); SWMgr *localMgr; WinStatusReporter *statusReporter; InstallMgrWin *installMgr; protected: TTntTreeView *installTree; TTntTreeView *localTree; virtual void fillInstallTree(); virtual void fillSourceTree(TTntTreeView *tree, InstallSource *is = 0); }; //--------------------------------------------------------------------------- extern PACKAGE TMainForm *MainForm; //--------------------------------------------------------------------------- #endif