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 DECLARE_MESSAGE_MAP()
00115
00116 virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
00117
00119 afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
00120
00121 public:
00122
00123 CConfigFrame* pConfigFrame;
00124
00125
00126 HBITMAP hBmpDarkBlue;
00127 HBITMAP hBmpBlue;
00128 HBITMAP hBmpDark;
00129 HBITMAP hBmpLight;
00130
00131 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00132 virtual ~CMainSyncFrame();
00133 void backupSyncModeSettings();
00134 void restoreSyncModeSettings();
00135 void showSettingsWindow(const int paneToDisplay = 1);
00136
00137
00138 bool checkConnectionSettings();
00139
00140 int getDpiX() {return dpiX;}
00141 int getDpiY() {return dpiY;}
00142
00143 #ifdef _DEBUG
00144 virtual void AssertValid() const;
00145 virtual void Dump(CDumpContext& dc) const;
00146 #endif
00147
00148 CStatusBar wndStatusBar;
00149 CSplitter wndSplitter;
00150 bool bSyncStarted;
00151
00152 void OnConfigClosed();
00153 void StartSync();
00154 int CancelSync();
00155
00156
00157 afx_msg LRESULT OnMsgSyncBegin (WPARAM , LPARAM);
00158 afx_msg LRESULT OnMsgSyncEnd (WPARAM , LPARAM);
00159 afx_msg LRESULT OnMsgSyncSourceBegin(WPARAM , LPARAM);
00160 afx_msg LRESULT OnMsgSyncSourceEnd (WPARAM , LPARAM);
00161 afx_msg LRESULT OnMsgItemSynced (WPARAM , LPARAM);
00162 afx_msg LRESULT OnMsgTotalItems (WPARAM , LPARAM);
00163 afx_msg LRESULT OnMsgStartSyncBegin (WPARAM , LPARAM);
00164 afx_msg LRESULT OnMsgStartsyncEnded (WPARAM , LPARAM);
00165 afx_msg LRESULT OnMsgRefreshStatusBar(WPARAM, LPARAM);
00166 afx_msg LRESULT OnMsgSyncSourceState(WPARAM, LPARAM);
00167 afx_msg LRESULT OnMsgUnlockButtons (WPARAM, LPARAM);
00168 afx_msg LRESULT OnMsgLockButtons (WPARAM, LPARAM);
00169
00170 afx_msg void OnFileConfiguration();
00171 afx_msg void OnToolsFullSync();
00172 afx_msg void OnFileSynchronize();
00173 afx_msg int OnCancelSync();
00174 afx_msg void OnToolsSetloglevel();
00175
00176 afx_msg BOOL OnNcActivate(BOOL bActive);
00177 afx_msg void OnClose();
00178
00179 afx_msg LRESULT OnMsgPopup(WPARAM wParam, LPARAM lParam);
00180 afx_msg LRESULT OnOKMsg(WPARAM wParam, LPARAM lParam);
00181 };
00182
00183
00186 #endif