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.

183 lines
5.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1998.
  5. //
  6. // File: Settings.h
  7. //
  8. // Contents: Onestop Settings PropertyPage Dialog box classes
  9. //
  10. // Classes: CAutoSyncPage
  11. // CSchedSyncPage
  12. //
  13. // Notes:
  14. //
  15. // History: 14-Nov-97 SusiA Created.
  16. //
  17. //--------------------------------------------------------------------------
  18. #ifndef _SETTINGSDLG_
  19. #define _SETTINGSDLG_
  20. // definitions for Advnanced Idle Setting Spin Control
  21. #define SPINDIALWAITMINUTES_MIN 1
  22. #define SPINDIALWAITMINUTES_MAX 999
  23. #define SPINDIALREPEATMINUTES_MIN 1
  24. #define SPINDIALREPEATMINUTES_MAX 999
  25. #define WM_NOTIFYLISTVIEWEX (WM_USER + 1)
  26. //+-------------------------------------------------------------------------------
  27. //
  28. // CLASS: CAutoSyncPage
  29. //
  30. // PURPOSE: Handle the AutoSync Psge
  31. //
  32. //--------------------------------------------------------------------------------
  33. class CAutoSyncPage
  34. {
  35. public:
  36. inline CAutoSyncPage(HINSTANCE hinst);
  37. ~CAutoSyncPage();
  38. void SetAutoSyncHwnd(HWND hwnd);
  39. void SetIdleHwnd(HWND hwnd);
  40. BOOL InitializeHwnd(HWND hwnd,SYNCTYPE syncType,DWORD dwDefaultConnection);
  41. DWORD GetNumConnections(HWND hwnd,SYNCTYPE syncType);
  42. BOOL ShowItemsOnThisConnection(HWND hwnd,SYNCTYPE syncType,DWORD dwConnectionNum);
  43. BOOL SetItemCheckState(HWND hwnd,SYNCTYPE syncType,int iItem, BOOL fChecked,int iCheckCount);
  44. BOOL SetConnectionCheck(HWND hwnd,SYNCTYPE syncType,WORD wParam,DWORD dwCheckState);
  45. HRESULT GetAdvancedIdleSettings(LPCONNECTIONSETTINGS pConnectionSettings);
  46. HRESULT SetAdvancedIdleSettings(LPCONNECTIONSETTINGS pConnectionSettings);
  47. HRESULT ShowProperties(HWND hwnd,int iItem);
  48. SCODE CommitAutoSyncChanges();
  49. SCODE CommitIdleChanges();
  50. private:
  51. BOOL InitializeHandler(HWND hwnd,SYNCTYPE SyncType);
  52. BOOL Initialize(HWND hwnd,DWORD dwDefaultConnection); // called to initialize the AutoSync page
  53. CHndlrQueue *m_HndlrQueue;
  54. HWND m_hwndAutoSync;
  55. HWND m_hwndIdle;
  56. CListView *m_pItemListViewAutoSync;
  57. CListView *m_pItemListViewIdle;
  58. BOOL m_pItemListViewAutoSyncInitialized;
  59. BOOL m_fListViewIdleInitialized;
  60. HINSTANCE m_hinst;
  61. CRasUI *m_pRas;
  62. BOOL m_fInitialized;
  63. BOOL m_fItemsOnConnection;
  64. friend INT_PTR CALLBACK AutoSyncDlgProc(HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam);
  65. friend INT_PTR CALLBACK IdleSyncDlgProc(HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam);
  66. };
  67. //+-------------------------------------------------------------------------------
  68. //
  69. // CLASS: CSchedSyncPage
  70. //
  71. // PURPOSE: Handle the SchedSync Psge
  72. //
  73. //--------------------------------------------------------------------------------
  74. class CSchedSyncPage
  75. {
  76. public:
  77. CSchedSyncPage(HINSTANCE hinst, HWND hwnd);
  78. ~CSchedSyncPage();
  79. BOOL Initialize();
  80. BOOL ShowAllSchedules();
  81. BOOL FreeAllSchedules();
  82. HRESULT InitializeScheduleAgent();
  83. BOOL StartScheduleWizard();
  84. BOOL EditTask(int iItem);
  85. BOOL RemoveTask(int iItem);
  86. BOOL OnCommand(HWND hDlg, WORD wNotifyCode, WORD wID, HWND hwndCtl);
  87. BOOL OnNotify(HWND hwnd, int idFrom, LPNMHDR pnmhdr);
  88. BOOL SetButtonState(int nIDDlgItem,BOOL fEnabled);
  89. private:
  90. HWND m_hwnd;
  91. HINSTANCE m_hinst;
  92. LPSYNCSCHEDULEMGR m_pISyncSchedMgr;
  93. int m_iDefaultIconImageIndex;
  94. };
  95. //+-------------------------------------------------------------------------------
  96. //
  97. // FUNCTION: CAutoSyncPage::CAutoSyncPage(HWND hwnd)
  98. //
  99. // PURPOSE: Constructor
  100. //
  101. // COMMENTS: Constructor for AutoSync page
  102. //
  103. //--------------------------------------------------------------------------------
  104. inline CAutoSyncPage::CAutoSyncPage(HINSTANCE hinst)
  105. {
  106. m_hinst = hinst;
  107. m_HndlrQueue = NULL;
  108. m_fInitialized = FALSE;
  109. m_fItemsOnConnection = FALSE;
  110. m_hwndIdle = NULL;
  111. m_hwndAutoSync = NULL;
  112. m_pItemListViewAutoSync = NULL;
  113. m_pItemListViewIdle = NULL;
  114. m_pItemListViewAutoSyncInitialized = FALSE;
  115. m_fListViewIdleInitialized = FALSE;
  116. }
  117. //+-------------------------------------------------------------------------------
  118. //
  119. // FUNCTION: CSchedSyncPage::CSchedSyncPage(HWND hwnd)
  120. //
  121. // PURPOSE: Constructor
  122. //
  123. // COMMENTS: Constructor for SchedSync page
  124. //
  125. //--------------------------------------------------------------------------------
  126. inline CSchedSyncPage::CSchedSyncPage(HINSTANCE hinst, HWND hwnd)
  127. {
  128. m_hwnd = hwnd;
  129. m_hinst = hinst;
  130. m_pISyncSchedMgr = NULL;
  131. }
  132. //+-------------------------------------------------------------------------------
  133. //
  134. // FUNCTION: CSchedSyncPage::~CSchedSyncPage(HWND hwnd)
  135. //
  136. // PURPOSE: Constructor
  137. //
  138. // COMMENTS: Constructor for SchedSync page
  139. //
  140. //--------------------------------------------------------------------------------
  141. inline CSchedSyncPage::~CSchedSyncPage()
  142. {
  143. if (m_pISyncSchedMgr)
  144. {
  145. m_pISyncSchedMgr->Release();
  146. }
  147. }
  148. #endif // _SETTINGSDLG_