00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #if !defined(AFX_MAINFRM_H__FA98B70F_D0B7_11D3_BC39_00C04F602FEE1__INCLUDED_)
00038 #define AFX_MAINFRM_H__FA98B70F_D0B7_11D3_BC39_00C04F602FEE1__INCLUDED_
00039
00044 #if _MSC_VER > 1000
00045 #pragma once
00046 #endif // _MSC_VER > 1000
00047
00048 #include "HwndFunctions.h"
00049 #include "ConfigFrm.h"
00050
00051
00059 class CMainSyncFrame : public CFrameWnd
00060 {
00061
00062 private:
00063
00064
00065 int contactsBegin;
00066 int calendarBegin;
00067 int tasksBegin;
00068 int notesBegin;
00069
00070 protected:
00071 CMainSyncFrame();
00072 DECLARE_DYNCREATE(CMainSyncFrame)
00073
00074 public:
00075 CConfigFrame* pConfigFrame;
00076
00077
00078 HBITMAP hBmpDarkBlue;
00079 HBITMAP hBmpBlue;
00080 HBITMAP hBmpDark;
00081 HBITMAP hBmpLight;
00082
00083 protected:
00084 HANDLE hSyncThread;
00085 DWORD dwThreadId;
00086 bool configOpened;
00087 int dpiX, dpiY;
00088
00089
00090
00091
00092 public:
00093 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00094 protected:
00095 virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
00096
00097
00098
00099 public:
00100 virtual ~CMainSyncFrame();
00101 void backupSyncModeSettings();
00102 void restoreSyncModeSettings();
00103 void showSettingsWindow(const int paneToDisplay = 1);
00104
00105
00106 bool checkConnectionSettings();
00107
00108 int getDpiX() {return dpiX;}
00109 int getDpiY() {return dpiY;}
00110
00111 #ifdef _DEBUG
00112 virtual void AssertValid() const;
00113 virtual void Dump(CDumpContext& dc) const;
00114 #endif
00115
00116 protected:
00117
00118 int syncModeCalendar;
00119 int syncModeContacts;
00120 int syncModeTasks;
00121 int syncModeNotes;
00122
00123
00124 int currentSource;
00125 int totalItems;
00126 int currentItem;
00127
00128 CFont fontBold;
00129
00130 public:
00131 CStatusBar wndStatusBar;
00132 CSplitter wndSplitter;
00133 bool bSyncStarted;
00134
00135 void OnConfigClosed();
00136 void StartSync();
00137 int CancelSync();
00138
00139
00140 protected:
00141
00142 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00143
00144
00145
00146 DECLARE_MESSAGE_MAP()
00147 public:
00148
00149 afx_msg LRESULT OnMsgSyncBegin(WPARAM , LPARAM);
00150 afx_msg LRESULT OnMsgSyncEnd(WPARAM , LPARAM);
00151 afx_msg LRESULT OnMsgSyncSourceBegin(WPARAM , LPARAM);
00152 afx_msg LRESULT OnMsgSyncSourceEnd(WPARAM , LPARAM);
00153 afx_msg LRESULT OnMsgItemSynced(WPARAM , LPARAM);
00154 afx_msg LRESULT OnMsgTotalItems(WPARAM , LPARAM);
00155 afx_msg LRESULT OnMsgStartSyncBegin(WPARAM , LPARAM);
00156 afx_msg LRESULT OnMsgStartsyncEnded(WPARAM , LPARAM);
00157 afx_msg LRESULT OnMsgRefreshStatusBar(WPARAM, LPARAM);
00158 afx_msg LRESULT OnMsgSyncSourceState(WPARAM, LPARAM);
00159 afx_msg LRESULT OnMsgUnlockButtons(WPARAM, LPARAM);
00160
00161 afx_msg void OnFileConfiguration();
00162 afx_msg void OnToolsFullSync();
00163 afx_msg void OnFileSynchronize();
00164 afx_msg int OnCancelSync();
00165 afx_msg void OnToolsSetloglevel();
00166
00167 afx_msg BOOL OnNcActivate(BOOL bActive);
00168 afx_msg void OnClose();
00169 };
00170
00171
00172 DWORD WINAPI syncThread(LPVOID lpParam);
00173 DWORD WINAPI syncThreadKiller(LPVOID lpParam);
00174
00176
00177
00178
00179
00182 #endif // !defined(AFX_MAINFRM_H__FA98B70F_D0B7_11D3_BC39_00C04F602FEE__INCLUDED_)