home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / componen / interact / demo / data.1 / IDOMFC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-22  |  36.8 KB  |  1,590 lines

  1. /***************************************************************************\
  2.  
  3.    (c) 1995-1996, ProtoView Development Co., All rights reserved
  4. \***************************************************************************/
  5.  
  6. //============================================================================
  7. //
  8. //        Microsoft C++ Class Library for the IDO Custom Control
  9. //
  10. //============================================================================
  11.  
  12. #ifndef __IDOMFC_H__
  13. #define __IDOMFC_H__
  14.  
  15. //============================================================================
  16.  
  17. #include <afxwin.h>
  18. #include "pvido.h"
  19.  
  20. // InterAct Notification macros
  21. #define ON_IDON_SELCHANGE(id, memberFxn)          ON_CONTROL(IDON_SELCHANGE, id, memberFxn)
  22.  
  23. // InterAct Notification Message macros
  24. #define ON_IDOM_N_BEFOREDIAGRAMSAVED(method)   ON_MESSAGE(IDOM_N_BEFOREDIAGRAMSAVED, method)
  25. #define ON_IDOM_N_DIAGRAMSAVED(method)         ON_MESSAGE(IDOM_N_DIAGRAMSAVED, method)
  26. #define ON_IDOM_N_BEFOREDIAGRAMLOADED(method)  ON_MESSAGE(IDOM_N_BEFOREDIAGRAMLOADED, method)
  27. #define ON_IDOM_N_DIAGRAMLOADED(method)        ON_MESSAGE(IDOM_N_DIAGRAMLOADED, method)
  28. #define ON_IDOM_N_BEFOREDIAGRAMRESET(method)   ON_MESSAGE(IDOM_N_BEFOREDIAGRAMRESET, method)
  29. #define ON_IDOM_N_DIAGRAMRESET(method)         ON_MESSAGE(IDOM_N_DIAGRAMRESET, method)
  30.  
  31. #define ON_IDOM_N_BEFOREPALETTESAVED(method)   ON_MESSAGE(IDOM_N_BEFOREPALETTESAVED, method)
  32. #define ON_IDOM_N_PALETTESAVED(method)         ON_MESSAGE(IDOM_N_PALETTESAVED, method)
  33. #define ON_IDOM_N_BEFOREPALETTELOADED(method)  ON_MESSAGE(IDOM_N_BEFOREPALETTELOADED, method)
  34. #define ON_IDOM_N_PALETTELOADED(method)        ON_MESSAGE(IDOM_N_PALETTELOADED, method)
  35. #define ON_IDOM_N_BEFOREPALETTERESET(method)   ON_MESSAGE(IDOM_N_BEFOREPALETTERESET, method)
  36. #define ON_IDOM_N_PALETTERESET(method)         ON_MESSAGE(IDOM_N_PALETTERESET, method)
  37.  
  38. #define ON_IDOM_N_BEFOREDISPLAYOPTIONSMENU(method)   ON_MESSAGE(IDOM_N_BEFOREDISPLAYOPTIONSMENU, method)
  39. #define ON_IDOM_N_BEFOREDISPLAYHELP(method)          ON_MESSAGE(IDOM_N_BEFOREDISPLAYHELP, method)
  40. #define ON_IDOM_N_BEFOREDISPLAYMANAGERULES(method)   ON_MESSAGE(IDOM_N_BEFOREDISPLAYMANAGERULES, method)
  41. #define ON_IDOM_N_BEFOREDISPLAYMANAGECLASSES(method) ON_MESSAGE(IDOM_N_BEFOREDISPLAYMANAGECLASSES, method)
  42. #define ON_IDOM_N_DISPLAYMANAGERULESBUTTON(method)   ON_MESSAGE(IDOM_N_DISPLAYMANAGERULESBUTTON, method)
  43. #define ON_IDOM_N_BEFOREDISPLAYTOOLSPALETTE(method)  ON_MESSAGE(IDOM_N_BEFOREDISPLAYTOOLSPALETTE, method)
  44. #define ON_IDOM_N_BEFOREHIDETOOLSPALETTE(method)     ON_MESSAGE(IDOM_N_BEFOREHIDETOOLSPALETTE, method)
  45.  
  46. #define ON_IDOM_N_ENTITYADDREQUEST(method)      ON_MESSAGE(IDOM_N_ENTITYADDREQUEST, method)
  47. #define ON_IDOM_N_ENTITYADDED(method)           ON_MESSAGE(IDOM_N_ENTITYADDED, method)
  48. #define ON_IDOM_N_ENTITYDELETEREQUEST(method)   ON_MESSAGE(IDOM_N_ENTITYDELETEREQUEST, method)
  49. #define ON_IDOM_N_ENTITYDELETED(method)         ON_MESSAGE(IDOM_N_ENTITYDELETED, method)
  50.  
  51. #define ON_IDOM_N_RELATIONADDREQUEST(method)    ON_MESSAGE(IDOM_N_RELATIONADDREQUEST, method)
  52. #define ON_IDOM_N_RELATIONADDED(method)         ON_MESSAGE(IDOM_N_RELATIONADDED, method)
  53. #define ON_IDOM_N_RELATIONDELETEREQUEST(method) ON_MESSAGE(IDOM_N_RELATIONDELETEREQUEST, method)
  54. #define ON_IDOM_N_RELATIONDELETED(method)       ON_MESSAGE(IDOM_N_RELATIONDELETED, method)
  55.  
  56. #define ON_IDOM_N_CLICK_ENTITY(method)          ON_MESSAGE(IDOM_N_CLICK_ENTITY, method)
  57. #define ON_IDOM_N_CLICK_RELATION(method)        ON_MESSAGE(IDOM_N_CLICK_RELATION, method)
  58. #define ON_IDOM_N_CLICK_INTERACT(method)        ON_MESSAGE(IDOM_N_CLICK_INTERACT, method)
  59.  
  60. class CIDO;
  61. class CEntity;
  62. class CRelation;
  63. class CIDORule;
  64.  
  65.  
  66. //============================================================================
  67. // IDO Rule Class Definition
  68. class CIDORule : public CObject
  69. {
  70.  
  71.  
  72. //******* Constructors *******
  73. public:
  74.  
  75.    CIDORule ()
  76.    {
  77.       lstrcpy(m_rule.E1, "");
  78.       lstrcpy(m_rule.R1, "");
  79.       lstrcpy(m_rule.E2, "");
  80.       m_rule.MaxCount = 0;
  81.    }
  82.    CIDORule (LPIDO_RULE lpRule)
  83.    {
  84.       lstrcpy(m_rule.E1, lpRule->E1);
  85.       lstrcpy(m_rule.R1, lpRule->R1);
  86.       lstrcpy(m_rule.E2, lpRule->E2);
  87.       m_rule.MaxCount = lpRule->MaxCount;
  88.    }
  89.  
  90.  
  91. //******* Destructors *******
  92. public:
  93.  
  94.   virtual ~CIDORule()
  95.   {
  96.      ;
  97.   }
  98.  
  99.  
  100. //******* Public Data Members *******
  101. public :
  102.  
  103.    IDO_RULE m_rule;
  104.  
  105.  
  106. //******* Public Member Functions *******
  107. public :
  108.  
  109.    LPCSTR DestinationEntityClassName()
  110.    {
  111.       return (LPCSTR)idoRuleDestinationEntityClassName(&m_rule);
  112.    }
  113.  
  114.    LPCSTR SourceEntityClassName()
  115.    {
  116.       return (LPCSTR)idoRuleSourceEntityClassName(&m_rule);
  117.    }
  118.  
  119.    LPCSTR RelationClassName()
  120.    {
  121.       return (LPCSTR)idoRuleRelationClassName(&m_rule);
  122.    }
  123.  
  124. };
  125.  
  126.  
  127. //============================================================================
  128. // Entity Class Definition
  129. class CEntity : public CObject
  130. {
  131. friend class CIDO;
  132. friend class CRelation;
  133.  
  134.  
  135. //******* Constructors *******
  136. public:
  137.  
  138.    CEntity ()
  139.    {
  140.       m_entity.id = 0L;
  141.       lstrcpy(m_entity.name, "");
  142.       m_entity.hIDO = 0;
  143.    }
  144.    CEntity (CWnd *pIDO, int UserID, LPCSTR lpszUserName)
  145.    {
  146.       m_entity.id = UserID;
  147.       lstrcpy(m_entity.name, lpszUserName);
  148.       m_entity.hIDO = pIDO->m_hWnd;
  149.    }
  150.    CEntity (LPENTITY lpEnt)
  151.    {
  152.       m_entity.id = lpEnt->id;
  153.       lstrcpy(m_entity.name, lpEnt->name);
  154.       lstrcpy(m_entity.classname, lpEnt->classname);
  155.       m_entity.hIDO = lpEnt->hIDO;
  156.    }
  157.  
  158.  
  159. //******* Destructors *******
  160. public:
  161.  
  162.   virtual ~CEntity()
  163.   {
  164.      ;
  165.   }
  166.  
  167.  
  168. //******* Public Data Members *******
  169. public :
  170.  
  171.    ENTITY m_entity;
  172.  
  173.  
  174. //******* Public Member Functions *******
  175. public :
  176.  
  177.    void   SetUserData(LPVOID lpData)
  178.    {
  179.       idoEntitySetUserData(&m_entity, lpData);
  180.    }
  181.    LPVOID GetUserData()
  182.    {
  183.       return idoEntityGetUserData(&m_entity);
  184.    }
  185.  
  186.    void     SetBackColor(COLORREF clrVal)
  187.    {
  188.       idoEntitySetBackColor(&m_entity, clrVal);
  189.    }
  190.    COLORREF GetBackColor()
  191.    {
  192.       return idoEntityGetBackColor(&m_entity);
  193.    }
  194.  
  195.    void   SetInetUrl(LPCSTR lpszText)
  196.    {
  197.       idoEntitySetInetUrl(&m_entity, lpszText);
  198.    }
  199.    LPCSTR GetInetUrl()
  200.    {
  201.       return idoEntityGetInetUrl(&m_entity);
  202.    }
  203.    void   SetInetHost(INET_HOST Host)
  204.    {
  205.       idoEntitySetInetHost(&m_entity, Host);
  206.    }
  207.    INET_HOST GetInetHost()
  208.    {
  209.       return idoEntityGetInetHost(&m_entity);
  210.    }
  211.  
  212.    void     SetTextColor(COLORREF clrVal)
  213.    {
  214.       idoEntitySetTextColor(&m_entity, clrVal);
  215.    }
  216.    COLORREF GetTextColor()
  217.    {
  218.       return idoEntityGetTextColor(&m_entity);
  219.    }
  220.  
  221.    void   SetText(LPCSTR lpszText)
  222.    {
  223.       idoEntitySetText(&m_entity, lpszText);
  224.    }
  225.    LPCSTR GetText()
  226.    {
  227.       return idoEntityGetText(&m_entity);
  228.    }
  229.  
  230.    int GetTop()
  231.    {
  232.       return idoEntityGetTop(&m_entity);
  233.    }
  234.    void SetTop(int cVal)
  235.    {
  236.       idoEntitySetTop(&m_entity, cVal);
  237.    }
  238.    int GetBottom()
  239.    {
  240.       return idoEntityGetBottom(&m_entity);
  241.    }
  242.    void SetBottom(int cVal)
  243.    {
  244.       idoEntitySetBottom(&m_entity, cVal);
  245.    }
  246.    int GetLeft()
  247.    {
  248.       return idoEntityGetLeft(&m_entity);
  249.    }
  250.    void SetLeft(int cVal)
  251.    {
  252.       idoEntitySetLeft(&m_entity, cVal);
  253.    }
  254.    int GetRight()
  255.    {
  256.       return idoEntityGetRight(&m_entity);
  257.    }
  258.    void SetRight(int cVal)
  259.    {
  260.       idoEntitySetRight(&m_entity, cVal);
  261.    }
  262.    int GetRect(LPRECT lpRect)
  263.    {
  264.       return idoEntityGetRect(&m_entity, lpRect);
  265.    }
  266.    void SetRect(LPRECT lpRect)
  267.    {
  268.       idoEntitySetRect(&m_entity, lpRect);
  269.    }
  270.  
  271.    void SetCoordX(int cVal)
  272.    {
  273.       idoEntitySetCoordX(&m_entity, cVal);
  274.    }
  275.    int  GetCoordX()
  276.    {
  277.       return idoEntityGetCoordX(&m_entity);
  278.    }
  279.    void SetCoordY(int cVal)
  280.    {
  281.       idoEntitySetCoordY(&m_entity, cVal);
  282.    }
  283.    int  GetCoordY()
  284.    {
  285.       return idoEntityGetCoordY(&m_entity);
  286.    }
  287.  
  288.    void        SetShape(ENTITYSHAPE cVal)
  289.    {
  290.       idoEntitySetShape(&m_entity, cVal);
  291.    }
  292.    ENTITYSHAPE GetShape()
  293.    {
  294.       return idoEntityGetShape(&m_entity);
  295.    }
  296.  
  297.    void          SetFrame(THREE_D_STYLE cVal)
  298.    {
  299.       idoEntitySetFrame(&m_entity, cVal);
  300.    }
  301.    THREE_D_STYLE GetFrame()
  302.    {
  303.       return idoEntityGetFrame(&m_entity);
  304.    }
  305.  
  306.    void SetSelect(BOOL bVal)
  307.    {
  308.       idoEntitySetSelect(&m_entity, bVal);
  309.    }
  310.    BOOL GetSelect()
  311.    {
  312.       return (BOOL)idoEntityGetSelect(&m_entity);
  313.    }
  314.  
  315.    void SetBorder(BOOL bVal)
  316.    {
  317.       idoEntitySetBorder(&m_entity, bVal);
  318.    }
  319.    BOOL GetBorder()
  320.    {
  321.       return (BOOL)idoEntityGetBorder(&m_entity);
  322.    }
  323.  
  324.    void SetContainer(long lVal)
  325.    {
  326.       idoEntitySetContainer(&m_entity, lVal);
  327.    }
  328.    long GetContainer()
  329.    {
  330.       return idoEntityGetContainer(&m_entity);
  331.    }
  332.  
  333.    void   SetGraphic(LPCSTR lpszVal)
  334.    {
  335.       idoEntitySetGraphic(&m_entity, lpszVal);
  336.    }
  337.    LPCSTR GetGraphic()
  338.    {
  339.       return idoEntityGetGraphic(&m_entity);
  340.    }
  341.  
  342.    void   SetTextOrientation(TEXTPOSSTYLE cVal)
  343.    {
  344.       idoEntitySetTextOrientation(&m_entity, cVal);
  345.    }
  346.    TEXTPOSSTYLE GetTextOrientation()
  347.    {
  348.       return idoEntityGetTextOrientation(&m_entity);
  349.    }
  350.  
  351.    void   SetFont(LPIDO_FONT lpFont)
  352.    {
  353.       idoEntitySetFont(&m_entity, lpFont);
  354.    }
  355.    LPIDO_FONT GetFont()
  356.    {
  357.       return idoEntityGetFont(&m_entity);
  358.    }
  359.  
  360.    BOOL GetValidRelationDragSource()
  361.    {
  362.       return idoEntityGetValidRelationDragSource(&m_entity);
  363.    }
  364.    void SetValidRelationDragSource(BOOL bVal)
  365.    {
  366.       idoEntitySetValidRelationDragSource(&m_entity, bVal);
  367.    }
  368.  
  369.    BOOL GetCanResize()
  370.    {
  371.       return idoEntityGetCanResize(&m_entity);
  372.    }
  373.    void SetCanResize(BOOL bVal)
  374.    {
  375.       idoEntitySetCanResize(&m_entity, bVal);
  376.    }
  377.  
  378.    BOOL GetCanMove()
  379.    {
  380.       return idoEntityGetCanMove(&m_entity);
  381.    }
  382.    void SetCanMove(BOOL bVal)
  383.    {
  384.       idoEntitySetCanMove(&m_entity, bVal);
  385.    }
  386.  
  387.    BOOL GetCanDelete()
  388.    {
  389.       return idoEntityGetCanDelete(&m_entity);
  390.    }
  391.    void SetCanDelete(BOOL bVal)
  392.    {
  393.       idoEntitySetCanDelete(&m_entity, bVal);
  394.    }
  395.  
  396.    BOOL GetReadOnly()
  397.    {
  398.       return idoEntityGetReadOnly(&m_entity);
  399.    }
  400.    void SetReadOnly(BOOL bVal)
  401.    {
  402.       idoEntitySetReadOnly(&m_entity, bVal);
  403.    }
  404.  
  405.    BOOL GetAutoResize()
  406.    {
  407.       return idoEntityGetAutoResize(&m_entity);
  408.    }
  409.    void SetAutoResize(BOOL bVal)
  410.    {
  411.       idoEntitySetAutoResize(&m_entity, bVal);
  412.    }
  413.  
  414.    BOOL GetStretchBitmap()
  415.    {
  416.       return idoEntityGetStretchBitmap(&m_entity);
  417.    }
  418.    void SetStretchBitmap(BOOL bVal)
  419.    {
  420.       idoEntitySetStretchBitmap(&m_entity, bVal);
  421.    }
  422.  
  423.    BOOL GetTransparent()
  424.    {
  425.       return idoEntityGetTransparent(&m_entity);
  426.    }
  427.    void SetTransparent(BOOL bVal)
  428.    {
  429.       idoEntitySetTransparent(&m_entity, bVal);
  430.    }
  431.  
  432. //******* Explicit inline Public Member Functions *******
  433. public :
  434.  
  435.    BOOL IterateRelationInNext(LPRELATION lpRel);
  436.    BOOL IterateRelationInNext(CRelation * lpRel);
  437.    CRelation * IterateRelationInNext();
  438.  
  439.    BOOL IterateRelationOutNext(LPRELATION lpRel);
  440.    BOOL IterateRelationOutNext(CRelation * lpRel);
  441.    CRelation * IterateRelationOutNext();
  442.  
  443.    BOOL IterateContainedEntityNext(LPENTITY lpEnt);
  444.    BOOL IterateContainedEntityNext(CEntity * lpEnt);
  445.    CEntity * IterateContainedEntityNext();
  446.  
  447.  
  448. //******* Public Member Functions *******
  449. public :
  450.  
  451.    long GetUserID()
  452.    {
  453.       return m_entity.id;
  454.    }
  455.    LPCSTR GetUserName()
  456.    {
  457.       return (LPCSTR)m_entity.name;
  458.    }
  459.    LPCSTR GetClassName()
  460.    {
  461.       return (LPCSTR)m_entity.classname;
  462.    }
  463.  
  464.    long GetRelationInCount()
  465.    {
  466.       return idoEntityGetRelationInCount(&m_entity);
  467.    }
  468.    BOOL IterateRelationInFirst()
  469.    {
  470.       return idoEntityIterateRelationInFirst(&m_entity);
  471.    }
  472.  
  473.    long GetRelationOutCount()
  474.    {
  475.       return idoEntityGetRelationOutCount(&m_entity);
  476.    }
  477.    BOOL IterateRelationOutFirst()
  478.    {
  479.       return idoEntityIterateRelationOutFirst(&m_entity);
  480.    }
  481.  
  482.    long GetContainedEntityCount()
  483.    {
  484.       return idoEntityGetContainedEntityCount(&m_entity);
  485.    }
  486.    BOOL IterateContainedEntityFirst()
  487.    {
  488.       return idoEntityIterateContainedEntityFirst(&m_entity);
  489.    }
  490.    BOOL AddEntityToContainer(CEntity * lpCEntity)
  491.    {
  492.       if(!lpCEntity)
  493.          return FALSE;
  494.       return idoEntityAddEntityToContainer(&m_entity, &(lpCEntity->m_entity));
  495.    }
  496.    BOOL RemoveEntityFromContainer(CEntity * lpCEntity)
  497.    {
  498.       if(!lpCEntity)
  499.          return FALSE;
  500.       return idoEntityRemoveEntityFromContainer(&m_entity, &(lpCEntity->m_entity));
  501.    }
  502.  
  503.    BOOL Delete()
  504.    {
  505.       return (BOOL)idoEntityDelete(&m_entity);
  506.    }
  507.  
  508.    BOOL Repaint()
  509.    {
  510.       return idoEntityRepaint(&m_entity);
  511.    }
  512.  
  513.    BOOL BringIntoView()
  514.    {
  515.       return idoEntityBringIntoView(&m_entity);
  516.    }
  517.  
  518.    void PropertyPage(int cVal)
  519.    {
  520.       idoEntityPropertyPage(&m_entity, cVal);
  521.    }
  522.  
  523. };
  524.  
  525.  
  526. //============================================================================
  527. // Relation Class Definition
  528. class CRelation : public CObject
  529. {
  530. friend class CIDO;
  531. friend class CEntity;
  532.  
  533.  
  534. //******* Constructors *******
  535. public:
  536.  
  537.    CRelation ()
  538.    {
  539.       m_relation.id = 0L;
  540.       lstrcpy(m_relation.name, "");
  541.       m_relation.hIDO = 0;
  542.    }
  543.    CRelation (CWnd *pIDO, int UserID, LPCSTR lpszUserName)
  544.    {
  545.       m_relation.id = UserID;
  546.       lstrcpy(m_relation.name, lpszUserName);
  547.       m_relation.hIDO = pIDO->m_hWnd;
  548.    }
  549.    CRelation (LPRELATION lpRel)
  550.    {
  551.       m_relation.id = lpRel->id;
  552.       lstrcpy(m_relation.name, lpRel->name);
  553.       lstrcpy(m_relation.classname, lpRel->classname);
  554.       m_relation.hIDO = lpRel->hIDO;
  555.    }
  556.  
  557.  
  558. //******* Destructors *******
  559. public:
  560.  
  561.   virtual ~CRelation()
  562.   {
  563.      ;
  564.   }
  565.  
  566.  
  567. //******* Public Data Members *******
  568. public :
  569.  
  570.    RELATION m_relation;
  571.  
  572.  
  573.  
  574. //******* Public Member Functions *******
  575. public :
  576.  
  577.    void   SetUserData(LPVOID lpData)
  578.    {
  579.       idoRelationSetUserData(&m_relation, lpData);
  580.    }
  581.    LPVOID GetUserData()
  582.    {
  583.       return idoRelationGetUserData(&m_relation);
  584.    }
  585.  
  586.    void     SetBackColor(COLORREF clrVal)
  587.    {
  588.       idoRelationSetBackColor(&m_relation, clrVal);
  589.    }
  590.    COLORREF GetBackColor()
  591.    {
  592.       return idoRelationGetBackColor(&m_relation);
  593.    }
  594.  
  595.    void     SetTextColor(COLORREF clrVal)
  596.    {
  597.       idoRelationSetTextColor(&m_relation, clrVal);
  598.    }
  599.    COLORREF GetTextColor()
  600.    {
  601.       return idoRelationGetTextColor(&m_relation);
  602.    }
  603.  
  604.    void   SetText(LPCSTR lpszText)
  605.    {
  606.       idoRelationSetText(&m_relation, lpszText);
  607.    }
  608.    LPCSTR GetText()
  609.    {
  610.       return idoRelationGetText(&m_relation);
  611.    }
  612.  
  613.    void       SetSourceArrow(ARROWSTYLE cVal)
  614.    {
  615.       idoRelationSetSourceArrow(&m_relation, cVal);
  616.    }
  617.    ARROWSTYLE GetSourceArrow()
  618.    {
  619.       return idoRelationGetSourceArrow(&m_relation);
  620.    }
  621.  
  622.    void       SetDestinationArrow(ARROWSTYLE cVal)
  623.    {
  624.       idoRelationSetDestinationArrow(&m_relation, cVal);
  625.    }
  626.    ARROWSTYLE GetDestinationArrow()
  627.    {
  628.       return idoRelationGetDestinationArrow(&m_relation);
  629.    }
  630.  
  631.    void      SetType(LINESTYLE cVal)
  632.    {
  633.       idoRelationSetType(&m_relation, cVal);
  634.    }
  635.    LINESTYLE GetType()
  636.    {
  637.       return idoRelationGetType(&m_relation);
  638.    }
  639.  
  640.    void SetThickness(long lVal)
  641.    {
  642.       idoRelationSetThickness(&m_relation, lVal);
  643.    }
  644.    long GetThickness()
  645.    {
  646.       return idoRelationGetThickness(&m_relation);
  647.    }
  648.  
  649.    void SetFont(LPIDO_FONT lpFont)
  650.    {
  651.       idoRelationSetFont(&m_relation, lpFont);
  652.    }
  653.    LPIDO_FONT GetFont()
  654.    {
  655.       return idoRelationGetFont(&m_relation);
  656.    }
  657.  
  658.    BOOL GetReadOnly()
  659.    {
  660.       return idoRelationGetReadOnly(&m_relation);
  661.    }
  662.    void SetReadOnly(LPRELATION, BOOL bVal)
  663.    {
  664.       idoRelationSetReadOnly(&m_relation, bVal);
  665.    }
  666.  
  667.    BOOL GetCanDelete()
  668.    {
  669.       return idoRelationGetCanDelete(&m_relation);
  670.    }
  671.    void SetCanDelete(BOOL bVal)
  672.    {
  673.       idoRelationSetCanDelete(&m_relation, bVal);
  674.    }
  675.  
  676.    BOOL GetCanMoveEndPoints()
  677.    {
  678.       return idoRelationGetCanMoveEndPoints(&m_relation);
  679.    }
  680.    void SetCanMoveEndPoints(BOOL bVal)
  681.    {
  682.       idoRelationSetCanMoveEndPoints(&m_relation, bVal);
  683.    }
  684.  
  685.    BOOL GetCanMoveMidPoints()
  686.    {
  687.       return idoRelationGetCanMoveMidPoints(&m_relation);
  688.    }
  689.    void SetCanMoveMidPoints(BOOL bVal)
  690.    {
  691.       idoRelationSetCanMoveMidPoints(&m_relation, bVal);
  692.    }
  693.  
  694.  
  695. //******* Explicit inline Public Member Functions *******
  696. public :
  697.  
  698.    BOOL SourceEntity(LPENTITY lpEnt);
  699.    BOOL SourceEntity(CEntity * lpEnt);
  700.    CEntity * SourceEntity();
  701.  
  702.    BOOL DestinationEntity(LPENTITY lpEnt);
  703.    BOOL DestinationEntity(CEntity * lpEnt);
  704.    CEntity * DestinationEntity();
  705.  
  706.  
  707. //******* Public inline Member Functions *******
  708. public :
  709.  
  710.    long GetUserID()
  711.    {
  712.       return m_relation.id;
  713.    }
  714.    LPCSTR GetUserName()
  715.    {
  716.       return (LPCSTR)m_relation.name;
  717.    }
  718.    LPCSTR GetClassName()
  719.    {
  720.       return (LPCSTR)m_relation.classname;
  721.    }
  722.  
  723.    BOOL Repaint()
  724.    {
  725.       return idoRelationRepaint(&m_relation);
  726.    }
  727.  
  728.    BOOL BringIntoView()
  729.    {
  730.       return idoRelationBringIntoView(&m_relation);
  731.    }
  732.  
  733.    BOOL Delete()
  734.    {
  735.       return idoRelationDelete(&m_relation);
  736.    }
  737.  
  738.    void PropertyPage(int cVal)
  739.    {
  740.       idoRelationPropertyPage(&m_relation, cVal);
  741.    }
  742.  
  743. };
  744.  
  745.  
  746. //============================================================================
  747. // IDO Class Definition
  748. class CIDO : public CWnd
  749. {
  750. friend class CEntity;
  751. friend class CRelation;
  752.  
  753.  
  754. //******* Constructors *******
  755. public:
  756.  
  757.    CIDO ()
  758.    {
  759.       ;
  760.    }
  761.    CIDO (CWnd *pParent, int ControlID)
  762.    {
  763.       m_hWnd = ::GetDlgItem(pParent->m_hWnd, ControlID);
  764.    }
  765.  
  766.    BOOL Create (DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)
  767.    {
  768.       #ifdef WIN32
  769.          return (CWnd::Create ("pvIDO32", NULL, dwStyle, rect, pParentWnd, nID));
  770.       #else
  771.          return (CWnd::Create ("pvIDO", NULL, dwStyle, rect, pParentWnd, nID));
  772.       #endif
  773.    }
  774.  
  775.  
  776. //******* Destructors *******
  777. public :
  778.  
  779.   virtual ~CIDO()
  780.   {
  781.      ;
  782.   }
  783.  
  784. //******* Protected Member Functions *******
  785. protected:
  786.  
  787.    virtual WNDPROC* GetSuperWndProcAddr (void)
  788.    {
  789.      static WNDPROC NEAR pfnSuper;
  790.      return (&pfnSuper);
  791.    }
  792.  
  793.  
  794. //******* Public Member Functions *******
  795. public:
  796.  
  797.    void SetModified(BOOL bVal)
  798.    {
  799.       idoSetModified(m_hWnd, bVal);
  800.    }
  801.    BOOL GetModified()
  802.    {
  803.       return idoGetModified(m_hWnd);
  804.    }
  805.  
  806.    BOOL GetEditMode()
  807.    {
  808.       return idoGetEditMode(m_hWnd);
  809.    }
  810.    void SetEditMode(BOOL bVal)
  811.    {
  812.       idoSetEditMode(m_hWnd, bVal);
  813.    }
  814.  
  815.    int  GetGridHeight()
  816.    {
  817.       return idoGetGridHeight(m_hWnd);
  818.    }
  819.    void SetGridHeight(int cVal)
  820.    {
  821.       idoSetGridHeight(m_hWnd, cVal);
  822.    }
  823.  
  824.    int  GetGridWidth()
  825.    {
  826.       return idoGetGridWidth(m_hWnd);
  827.    }
  828.    void SetGridWidth(int cVal)
  829.    {
  830.       idoSetGridWidth(m_hWnd, cVal);
  831.    }
  832.  
  833.    COLORREF GetGridLineColor()
  834.    {
  835.       return idoGetGridLineColor(m_hWnd);
  836.    }
  837.    void     SetGridLineColor(COLORREF clrVal)
  838.    {
  839.       idoSetGridLineColor(m_hWnd, clrVal);
  840.    }
  841.  
  842.    COLORREF GetBackColor()
  843.    {
  844.       return idoGetBackColor(m_hWnd);
  845.    }
  846.    void     SetBackColor(COLORREF clrVal)
  847.    {
  848.       idoSetBackColor(m_hWnd, clrVal);
  849.    }
  850.  
  851.    BOOL GetGridLines()
  852.    {
  853.       return idoGetGridLines(m_hWnd);
  854.    }
  855.    void SetGridLines(BOOL bVal)
  856.    {
  857.       idoSetGridLines(m_hWnd, bVal);
  858.    }
  859.  
  860.    BOOL GetSnapToGrid()
  861.    {
  862.       return idoGetSnapToGrid(m_hWnd);
  863.    }
  864.    void SetSnapToGrid(BOOL bVal)
  865.    {
  866.       idoSetSnapToGrid(m_hWnd, bVal);
  867.    }
  868.  
  869.    BOOL GetToolsPalette()
  870.    {
  871.       return idoGetToolsPalette(m_hWnd);
  872.    }
  873.    void SetToolsPalette(BOOL bVal)
  874.    {
  875.       idoSetToolsPalette(m_hWnd, bVal);
  876.    }
  877.  
  878.    void SetToolsPaletteButtonText(LPCSTR lpText)
  879.    {
  880.       idoSetToolsPaletteButtonText(m_hWnd, lpText);
  881.    }
  882.    void SetToolsPaletteButtonText(CString& Text)
  883.    {
  884.       idoSetToolsPaletteButtonText(m_hWnd, Text.GetBuffer(0));
  885.    }
  886.  
  887.    BOOL GetRulesEnforced()
  888.    {
  889.       return idoGetRulesEnforced(m_hWnd);
  890.    }
  891.    void SetRulesEnforced(BOOL bVal)
  892.    {
  893.       idoSetRulesEnforced(m_hWnd, bVal);
  894.    }
  895.  
  896.    BOOL GetCurrentEntity(LPENTITY lpEnt)
  897.    {
  898.       return idoGetCurrentEntity(m_hWnd, lpEnt);
  899.    }
  900.    BOOL GetCurrentEntity(CEntity * lpEnt)
  901.    {
  902.       return idoGetCurrentEntity(m_hWnd, &(lpEnt->m_entity));
  903.    }
  904.    CEntity * GetCurrentEntity()
  905.    {
  906.       ENTITY entity;
  907.       CEntity * lpEnt = NULL;
  908.  
  909.       if(idoGetCurrentEntity(m_hWnd, &entity))
  910.          lpEnt = new CEntity(&entity);
  911.  
  912.       return lpEnt;
  913.    }
  914.  
  915.    BOOL SetCurrentEntity(LPENTITY lpEnt)
  916.    {
  917.       return idoSetCurrentEntity(m_hWnd, lpEnt);
  918.    }
  919.    BOOL SetCurrentEntity(CEntity * lpEnt)
  920.    {
  921.       return idoSetCurrentEntity(m_hWnd, &(lpEnt->m_entity));
  922.    }
  923.  
  924.    BOOL GetCurrentRelation(LPRELATION lpRel)
  925.    {
  926.       return idoGetCurrentRelation(m_hWnd, lpRel);
  927.    }
  928.    BOOL GetCurrentRelation(CRelation * lpRel)
  929.    {
  930.       return idoGetCurrentRelation(m_hWnd, &(lpRel->m_relation));
  931.    }
  932.    CRelation * GetCurrentRelation()
  933.    {
  934.       RELATION relation;
  935.       CRelation * lpRel = NULL;
  936.  
  937.       if(idoGetCurrentRelation(m_hWnd, &relation))
  938.          lpRel = new CRelation(&relation);
  939.  
  940.       return lpRel;
  941.    }
  942.  
  943.    BOOL SetCurrentRelation(LPRELATION lpRel)
  944.    {
  945.       return idoSetCurrentRelation(m_hWnd, lpRel);
  946.    }
  947.    BOOL SetCurrentRelation(CRelation * lpRel)
  948.    {
  949.       return idoSetCurrentRelation(m_hWnd, &(lpRel->m_relation));
  950.    }
  951.  
  952.    BOOL GetPopupMenu(long lVal)
  953.    {
  954.       return idoGetPopupMenu(m_hWnd, lVal);
  955.    }
  956.    void SetPopupMenu(long lVal, BOOL bVal)
  957.    {
  958.       idoSetPopupMenu(m_hWnd, lVal, bVal);
  959.    }
  960.  
  961. // conflicts with WINDOWSX.H
  962. //   long GetWindowStyle()
  963. //   {
  964. //      return idoGetWindowStyle(m_hWnd);
  965. //   }
  966. //   void SetWindowStyle(long lVal)
  967. //   {
  968. //      idoSetWindowStyle(m_hWnd, lVal);
  969. //   }
  970.  
  971.    BOOL GetBorder()
  972.    {
  973.       return idoGetBorder(m_hWnd);
  974.    }
  975.    void SetBorder(BOOL bVal)
  976.    {
  977.       idoSetBorder(m_hWnd, bVal);
  978.    }
  979.  
  980.    BOOL GetPrinterLines()
  981.    {
  982.       return idoGetPrinterLines(m_hWnd);
  983.    }
  984.    void SetPrinterLines(BOOL bVal)
  985.    {
  986.       idoSetPrinterLines(m_hWnd, bVal);
  987.    }
  988.  
  989.    BOOL GetPrinterLandscape()
  990.    {
  991.       return idoGetPrinterLandscape(m_hWnd);
  992.    }
  993.    void SetPrinterLandscape(BOOL bVal)
  994.    {
  995.       idoSetPrinterLandscape(m_hWnd, bVal);
  996.    }
  997.  
  998.    long GetScrollBars()
  999.    {
  1000.       return idoGetScrollBars(m_hWnd);
  1001.    }
  1002.    void SetScrollBars(long lVal)
  1003.    {
  1004.       idoSetScrollBars(m_hWnd, lVal);
  1005.    }
  1006.  
  1007.    BOOL GetRedraw()
  1008.    {
  1009.       return idoGetRedraw(m_hWnd);
  1010.    }
  1011.    void SetRedraw(BOOL bVal)
  1012.    {
  1013.       idoSetRedraw(m_hWnd, bVal);
  1014.    }
  1015.  
  1016.  
  1017.    LPCSTR GetInetPath()
  1018.    {
  1019.       return (LPCSTR)idoGetInetPath(m_hWnd);
  1020.    }
  1021.    void SetInetPath(LPCSTR lpPath)
  1022.    {
  1023.      idoSetInetPath(m_hWnd, (LPCSTR)lpPath);
  1024.    }
  1025.    void SetInetPath(CString& Path)
  1026.    {
  1027.      idoSetInetPath(m_hWnd, (LPCSTR)Path.GetBuffer(0));
  1028.    }
  1029.  
  1030.    short GetZoomValue()
  1031.    {
  1032.       return idoGetZoomValue(m_hWnd);
  1033.    }
  1034.    void SetZoomValue(short cVal)
  1035.    {
  1036.       idoSetZoomValue(m_hWnd, cVal);
  1037.    }
  1038.  
  1039. //******* Public Member Functions *******
  1040. public :
  1041.  
  1042.    void CancelAction()
  1043.    {
  1044.       idoCancelAction(m_hWnd);
  1045.    }
  1046.    void AllowAction()
  1047.    {
  1048.       idoAllowAction(m_hWnd);
  1049.    }
  1050.  
  1051.    BOOL DragAddEntity(LPCSTR lpszVal)
  1052.    {
  1053.       return idoDragAddEntity(m_hWnd, lpszVal);
  1054.    }
  1055.  
  1056.    BOOL AddEntityFromClass(long lID, LPSTR lpszName, LPSTR lpszClass, LPSTR lpszText, int cX, int cY, int cWidth, int cHeight)
  1057.    {
  1058.       return idoAddEntityFromClass(m_hWnd, lID, lpszName, lpszClass, lpszText, cX, cY, cWidth, cHeight);
  1059.    }
  1060.  
  1061.    BOOL DeleteEntity(LPENTITY lpEnt)
  1062.    {
  1063.       return idoDeleteEntity(m_hWnd, lpEnt);
  1064.    }
  1065.    BOOL DeleteEntity(CEntity * lpEnt)
  1066.    {
  1067.       return idoDeleteEntity(m_hWnd, &(lpEnt->m_entity));
  1068.    }
  1069.  
  1070.    BOOL DoesEntityExist(long lID, LPSTR lpszName)
  1071.    {
  1072.       return idoDoesEntityExist(m_hWnd, lID, lpszName);
  1073.    }
  1074.  
  1075.    long GetNumberOfSelectedEntities()
  1076.    {
  1077.       return idoGetNumberOfSelectedEntities(m_hWnd);
  1078.    }
  1079.    long GetNumberOfEntities()
  1080.    {
  1081.       return idoGetNumberOfEntities(m_hWnd);
  1082.    }
  1083.    long GetNumberOfRelations()
  1084.    {
  1085.       return idoGetNumberOfRelations(m_hWnd);
  1086.    }
  1087.  
  1088.    BOOL DragAddRelation(LPCSTR lpszVal)
  1089.    {
  1090.       return idoDragAddRelation(m_hWnd, lpszVal);
  1091.    }
  1092.  
  1093.    BOOL AddRelationFromClass(long lID, LPSTR lpszName, LPSTR lpszClass, LPSTR lpszText, long lsID, LPSTR lpszsName, long ldID, LPSTR lpszdName)
  1094.    {
  1095.       return idoAddRelationFromClass(m_hWnd, lID, lpszName, lpszClass, lpszText, lsID, lpszsName, ldID, lpszdName);
  1096.    }
  1097.  
  1098.    BOOL DeleteRelation(LPRELATION lpRel)
  1099.    {
  1100.       return idoDeleteRelation(m_hWnd, lpRel);
  1101.    }
  1102.    BOOL DeleteRelation(CRelation * lpRel)
  1103.    {
  1104.       return idoDeleteRelation(m_hWnd, &(lpRel->m_relation));
  1105.    }
  1106.  
  1107.    BOOL DoesRelationExist(long lID, LPSTR lpszName)
  1108.    {
  1109.       return idoDoesRelationExist(m_hWnd, lID, lpszName);
  1110.    }
  1111.  
  1112.    BOOL ReadDiagram(LPSTR lpszVal)
  1113.    {
  1114.       return idoReadDiagram(m_hWnd, lpszVal);
  1115.    }
  1116.    BOOL ReadDiagram(CString& szVal)
  1117.    {
  1118.       return idoReadDiagram(m_hWnd, (LPSTR)szVal.GetBuffer(0));
  1119.    }
  1120.  
  1121.    BOOL SaveDiagram(LPSTR lpszVal)
  1122.    {
  1123.       return idoSaveDiagram(m_hWnd, lpszVal);
  1124.    }
  1125.    BOOL SaveDiagram(CString& szVal)
  1126.    {
  1127.       return idoSaveDiagram(m_hWnd, (LPSTR)szVal.GetBuffer(0));
  1128.    }
  1129.  
  1130.    void ResetDiagram()
  1131.    {
  1132.       idoResetDiagram(m_hWnd);
  1133.    }
  1134.    void ResetPalette()
  1135.    {
  1136.      idoResetPalette(m_hWnd);
  1137.    }
  1138.  
  1139.    LPCSTR GetFileName()
  1140.    {
  1141.       return (LPCSTR)idoGetFileName(m_hWnd);
  1142.    }
  1143.    void SetFileName(LPCSTR lpFileName)
  1144.    {
  1145.      idoSetFileName(m_hWnd, (LPCSTR)lpFileName);
  1146.    }
  1147.    void SetFileName(CString& FileName)
  1148.    {
  1149.      idoSetFileName(m_hWnd, (LPCSTR)FileName.GetBuffer(0));
  1150.    }
  1151.  
  1152.    long GetVersion()
  1153.    {
  1154.      return idoGetVersion(m_hWnd);
  1155.    }
  1156.  
  1157.    BOOL ReadPalette(LPSTR lpszVal)
  1158.    {
  1159.       return idoReadPalette(m_hWnd, lpszVal);
  1160.    }
  1161.    BOOL ReadPalette(CString& szVal)
  1162.    {
  1163.       return idoReadPalette(m_hWnd, (LPSTR)szVal.GetBuffer(0));
  1164.    }
  1165.  
  1166.    BOOL SavePalette(LPSTR lpszVal)
  1167.    {
  1168.       return idoSavePalette(m_hWnd, lpszVal);
  1169.    }
  1170.    BOOL SavePalette(CString& szVal)
  1171.    {
  1172.       return idoSavePalette(m_hWnd, (LPSTR)szVal.GetBuffer(0));
  1173.    }
  1174.  
  1175.    void Zoom(int cVal, long lVal)
  1176.    {
  1177.       idoZoom(m_hWnd, cVal, lVal);
  1178.    }
  1179.  
  1180.    BOOL GetNotifyEntity(LPENTITY lpEnt)
  1181.    {
  1182.       return idoGetNotifyEntity(m_hWnd, lpEnt);
  1183.    }
  1184.    BOOL GetNotifyEntity(CEntity * lpEnt)
  1185.    {
  1186.       return idoGetNotifyEntity(m_hWnd, &(lpEnt->m_entity));
  1187.    }
  1188.    CEntity * GetNotifyEntity()
  1189.    {
  1190.       ENTITY entity;
  1191.       CEntity * lpEnt = NULL;
  1192.  
  1193.       if(idoGetNotifyEntity(m_hWnd, &entity))
  1194.          lpEnt = new CEntity(&entity);
  1195.  
  1196.       return lpEnt;
  1197.    }
  1198.  
  1199.    BOOL GetNotifyRelation(LPRELATION lpRel)
  1200.    {
  1201.       return idoGetNotifyRelation(m_hWnd, lpRel);
  1202.    }
  1203.    BOOL GetNotifyRelation(CRelation * lpRel)
  1204.    {
  1205.       return idoGetNotifyRelation(m_hWnd, &(lpRel->m_relation));
  1206.    }
  1207.    CRelation * GetNotifyRelation()
  1208.    {
  1209.       RELATION relation;
  1210.       CRelation * lpRel = NULL;
  1211.  
  1212.       if(idoGetNotifyRelation(m_hWnd, &relation))
  1213.          lpRel = new CRelation(&relation);
  1214.  
  1215.       return lpRel;
  1216.    }
  1217.  
  1218.    void Cut()
  1219.    {
  1220.       idoCut(m_hWnd);
  1221.    }
  1222.    void Copy()
  1223.    {
  1224.       idoCopy(m_hWnd);
  1225.    }
  1226.    void Paste()
  1227.    {
  1228.       idoPaste(m_hWnd);
  1229.    }
  1230.  
  1231.    void ManageClasses()
  1232.    {
  1233.       idoManageClasses(m_hWnd);
  1234.    }
  1235.    void ManageRules()
  1236.    {
  1237.       idoManageRules(m_hWnd);
  1238.    }
  1239.    void PrintDiagram()
  1240.    {
  1241.       idoPrintDiagram(m_hWnd);
  1242.    }
  1243.  
  1244.    void PropertyPage(int cVal)
  1245.    {
  1246.       idoPropertyPage(m_hWnd, cVal);
  1247.    }
  1248.  
  1249.    BOOL IterateSelectedEntityFirst()
  1250.    {
  1251.       return idoIterateSelectedEntityFirst(m_hWnd);
  1252.    }
  1253.    BOOL IterateSelectedEntityNext(LPENTITY lpEnt)
  1254.    {
  1255.       return idoIterateSelectedEntityNext(m_hWnd, lpEnt);
  1256.    }
  1257.    BOOL IterateSelectedEntityNext(CEntity * lpEnt)
  1258.    {
  1259.       return idoIterateSelectedEntityNext(m_hWnd, &(lpEnt->m_entity));
  1260.    }
  1261.    CEntity * IterateSelectedEntityNext()
  1262.    {
  1263.       ENTITY entity;
  1264.       CEntity * pEnt = NULL;
  1265.  
  1266.       if(idoIterateSelectedEntityNext(m_hWnd, &entity))
  1267.          pEnt = new CEntity(&entity);
  1268.  
  1269.       return pEnt;
  1270.    }
  1271.  
  1272.    BOOL IterateEntityFirst()
  1273.    {
  1274.       return idoIterateEntityFirst(m_hWnd);
  1275.    }
  1276.    BOOL IterateEntityNext(LPENTITY lpEnt)
  1277.    {
  1278.       return idoIterateEntityNext(m_hWnd, lpEnt);
  1279.    }
  1280.    BOOL IterateEntityNext(CEntity * lpEnt)
  1281.    {
  1282.       return idoIterateEntityNext(m_hWnd, &(lpEnt->m_entity));
  1283.    }
  1284.    CEntity * IterateEntityNext()
  1285.    {
  1286.       ENTITY entity;
  1287.       CEntity * pEnt = NULL;
  1288.  
  1289.       if(idoIterateEntityNext(m_hWnd, &entity))
  1290.          pEnt = new CEntity(&entity);
  1291.  
  1292.       return pEnt;
  1293.    }
  1294.  
  1295.    BOOL IterateRelationFirst()
  1296.    {
  1297.       return idoIterateRelationFirst(m_hWnd);
  1298.    }
  1299.    BOOL IterateRelationNext(LPRELATION lpRel)
  1300.    {
  1301.       return idoIterateRelationNext(m_hWnd, lpRel);
  1302.    }
  1303.    BOOL IterateRelationNext(CRelation * lpRel)
  1304.    {
  1305.       return idoIterateRelationNext(m_hWnd, &(lpRel->m_relation));
  1306.    }
  1307.    CRelation * IterateRelationNext()
  1308.    {
  1309.       RELATION relation;
  1310.       CRelation * lpRel = NULL;
  1311.  
  1312.       if(idoIterateRelationNext(m_hWnd, &relation))
  1313.          lpRel = new CRelation(&relation);
  1314.  
  1315.       return lpRel;
  1316.    }
  1317.  
  1318.    BOOL AddEntityClass(LPSTR lpszClass, LPSTR lpszBitmap, CEntity * lpCEnt)
  1319.    {
  1320.       if(lpCEnt)
  1321.          return idoAddEntityClass(m_hWnd, lpszClass, lpszBitmap, &(lpCEnt->m_entity));
  1322.       else
  1323.          return idoAddEntityClass(m_hWnd, lpszClass, lpszBitmap, NULL);
  1324.    }
  1325.    BOOL DeleteEntityClass(LPSTR lpszClass)
  1326.    {
  1327.       return idoDeleteEntityClass(m_hWnd, lpszClass);
  1328.    }
  1329.    BOOL RedefineFromEntityClass(LPSTR lpszClass)
  1330.    {
  1331.       return idoRedefineFromEntityClass(m_hWnd, lpszClass);
  1332.    }
  1333.    BOOL GetEntityClass(LPSTR lpszClassName, LPENTITY lpEnt)
  1334.    {
  1335.       return idoGetEntityClass(m_hWnd, lpszClassName, lpEnt);
  1336.    }
  1337.    BOOL GetEntityClass(LPSTR lpszClassName, CEntity * lpEnt)
  1338.    {
  1339.       return idoGetEntityClass(m_hWnd, lpszClassName, &(lpEnt->m_entity));
  1340.    }
  1341.    CEntity * GetEntityClass(LPSTR lpszClassName)
  1342.    {
  1343.       ENTITY entity;
  1344.       CEntity * lpEnt = NULL;
  1345.  
  1346.       if(idoGetEntityClass(m_hWnd, lpszClassName, &entity))
  1347.          lpEnt = new CEntity(&entity);
  1348.  
  1349.       return lpEnt;
  1350.    }
  1351.    BOOL DoesEntityClassExist(LPSTR lpszClassName)
  1352.    {
  1353.       return idoDoesEntityClassExist(m_hWnd, lpszClassName);
  1354.    }
  1355.    BOOL IterateEntityClassFirst()
  1356.    {
  1357.       return idoIterateEntityClassFirst(m_hWnd);
  1358.    }
  1359.    BOOL IterateEntityClassNext(LPSTR lpszVal)
  1360.    {
  1361.       return idoIterateEntityClassNext(m_hWnd, lpszVal);
  1362.    }
  1363.  
  1364.  
  1365.    BOOL AddRelationClass(LPSTR lpszClass, LPSTR lpszBitmap, CRelation * lpCRel)
  1366.    {
  1367.       if(lpCRel)
  1368.          return idoAddRelationClass(m_hWnd, lpszClass, lpszBitmap, &(lpCRel->m_relation));
  1369.       else
  1370.          return idoAddRelationClass(m_hWnd, lpszClass, lpszBitmap, NULL);
  1371.    }
  1372.    BOOL DeleteRelationClass(LPSTR lpszClass)
  1373.    {
  1374.       return idoDeleteRelationClass(m_hWnd, lpszClass);
  1375.    }
  1376.    BOOL RedefineFromRelationClass(LPSTR lpszClass)
  1377.    {
  1378.       return idoRedefineFromRelationClass(m_hWnd, lpszClass);
  1379.    }
  1380.    BOOL GetRelationClass(LPSTR lpszClassName, LPRELATION lpRel)
  1381.    {
  1382.       return idoGetRelationClass(m_hWnd, lpszClassName, lpRel);
  1383.    }
  1384.    BOOL GetRelationClass(LPSTR lpszClassName, CRelation * lpRel)
  1385.    {
  1386.       return idoGetRelationClass(m_hWnd, lpszClassName, &(lpRel->m_relation));
  1387.    }
  1388.    CRelation * GetRelationClass(LPSTR lpszClassName)
  1389.    {
  1390.       RELATION relation;
  1391.       CRelation * lpRel = NULL;
  1392.  
  1393.       if(idoGetRelationClass(m_hWnd, lpszClassName, &relation))
  1394.          lpRel = new CRelation(&relation);
  1395.  
  1396.       return lpRel;
  1397.    }
  1398.    BOOL DoesRelationClassExist(LPSTR lpszClassName)
  1399.    {
  1400.       return idoDoesRelationClassExist(m_hWnd, lpszClassName);
  1401.    }
  1402.    BOOL IterateRelationClassFirst()
  1403.    {
  1404.       return idoIterateRelationClassFirst(m_hWnd);
  1405.    }
  1406.    BOOL IterateRelationClassNext(LPSTR lpszVal)
  1407.    {
  1408.       return idoIterateRelationClassNext(m_hWnd, lpszVal);
  1409.    }
  1410.  
  1411.  
  1412.    BOOL AddRule(LPSTR lpszE1, LPSTR lpszR, LPSTR lpszE2)
  1413.    {
  1414.       return idoAddRule(m_hWnd, lpszE1, lpszR, lpszE2);
  1415.    }
  1416.    BOOL DeleteRule(CIDORule * lpRule)
  1417.    {
  1418.       return idoDeleteRule(m_hWnd, &(lpRule->m_rule));
  1419.    }
  1420.    BOOL DoesRuleExist(LPSTR lpszE1, LPSTR lpszR, LPSTR lpszE2)
  1421.    {
  1422.       return idoDoesRuleExist(m_hWnd, lpszE1, lpszR, lpszE2);
  1423.    }
  1424.    BOOL IterateRuleFirst()
  1425.    {
  1426.       return idoIterateRuleFirst(m_hWnd);
  1427.    }
  1428.    BOOL IterateRuleNext(CIDORule * lpRule)
  1429.    {
  1430.       return idoIterateRuleNext(m_hWnd, &(lpRule->m_rule));
  1431.    }
  1432.    CIDORule * IterateRuleNext()
  1433.    {
  1434.       IDO_RULE rule;
  1435.       CIDORule * lpRule = NULL;
  1436.  
  1437.       if(idoIterateRuleNext(m_hWnd, &rule))
  1438.          lpRule = new CIDORule(&rule);
  1439.  
  1440.       return lpRule;
  1441.    }
  1442.  
  1443.  
  1444.    BOOL GetEntity(long lID, LPSTR lpszName, LPENTITY lpEnt)
  1445.    {
  1446.       return idoGetEntity(m_hWnd, lID, lpszName, lpEnt);
  1447.    }
  1448.    BOOL GetEntity(long lID, LPSTR lpszName, CEntity * lpEnt)
  1449.    {
  1450.       return idoGetEntity(m_hWnd, lID, lpszName, &(lpEnt->m_entity));
  1451.    }
  1452.    CEntity * GetEntity(long lID, LPSTR lpszName)
  1453.    {
  1454.       ENTITY entity;
  1455.       CEntity * lpEnt = NULL;
  1456.  
  1457.       if(idoGetEntity(m_hWnd, lID, lpszName, &entity))
  1458.          lpEnt = new CEntity(&entity);
  1459.  
  1460.       return lpEnt;
  1461.    }
  1462.  
  1463.    BOOL GetRelation(long lID, LPSTR lpszName, LPRELATION lpRel)
  1464.    {
  1465.       return idoGetRelation(m_hWnd, lID, lpszName, lpRel);
  1466.    }
  1467.    BOOL GetRelation(long lID, LPSTR lpszName, CRelation * lpRel)
  1468.    {
  1469.       return idoGetRelation(m_hWnd, lID, lpszName, &(lpRel->m_relation));
  1470.    }
  1471.    CRelation * GetRelation(long lID, LPSTR lpszName)
  1472.    {
  1473.       RELATION relation;
  1474.       CRelation * lpRel = NULL;
  1475.  
  1476.       if(idoGetRelation(m_hWnd, lID, lpszName, &relation))
  1477.          lpRel = new CRelation(&relation);
  1478.  
  1479.       return lpRel;
  1480.    }
  1481.  
  1482. };
  1483.  
  1484.  
  1485. //============================================================================
  1486. // CEntity Class Explicit inline functions.
  1487.  
  1488. inline BOOL CEntity::IterateRelationInNext(LPRELATION lpRel)
  1489.    {
  1490.       return idoEntityIterateRelationInNext(&m_entity, lpRel);
  1491.    }
  1492. inline BOOL CEntity::IterateRelationInNext(CRelation * lpRel)
  1493.    {
  1494.       return idoEntityIterateRelationInNext(&m_entity, &(lpRel->m_relation));
  1495.    }
  1496. inline CRelation * CEntity::IterateRelationInNext()
  1497.    {
  1498.       RELATION relation;
  1499.       CRelation * lpRel = NULL;
  1500.  
  1501.       if(idoEntityIterateRelationInNext(&m_entity, &relation))
  1502.          lpRel = new CRelation(&relation);
  1503.  
  1504.       return lpRel;
  1505.    }
  1506.  
  1507. inline BOOL CEntity::IterateRelationOutNext(LPRELATION lpRel)
  1508.    {
  1509.       return idoEntityIterateRelationOutNext(&m_entity, lpRel);
  1510.    }
  1511. inline BOOL CEntity::IterateRelationOutNext(CRelation * lpRel)
  1512.    {
  1513.       return idoEntityIterateRelationOutNext(&m_entity, &(lpRel->m_relation));
  1514.    }
  1515. inline CRelation * CEntity::IterateRelationOutNext()
  1516.    {
  1517.       RELATION relation;
  1518.       CRelation * lpRel = NULL;
  1519.  
  1520.       if(idoEntityIterateRelationOutNext(&m_entity, &relation))
  1521.          lpRel = new CRelation(&relation);
  1522.  
  1523.       return lpRel;
  1524.    }
  1525.  
  1526. inline BOOL CEntity::IterateContainedEntityNext(LPENTITY lpEnt)
  1527.    {
  1528.       return idoEntityIterateContainedEntityNext(&m_entity, lpEnt);
  1529.    }
  1530. inline BOOL CEntity::IterateContainedEntityNext(CEntity * lpEnt)
  1531.    {
  1532.       return idoEntityIterateContainedEntityNext(&m_entity, &(lpEnt->m_entity));
  1533.    }
  1534. inline CEntity * CEntity::IterateContainedEntityNext()
  1535.    {
  1536.       ENTITY entity;
  1537.       CEntity * lpEnt = NULL;
  1538.  
  1539.       if(idoEntityIterateContainedEntityNext(&m_entity, &entity))
  1540.          lpEnt = new CEntity(&entity);
  1541.  
  1542.       return lpEnt;
  1543.    }
  1544.  
  1545.  
  1546. //============================================================================
  1547. // CRelation Class Explicit inline functions.
  1548.  
  1549. inline BOOL CRelation::SourceEntity(LPENTITY lpEnt)
  1550.    {
  1551.       return idoRelationSourceEntity(&m_relation, lpEnt);
  1552.    }
  1553. inline BOOL CRelation::SourceEntity(CEntity * lpEnt)
  1554.    {
  1555.       return idoRelationSourceEntity(&m_relation, &(lpEnt->m_entity));
  1556.    }
  1557. inline CEntity * CRelation::SourceEntity()
  1558.    {
  1559.       ENTITY entity;
  1560.       CEntity *lpEntity = NULL;
  1561.  
  1562.       if(idoRelationSourceEntity(&m_relation, &entity))
  1563.          lpEntity = new CEntity(&entity);
  1564.  
  1565.       return lpEntity;
  1566.    }
  1567.  
  1568. inline BOOL CRelation::DestinationEntity(LPENTITY lpEnt)
  1569.    {
  1570.       return idoRelationDestinationEntity(&m_relation, lpEnt);
  1571.    }
  1572. inline BOOL CRelation::DestinationEntity(CEntity * lpEnt)
  1573.    {
  1574.       return idoRelationDestinationEntity(&m_relation, &(lpEnt->m_entity));
  1575.    }
  1576. inline CEntity * CRelation::DestinationEntity()
  1577.    {
  1578.       ENTITY entity;
  1579.       CEntity *lpEntity = NULL;
  1580.  
  1581.       if(idoRelationDestinationEntity(&m_relation, &entity))
  1582.          lpEntity = new CEntity(&entity);
  1583.  
  1584.       return lpEntity;
  1585.    }
  1586.  
  1587.  
  1588. #endif   // ifndef __IDOMFC_H__
  1589.  
  1590.