home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / mapi / win16 / dev / tablevu / tblview.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  7.3 KB  |  382 lines

  1. /*
  2.  -  T B L V I E W . H
  3.  -  Copyright (C) 1995 Microsoft Corporation
  4.  -
  5.  *  Purpose:
  6.  *      Header for TBLVIEW.CPP
  7.  *
  8.  */
  9.  
  10. #ifndef __TBLVIEW_H__
  11. #define __TBLVIEW_H__
  12.  
  13.  
  14. #define VALUES_LB_HOR_SIZE  2000
  15. #define VALUES_LB_TAB1      140
  16. #define VALUES_LB_TAB2      40
  17.  
  18. typedef struct _bk
  19. {
  20.     BOOKMARK        bk;
  21.     LPSPropValue    lpProp;
  22. }BK, FAR *LPBK;
  23.  
  24. #define BKLIST_MAX  100
  25.  
  26. typedef struct _bklist
  27. {
  28.     ULONG       cValues;
  29.     BK          bkList[BKLIST_MAX];
  30. }BKLIST, FAR *LPBKLIST;
  31.  
  32.         
  33.  
  34. /*
  35.  -  CTblDlg
  36.  -
  37.  *  Purpose:
  38.  *
  39.  *
  40.  */
  41.  
  42. class CTblDlg : public CModalDialog
  43. {
  44. private:
  45.     LPMAPITABLE     m_lpTable;
  46.     LPSRestriction  m_lpRes;
  47.     LPSSortOrderSet m_lpSort;
  48.     ULONG           m_ulptDisplay;
  49.     ULONG           m_cRows;
  50.     BKLIST          m_BookMarks;
  51.  
  52. public:
  53.     CTblDlg(LPMAPITABLE lpTbl, HWND hWnd = NULL);
  54.  
  55.     virtual BOOL    OnInitDialog();
  56.  
  57.     afx_msg void    OnSelDisplayValue();
  58.     afx_msg void    OnSetBookmark();
  59.     afx_msg void    OnForceSort();
  60.     afx_msg void    OnForceRestriction();
  61.     afx_msg void    OnGetStatus();
  62.     afx_msg void    OnQueryPosition();
  63.     afx_msg void    OnAbort();
  64.     afx_msg void    OnQuerySortOrder();
  65.     afx_msg void    OnGetLastError();
  66.     afx_msg void    OnGetRowCount();
  67.     
  68.     afx_msg void    OnFind();
  69.     afx_msg void    OnFreeBookmark();
  70.     afx_msg void    OnRestriction();
  71.     afx_msg void    OnSeek();
  72.     afx_msg void    OnSetColumns();
  73.     afx_msg void    OnSortOrder();
  74.     afx_msg void    OnClose();
  75.     afx_msg void    OnClearStatus();
  76.     afx_msg void    OnClearMapiLog();
  77.  
  78. private:
  79.     void    RenderTable();
  80.     void    RenderRow(ULONG cValues, LPSPropValue lpProps);
  81.     void    UpdateRow(LPMAPITABLE lpTable);
  82.  
  83.     DECLARE_MESSAGE_MAP();
  84. };
  85.  
  86.  
  87.  
  88. /*
  89.  -  CSortDlg
  90.  -
  91.  *  Purpose:
  92.  *
  93.  *
  94.  */
  95.  
  96. class CSortDlg : public CModalDialog
  97. {
  98. private:
  99.     LPMAPITABLE     m_lpTable;
  100.     LPSSortOrderSet *m_lppSort;
  101.     BOOL            fDesc;
  102.  
  103. public:
  104.     CSortDlg(LPMAPITABLE lpTbl, LPSSortOrderSet *lppsos, CWnd* lpParent = NULL)
  105.         : CModalDialog(IDD_SORTDLG, lpParent)
  106.     {
  107.         m_lpTable = lpTbl;
  108.         m_lppSort = lppsos;
  109.     }
  110.  
  111.     virtual BOOL OnInitDialog();
  112.     virtual void OnOK();
  113.     virtual void OnCancel();
  114.     
  115.     afx_msg void OnAdd();
  116.     afx_msg void OnAddDesc();
  117.     afx_msg void OnRemove();
  118.     afx_msg void OnRemoveAll();
  119.     afx_msg void OnAddHexValueA();
  120.     afx_msg void OnAddHexValueD();
  121.     afx_msg void OnAllMAPITags();
  122.  
  123.     DECLARE_MESSAGE_MAP();
  124. };
  125.  
  126.  
  127.  
  128. class CResDlg : public CModalDialog
  129. {
  130. private:
  131.     LPSPropTagArray m_lpCurColumns;
  132.     LPSRestriction  m_lpRes;
  133.     LPSRestriction  m_lpSubRes;
  134.     int             m_fComb;
  135.     int             m_nResType1;
  136.     int             m_nResType2;
  137.     int             m_nResType3;
  138.  
  139. public:
  140.     CResDlg(LPSPropTagArray lpspta, LPSRestriction lpr, CWnd* lpParent = NULL);
  141.  
  142.     virtual BOOL OnInitDialog();
  143.     virtual void OnOK();
  144.     virtual void OnCancel();
  145.     
  146.     afx_msg void OnAnd();
  147.     afx_msg void OnOr();
  148.     afx_msg void OnResType1();
  149.     afx_msg void OnResType2();
  150.     afx_msg void OnResType3();
  151.     afx_msg void OnSubRes1();
  152.     afx_msg void OnSubRes2();
  153.     afx_msg void OnSubRes3();
  154.  
  155.     DECLARE_MESSAGE_MAP();
  156. };
  157.  
  158. /*
  159.  -  CAcceptRestrictionDlg
  160.  -
  161.  *  Purpose:
  162.  *
  163.  *
  164.  */
  165.  
  166. class CAcceptRestrictionDlg : public CModalDialog
  167. {
  168. public:
  169.     LPSRestriction  m_prest;
  170.  
  171.     CAcceptRestrictionDlg( CWnd * pParentWnd)
  172.         : CDialog(ACCEPTRES, pParentWnd)
  173.         {
  174.             m_prest         = NULL;
  175.         }
  176.     
  177.     ~CAcceptRestrictionDlg();
  178.  
  179.     BOOL OnInitDialog();
  180.     afx_msg void OnModify();
  181.  
  182.     DECLARE_MESSAGE_MAP();
  183.   
  184.     void DisplayRestriction(LPSRestriction lpRes);
  185.  
  186. };
  187.  
  188.  
  189.  
  190. /*
  191.  -  CPickPropDlg
  192.  -
  193.  *  Purpose:
  194.  *
  195.  *
  196.  */
  197.  
  198. class CPickPropDlg : public CModalDialog
  199. {
  200. private:
  201.     LPSRow          m_lpRow;
  202.     DWORD *         m_lpdwIndex;
  203.  
  204. public:
  205.     CPickPropDlg(LPSRow lpsr, DWORD *lpdw, CWnd* lpParent = NULL)
  206.         : CModalDialog(IDD_PICKPROP, lpParent)
  207.     {
  208.         m_lpRow     = lpsr;
  209.         m_lpdwIndex = lpdw;
  210.     }
  211.  
  212.     virtual BOOL OnInitDialog();
  213.     virtual void OnOK();
  214.  
  215.     DECLARE_MESSAGE_MAP();
  216. };
  217.  
  218.  
  219.  
  220. /*
  221.  -  CSetColDlg
  222.  -
  223.  *  Purpose:
  224.  *
  225.  *
  226.  */
  227.  
  228. class CSetColDlg : public CModalDialog
  229. {
  230. private:
  231.     LPMAPITABLE m_lpTable;
  232.  
  233. public:
  234.     CSetColDlg(LPMAPITABLE lpTbl, CWnd* lpParent = NULL)
  235.         : CModalDialog(IDD_SETCOL, lpParent)
  236.     {
  237.         m_lpTable = lpTbl;
  238.     }
  239.  
  240.     virtual BOOL OnInitDialog();
  241.  
  242.     afx_msg void OnAdd();
  243.     afx_msg void OnRemove();
  244.     afx_msg void OnRemoveAll();
  245.     afx_msg void OnAllMAPITags();
  246.     afx_msg void OnAddHexValue();
  247.     afx_msg void OnSet();
  248.     afx_msg void OnClose();
  249.     afx_msg void OnCancel();
  250.  
  251.     DECLARE_MESSAGE_MAP();
  252. };
  253.  
  254.  
  255.  
  256. /*
  257.  -  CFreeBkDlg
  258.  -
  259.  *  Purpose:
  260.  *
  261.  *
  262.  */
  263.  
  264. class CFreeBkDlg : public CModalDialog
  265. {
  266. private:
  267.     LPMAPITABLE m_lpTable;
  268.     LPBKLIST    m_lpBkList;
  269.  
  270. public:
  271.     CFreeBkDlg(LPMAPITABLE lpTbl, LPBKLIST lpbkl, CWnd* lpParent = NULL)
  272.         : CModalDialog(IDD_FREEBOOKMARK, lpParent)
  273.     {
  274.         m_lpTable  = lpTbl;
  275.         m_lpBkList = lpbkl;
  276.     }
  277.  
  278.     virtual BOOL OnInitDialog();
  279.  
  280.     afx_msg void OnFree();
  281.     afx_msg void OnFreeAll();
  282.     afx_msg void OnClose();
  283.  
  284.     DECLARE_MESSAGE_MAP();
  285. };
  286.  
  287.  
  288.  
  289. /*
  290.  -  CSeekDlg
  291.  -
  292.  *  Purpose:
  293.  *
  294.  *
  295.  */
  296.  
  297. class CSeekDlg : public CModalDialog
  298. {
  299. private:
  300.     LPMAPITABLE m_lpTable;
  301.     LPBKLIST    m_lpBkList;
  302.     BOOL        m_fSeek;
  303.     int         m_nBk;
  304.  
  305. public:
  306.     CSeekDlg(LPMAPITABLE lpTbl, LPBKLIST lpbkl, CWnd* lpParent = NULL)
  307.         : CModalDialog(IDD_SEEK, lpParent)
  308.     {
  309.         m_lpTable = lpTbl;
  310.         m_lpBkList = lpbkl;
  311.     }
  312.  
  313.     virtual BOOL OnInitDialog();
  314.     virtual void OnOK();
  315.     virtual void OnCancel();
  316.  
  317.     afx_msg void OnTypeSeekRow();
  318.     afx_msg void OnTypeSeekRowApprox();
  319.     afx_msg void OnBkBeginning();
  320.     afx_msg void OnBkCurrent();
  321.     afx_msg void OnBkEnd();
  322.     afx_msg void OnBkUser();
  323.  
  324.     DECLARE_MESSAGE_MAP();
  325. };
  326.  
  327.  
  328.  
  329. /*
  330.  -  CFindDlg
  331.  -
  332.  *  Purpose:
  333.  *
  334.  *
  335.  */
  336.  
  337. class CFindDlg : public CModalDialog
  338. {
  339. private:
  340.     LPMAPITABLE     m_lpTable;
  341.     LPBKLIST        m_lpBkList;
  342.     LPSRestriction  m_lpFindRes;
  343.     int             m_nBk;
  344.     ULONG           m_ulFlags;
  345.  
  346. public:
  347.     CFindDlg(LPMAPITABLE lpTbl, LPBKLIST lpbkl, CWnd* lpParent = NULL)
  348.         : CModalDialog(IDD_FIND, lpParent)
  349.     {
  350.         m_lpTable   = lpTbl;
  351.         m_lpBkList  = lpbkl;
  352.         m_lpFindRes = NULL;
  353.     }
  354.  
  355.     virtual BOOL OnInitDialog();
  356.     virtual void OnOK();
  357.     virtual void OnCancel();
  358.     
  359.     afx_msg void OnBuildRes();
  360.     afx_msg void OnDirForward();
  361.     afx_msg void OnDirBackward();
  362.     afx_msg void OnDirInvalid();
  363.     afx_msg void OnBkBeginning();
  364.     afx_msg void OnBkCurrent();
  365.     afx_msg void OnBkEnd();
  366.     afx_msg void OnBkUser();
  367.  
  368.     DECLARE_MESSAGE_MAP();
  369. };
  370.  
  371.  
  372. /* Misc. Function Prototypes */
  373. void AddBookmark(LPBKLIST lpBkList, BOOKMARK bk, LPSPropValue lpProp);
  374. void RemoveBookmark(LPBKLIST lpBkList, DWORD idxBk);
  375. void FreeRestriction(LPSRestriction lpRes);
  376. #ifdef WIN16
  377. void SetStatus(LPSTR szMsg, SCODE);
  378. #endif
  379. void SetStatus(LPSTR szMsg, HRESULT);
  380.  
  381. #endif  /* __TBLVIEW_H__ */
  382.