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.

96 lines
2.3 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. //
  3. // Tab state
  4. //
  5. // 3-11-98 sburns
  6. #ifndef STATE_HPP_INCLUDED
  7. #define STATE_HPP_INCLUDED
  8. #include <chstring.h>
  9. #include "..\common\sshWbemHelpers.h"
  10. // Singleton state of the UI.
  11. #define NET_API_STATUS DWORD
  12. class State
  13. {
  14. public:
  15. // Init() actually builds the instance
  16. State();
  17. // Delete destroys the instance
  18. ~State();
  19. void Init(CWbemClassObject &computer,
  20. CWbemClassObject &os,
  21. CWbemClassObject dns);
  22. void Refresh();
  23. bool ChangesNeedSaving() const;
  24. bool IsMachineDC() const;
  25. bool IsNetworkingInstalled() const;
  26. bool IsMemberOfWorkgroup() const;
  27. void SetIsMemberOfWorkgroup(bool yesNo);
  28. CHString GetComputerDomainDNSName() const;
  29. void SetComputerDomainDNSName(const CHString& newName);
  30. bool ComputerDomainDNSNameWasChanged() const;
  31. CHString GetFullComputerName() const;
  32. CHString GetNetBIOSComputerName() const;
  33. CHString GetShortComputerName() const;
  34. void SetShortComputerName(const CHString& name);
  35. bool WasShortComputerNameChanged() const;
  36. CHString GetOriginalShortComputerName() const;
  37. CHString GetDomainName() const;
  38. void SetDomainName(const CHString& name);
  39. bool WasMembershipChanged() const;
  40. bool GetSyncDNSNames() const;
  41. void SetSyncDNSNames(bool yesNo);
  42. bool SyncDNSNamesWasChanged() const;
  43. bool SaveChanges(HWND dialog);
  44. CHString GetUsername() const;
  45. void SetUsername(const CHString& name);
  46. CHString GetPassword() const;
  47. void SetPassword(const CHString& password);
  48. // indicates that changes have been made in this session.
  49. bool MustReboot() const;
  50. void SetMustRebootFlag(bool yesNo);
  51. // indicates that changes have been made in this or prior sessions.
  52. bool NeedsReboot() const;
  53. private:
  54. CWbemClassObject m_computer;
  55. CWbemClassObject m_OS;
  56. CWbemClassObject m_DNS;
  57. // not implemented: no copying allowed
  58. State(const State&);
  59. const State& operator=(const State&);
  60. bool doSaveDomainChange(HWND dialog);
  61. bool doSaveWorkgroupChange(HWND dialog);
  62. bool doSaveNameChange(HWND dialog);
  63. void setFullComputerName();
  64. CHString username;
  65. CHString password;
  66. bool must_reboot;
  67. };
  68. #endif // STATE_HPP_INCLUDED