mainfrm.h

来自「一个多窗口的浏览器的程序benbrowse」· C头文件 代码 · 共 319 行

H
319
字号
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MAINFRM_H__8C31A52B_64C6_4063_8FAB_BED85CEDF951__INCLUDED_)
#define AFX_MAINFRM_H__8C31A52B_64C6_4063_8FAB_BED85CEDF951__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ViewManager.h"
#include "WindowManager.h"
#include "BCMenu.h"

#include "StatusBarWithProgress.h"

#include ".\Common\ToolBarEx.h"
#include ".\Common\FrameWndEx.h"

#include "AddressBarEx.h"

#include ".\sizecontrolbar\CoolTabCtrl.h"	// Added by ClassView
#include ".\sizecontrolbar\FavWnd2.h"
#include ".\sizecontrolbar\HistoryWnd.h"

#include "mybar.h"
#include ".\sizecontrolbar\scbarg.h"
class CMainToolBar : public CToolBarEx
{
    DECLARE_DYNAMIC( CMainToolBar )
public:
    CMainToolBar();

// Overrides
public:
    virtual void Init();

protected:
    virtual bool HasButtonText( UINT nID );
};
class CLinkBar : public CToolBarEx
{
    DECLARE_DYNAMIC( CLinkBar )
public:
    CLinkBar();
public:
	//CImageList	m_ImageListSmall;
// Overrides
public:

    virtual void Init();
protected:
    virtual bool HasButtonText( UINT nID );
	virtual void GetButtonTip( UINT nID, CString& strTip);
	virtual bool HasButtonTip( UINT nID );
//	virtual void GetButtonText( UINT nID, CString& strText );
};

typedef struct FavDirItem
{

	UINT nID;
	UINT m_StartPos;
	UINT m_EndPos;
} FavDirItem, *LPFavDirItem;

typedef struct BuildFavStruct
{
	CString pszPath;
	int nStartPos;
	BCMenu* pMenu;
	CImageList *imaglist;
	bool IsLinkFolder;
}BuildFavStruct,*LPBuildFavStruct;

typedef struct BuildLinkStruct
{
	CString strName;
	UINT nID;
	int icon;
}BuildLinkStruct,*LPBuildLinkStruct;

class CMainFrame : public CMDIFrameWndEx
{
	DECLARE_DYNAMIC(CMainFrame)
public:
	CMainFrame();

// Attributes
public:
	CArray<FavDirItem*, FavDirItem*>m_FavDirItem;
	CArray<BuildLinkStruct*, BuildLinkStruct*>m_linkbarItem;
	
	CStringList  m_aliasespages;
	CStringList  m_lockURLlist;
	CStringList  m_quicksearchpages;
	CStringList  m_language;
	CString      m_language_file_name;
	CString      m_languageName;
	CStringList  m_searchpages;
	CStringList  m_proxylist;
	CStringList m_TranslationPages;
	BOOL m_local_pass;
	CString m_CurrentProxy;

	CHistoryWnd m_wndTreeHisty;
	CFavWnd2 m_wndTree;
	CEdit	  m_wndEdit;
	CMyBar  m_wndMyBar1;
	CCoolTabCtrl m_TabCtrl;
// Operations
public:
	int BuildFavoritesMenu(BuildFavStruct favstruct);//LPCTSTR pszPath, int nStartPos, BCMenu* pMenu,CImageList *imaglist=NULL);
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMainFrame)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, CWnd* pParentWnd = NULL, CCreateContext* pContext = NULL);
	virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	void GetLangulagesExist();
	void SetNewLanguage(BCMenu *menu);

	void RefreshFavoriteMenu();
	void GetMultimediaSettings();
	void GetFileIcon(CString filename,int &icon);
	void AutoRefresh(bool type);
	void StopAnimate();
	void PlayAnimate();
	CView * GetbenActiveView();
	void SetAddressComText(CString URL);
	CView * NewHtmlView(int type,BOOL beVisible=FALSE);
	HRESULT ExecCmdTarget(const GUID *pguidCmdGroup, DWORD nCmdID);
	HMENU NewMenu();
	virtual ~CMainFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:  // control bar embedded members
	CStatusBarWithProgress  m_wndStatusBar;
	CMainToolBar    m_wndToolBar;
	CComboBoxEx  *m_AddressCom;
	CFont        m_Font;

	CLinkBar       m_linkbar;  
	CAddressBarEx m_AddressBar;

	friend void CMDIClient::OnViewFullscreen();
	
	CAnimateCtrl m_wndAnimate;
	BCMenu m_menu;
	int m_autorefreshtype ;
	bool m_activeonly;
	bool m_showimage;
	bool m_showvideo;
	bool m_showanimation;
	bool m_showsound;
	CString m_strFavDirOpen;
