home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / C_C++ / VisualProgrammingArmoury / data1.cab / MyFileGroup / INCLUDE / PfUtils.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-06-23  |  7.2 KB  |  209 lines

  1. #ifndef _INC_PFUTILS_HPP
  2. #define _INC_PFUTILS_HPP
  3. class TC_CPfTimer;
  4. class TC_CPfHistory;
  5. class TC_CPfHistoryDlg;
  6. class TC_CPfCalendarDlg;
  7. class TC_CPfThreadKiller;
  8. class TC_CPfConnect;
  9.  extern  TC_CPsTxContext * tcTxCxt ;
  10. void tcExMsg (TC_CPsException & ex)  ;
  11.  
  12. // **********************************************************************
  13. class TC_CPfConnect 
  14. {
  15.  
  16. // **********************************************************************
  17. public: 
  18. class Helper 
  19. {
  20.     public:  TC_CPsDataDriver * m_DataDrv ;
  21.     public:  TC_CPsDataService * m_DataService ;
  22.     public:   ~Helper ()  ;
  23.     public:  void Create ()  ;
  24.     public:  void Destroy ()  ;
  25.     public:  BOOL IsExists ()  ;
  26.  
  27. }; // end of class Helper
  28.  
  29. // **********************************************************************
  30.     public:  static  TC_CString m_Srv ;
  31.     public:  static  TC_CString m_DB ;
  32.     public:  static  TC_CString m_Usr ;
  33.     public:  static  TC_CString m_Pwd ;
  34.     public:  static  Helper m_Helper ;
  35.     public:  static  TC_CString m_DrvName ;
  36.     public:  static  TC_CString m_ServiceName ;
  37.     public: static void RegPath (TC_CString &path)  ;
  38.     public: static BOOL Connect () TC_PS_THROW_FUNC ;
  39.     public: static TCPsRetCode DoConnect (const char *srv, const char *db, const char *usr, const char *pwd) TC_PS_THROW_FUNC ;
  40.     public: static TCPsRetCode Disconnect ()  ;
  41.  
  42. }; // end of class TC_CPfConnect
  43.  
  44. // **********************************************************************
  45.  
  46. // **********************************************************************
  47. class TC_CPfConnectDlg 
  48.     : public TC_CWindow
  49. {
  50.     public:   TC_CPfConnectDlg ()  ;
  51.     public:   ~TC_CPfConnectDlg ()  ;
  52.     public: virtual BOOL Form_Creator (TC_CWindow * frame)  ;
  53.     public: TC_CWindow * mc_Srv;
  54.     public: TC_CWindow * mc_DB;
  55.     public: TC_CWindow * mc_Usr;
  56.     public: TC_CWindow * mc_Pwd;
  57.     public: TC_CWindow * mc_Ok;
  58.     public: virtual BOOL Form_OnCreate ()  ;
  59.     public:  BOOL EvCreate (TC_Event*)  ;
  60.     public:  BOOL EvOk ()  ;
  61.     public:  BOOL EvCancel ()  ;
  62.     public:  BOOL EvChange_DB (TC_Event_CM *)  ;
  63.  
  64. }; // end of class TC_CPfConnectDlg
  65.  
  66. // **********************************************************************
  67. void tcMsg (char *fmt, ...)  ;
  68. TC_CDate tcCurDate ()  ;
  69. TC_CTime tcCurTime ()  ;
  70. extern char bmpAid [];
  71. extern char bmpCalendar [];
  72. TC_CIDataType * tcCreateDataType (TC_CPsAttribInfo & atInfo)  ;
  73. TC_CPsBuffer tcPsBuffer (TC_CIDataType *dataType)  ;
  74. BOOL tcAttrHasUIFlags (TC_CPsAttribInfo &ai, long flags)  ;
  75. TC_CPsAttribInfo tcClsHasAttrWithFlags (TCPsHClass hc, long flags)  ;
  76. TC_CPsAttribInfo tcGetSuperAgentInfo (TCPsHClass hClass)  ;
  77. void tcGetDefaultSortOrder (TCPsHClass hClass, TC_CPsSort &sort)  ;
  78.  
  79. // **********************************************************************
  80. class TC_CPfTimer 
  81. {
  82.     private:  UINT m_ID ;
  83.     private:  int m_TimeOut ;
  84.     private:  HWND m_hWnd ;
  85.     private:  BOOL m_IsSet ;
  86.     private:  static  UINT m_Count ;
  87.     public:   TC_CPfTimer (int time_out=200)  ;
  88.     public:   ~TC_CPfTimer ()  ;
  89.     public:  void Associate (HWND hWnd)  ;
  90.     public:  UINT ID ()  ;
  91.     public:  void Set (int time_out = 0)  ;
  92.     public:  void Kill ()  ;
  93.     public:  void Flush ()  ;
  94.     public:  BOOL IsSet ()  ;
  95.  
  96. }; // end of class TC_CPfTimer
  97.  
  98. // **********************************************************************
  99.  
  100. // **********************************************************************
  101. class TC_CPfHistory 
  102. {
  103.     private:  TC_CArrayString m_HistArr ;
  104.     private:  int m_Size ;
  105.     private:  int m_Current ;
  106.     private:  TC_CString m_RegPath ;
  107.     public:  int m_Selected ;
  108.     public:   TC_CPfHistory (int size=12)  ;
  109.     public:   TC_CPfHistory (const char *reg_path, int size=12)  ;
  110.     public:   ~TC_CPfHistory ()  ;
  111.     private:  void FromRegistry (const char * reg_path)  ;
  112.     private:  void ToRegistry ()  ;
  113.     public:  void Add (const char * str)  ;
  114.     public:  int Count ()  ;
  115.     public:  int GetPrev ()  ;
  116.     public:  TC_CString & operator [] (int idx)  ;
  117.     public:  const char * GetHistItem (int idx)  ;
  118.  
  119. }; // end of class TC_CPfHistory
  120.  
  121. // **********************************************************************
  122.  
  123. // **********************************************************************
  124. class TC_CPfHistoryDlg 
  125.     : public TC_CWindow
  126. {
  127.     private:  POINT m_InitPos ;
  128.     private:  TC_CPfHistory * m_History ;
  129.     public: static void Run (TC_CPfHistory *history, HWND hwndPar, int x=INT_MAX, int y=INT_MAX)  ;
  130.     public:  BOOL Form_Creator (TC_CWindow *frame)  ;
  131.     public: TC_CWindow * mc_List;
  132.     public:  void Init ()  ;
  133.     public:  BOOL EvRButton (TC_Event *)  ;
  134.     public:  BOOL EvCommand (TC_Event_WM * ev)  ;
  135.     public:  BOOL EvEscape (TC_Event *)  ;
  136.     public:  BOOL EvDblClk (TC_Event *)  ;
  137.  
  138. }; // end of class TC_CPfHistoryDlg
  139.  
  140. // **********************************************************************
  141.  
  142. // **********************************************************************
  143. class TC_CPfCalendarDlg 
  144.     : public TC_CWindow
  145. {
  146.     public: static char bmpPrev [];
  147.     public: static char bmpNext [];
  148.     private:  int m_DaysPerMonth ;
  149.     private:  int m_DaysPerPrevMonth ;
  150.     private:  int m_MonthOffset ;
  151.     private:  int m_ColCX ;
  152.     private:  int m_Today ;
  153.     private:  long * m_InitValue ;
  154.     private:  TC_CDate m_Date ;
  155.     private:  POINT m_InitPos ;
  156.     public:   TC_CPfCalendarDlg ()  ;
  157.     public:  BOOL Form_Creator (TC_CWindow *frame)  ;
  158.     public: TC_CWindow * mc_List;
  159.     public: TC_CWindow * mc_Hdr;
  160.     public: TC_CWindow * mc_Month;
  161.     public: TC_CWindow * mc_Year;
  162.     public:  void Init ()  ;
  163.     public:  void Set_LBItemSize (int cx, int cy)  ;
  164.     public:  void UpdateDate ()  ;
  165.     public:  void ChangeMonth (int delta, int day=0)  ;
  166.     public:  BOOL ChangeDay (int idx)  ;
  167.     public: virtual void* GetInterface (LPCSTR name)  ;
  168.     public: virtual const char* GetClassName ()  ;
  169.     public: virtual void WinName (TC_CString &dst)  ;
  170.     public:  BOOL EvCommand (TC_Event_WM * ev)  ;
  171.     public:  BOOL EvEscape (TC_Event *)  ;
  172.     public:  BOOL EvPrevMonth (TC_Event *)  ;
  173.     public:  BOOL EvNextMonth (TC_Event *)  ;
  174.     public:  BOOL EvDayChange (TC_Event_CM *)  ;
  175.     public:  BOOL EvMonthChange (TC_Event_CM *)  ;
  176.     public:  BOOL EvYearChange (TC_Event_CM *)  ;
  177.     public:  BOOL EvDayDblClk (TC_Event *)  ;
  178.     public:  BOOL EvRButton (TC_Event *)  ;
  179.     public:  BOOL Ev_List_WPCg (TC_Event_WM *e)  ;
  180.     public:  BOOL Ev_List_Keyb (TC_Event_WM *e)  ;
  181.     public:  BOOL Ev_List_Size (TC_Event*)  ;
  182.     public:  BOOL Ev_DrawLItem (TC_Event_WIN *e)  ;
  183.     public:  BOOL Ev_PaintHdr (TC_Event *)  ;
  184.     public:  int LIdx2DIdx (int index)  ;
  185.     public:  int DIdx2LIdx (int index)  ;
  186.     public: static void Run (long * val, HWND hwndPar, int x=INT_MAX, int y=INT_MAX)  ;
  187.  
  188. }; // end of class TC_CPfCalendarDlg
  189.  
  190. // **********************************************************************
  191.  
  192. // **********************************************************************
  193. class TC_CPfThreadKiller 
  194.     : public TC_CWindow
  195. {
  196.     public: static char bmpStop [];
  197.     public: static TC_CPfThreadKiller * Run (TC_CWindow *parent)  ;
  198.     public:  void Create (TC_CWindow * parent)  ;
  199.     public: TC_CWindow * mc_Stop;
  200.     public: TC_CWindow * mc_Status;
  201.     public:  BOOL EvKillThread (TC_Event *)  ;
  202.     public:  BOOL EvPopulateStatus (TC_Event_WM * ev)  ;
  203.  
  204. }; // end of class TC_CPfThreadKiller
  205.  
  206. // **********************************************************************
  207.  
  208. #endif // _INC_PFUTILS_HPP
  209.