home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / ole / oleview / iviewers / tree.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.7 KB  |  95 lines

  1. // tree.h
  2.  
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #ifndef __TREE_H__
  14. #define __TREE_H__
  15.  
  16. // base class
  17. class CTreeItem : public CObject
  18. {
  19. public:
  20.     CTreeItem( CTreeCtrl* pTree = NULL) ;
  21.     virtual ~CTreeItem();
  22.     DECLARE_DYNCREATE(CTreeItem)
  23.  
  24. // Attributes
  25. public:
  26.     IUnknown*       m_punk ;
  27.     CTreeCtrl*      m_pTree ;
  28.  
  29.     // enum of entry types.
  30.     //
  31.     typedef enum {
  32.         typeUnknown         ,
  33.         typeUnknown2        ,
  34.         typeTypeLib         ,
  35.         typeTypeLib2        ,
  36.         typeTypeInfo        ,
  37.         typeTypeInfo2       ,
  38.         typeMethods         ,
  39.         typeMethods2        ,
  40.         typeProperties      ,
  41.         typeProperties2     ,
  42.         typeConstants       ,
  43.         typeConstants2      ,
  44.         typeImplTypes       ,
  45.         typeImplTypes2      ,
  46.         typeMethod          ,
  47.         typeProperty        ,
  48.         typeConstant        ,
  49.         typeEnum            ,       // TKIND_ENUM
  50.         typeRecord          ,       // TKIND_RECORD
  51.         typeModule          ,       // TKIND_MODULE
  52.         typeInterface       ,       // TKIND_INTERFACE
  53.         typeDispinterface   ,       // TKIND_DISPATCH
  54.         typeCoClass         ,       // TKIND_COCLASS
  55.         typeAlias           ,       // TKIND_ALIAS
  56.         typeUnion           ,       // TKIND_UNION
  57.         typeEnums           ,
  58.         typeRecords         ,
  59.         typeModules         ,
  60.         typeInterfaces      ,
  61.         typeDispinterfaces  ,
  62.         typeCoClasses       ,
  63.         typeAliases         ,
  64.         typeUnions          ,
  65.     } ITEM_TYPE ;
  66.  
  67.     ITEM_TYPE       m_Type ;
  68.     MEMBERID        m_uiMemid ;    // memid of the func/var/const
  69.  
  70. // Operations:
  71. public:
  72.     CString         TYPEDESCtoString( TYPEDESC* lptdesc ) ;
  73.     TYPEKIND        GetTypeKind() ;
  74.     ITEM_TYPE       TypeKindToItemType( TYPEKIND tkind) ;
  75.     void            GetName(CString& szReturn, BOOL fIDLStyle = FALSE ) ;
  76.  
  77.     virtual ITypeLib* GetTypeLib()
  78.         {return (ITypeLib*)m_punk;}
  79.     virtual void SetTypeLib(ITypeLib* punk)
  80.         {ASSERT(punk); m_punk = (IUnknown*)punk;}
  81.  
  82.     virtual ITypeInfo* GetTypeInfo()
  83.         {return (ITypeInfo*)m_punk;}
  84.     virtual void SetTypeInfo(ITypeInfo* punk)
  85.         {ASSERT(punk); m_punk = (IUnknown*)punk;}
  86.  
  87.     virtual BOOL Expand( HTREEITEM hitem ) ;
  88.     virtual BOOL ExpandTypeLib( HTREEITEM hitem ) ;
  89.     virtual BOOL ExpandTypeInfo( HTREEITEM hitem ) ;
  90.     virtual BOOL ExpandFuncs( HTREEITEM hitem ) ;
  91.     virtual BOOL ExpandVars( HTREEITEM hitem ) ;
  92.     virtual BOOL ExpandImplTypes( HTREEITEM hitem ) ;
  93. };
  94. #endif
  95.