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
00052
00053 DWORD WINAPI syncThread(LPVOID lpParam);
00054 DWORD WINAPI syncThreadKiller(LPVOID lpParam);
00055
00056
00066 class CMainSyncFrame : public CFrameWnd
00067 {
00068
00069 private:
00070
00071
00072
00073 int contactsBegin;
00074 int calendarBegin;
00075 int tasksBegin;
00076 int notesBegin;
00077 int picturesBegin;
00078
00079
00080 protected:
00081
00082 CMainSyncFrame();
00083 DECLARE_DYNCREATE(CMainSyncFrame)
00084
00085 HANDLE hSyncThread;
00086 DWORD dwThreadId;
00087 bool configOpened;
00088 int dpiX, dpiY;
00089
00090
00091 int syncModeCalendar;
00092 int syncModeContacts;
00093 int syncModeTasks;
00094 int syncModeNotes;
00095 int syncModePictures;
00096
00097
00098 bool backupEnabledContacts;
00099 bool backupEnabledCalendar;
00100 bool backupEnabledTasks;
00101 bool backupEnabledNotes;
00102 bool backupEnabledPictures;
00103
00104
00105
00106 int currentSource;
00107 int totalItems;
00108 int currentItem;
00109
00110 CFont fontBold;
00111
00112 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00113
00114
00115
00116
00117 protected:
00118 virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
00119
00120
00121 DECLARE_MESSAGE_MAP()
00122
00123
00124
00125 afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
00126
00127 public:
00128
00129 CConfigFrame* pConfigFrame;
00130
00131
00132 HBITMAP hBmpDarkBlue;
00133 HBITMAP hBmpBlue;
00134 HBITMAP hBmpDark;
00135 HBITMAP hBmpLight;
00136
00137 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00138 virtual ~CMainSyncFrame();
00139 void backupSyncModeSettings();
00140 void restoreSyncModeSettings();
00141 void showSettingsWindow(const int paneToDisplay = 1);
00142
00143
00144 bool checkConnectionSettings();
00145
00146 int getDpiX() {return dpiX;}
00147 int getDpiY() {return dpiY;}
00148
00149 #ifdef _DEBUG
00150 virtual void AssertValid() const;
00151 virtual void Dump(CDumpContext& dc) const;
00152 #endif
00153
00154 CStatusBar wndStatusBar;
00155 CSplitter wndSplitter;
00156 bool bSyncStarted;
00157
00158 void OnConfigClosed();
00159 void StartSync();
00160 int CancelSync(bool confirm = true);
00161
00162
00163 afx_msg LRESULT OnMsgSyncBegin (WPARAM , LPARAM);
00164 afx_msg LRESULT OnMsgSyncEnd (WPARAM , LPARAM);
00165 afx_msg LRESULT OnMsgSyncSourceBegin(WPARAM , LPARAM);
00166 afx_msg LRESULT OnMsgSyncSourceEnd (WPARAM , LPARAM);
00167 afx_msg LRESULT OnMsgItemSynced (WPARAM , LPARAM);
00168 afx_msg LRESULT OnMsgTotalItems (WPARAM , LPARAM);
00169 afx_msg LRESULT OnMsgStartSyncBegin (WPARAM , LPARAM);
00170 afx_msg LRESULT OnMsgStartsyncEnded (WPARAM , LPARAM);
00171 afx_msg LRESULT OnMsgRefreshStatusBar(WPARAM, LPARAM);
00172 afx_msg LRESULT OnMsgSyncSourceState(WPARAM, LPARAM);
00173 afx_msg LRESULT OnMsgUnlockButtons (WPARAM, LPARAM);
00174 afx_msg LRESULT OnMsgLockButtons (WPARAM, LPARAM);
00175
00176 afx_msg LRESULT CancelSync(WPARAM wParam, LPARAM lParam);
00177
00178 afx_msg LRESULT Synchronize(WPARAM wParam, LPARAM lParam);
00179
00180 afx_msg void OnFileConfiguration();
00181 afx_msg void OnToolsFullSync();
00182 afx_msg void OnFileSynchronize();
00183 afx_msg int OnCancelSync();
00184 afx_msg void OnToolsSetloglevel();
00185
00186 afx_msg BOOL OnNcActivate(BOOL bActive);
00187 afx_msg void OnClose();
00188
00189 afx_msg LRESULT OnMsgPopup(WPARAM wParam, LPARAM lParam);
00190 afx_msg LRESULT OnOKMsg(WPARAM wParam, LPARAM lParam);
00191 };
00192
00193
00196 #endif