public:
	int m_coolbarStyle;
	void SetViewIcon(CView *pView);
	void ChangeDLProperty();
	BOOL GetLocalFileName(CString URL,CString &filename);
	DWORD m_dwdownloadProperty;
	BOOL m_beVisibleNewWin;
	BOOL GetLinkFileTarget(LPCSTR lpszLinkFile, LPSTR lpszPath);
	bool m_behidden;
	void SetInternetProxyben();
	void LoadBenbroState();
	bool m_beshowBK;
	CString m_strBmpFilename;
	void LoadBKbmp();
	void SetBkGroundBmp(bool show);
	HBITMAP m_hbmBack;
	void SaveBenbroState();
	void OpenWithEditor(CString editor);
	void SaveDefaultData(CString finename,CStringList *list);
	void SetProgressPos(int position);
	bool GetIEHistory(CMenu *pmenu,int ID);
	BOOL GetAliasesURL(CString name ,CString &URL);
	BOOL GetQuickSearchURL(CString name,CString &URL);
	BOOL GetLinkFolderName(CString &strLinksFoldername);
	void BuildMailMenu(CMenu *menu);

	int GetChildWindowNum();
	void BuildTranslationMenu(CMenu *menu_translation);
	void SaveSearchPages();
	void NavigateToUrl(CString URL,int type,BOOL beVisible=FALSE);
	void LoadSearchPages(CString filename);
	void InstallCollBar();
	void ShowControlbarBen();
	void HideControlbarBen();
	void LoadHistoryUrls();
	void SetViewNames(CString ViewName,CView *pView);
	BOOL IsGlobalOffline();
	CMDIClient   m_MDIClient;
	CViewManager m_wndViewManager;
	CStringArray m_astrFavoriteURLs;
