home *** CD-ROM | disk | FTP | other *** search
- #define __ICTRLLER_H
-
-
- #ifndef __SAINT_H
- #include "saint.h"
- #endif
- #ifndef __OPRDR_H
- #include "oprdr.h"
- #endif
- #ifndef __ICONOBJ_H
- #include "iconobj.h"
- #endif
- #ifndef __USERWND_H
- #include "userwnd.h"
- #endif
- #ifndef __INSTALLR_H
- #include "installr.h"
- #endif
-
- class fimd;
-
- class iinfo;
-
- class dcontext;
-
- class cthelpobj;
-
-
- class ictrller;
-
- class bkwndobj:public userwnd
- {
- ictrller *ic;
-
- public:
-
- enum
- {
- idexit = 101, idhelp = 102, idminz = 103
- };
-
- void setic(ictrller *icx)
- {
- ic = icx;
- }
-
- LRESULT onmsg(UINT msg, WPARAM wp, LPARAM lp);
- };
-
- class icwndobj:public userwnd
- {
- ictrller *ic;
-
- public:
-
- void setic(ictrller *icx)
- {
- ic = icx;
- }
-
- LRESULT onmsg(UINT msg, WPARAM wp, LPARAM lp);
- };
-
- class bkbtn;
-
- class bkgauge;
-
- class linelist;
-
- class fioptnode;
-
- class ictrller
- {
- friend icwndobj;
- friend bkwndobj;
-
- typedef int (ictrller::*mergefunc)(linelist &dstls, char srcl[], char addl[], int i);
-
- int createicwnd();
- int createbkwnd();
- int copysubtree(fioptnode *i2nmap[], int k);
- void paint();
- void drawbktxts(dcontext &dc);
- void drawnotice(dcontext &dc);
- void drawgradient(dcontext &dc, RECT &r);
-
- public:
-
-
- class ffr01 /* file frame01 */
- {
- public:
-
- int xfer; /* 0 -- decompress 1 -- copy */
- int uninst; /* 0 -- uninstall 1 -- none */
- int create; /* 0 -- create 1 -- append */
- int isff; /* is a font file to be installed? */
- int cond;/* 0 -- none 1 -- ver info 2 -- INI ver 3 -- time 4 -- size */
- LONG size;
- char desc[128];
- char disk[128];
- stcpath srcpath;
- stcpath dstpath;
- };
-
- class ffr02 /* file frame02 */
- {
- public:
-
- int ismustexist;
- char desc[128];
- stcpath srcpath;
- stcpath dstpath;
- };
-
- class ffr03 /* file frame03 */
- {
- public:
-
- char desc[128];
-
- stcpath path;
- };
-
- class ffr04 /* file frame04 */
- {
- public:
-
- int amode; /* 0 -- quietly 1 -- advise before 2 -- advise after */
- char desc[128];
- stcpath path;
- };
-
- class cfr00 /* component info */
- {
- public:
-
- int isleaf;
- int isxcl; /* exclusive to siblings? */
- int isinichk; /* initial check state */
- int isenable; /* enability */
- int isinisks; /* is it expanded initially? */
- char name[80]; /* component name */
- char desc[256]; /* component description */
- };
-
- class ifr00 /* PM item info */
- {
- public:
-
- int iidx;
- char name[80];
- char grup[80];
- char cmdl[512];
- stcpath icon;
- stcpath dirw;
- };
-
- class efr00 /* INI entry info */
- {
- public:
-
- int dmode;/* duplicate mode. 0 -- set 1 -- add if diff 2 -- always add */
- char sect[128];
- char entry[128];
- char value[512];
- stcpath file;
- };
-
- class rfr00 /* reg key info */
- {
- public:
-
- char kpath[256];
- char value[256];
- };
-
- class tfr00 /* background text info */
- {
- public:
-
- int x; /* x, y, width, height in 0.1% of screen */
- int y;
- int h;
- int w;
- int effect; /* 0 -- none 1 -- 3D 2 -- shadow */
- int isbold;
- int isitalic;
- char txt[128];
- char fnt[128];
- COLORREF c;
- };
-
- class welstruct /* welcome dlg structure */
- {
- public:
-
- char line1[256];
- char line2[256];
- char line3[256];
- char line4[256];
- char line5[256];
- };
-
- class psstruct /* prompt string structure */
- {
- public:
-
- int ctid;
- int isdir;
- int ischkspace;
- int minspace;
- char s[256];
- char def[256];
- char line1[256];
- char line2[256];
- char line3[256];
- char line4[256];
- };
-
- public:
-
- ictrller(); /* we must call init() after it is constructed */
-
- virtual ~ictrller();
-
- int doneret; /* the ret fron done() */
- int oldemode; /* original error mode */
- int isdossyschged; /* was autoexec.bat or config.sys changed? */
- int iswinsyschged; /* was system.ini changed? */
- char appname[60]; /* cached app name */
- saint ics; /* is the component selected? */
- saint ifs; /* is the file selected? */
- saint iis; /* is the item selected? */
- saint ies; /* is the entry selected? */
- saint irs; /* is the reg key selected? */
- iinfo *ii; /* custom install info obj */
- bkbtn *btns[3]; /* 3 buttons */
- double spaceneeded; /* hard disk space needed */
- stcpath dirs; /* install source directory */
- iconobj icon; /* icon used by icon window */
- bkgauge *g; /* gauge dlg */
- oprdrini rdr; /* INI operation recorder */
- icwndobj icwnd; /* icon window */
- bkwndobj bkwnd; /* background window */
- installer ir; /* installer */
-
- /* return: 0 --- ok. stay in Windows 1 --- error */
- /* 2 --- ok. restart Windows 3 --- ok. quit to dos */
- /* 4 --- ok. restart DOS */
- virtual int run() = 0;
-
- int init(abspath &dirs); /* must be called to init the obj */
- int done();
- int askquit();
- int welcome(welstruct &b);
- int dofiles();
- int askuser(int issaveexe, int issaveini);
- int modconfig();
- int setregkeys();
- int modautoexec();
- int promptyn(char line1[], char line2[], char line3[], int ctid);
- int promptstr(psstruct &b);
- int searchfile(abspath &startdir, abspath &filespec, int isinclsub, varpath *path = 0);
- int searchfile(abspath &startdir, abspath &filespec, int isinclsub, varpath *path, fimd *md);
- int getdoneret();
- int createitems();
- int selectcomps();
- int setinientries();
- int setinientriessimple();
- int getspaceneeded();
- int chkcompselected(int cidx);
- int forceexist(char disk[], abspath &path);
- int askinsertdisk(char disk[]);
- int moddos(int iscfig);
- int mergecfig(char dstl[], char srcl[], char addl[]);
- int mergeauto(char dstl[], char srcl[], char addl[]);
- int chkminz();
- int tryclose(abswndobj &w);
- int chkpathst(char s[], char paths[]);
- int initgadget(int i, int x, int y);
- void free(); /* must be called to free the obj */
- void error(char fmt[], ...);
- void errormem();
- void movelog();
- void cleanup();
- void getdirsrc(varpath *d);
- void maxzbkwnd();
- void minzbkwnd();
- void freegadgets();
- };
-
-