home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vgserv45.zip / BASE / HPTWGS2 / include / fcwuirec.h < prev    next >
C/C++ Source or Header  |  2001-03-21  |  16KB  |  476 lines

  1. /*****************************************************************************/
  2. /*                                                                           */
  3. /*                           OCO SOURCE MATERIALS                            */
  4. /*                             IBM CONFIDENTIAL                              */
  5. /*                                    OR                                     */
  6. /*                        IBM CONFIDENTIAL RESTRICTED                        */
  7. /*            WHEN COMBINED WITH THE AGGREGATED OCO SOURCE MODULES           */
  8. /*                           FOR THIS PROGRAM PRODUCT                        */
  9. /*                                                                           */
  10. /*   VisualAge Generator Server for OS/2, AIX, HP-UX, SUN, and Windows NT    */
  11. /*                          Version 4.0  5697-C28                            */
  12. /*                    (C) COPYRIGHT IBM CORP. 1994,1999                      */
  13. /*                                                                           */
  14. /*****************************************************************************/
  15. /*    Date     Userid          Description of problem                        */
  16. /*  08/17/99   Lui        D11871  -  Unicode Support                         */
  17. /*  12/07/99   mheitz     D12562  -  PutData writes past end of buffer       */
  18. /*  06/12/00   mheitz     D13176  -  UI state not updated after call         */
  19. /*  07/07/00   mheitz     D13994  -  Add constructor w/ quadnum to UIRItems  */
  20. /*****************************************************************************/
  21.  
  22. #ifndef FCWUIREC_H
  23. #define FCWUIREC_H
  24.  
  25. #include <fcwexpu.h>
  26.  
  27. /*-------------------------------------------------------------------------*/
  28. /*  Misc definitions for UIRecords                                         */
  29. /*-------------------------------------------------------------------------*/
  30.  
  31. const char UIRC[4] = {'\xAA','\xAA','\xAA','\xAA'};
  32. const char FERR[4] = {'\xBB','\xBB','\xBB','\xBB'};
  33.  
  34. #define UIBUF_SIZE  32500  /* D12562 */
  35.  
  36. #define UIRC_HDRSIZE  28
  37. typedef struct
  38. {
  39.    char  id[4];                        /* id = UIRC                        */
  40.    char  bean[18];                     /* record / bean name               */
  41.    char  fill1[2];                     /* filler for alignment             */
  42.    long  segment_count;                /* number of record segments        */
  43.    char  segments[1];                  /* string of UIR segments           */
  44. }  UIRECORD;
  45.  
  46.  
  47. #define UIRS_HDRSIZE  8
  48. typedef struct
  49. {
  50.    long  segment_offset;               /* offset of segment in record      */
  51.    long  segment_length;               /* number of bytes of segment data  */
  52.    char  segment_data[1];              /* segment data                     */
  53. }  UIRSEGMENT;
  54.  
  55.  
  56. #define FERR_HDRSIZE  32
  57. typedef struct
  58. {
  59.    char  id[4];                        /* id = FERR                        */
  60.    char  bean[18];                     /* record / bean name               */
  61.    char  fill1[2];                     /* filler for alignment             */
  62.    long  field_offset;                 /* offset of field in error         */
  63.    long  text_len;                     /* total text length                */
  64.    char  text[1];                      /* null terminated text             */
  65. }  UIFIELDERR;
  66.  
  67. /*-------------------------------------------------------------------------*/
  68. /*  Class definition for User Interface Record (UIRecord)                  */
  69. /*-------------------------------------------------------------------------*/
  70. class UIRItem;
  71.  
  72. class UIRecord : public Record
  73. {
  74.   friend class UIRDriver;
  75.  
  76.   private:
  77.     void*           pData;
  78.     Bool            bInitial;
  79.     Bool            bBypassSegmentIn;
  80.     char            recName[18];
  81.     Bool            recInError;
  82.     FCWApp*         pAppl;
  83.     LIST(UIRItem*)  LUIRItems;
  84.     long            hashCode;
  85.  
  86.   protected:
  87.                     UIRecord (char* n, long l);
  88.     virtual         ~UIRecord();
  89.  
  90.     UIRSEGMENT*     BuildUIRC( UIRECORD* );
  91.     long            BuildUIRSegments( UIRSEGMENT*, long* );
  92.     Bool            BypassSegmentIn();
  93.     void            SetUIRItemModified( long offSet );
  94.     long            GetData( void* );
  95.     Bool            IsInitial();
  96.     FCWApp*         pApp();
  97.     void            ResetInitial();
  98.     void            ResetModified();
  99.     void            ResetSelected();
  100.     void            SetBypassSegmentIn( Bool bp );
  101.     virtual void    StatementGroupEdits() {};
  102.     void            UpdateItems( UIRECORD* );
  103.     void            ValidateGWS( void* );
  104.  
  105.   public:
  106.     void            AddUIRItem( UIRItem* );
  107.     void            Converse();
  108.     UIRItem*        GetUIRItem( int );
  109.     Bool            IsAnyModified();
  110.     Bool            IsError();
  111.     char*           Name();
  112.     void            PutData( void* );
  113.     void            ResetError();
  114.     void            SetClear();
  115.     void            SetError();
  116.     void            SetSelected();   /* D13176 */
  117.     virtual long    GetHashCode() = 0;
  118.     void            VerifyAndRetrieveFirstUI();
  119.  
  120. };
  121.  
  122. /*-------------------------------------------------------------------------*/
  123. /*  Declare forward references                                             */
  124. /*-------------------------------------------------------------------------*/
  125.  
  126. class MAPDBCS;
  127. class TBLDBCS;
  128.  
  129. /*-------------------------------------------------------------------------*/
  130. /*  Class definition for User Interface Record Item                        */
  131. /*-------------------------------------------------------------------------*/
  132.  
  133. class UIRItem
  134. {
  135.    public:
  136.  
  137.      Bool         IsAnyModified();
  138.      Bool         IsModified();
  139.      Bool         IsModified(int);
  140.      void         ResetModified();
  141.      void         SetModified();
  142.      void         SetModified( int );
  143.      Bool         TestModified();
  144.  
  145.      void         ClearSelected();
  146.      Bool         IsSelected();
  147.      Bool         IsSelected( int );
  148.      void         SetSelected();
  149.      void         SetSelected( int );
  150.  
  151.    protected:
  152.                   UIRItem();
  153.                   UIRItem( int );
  154.                   UIRItem( const UIRItem&, int );
  155.                   ~UIRItem();
  156.  
  157.    private:
  158.  
  159.      Bool         bAllocated;         /* This obj allocated the other flags*/
  160.      Bool*        bModified;           /* item was changed by the user     */
  161.      Bool*        bSelected;           /* item was changed by the program  */
  162.                                        /*  or user                         */
  163.      int          occurs;
  164.  
  165. };
  166.  
  167.  
  168. /*-------------------------------------------------------------------------*/
  169. /*  Class definition for UIRBIN2 Item                                      */
  170. /*-------------------------------------------------------------------------*/
  171.  
  172. class UIRBIN2 : public BIN2, public UIRItem
  173. {
  174.  
  175.   public:
  176.  
  177.     UIRBIN2 (UIRecord&, Level, int, int, int, int, int=0);
  178.     UIRBIN2 (const UIRBIN2&, int);
  179.     UIRBIN2 (const UIRBIN2&, quadnum); /* D13994 */
  180.     virtual ~UIRBIN2();
  181.  
  182.     void    operator = (const UIRBIN2&);
  183.     void    operator = (const quadnum& v);
  184.     UIRBIN2 operator [] (quadnum) const;
  185.  
  186.   private:
  187.     void*    pData;
  188. };
  189.  
  190. /*-------------------------------------------------------------------------*/
  191. /*  Class definition for UIRBIN4 Item                                      */
  192. /*-------------------------------------------------------------------------*/
  193.  
  194. class UIRBIN4 : public BIN4, public UIRItem
  195. {
  196.  
  197.   public:
  198.  
  199.     UIRBIN4 (UIRecord&, Level, int, int, int, int, int=0);
  200.     UIRBIN4 (const UIRBIN4&, int);
  201.     UIRBIN4 (const UIRBIN4&, quadnum); /* D13994 */
  202.     virtual ~UIRBIN4();
  203.  
  204.     void    operator = (const UIRBIN4&);
  205.     void    operator = (const quadnum& v);
  206.     UIRBIN4 operator [] (quadnum) const;
  207.  
  208.   private:
  209.     void*    pData;
  210. };
  211.  
  212. /*-------------------------------------------------------------------------*/
  213. /*  Class definition for UIRBIN8 Item                                      */
  214. /*-------------------------------------------------------------------------*/
  215.  
  216. class UIRBIN8 : public BIN8, public UIRItem
  217. {
  218.  
  219.   public:
  220.  
  221.     UIRBIN8 (UIRecord&, Level, int, int, int, int, int=0);
  222.     UIRBIN8 (const UIRBIN8&, int);
  223.     UIRBIN8 (const UIRBIN8&, quadnum); /* D13994 */
  224.     virtual ~UIRBIN8();
  225.  
  226.     void    operator = (const UIRBIN8&);
  227.     void    operator = (const quadnum& v);
  228.     UIRBIN8 operator [] (quadnum) const;
  229.  
  230.   private:
  231.     void*    pData;
  232. };
  233.  
  234. /*-------------------------------------------------------------------------*/
  235. /*  Class definition for UIRCHA Item                                       */
  236. /*-------------------------------------------------------------------------*/
  237.  
  238. class UIRCHA : public CHA, public UIRItem
  239. {
  240.  
  241.   public:
  242.  
  243.     UIRCHA (UIRecord&, Level, int, int, int, int);
  244.     UIRCHA (const UIRCHA&, int);
  245.     UIRCHA (const UIRCHA&, quadnum); /* D13994 */
  246.     virtual ~UIRCHA();
  247.  
  248.     void SetEmpty() const;
  249.  
  250.     void   operator = (const CHA& v);
  251.     void   operator = (const UIRCHA& v);
  252.     void   operator = (const HEX& v);
  253.     void   operator = (const MIX& v);
  254.     void   operator = (const NUM& v);
  255.     void   operator = (const char *v);
  256.     void   operator = (const quadnum& v );
  257.     void   operator = (const int v );
  258.     UIRCHA operator [] (quadnum) const;
  259.  
  260.   private:
  261.     void*    pData;
  262. };
  263.  
  264. /*-------------------------------------------------------------------------*/
  265. /*  Class definition for UIRMIX Item                                       */
  266. /*-------------------------------------------------------------------------*/
  267.  
  268. class UIRMIX : public MIX, public UIRItem
  269. {
  270.  
  271.   public:
  272.  
  273.     UIRMIX (UIRecord&, Level, int, int, int, int);
  274.     UIRMIX (const UIRMIX&, int);
  275.     UIRMIX (const UIRMIX&, quadnum); /* D13994 */
  276.     virtual ~UIRMIX();
  277.  
  278.     void    operator = (const CHA& v);
  279.     void    operator = (const MIX& v);
  280.     void    operator = (const UIRCHA& v);
  281.     void    operator = (const UIRMIX& v);
  282.     void    operator = (const char *v);
  283.     UIRMIX  operator [] (quadnum) const;
  284.  
  285.   private:
  286.     void*    pData;
  287. };
  288.  
  289. /*-------------------------------------------------------------------------*/
  290. /*  Class definition for UIRDBCS Item                                      */
  291. /*-------------------------------------------------------------------------*/
  292.  
  293. class UIRDBCS : public DBCS, public UIRItem
  294. {
  295.  
  296.   public:
  297.  
  298.     UIRDBCS (UIRecord&, Level, int, int, int, int);
  299.     UIRDBCS (const UIRDBCS&, int);
  300.     UIRDBCS (const UIRDBCS&, quadnum); /* D13994 */
  301.     virtual ~UIRDBCS();
  302.  
  303.     void    operator = (const DBCS& v);
  304.     void    operator = (const UIRDBCS& v);
  305.     void    operator = (const char *v);
  306.     UIRDBCS operator [] (quadnum) const;
  307.  
  308.   private:
  309.     void*    pData;
  310. };
  311.  
  312. /*-------------------------------------------------------------------------*/
  313. /*  Class definition for UIRUNICODE Item                      @11871       */
  314. /*-------------------------------------------------------------------------*/
  315.  
  316. class UIRUNICODE : public UNICODE, public UIRItem
  317. {
  318.  
  319.   public:
  320.  
  321.     UIRUNICODE (UIRecord&, Level, int, int, int, int);
  322.     UIRUNICODE (const UIRUNICODE&, int);
  323.     UIRUNICODE (const UIRUNICODE&, quadnum); /* D13994 */
  324.     virtual ~UIRUNICODE();
  325.  
  326.     void    operator = (const UNICODE& v);
  327.     void    operator = (const UIRUNICODE& v);
  328.     UIRUNICODE operator [] (quadnum) const;
  329.  
  330.   private:
  331.     void*    pData;
  332. };
  333.  
  334. /*-------------------------------------------------------------------------*/
  335. /*  Class definition for UIRHEX Item                                       */
  336. /*-------------------------------------------------------------------------*/
  337.  
  338. class UIRHEX : public HEX, public UIRItem
  339. {
  340.  
  341.   public:
  342.  
  343.     UIRHEX (UIRecord&, Level, int, int, int, int);
  344.     UIRHEX (const UIRHEX&, int);
  345.     UIRHEX (const UIRHEX&, quadnum); /* D13994 */
  346.     virtual ~UIRHEX();
  347.  
  348.     void   operator = (const HEX& v);
  349.     void   operator = (const CHA& v);
  350.     void   operator = (const UIRHEX& v);
  351.     void   operator = (const char* v);
  352.     UIRHEX operator [] (quadnum) const;
  353.  
  354.   private:
  355.     void*    pData;
  356. };
  357.  
  358.  
  359. /*-------------------------------------------------------------------------*/
  360. /*  Class definition for UIRNUM Item                                       */
  361. /*-------------------------------------------------------------------------*/
  362.  
  363. class UIRNUM : public NUM, public UIRItem
  364. {
  365.  
  366.   public:
  367.  
  368.     UIRNUM (UIRecord&, Level, int, int, int, int, int=0);
  369.     UIRNUM (const UIRNUM&, int);
  370.     UIRNUM (const UIRNUM&, quadnum); /* D13994 */
  371.     virtual ~UIRNUM();
  372.  
  373.     void   operator = (const CHA&);
  374.     void   operator = (const NUM&);
  375.     void   operator = (const UIRCHA& v);
  376.     void   operator = (const UIRNUM& v);
  377.     void   operator = (const quadnum& v);
  378.     UIRNUM operator [] (quadnum) const;
  379.  
  380.   private:
  381.     void*    pData;
  382. };
  383.  
  384. /*-------------------------------------------------------------------------*/
  385. /*  Class definition for UIRNUMC Item                                      */
  386. /*-------------------------------------------------------------------------*/
  387.  
  388. class UIRNUMC : public NUMC, public UIRItem
  389. {
  390.  
  391.   public:
  392.  
  393.     UIRNUMC (UIRecord&, Level, int, int, int, int, int=0);
  394.     UIRNUMC (const UIRNUMC&, int);
  395.     UIRNUMC (const UIRNUMC&, quadnum); /* D13994 */
  396.     virtual ~UIRNUMC();
  397.  
  398.     void    operator = (const NUMC&);
  399.     void    operator = (const UIRNUMC& v);
  400.     void    operator = (const quadnum& v);
  401.     UIRNUMC operator [] (quadnum) const;
  402.  
  403.   private:
  404.     void*    pData;
  405. };
  406.  
  407. /*-------------------------------------------------------------------------*/
  408. /*  Class definition for UIRPACK Item                                      */
  409. /*-------------------------------------------------------------------------*/
  410.  
  411. class UIRPACK : public PACK, public UIRItem
  412. {
  413.  
  414.   public:
  415.  
  416.     UIRPACK (UIRecord&, Level, int, int, int, int, int=0);
  417.     UIRPACK (const UIRPACK&, int);
  418.     UIRPACK (const UIRPACK&, quadnum); /* D13994 */
  419.     virtual ~UIRPACK();
  420.  
  421.     void    operator = (const PACK&);
  422.     void    operator = (const UIRPACK& v);
  423.     void    operator = (const quadnum& v);
  424.     UIRPACK operator [] (quadnum) const;
  425.  
  426.   private:
  427.     void*    pData;
  428. };
  429.  
  430. /*-------------------------------------------------------------------------*/
  431. /*  Class definition for UIRPACF Item                                      */
  432. /*-------------------------------------------------------------------------*/
  433.  
  434. class UIRPACF : public PACF, public UIRItem
  435. {
  436.  
  437.   public:
  438.  
  439.     UIRPACF (UIRecord&, Level, int, int, int, int, int=0);
  440.     UIRPACF (const UIRPACF&, int);
  441.     UIRPACF (const UIRPACF&, quadnum); /* D13994 */
  442.     virtual ~UIRPACF();
  443.  
  444.     void    operator = (const PACF&);
  445.     void    operator = (const UIRPACF& v);
  446.     void    operator = (const quadnum& v);
  447.     UIRPACF operator [] (quadnum) const;
  448.  
  449.   private:
  450.     void*    pData;
  451. };
  452.  
  453. /*-------------------------------------------------------------------------*/
  454. /*  Class definition for CSOUIERR record                                   */
  455. /*-------------------------------------------------------------------------*/
  456.  
  457. struct rcdCSOERRORUIR_ : public UIRecord
  458. {
  459.         UIRCHA      PGMNAME_ ;
  460.         UIRCHA      ERRDATE_ ;
  461.         UIRCHA      ERRTIME_ ;
  462.         UIRBIN4     MSGCOUNT_ ;
  463.         UIRCHA      ERRMSG_ ;
  464.  
  465. rcdCSOERRORUIR_ () : UIRecord ( "CSOERRORUIR" , 10077 ) ,
  466.         PGMNAME_       ( *this , Leaf , 1, 0, 0, 50 ) ,
  467.         ERRDATE_       ( *this , Leaf , 1, 0, 50, 15 ) ,
  468.         ERRTIME_       ( *this , Leaf , 1, 0, 65, 8 ) ,
  469.         MSGCOUNT_      ( *this , Leaf , 1, 0, 73, 9 , 0 ) ,
  470.         ERRMSG_        ( *this , Leaf , 40, 250, 77, 250 )
  471.         {};
  472.         long GetHashCode()  { return 0x00000687; }
  473. };
  474.  
  475. #endif
  476.