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.

100 lines
2.3 KiB

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