home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pc3270sa.zip / ecloia.hpp < prev    next >
C/C++ Source or Header  |  2002-02-28  |  6KB  |  167 lines

  1. //-------------------------------------------------------------------------------
  2. // Module:  ecloia.hpp
  3. //-------------------------------------------------------------------------------
  4. //
  5. // Description:  ECLOIA class definitions.
  6. //
  7. //-------------------------------------------------------------------------------
  8. // Copyright Notice: IBM Personal Communication/3270 Version 4.3
  9. //                   (C) COPYRIGHT IBM CORP. 1989,1998 - PROGRAM PROPERTY
  10. //                   OF IBM ALL RIGHTS RESERVED
  11. //-------------------------------------------------------------------------------
  12.  
  13. #include "eclall.hpp"
  14. #ifndef _ECLOIA_HPP_
  15. #define _ECLOIA_HPP_
  16.  
  17. #define    HL_OIA_SYSAPP_AVAILABLE                                3                    
  18.  
  19.  
  20. // Enumeration for InputInhibited method
  21. enum INHIBIT_REASON {
  22.   NotInhibited   = 0,
  23.   SystemWait     = 1,
  24.   CommCheck      = 2,
  25.   ProgCheck      = 3,
  26.   MachCheck      = 4,
  27.   OtherInhibit   = 5
  28. };
  29.  
  30. // Definition of GetStatusFlags bit flags
  31. const ULONG OIAFLAG_ALPHANUM =   0x80000000;
  32. const ULONG OIAFLAG_APL      =   0x40000000;
  33. const ULONG OIAFLAG_KATAKANA =   0x20000000;
  34. const ULONG OIAFLAG_HIRAGANA =   0x10000000;
  35. const ULONG OIAFLAG_DBCS     =   0x08000000;
  36. const ULONG OIAFLAG_UPSHIFT  =   0x04000000;
  37. const ULONG OIAFLAG_NUMERIC  =   0x02000000;  
  38. const ULONG OIAFLAG_CAPSLOCK =   0x01000000;
  39. const ULONG OIAFLAG_INSERT   =   0x00800000;
  40. const ULONG OIAFLAG_COMMERR  =   0x00400000;
  41. const ULONG OIAFLAG_MSGWAIT  =   0x00200000;
  42. const ULONG OIAFLAG_ENCRYPTED =  0x00100000;  // SSL indicator          
  43. const ULONG OIAFLAG_INHIBMASK=   0x0000000F;  // Mask for inhibit reason
  44. const ULONG HODSTATE_SCREEN_REVERSE   = 0x00800000;
  45. const ULONG HODSTATE_LANGUAGE_LAYER   = 0x01000000;
  46. const ULONG HODSTATE_CURSOR_DIRECTION = 0x02000000;
  47. const ULONG HODSTATE_AUTOREVERSE      = 0x04000000;
  48. const ULONG HODSTATE_NUMFIELD         = 0x08000000;
  49. const ULONG HODSTATE_AUTOPUSH         = 0x10000000;
  50. const ULONG HODSTATE_AUTOSHAPE        = 0x20000000;
  51. const ULONG HODSTATE_PUSH             = 0x40000000;
  52.  
  53. const ULONG HODSTATE_BASE       =  2;                     
  54. const ULONG HODSTATE_CSD        =  1;                     
  55. const ULONG HODSTATE_ISOLATED   =  2;
  56. const ULONG HODSTATE_INITIAL    =  3;
  57. const ULONG HODSTATE_MIDDLE     =  4;
  58. const ULONG HODSTATE_FINAL      =  5;
  59.  
  60. // Definition for GetOwner return values @sm4
  61. const int OIAOWNER_MYJOB = 1; 
  62. const int OIAOWNER_NVT = 2; 
  63. const int OIAOWNER_UNOWNED = 3; 
  64. const int OIAOWNER_SSCP = 4; 
  65. const int OIAOWNER_UNKNOWN = -1; 
  66.  
  67.  
  68. class ECLOIAData;                           // Foreward declaration 
  69. class DllExport ECLOIA : public ECLConnection
  70. {
  71.   private: // Class private data
  72.     ECLOIAData   *pd;                           
  73.  
  74.   private: // Constructors and operators not allowed on this object
  75.     ECLOIA();
  76.     ECLOIA(const ECLOIA &From);
  77.     ECLOIA& operator= (const ECLOIA &From);
  78.     char operator[](BYTE nPos)const;                    
  79.  
  80.   public:
  81.  
  82.     // Constructor/destructor
  83.     ECLOIA(char ConnName);
  84.     ECLOIA(long ConnHandle);
  85.     ~ECLOIA();
  86.  
  87.     // ECLOIA property access methods
  88.     BOOL IsAlphanumeric() const;
  89.     BOOL IsAPL() const;
  90.     BOOL IsKatakana() const;
  91.     BOOL IsHiragana() const;
  92.     BOOL IsDBCS() const;
  93.     BOOL IsUpperShift() const;
  94.     BOOL IsNumeric() const;
  95.     BOOL IsCapsLock() const;
  96.     BOOL IsInsertMode() const;
  97.     BOOL IsCommErrorReminder() const;
  98.     BOOL IsMessageWaiting() const;
  99.     INHIBIT_REASON InputInhibited() const;
  100.     ULONG GetStatusFlags() const;
  101.     ULONG GetBidiStatusFlags() const;                    
  102.  
  103.     // New methods in PComm Version 4.3
  104.     void RegisterOIAEvent(ECLOIANotify *Observer, BOOL InitEvent=TRUE);
  105.     void UnregisterOIAEvent(ECLOIANotify *Observer);
  106.     // Implementation Not for documentation
  107.     BOOL IsApplicationAvailable() const;                
  108.     // Implementation Not for documentation
  109.     BOOL IsSystemAvailable() const;                     
  110.     BOOL WaitForInputReady(long nTimeOut = INFINITE);
  111.     BOOL WaitForSystemAvailable(long nTimeOut = INFINITE);
  112.     BOOL WaitForAppAvailable(long nTimeOut = INFINITE);
  113.     BOOL WaitForTransition(BYTE nIndex = HL_OIA_SYSAPP_AVAILABLE, long nTimeOut = INFINITE);
  114.     // Implementation Not for documentation
  115.     void CancelWait();                                                  
  116.  
  117.   protected:
  118.     // Implementation Not for documentation
  119.     HANDLE m_hWaitEvent;                                                
  120.     // Implementation Not for documentation
  121.     BOOL DoWait(ULONG nTrigger, BYTE nIndex = 0xFF, 
  122.         long nTimeOut = INFINITE);
  123.     // Implementation Not for documentation
  124.     char GetCharAt(BYTE nPos) const;                    
  125.  
  126.   // Methods for status codes
  127.   public:
  128.     // Implementation Not for documentation
  129.     int GetProgCheckCode() const;         
  130.     int GetCommCheckCode() const;         
  131.     int GetMachineCheckCode() const;      
  132.     int GetCommRemindCode() const;        
  133.  
  134.     // Implementation Not for documentation
  135.     int GetOwner() const;          
  136.  
  137.     // Implementation Not for documentation
  138.     friend class OIAWaitNotify;
  139. };
  140.  
  141. typedef ECLOIA * PECLOIA;
  142.  
  143. // Implementation Not for documentation
  144. class OIAWaitNotify:public ECLOIANotify
  145. {
  146. protected:
  147.     ECLOIA* m_pOIA;
  148.     BOOL m_bCondMet;
  149.     ULONG m_nTrigger;
  150.     char m_cPosValue;
  151.     BYTE m_nPosToWatch;
  152.     HANDLE m_hEvent;
  153.  
  154. public:
  155.     OIAWaitNotify(ECLOIA* OIAObj, ULONG nTrigger, BYTE nPos = 0xFF);
  156.     ~OIAWaitNotify();                                   
  157.  
  158.     void NotifyEvent(ECLOIA* OIAObj);
  159.     void NotifyStop(ECLOIA* OIAObj, int Reason);
  160.     void NotifyError(ECLOIA* OIAObj, ECLErr ErrObj);
  161.  
  162.     HANDLE GetEvent(){return m_hEvent;}
  163.     BOOL   IsCondMet(){return m_bCondMet;}
  164. };
  165.  
  166. #endif //_ECLOIA_HPP_
  167.