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.

101 lines
2.1 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. ESPSTATE.H
  5. History:
  6. --*/
  7. #pragma once
  8. // *************************************************************************************************
  9. // TEMPORARY: Move to seperate file
  10. #pragma warning(disable: 4275) // non dll-interface class 'foo' used
  11. // as base for dll-interface class 'bar'
  12. class LTAPIENTRY CEspState : public CObject
  13. {
  14. // Construction
  15. public:
  16. CEspState();
  17. // Enums
  18. public:
  19. enum eState
  20. {
  21. esIdle = 0,
  22. esUpdate = 1,
  23. esGenerate = 2,
  24. esUpload = 3,
  25. esCopyData = 4,
  26. esImportData = 5,
  27. esImportGlossary = 7,
  28. esInternal = 8,
  29. esMerge = 9,
  30. esOther = 10,
  31. esOpeningMainTab = 11,
  32. esOpeningResEdTab = 12,
  33. esSavingResEdChanges = 13,
  34. esApplyingFilter = 14,
  35. esOpeningEDB = 15,
  36. NUM_STATES
  37. };
  38. // Data
  39. private:
  40. BOOL m_fComplete;
  41. IDispatch * m_pdispCheckTree;
  42. IDispatch * m_pdispDescBox;
  43. IDispatch * m_pdispDlgGlosGrid;
  44. eState m_nOperation; // Current operation
  45. eState m_nLastOperation; // Previous operation
  46. // Operations
  47. public:
  48. eState GetState();
  49. eState GetLastState();
  50. BOOL SetState(eState state);
  51. BOOL StartState(eState state); // Moves to state and not complete
  52. BOOL FinishState(); // Moves to idle and complete
  53. BOOL GetComplete();
  54. void SetComplete(BOOL fComplete = TRUE);
  55. // Functions to store the current CheckTree and DescBox.
  56. //
  57. // NOTE: These functions do not AddRef() the pointers assigned since they
  58. // should never hold onto the interface outside of the parent's lifetime.
  59. //
  60. IDispatch * GetCurrentCheckTree();
  61. IDispatch * GetCurrentDescBox();
  62. IDispatch * GetCurrentDlgGlosGrid();
  63. void SetCurrentCheckTree(IDispatch * pdisp);
  64. void SetCurrentDescBox(IDispatch * pdisp);
  65. void SetCurrentDlgGlosGrid(IDispatch * pdisp);
  66. };
  67. //
  68. // Sets a state on creation, calls FinishState on destruction
  69. class LTAPIENTRY CEspStateObj
  70. {
  71. public:
  72. CEspStateObj(CEspState::eState);
  73. ~CEspStateObj();
  74. private:
  75. int foo;
  76. };
  77. #pragma warning(default: 4275)
  78. LTAPIENTRY CEspState & GetEspState();