D:/develop/v65/clients/outlook/install/output/export/funambol/clients/outlook/UI/src/MainSyncFrm.h

00001  /*
00002  * Copyright (C) 2007 Funambol, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 2 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
00011  * PURPOSE.  See the GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00016  * 02111-1307  USA
00017 */
00018 
00019 
00020 #if !defined(AFX_MAINFRM_H__FA98B70F_D0B7_11D3_BC39_00C04F602FEE1__INCLUDED_)
00021 #define AFX_MAINFRM_H__FA98B70F_D0B7_11D3_BC39_00C04F602FEE1__INCLUDED_
00022 
00027 #if _MSC_VER > 1000
00028 #pragma once
00029 #endif // _MSC_VER > 1000
00030 
00031 #include "HwndFunctions.h"
00032 #include "ConfigFrm.h"
00033 
00034 
00042 class CMainSyncFrame : public CFrameWnd
00043 {
00044 
00045 private:
00046     // Counters, incremented each time a source has begun.
00047     // (1 when begin sending data, 2 when begin receiving data)
00048     int contactsBegin;
00049     int calendarBegin;
00050     int tasksBegin;
00051     int notesBegin;
00052         
00053 protected: // create from serialization only
00054   CMainSyncFrame();
00055   DECLARE_DYNCREATE(CMainSyncFrame)
00056 
00057 public:
00058     CConfigFrame* pConfigFrame;
00059 
00060     // bitmaps, load once, use it everywhere
00061     HBITMAP hBmpDarkBlue;
00062     HBITMAP hBmpBlue;
00063     HBITMAP hBmpDark;
00064     HBITMAP hBmpLight;
00065 
00066 protected:
00067     HANDLE hSyncThread;
00068     DWORD dwThreadId;
00069     bool configOpened;
00070     int dpiX, dpiY;
00071 
00072 // Overrides
00073         // ClassWizard generated virtual function overrides
00074         //{{AFX_VIRTUAL(CConfigFrame)
00075         public:
00076         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00077         protected:
00078         virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
00079         //}}AFX_VIRTUAL
00080 
00081 // Implementation
00082 public:
00083         virtual ~CMainSyncFrame();
00084     void backupSyncModeSettings();
00085     void restoreSyncModeSettings();
00086     void showSettingsWindow(const int paneToDisplay = 1);
00087     
00088     // check if the user has set the connection settings
00089     bool checkConnectionSettings(); 
00090 
00091     int getDpiX() {return dpiX;}
00092     int getDpiY() {return dpiY;}
00093   
00094 #ifdef _DEBUG
00095         virtual void AssertValid() const;
00096         virtual void Dump(CDumpContext& dc) const;
00097 #endif
00098 
00099 protected: 
00100     // info about sync modes for sources, used on full sync
00101     int syncModeCalendar; 
00102     int syncModeContacts;
00103     int syncModeTasks;
00104     int syncModeNotes;
00105 
00106     // info about the sync in progress
00107     int currentSource;
00108     int totalItems;
00109     int currentItem;
00110     
00111     CFont fontBold;
00112     
00113 public:
00114     CStatusBar wndStatusBar;
00115     CSplitter wndSplitter;
00116     bool bSyncStarted;
00117 
00118     void OnConfigClosed();
00119     void StartSync();
00120     int CancelSync();
00121 
00122 // Generated message map functions
00123 protected:
00124         //{{AFX_MSG(CConfigFrame)
00125         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00126                 // NOTE - the ClassWizard will add and remove member functions here.
00127                 //    DO NOT EDIT what you see in these blocks of generated code!
00128         //}}AFX_MSG
00129         DECLARE_MESSAGE_MAP()
00130 public:
00131     //afx_msg void OnUpdatePage(CCmdUI *pCmdUI); //status bar update
00132     afx_msg LRESULT OnMsgSyncBegin(WPARAM , LPARAM);
00133     afx_msg LRESULT OnMsgSyncEnd(WPARAM , LPARAM);
00134     afx_msg LRESULT OnMsgSyncSourceBegin(WPARAM , LPARAM);
00135     afx_msg LRESULT OnMsgSyncSourceEnd(WPARAM , LPARAM);
00136     afx_msg LRESULT OnMsgItemSynced(WPARAM , LPARAM);
00137     afx_msg LRESULT OnMsgTotalItems(WPARAM , LPARAM); 
00138     afx_msg LRESULT OnMsgStartSyncBegin(WPARAM , LPARAM); 
00139     afx_msg LRESULT OnMsgStartsyncEnded(WPARAM , LPARAM); 
00140     afx_msg LRESULT OnMsgRefreshStatusBar(WPARAM, LPARAM);
00141     afx_msg LRESULT OnMsgSyncSourceState(WPARAM, LPARAM);
00142     afx_msg LRESULT OnMsgUnlockButtons(WPARAM, LPARAM);
00143 
00144     afx_msg void OnFileConfiguration();
00145     afx_msg void OnToolsFullSync();
00146     afx_msg void OnFileSynchronize();
00147     afx_msg int  OnCancelSync();
00148     afx_msg void OnToolsSetloglevel();
00149 
00150     afx_msg BOOL OnNcActivate(BOOL bActive);
00151     afx_msg void OnClose();
00152 };
00153 
00154 // Thread related
00155 DWORD WINAPI syncThread(LPVOID lpParam);
00156 DWORD WINAPI syncThreadKiller(LPVOID lpParam);
00157 
00159 
00160 //{{AFX_INSERT_LOCATION}}
00161 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00162 
00165 #endif // !defined(AFX_MAINFRM_H__FA98B70F_D0B7_11D3_BC39_00C04F602FEE__INCLUDED_)

Generated on Fri Nov 9 12:21:27 2007 for Funambol Outlook Plug-in Library by  doxygen 1.5.2