00001
00002
00003
00004
00005
00006 #if !defined(AFX_MAINFRM_H__AC3FA611_4FF2_4779_82DF_504A2BF21D9A__INCLUDED_)
00007 #define AFX_MAINFRM_H__AC3FA611_4FF2_4779_82DF_504A2BF21D9A__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif
00012
00013 #include "AppStatusBar.h"
00014 #include "ChildView.h"
00015 #include "ToolBarEx.h"
00016 #include "fsODMenu.h"
00017 #include "UpdateDlg.h"
00018 #include "FloatingWnd.h"
00019 #include "FloatingInfoWnd.h"
00020 #include "FloatingWndsThread.h"
00021 #pragma warning (push, 3)
00022 #include "FDMCustomized/FDMCustomized_lib/FDMCustomizations.h"
00023 #include "Wnd_Banner.h"
00024 #include "FDCButton.h"
00025 #include "Wnd_FDMGetCustVer_Btn.h"
00026 #pragma warning (pop)
00027
00028 #define WM_SHOWTRAYMENU (WM_APP+101)
00029 #define WM_SHOWDOWNLOADDIALOG (WM_APP+102)
00030
00031 #define ID_APP_EXIT_2 40000
00032
00033 class CMainFrame : public CFrameWnd
00034 {
00035 friend class CFloatingWnd;
00036 friend class CFdmApp;
00037 friend class CFloatingInfo_ListCtrlWnd;
00038 public:
00039 CMainFrame();
00040 protected:
00041 DECLARE_DYNAMIC(CMainFrame)
00042
00043 public:
00044
00045 public:
00046
00047
00048 public:
00049 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00050 virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
00051 virtual void RecalcLayout(BOOL bNotify = TRUE);
00052 protected:
00053 virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
00054
00055
00056 public:
00057 void SetActivePlugin (int nIndex);
00058
00059 vmsFDMCustomizations m_Customizations;
00060
00061 bool ShowSpreadHelpDialogIfRequired();
00062
00063 BOOL IsFloatingInfoWindowVisible();
00064
00065 void ShowFloatingInfoWindow (BOOL bShow);
00066 vmsFDMCustomizations* get_Customizations ();
00067 BOOL m_bInited;
00068
00069 void RebuidDownloadsList();
00070
00071 static void ShowTimeoutBalloon (LPCSTR pszInfo, LPCSTR pszTitle, DWORD dwIcon = NIIF_INFO, BOOL bClear = FALSE);
00072
00073 void ShowTrayMenu(BOOL bModeTray = TRUE);
00074 afx_msg void OnUpdateLngMenu (CCmdUI* pCmdUI);
00075 void SaveState();
00076
00077 void AddPluginMenuView (HMENU hMenuView, fsSetImage* pImages, int cImages, wgMenuViewItem *pItems, int cItems);
00078
00079 void RemovePluginMenuView();
00080 BOOL m_bCloseAsMinimize;
00081 BOOL m_bMinToTray;
00082 CFloatingWndsThread* m_pFloatWndsThread;
00083
00084 CImageList m_imgsMenu, m_dimgsMenu;
00085
00086 CImageList m_imgsTool, m_dimgsTool;
00087
00088 void RemovePluginMenu();
00089
00090 void AddPluginMenu (HMENU hMenu, fsSetImage* pImages, int cImages);
00091 virtual ~CMainFrame();
00092 #ifdef _DEBUG
00093 virtual void AssertValid() const;
00094 virtual void Dump(CDumpContext& dc) const;
00095 #endif
00096
00097 protected:
00098 CAppStatusBar m_wndStatusBar;
00099 CChildView m_wndView;
00100 BOOL m_bQueryForExit;
00101
00102 protected:
00103 int GetTumMenuPosition();
00104 UINT m_nUploadsMsg1;
00105 UINT m_nShutdownMsg;
00106 afx_msg LRESULT OnPowerBroadCast (WPARAM, LPARAM);
00107
00108 void TotalTraffic_CheckMonthChange();
00109
00110 void ReadTotalTrafficInfo();
00111
00112 UINT64 m_nTrafficUsedPrevMonth, m_nTrafficUsedThisMonth;
00113 UINT64 m_nTrafficUpldPrevMonth, m_nTrafficUpldThisMonth;
00114
00115 int m_nTotalTraffic_CurrMonth;
00116
00117 afx_msg void OnUpdateTotalSpeed (CCmdUI* pCmdUI);
00118 afx_msg void OnUpdateTrafficThisMonth (CCmdUI* pCmdUI);
00119
00120 afx_msg void OnLDF (UINT nID);
00121
00122 bool m_bNeedSpreadHelpDialog;
00123
00124 bool m_bDontShowSHD;
00125
00126 BOOL ImportListOfDownloads_FromDLInfoListFile(LPCSTR pszFile);
00127 BOOL ImportDownload (IXMLDOMNode* pNode, DLDS_LIST_REF v);
00128
00129 BOOL ImportListOfDownloads_FromURLListFile (LPCSTR pszFile);
00130
00131 afx_msg void OnTUMChanged();
00132
00133 BOOL is_MouseInTray();
00134
00135 afx_msg void OnUpdateSkin (CCmdUI* pCmdUI);
00136 afx_msg void OnSkin (UINT nID);
00137 void BuildSkinsMenu();
00138
00139 int get_SkinsMenuPos();
00140 CWnd_FDMGetCustVer_Btn m_wndFDMCustBtn;
00141
00142 void SetupButton();
00143 CFDCButton m_btnFDC;
00144
00145 void DisplayBanner (int iIndex);
00146 CWnd_Banner m_wndBanner;
00147 CReBar m_wndReBar;
00148
00149 BOOL ReadCusomizationInfo();
00150 afx_msg LRESULT OnShowTrayMenu (WPARAM, LPARAM);
00151 void LoadToolImages();
00152
00153 CString m_strTimeoutBallon_Msgs;
00154
00155 void Balloon_ShowDLInfo(BOOL bCheckSettings = TRUE);
00156 BOOL m_bTrayMenuShowing;
00157
00158 void ShowBalloon (LPCSTR pszInfo, LPCSTR pszTitle, BOOL bCheckSettings = TRUE, DWORD dwIcon = NIIF_INFO);
00159 void HideBalloon();
00160 BOOL m_bBalloonShowing;
00161 int m_balloonX, m_balloonY;
00162
00163 afx_msg void OnIdUpdate();
00164
00165 void RemovePluginMenuView2();
00166
00167 void AddPluginMenuView (HMENU hMenu, fsSetImage* pImages, int cImages);
00168
00169 afx_msg void OnTBChange (NMHDR*, LRESULT* res);
00170 afx_msg void OnTBGetButtonInfo (NMHDR*, LRESULT* res);
00171 afx_msg void OnTBReset (NMHDR*, LRESULT* res);
00172 afx_msg void OnTBCustHelp (NMHDR*, LRESULT* res);
00173 afx_msg void OnTBEndDrag (NMHDR*, LRESULT* res);
00174 afx_msg void OnTBBeginDrag (NMHDR*, LRESULT* res);
00175 afx_msg void OnTBEndAdjust (NMHDR*, LRESULT* res);
00176 afx_msg void OnTBBeginAdjust (NMHDR*, LRESULT* res);
00177 afx_msg void OnTBQueryInsert (NMHDR*, LRESULT* res);
00178 afx_msg void OnTBQueryDelete (NMHDR*, LRESULT* res);
00179
00180 virtual LRESULT WindowProc (UINT msg, WPARAM wp, LPARAM lp);
00181 static UINT m_umsgTaskBarCreated;
00182
00183 afx_msg void OnDropBox();
00184
00185 void UpdateSettings();
00186
00187 afx_msg void OnImportSettings();
00188
00189 afx_msg void OnExportSettings();
00190
00191 afx_msg void OnSpiderDLWebPage();
00192
00193 afx_msg void OnSpiderDefSettings();
00194
00195 static DWORD WINAPI _threadUpdate (LPVOID lp);
00196
00197 void SetMenuImages();
00198
00199 void ApplyLanguageToMenu();
00200 void ApplyLanguage();
00201
00202 afx_msg void OnLngMenu (UINT id);
00203
00204 void BuildLngMenu();
00205 afx_msg void OnViewStatusbar();
00206 afx_msg void OnViewToolbar();
00207
00208 afx_msg void OnUpdatePluginMenuView (CCmdUI *pCmdUI);
00209 afx_msg void OnUpdateDropBox (CCmdUI* pCmdUI);
00210
00211 afx_msg void OnAltPlusDigit (UINT nID);
00212 int m_cPluginMenuViewInserted;
00213 void OnUpdateSwitchTo (CCmdUI *pCmdUI);
00214
00215 afx_msg void OnSwitchTo (UINT nID);
00216
00217 void BuildSwitchToMenu();
00218 void UpdateTitle();
00219
00220 void StartUpdate (BOOL bShowDlg);
00221 CUpdateDlg* m_pUpdateDlg;
00222
00223 static void _UpdateMgrEvents (fsUpdateMgrEvent ev, UINT* puInfo, LPVOID lp);
00224 void SaveSettings();
00225 void ReadSettings();
00226 void LoadMenuImages();
00227 fsODMenu m_odTrayMenu;
00228 fsODMenu m_odmenu;
00229 wgMenuViewItem *m_pPluginMenuViewItems;
00230 int m_cPluginMenuViewItems;
00231 afx_msg LRESULT OnTrayMsg (WPARAM wp, LPARAM lp);
00232
00233 int m_cMenuMainItemsAdded,
00234 m_cMenuViewItemsAdded;
00235
00236 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00237 afx_msg void OnSetFocus(CWnd *pOldWnd);
00238 afx_msg void OnClose();
00239 afx_msg void OnDlddefoptions();
00240 afx_msg void OnDldroptions();
00241 afx_msg void OnTumHeavy();
00242 afx_msg void OnUpdateTumHeavy(CCmdUI* pCmdUI);
00243 afx_msg void OnTumLight();
00244 afx_msg void OnUpdateTumLight(CCmdUI* pCmdUI);
00245 afx_msg void OnTumMedium();
00246 afx_msg void OnUpdateTumMedium(CCmdUI* pCmdUI);
00247 afx_msg void OnOptmaster();
00248 afx_msg void OnDldCreate();
00249 afx_msg void OnTaskCreateNew();
00250 afx_msg void OnNeedExit();
00251 afx_msg void OnSize(UINT nType, int cx, int cy);
00252 afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
00253 afx_msg void OnSaveall();
00254 afx_msg void OnAppExit();
00255 afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00256 afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
00257 afx_msg void OnShowmainwindow();
00258 afx_msg void OnStartall();
00259 afx_msg void OnStopall();
00260 afx_msg void OnHelp();
00261 afx_msg void OnHomepage();
00262 afx_msg void OnRecommend();
00263 afx_msg void OnSupport();
00264 afx_msg void OnUpdate();
00265 afx_msg void OnProggeneralsettings();
00266 afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
00267 afx_msg void OnDial();
00268 afx_msg void OnEndSession(BOOL bEnding);
00269 afx_msg void OnHowregister();
00270 afx_msg void OnHangupwhendone();
00271 afx_msg void OnUpdateHangupwhendone(CCmdUI* pCmdUI);
00272 afx_msg void OnTurnoffwhendone();
00273 afx_msg void OnUpdateTurnoffwhendone(CCmdUI* pCmdUI);
00274 afx_msg void OnEnterkey();
00275 afx_msg void OnBuyonline();
00276 afx_msg void OnMonitorbrowser();
00277 afx_msg void OnUpdateMonitorbrowser(CCmdUI* pCmdUI);
00278 afx_msg void OnMonitorclipboard();
00279 afx_msg void OnUpdateMonitorclipboard(CCmdUI* pCmdUI);
00280 afx_msg void OnAddsite();
00281 afx_msg void OnViewSwbar();
00282 afx_msg void OnUpdateViewSwbar(CCmdUI* pCmdUI);
00283 afx_msg void OnNcRButtonUp(UINT nHitTest, CPoint point);
00284 afx_msg void OnTimer(UINT nIDEvent);
00285 afx_msg BOOL OnQueryEndSession();
00286 afx_msg void OnInsert();
00287 afx_msg void OnDlinfobox();
00288 afx_msg void OnDllangfiles();
00289 afx_msg void OnFDC();
00290 afx_msg void OnProceedFurherInitialization();
00291 afx_msg void OnAppAbout();
00292 afx_msg void OnExportlistofdownloads();
00293 afx_msg void OnImportlistofdownloads();
00294 afx_msg void OnExitwhendone();
00295 afx_msg void OnUpdateExitwhendone(CCmdUI* pCmdUI);
00296 afx_msg void OnFind();
00297 afx_msg void OnFindnext();
00298 afx_msg void OnUpdateFindnext(CCmdUI* pCmdUI);
00299 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00300 afx_msg void OnDonate();
00301 afx_msg void OnDldCreatebatch();
00302 afx_msg void OnFileImportImportlistofdownloadsfromclipboard();
00303 afx_msg void OnOptionsSm();
00304 afx_msg void OnSpreadhelp();
00305 afx_msg void OnExportdlhist();
00306 afx_msg void OnUpdateExportdlhist(CCmdUI* pCmdUI);
00307 afx_msg void OnUpdateLdf0(CCmdUI* pCmdUI);
00308 afx_msg void OnLdfClear();
00309 afx_msg void OnUpdateLdfClear(CCmdUI* pCmdUI);
00310 afx_msg void OnPausealldlds();
00311 afx_msg void OnUpdatePausealldlds(CCmdUI* pCmdUI);
00312 afx_msg void OnUpdateDlinfobox(CCmdUI* pCmdUI);
00313 afx_msg void OnAppExit2();
00314 afx_msg void OnPortableFdm();
00315 afx_msg void OnUpldroptions();
00316 afx_msg void OnLoadatstartup();
00317 afx_msg void OnUpdateLoadatstartup(CCmdUI* pCmdUI);
00318
00319 DECLARE_MESSAGE_MAP()
00320 };
00321
00322
00323
00324 #endif