Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
4.0 KiB

  1. //==============================================================;
  2. //
  3. // This source code is only intended as a supplement to
  4. // existing Microsoft documentation.
  5. //
  6. //
  7. //
  8. //
  9. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  10. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  11. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  12. // PURPOSE.
  13. //
  14. // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  15. //
  16. //
  17. //
  18. //==============================================================;
  19. #ifndef _SPACE_H
  20. #define _SPACE_H
  21. #include "DeleBase.h"
  22. #include "CompData.h"
  23. class CSpaceStation;
  24. class CComponentData;
  25. class CRocket : public CDelegationBase {
  26. public:
  27. CRocket(CSpaceStation *pSpaceStation, _TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload);
  28. virtual ~CRocket();
  29. virtual const _TCHAR *GetDisplayName(int nCol = 0);
  30. virtual const GUID & getNodeType() { return thisGuid; }
  31. virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
  32. BOOL getDeletedStatus() { return isDeleted; }
  33. void setDeletedStatus(BOOL status) { isDeleted = status; }
  34. public:
  35. // virtual functions go here (for MMCN_*)
  36. virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
  37. virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype);
  38. virtual HRESULT OnDelete(IConsole *pConsole);
  39. virtual HRESULT OnRefresh(IConsole *pConsole);
  40. virtual HRESULT OnRename(LPOLESTR pszNewName);
  41. private:
  42. // {29743810-4C4B-11d2-89D8-000021473128}
  43. static const GUID thisGuid;
  44. _TCHAR *szName;
  45. LONG lWeight;
  46. LONG lHeight;
  47. LONG lPayload;
  48. int nId;
  49. friend CSpaceStation;
  50. CSpaceStation *m_pSpaceStation;
  51. enum ROCKET_STATUS {RUNNING, PAUSED, STOPPED} iStatus;
  52. BOOL isDeleted;
  53. };
  54. class CSpaceStation : public CDelegationBase {
  55. public:
  56. CSpaceStation();
  57. virtual ~CSpaceStation();
  58. virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Space Station"); }
  59. virtual const GUID & getNodeType() { return thisGuid; }
  60. virtual const int GetBitmapIndex() { return INDEX_STATION; }
  61. public:
  62. virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
  63. virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions);
  64. virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
  65. virtual HRESULT OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted);
  66. virtual HRESULT OnQueryPaste(CDelegationBase *pPasted);
  67. virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype);
  68. virtual HRESULT OnDeleteScopeItem(IConsoleNameSpace *pConsoleNameSpace);
  69. private:
  70. // {29743810-4C4B-11d2-89D8-000021473128}
  71. static const GUID thisGuid;
  72. HRESULT Expand(IConsoleNameSpace *pConsoleNameSpace);
  73. private:
  74. enum { NUMBER_OF_CHILDREN = 9, MAX_CHILDREN = 20 };
  75. CRocket *children[MAX_CHILDREN];
  76. CComponentData *m_pComponentData;
  77. int m_cChildSpaceStations;
  78. public:
  79. int GetCountChildSpaceStations() { return m_cChildSpaceStations; }
  80. void DecrementCountChildSpaceStations() { m_cChildSpaceStations--; }
  81. };
  82. class CSpaceFolder : public CDelegationBase {
  83. public:
  84. CSpaceFolder();
  85. virtual ~CSpaceFolder();
  86. virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Space Vehicles"); }
  87. virtual const GUID & getNodeType() { return thisGuid; }
  88. virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
  89. public:
  90. // virtual functions go here (for MMCN_*)
  91. virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
  92. private:
  93. enum { IDM_NEW_SPACE = 4 };
  94. // {29743810-4C4B-11d2-89D8-000021473128}
  95. static const GUID thisGuid;
  96. private:
  97. enum { NUMBER_OF_CHILDREN = 4 };
  98. CSpaceStation *children[NUMBER_OF_CHILDREN];
  99. };
  100. #endif // _SPACE_H