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

00001 /*
00002  * Funambol is a mobile platform developed by Funambol, Inc. 
00003  * Copyright (C) 2003 - 2007 Funambol, Inc.
00004  * 
00005  * This program is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Affero General Public License version 3 as published by
00007  * the Free Software Foundation with the addition of the following permission 
00008  * added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
00009  * WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE 
00010  * WARRANTY OF NON INFRINGEMENT  OF THIRD PARTY RIGHTS.
00011  * 
00012  * This program is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00015  * details.
00016  * 
00017  * You should have received a copy of the GNU Affero General Public License 
00018  * along with this program; if not, see http://www.gnu.org/licenses or write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00020  * MA 02110-1301 USA.
00021  * 
00022  * You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite 
00023  * 305, Redwood City, CA 94063, USA, or at email address info@funambol.com.
00024  * 
00025  * The interactive user interfaces in modified source and object code versions
00026  * of this program must display Appropriate Legal Notices, as required under
00027  * Section 5 of the GNU Affero General Public License version 3.
00028  * 
00029  * In accordance with Section 7(b) of the GNU Affero General Public License
00030  * version 3, these Appropriate Legal Notices must retain the display of the
00031  * "Powered by Funambol" logo. If the display of the logo is not reasonably 
00032  * feasible for technical reasons, the Appropriate Legal Notices must display
00033  * the words "Powered by Funambol".
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     // Counters, incremented each time a source has begun.
00064     // (1 when begin sending data, 2 when begin receiving data)
00065     int contactsBegin;
00066     int calendarBegin;
00067     int tasksBegin;
00068     int notesBegin;
00069         
00070 protected: // create from serialization only
00071   CMainSyncFrame();
00072   DECLARE_DYNCREATE(CMainSyncFrame)
00073 
00074 public:
00075     CConfigFrame* pConfigFrame;
00076 
00077     // bitmaps, load once, use it everywhere
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 // Overrides
00090         // ClassWizard generated virtual function overrides
00091         //{{AFX_VIRTUAL(CConfigFrame)
00092         public:
00093         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00094         protected:
00095         virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
00096         //}}AFX_VIRTUAL
00097 
00098 // Implementation
00099 public:
00100         virtual ~CMainSyncFrame();
00101     void backupSyncModeSettings();
00102     void restoreSyncModeSettings();
00103     void showSettingsWindow(const int paneToDisplay = 1);
00104     
00105     // check if the user has set the connection settings
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     // info about sync modes for sources, used on full sync
00118     int syncModeCalendar; 
00119     int syncModeContacts;
00120     int syncModeTasks;
00121     int syncModeNotes;
00122 
00123     // info about the sync in progress
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 // Generated message map functions
00140 protected:
00141         //{{AFX_MSG(CConfigFrame)
00142         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00143                 // NOTE - the ClassWizard will add and remove member functions here.
00144                 //    DO NOT EDIT what you see in these blocks of generated code!
00145         //}}AFX_MSG
00146         DECLARE_MESSAGE_MAP()
00147 public:
00148     //afx_msg void OnUpdatePage(CCmdUI *pCmdUI); //status bar update
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 // Thread related
00172 DWORD WINAPI syncThread(LPVOID lpParam);
00173 DWORD WINAPI syncThreadKiller(LPVOID lpParam);
00174 
00176 
00177 //{{AFX_INSERT_LOCATION}}
00178 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00179 
00182 #endif // !defined(AFX_MAINFRM_H__FA98B70F_D0B7_11D3_BC39_00C04F602FEE__INCLUDED_)

Generated on Mon Feb 4 09:50:49 2008 for Funambol Outlook Plug-in Library by  doxygen 1.5.2