home *** CD-ROM | disk | FTP | other *** search
- #ifndef _INC_PFUTILS_HPP
- #define _INC_PFUTILS_HPP
- class TC_CPfTimer;
- class TC_CPfHistory;
- class TC_CPfHistoryDlg;
- class TC_CPfCalendarDlg;
- class TC_CPfThreadKiller;
- class TC_CPfConnect;
- extern TC_CPsTxContext * tcTxCxt ;
- void tcExMsg (TC_CPsException & ex) ;
-
- // **********************************************************************
- class TC_CPfConnect
- {
-
- // **********************************************************************
- public:
- class Helper
- {
- public: TC_CPsDataDriver * m_DataDrv ;
- public: TC_CPsDataService * m_DataService ;
- public: ~Helper () ;
- public: void Create () ;
- public: void Destroy () ;
- public: BOOL IsExists () ;
-
- }; // end of class Helper
-
- // **********************************************************************
- public: static TC_CString m_Srv ;
- public: static TC_CString m_DB ;
- public: static TC_CString m_Usr ;
- public: static TC_CString m_Pwd ;
- public: static Helper m_Helper ;
- public: static TC_CString m_DrvName ;
- public: static TC_CString m_ServiceName ;
- public: static void RegPath (TC_CString &path) ;
- public: static BOOL Connect () TC_PS_THROW_FUNC ;
- public: static TCPsRetCode DoConnect (const char *srv, const char *db, const char *usr, const char *pwd) TC_PS_THROW_FUNC ;
- public: static TCPsRetCode Disconnect () ;
-
- }; // end of class TC_CPfConnect
-
- // **********************************************************************
-
- // **********************************************************************
- class TC_CPfConnectDlg
- : public TC_CWindow
- {
- public: TC_CPfConnectDlg () ;
- public: ~TC_CPfConnectDlg () ;
- public: virtual BOOL Form_Creator (TC_CWindow * frame) ;
- public: TC_CWindow * mc_Srv;
- public: TC_CWindow * mc_DB;
- public: TC_CWindow * mc_Usr;
- public: TC_CWindow * mc_Pwd;
- public: TC_CWindow * mc_Ok;
- public: virtual BOOL Form_OnCreate () ;
- public: BOOL EvCreate (TC_Event*) ;
- public: BOOL EvOk () ;
- public: BOOL EvCancel () ;
- public: BOOL EvChange_DB (TC_Event_CM *) ;
-
- }; // end of class TC_CPfConnectDlg
-
- // **********************************************************************
- void tcMsg (char *fmt, ...) ;
- TC_CDate tcCurDate () ;
- TC_CTime tcCurTime () ;
- extern char bmpAid [];
- extern char bmpCalendar [];
- TC_CIDataType * tcCreateDataType (TC_CPsAttribInfo & atInfo) ;
- TC_CPsBuffer tcPsBuffer (TC_CIDataType *dataType) ;
- BOOL tcAttrHasUIFlags (TC_CPsAttribInfo &ai, long flags) ;
- TC_CPsAttribInfo tcClsHasAttrWithFlags (TCPsHClass hc, long flags) ;
- TC_CPsAttribInfo tcGetSuperAgentInfo (TCPsHClass hClass) ;
- void tcGetDefaultSortOrder (TCPsHClass hClass, TC_CPsSort &sort) ;
-
- // **********************************************************************
- class TC_CPfTimer
- {
- private: UINT m_ID ;
- private: int m_TimeOut ;
- private: HWND m_hWnd ;
- private: BOOL m_IsSet ;
- private: static UINT m_Count ;
- public: TC_CPfTimer (int time_out=200) ;
- public: ~TC_CPfTimer () ;
- public: void Associate (HWND hWnd) ;
- public: UINT ID () ;
- public: void Set (int time_out = 0) ;
- public: void Kill () ;
- public: void Flush () ;
- public: BOOL IsSet () ;
-
- }; // end of class TC_CPfTimer
-
- // **********************************************************************
-
- // **********************************************************************
- class TC_CPfHistory
- {
- private: TC_CArrayString m_HistArr ;
- private: int m_Size ;
- private: int m_Current ;
- private: TC_CString m_RegPath ;
- public: int m_Selected ;
- public: TC_CPfHistory (int size=12) ;
- public: TC_CPfHistory (const char *reg_path, int size=12) ;
- public: ~TC_CPfHistory () ;
- private: void FromRegistry (const char * reg_path) ;
- private: void ToRegistry () ;
- public: void Add (const char * str) ;
- public: int Count () ;
- public: int GetPrev () ;
- public: TC_CString & operator [] (int idx) ;
- public: const char * GetHistItem (int idx) ;
-
- }; // end of class TC_CPfHistory
-
- // **********************************************************************
-
- // **********************************************************************
- class TC_CPfHistoryDlg
- : public TC_CWindow
- {
- private: POINT m_InitPos ;
- private: TC_CPfHistory * m_History ;
- public: static void Run (TC_CPfHistory *history, HWND hwndPar, int x=INT_MAX, int y=INT_MAX) ;
- public: BOOL Form_Creator (TC_CWindow *frame) ;
- public: TC_CWindow * mc_List;
- public: void Init () ;
- public: BOOL EvRButton (TC_Event *) ;
- public: BOOL EvCommand (TC_Event_WM * ev) ;
- public: BOOL EvEscape (TC_Event *) ;
- public: BOOL EvDblClk (TC_Event *) ;
-
- }; // end of class TC_CPfHistoryDlg
-
- // **********************************************************************
-
- // **********************************************************************
- class TC_CPfCalendarDlg
- : public TC_CWindow
- {
- public: static char bmpPrev [];
- public: static char bmpNext [];
- private: int m_DaysPerMonth ;
- private: int m_DaysPerPrevMonth ;
- private: int m_MonthOffset ;
- private: int m_ColCX ;
- private: int m_Today ;
- private: long * m_InitValue ;
- private: TC_CDate m_Date ;
- private: POINT m_InitPos ;
- public: TC_CPfCalendarDlg () ;
- public: BOOL Form_Creator (TC_CWindow *frame) ;
- public: TC_CWindow * mc_List;
- public: TC_CWindow * mc_Hdr;
- public: TC_CWindow * mc_Month;
- public: TC_CWindow * mc_Year;
- public: void Init () ;
- public: void Set_LBItemSize (int cx, int cy) ;
- public: void UpdateDate () ;
- public: void ChangeMonth (int delta, int day=0) ;
- public: BOOL ChangeDay (int idx) ;
- public: virtual void* GetInterface (LPCSTR name) ;
- public: virtual const char* GetClassName () ;
- public: virtual void WinName (TC_CString &dst) ;
- public: BOOL EvCommand (TC_Event_WM * ev) ;
- public: BOOL EvEscape (TC_Event *) ;
- public: BOOL EvPrevMonth (TC_Event *) ;
- public: BOOL EvNextMonth (TC_Event *) ;
- public: BOOL EvDayChange (TC_Event_CM *) ;
- public: BOOL EvMonthChange (TC_Event_CM *) ;
- public: BOOL EvYearChange (TC_Event_CM *) ;
- public: BOOL EvDayDblClk (TC_Event *) ;
- public: BOOL EvRButton (TC_Event *) ;
- public: BOOL Ev_List_WPCg (TC_Event_WM *e) ;
- public: BOOL Ev_List_Keyb (TC_Event_WM *e) ;
- public: BOOL Ev_List_Size (TC_Event*) ;
- public: BOOL Ev_DrawLItem (TC_Event_WIN *e) ;
- public: BOOL Ev_PaintHdr (TC_Event *) ;
- public: int LIdx2DIdx (int index) ;
- public: int DIdx2LIdx (int index) ;
- public: static void Run (long * val, HWND hwndPar, int x=INT_MAX, int y=INT_MAX) ;
-
- }; // end of class TC_CPfCalendarDlg
-
- // **********************************************************************
-
- // **********************************************************************
- class TC_CPfThreadKiller
- : public TC_CWindow
- {
- public: static char bmpStop [];
- public: static TC_CPfThreadKiller * Run (TC_CWindow *parent) ;
- public: void Create (TC_CWindow * parent) ;
- public: TC_CWindow * mc_Stop;
- public: TC_CWindow * mc_Status;
- public: BOOL EvKillThread (TC_Event *) ;
- public: BOOL EvPopulateStatus (TC_Event_WM * ev) ;
-
- }; // end of class TC_CPfThreadKiller
-
- // **********************************************************************
-
- #endif // _INC_PFUTILS_HPP
-