// Generated message map functions
protected:
	//{{AFX_MSG(CMainFrame)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnOfflineFile();
	afx_msg void OnUpdateOfflineFile(CCmdUI* pCmdUI);
	afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
	afx_msg void OnOptionTool();
	afx_msg void OnSourcecodeView();
	afx_msg void OnFindEdit();
	afx_msg void OnAddtolocklistTool();
	afx_msg void OnOrganizeFavorites();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnViewLinkbar();
	afx_msg void OnUpdateViewLinkbar(CCmdUI* pCmdUI);
	afx_msg void OnNorefreshView();
	afx_msg void OnUpdateNorefreshView(CCmdUI* pCmdUI);
	afx_msg void OnAutorefresh5View();
	afx_msg void OnUpdateAutorefresh5View(CCmdUI* pCmdUI);
	afx_msg void OnAutorefresh15View();
	afx_msg void OnUpdateAutorefresh15View(CCmdUI* pCmdUI);
	afx_msg void OnAutorefresh30View();
	afx_msg void OnUpdateAutorefresh30View(CCmdUI* pCmdUI);
	afx_msg void OnAutorefresh1mView();
	afx_msg void OnUpdateAutorefresh1mView(CCmdUI* pCmdUI);
	afx_msg void OnAutorefresh5mView();
	afx_msg void OnUpdateAutorefresh5mView(CCmdUI* pCmdUI);
	afx_msg void OnAutorefresh10mView();
	afx_msg void OnUpdateAutorefresh10mView(CCmdUI* pCmdUI);
	afx_msg void OnAutorefreshonlyView();
	afx_msg void OnUpdateAutorefreshonlyView(CCmdUI* pCmdUI);
	afx_msg void OnDownloadimageTool();
	afx_msg void OnUpdateDownloadimageTool(CCmdUI* pCmdUI);
	afx_msg void OnDownloadanimationTool();
	afx_msg void OnUpdateDownloadanimationTool(CCmdUI* pCmdUI);
	afx_msg void OnDownloadsoundTool();
	afx_msg void OnUpdateDownloadsoundTool(CCmdUI* pCmdUI);
	afx_msg void OnDownloadvideoTool();
	afx_msg void OnUpdateDownloadvideoTool(CCmdUI* pCmdUI);
	afx_msg void OnModifyUrllock();
	afx_msg void OnMaillinkFile();
	afx_msg void OnClose();
	afx_msg void OnSynchronizeTool();
	afx_msg void OnViewCoolbar();
	afx_msg void OnUpdateViewCoolbar(CCmdUI* pCmdUI);
	afx_msg void OnOrganizesearchTool();
	afx_msg void OnSetproxyTool();
	afx_msg void OnOrganizetranslationTool();
	afx_msg void OnFileNewBlank();
	afx_msg void OnFileNewHome();
	afx_msg void OnFileNewCurrent();
	afx_msg void OnFileNewClipboard();
	afx_msg void OnAddtofavoritesFavorite();
	afx_msg void OnFileOpenrecent();
	afx_msg void OnWindowCloseAllnocur();
	afx_msg void OnViewAddressbar();
	afx_msg void OnUpdateViewAddressbar(CCmdUI* pCmdUI);
	afx_msg void OnViewRefreshAll();
	afx_msg void OnViewStopAll();
	afx_msg void OnWindowCloseAll();
	afx_msg void OnFileOpenurl();
	afx_msg void OnImprotfavoriteTool();
	afx_msg void OnExportfavoriteTool();
	afx_msg void OnReadmailTool();
	afx_msg void OnWritemailTool();
	afx_msg void OnReadnewsTool();
	afx_msg void OnAddressbarFocus();
	afx_msg void OnAddressbarDropdown();
	afx_msg void OnQuicksearchTool();
	afx_msg void OnAliasesTool();
	afx_msg void OnAddresstoolTool();
	afx_msg void OnViewFavoriteBar();
	afx_msg void OnUpdateViewFavoriteBar(CCmdUI* pCmdUI);
	afx_msg void OnSelectbmpTool();
	afx_msg void OnShowbkTool();
	afx_msg void OnUpdateShowbkTool(CCmdUI* pCmdUI);
	afx_msg void OnDropFiles(HDROP hDropInfo);
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnViewActivatenew();
	afx_msg void OnUpdateViewActivatenew(CCmdUI* pCmdUI);
	afx_msg void OnJavaSecurity();
	afx_msg void OnUpdateJavaSecurity(CCmdUI* pCmdUI);
	afx_msg void OnActivexSecurity();
	afx_msg void OnUpdateActivexSecurity(CCmdUI* pCmdUI);
	afx_msg void OnScriptSecurity();
	afx_msg void OnUpdateScriptSecurity(CCmdUI* pCmdUI);
	afx_msg void OnHelpMailAuthor();
	afx_msg void OnViewNewlast();
	afx_msg void OnUpdateViewNewlast(CCmdUI* pCmdUI);
	//}}AFX_MSG
	afx_msg void OnNewAddress();
	afx_msg void OnNewAddressEnter();
	afx_msg void OnDropDown(NMHDR* pNotifyStruct, LRESULT* pResult);
	afx_msg void DoNothing();
	afx_msg void OnFavorite(UINT nID);
	afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
	afx_msg void OnHistory(UINT nID);
	afx_msg LRESULT OnSetMessageString(WPARAM wParam, LPARAM lParam);
	afx_msg void OnSetNewLanguage(UINT nID);
	afx_msg void OnTranslation(UINT nID);
	afx_msg void OnMail(UINT nID);
	afx_msg HRESULT OnHotKey(WPARAM wParam,LPARAM lParam);
	DECLARE_MESSAGE_MAP();
private:
	BOOL m_beAddLast;
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MAINFRM_H__8C31A52B_64C6_4063_8FAB_BED85CEDF951__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?