📄 imagedoc.h
字号:
// imageDoc.h : interface of the CImageDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_IMAGEDOC_H__1310C848_D6A3_451F_A8A8_FE395956DD57__INCLUDED_)
#define AFX_IMAGEDOC_H__1310C848_D6A3_451F_A8A8_FE395956DD57__INCLUDED_
#include "Include.h" // Added by ClassView
#include "Doneurl.h" // Added by ClassView
#include "History.h" // Added by ClassView
#include "Todownloadurl.h" // Added by ClassView
#include "Log.h" //Added by zhanghuajian
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//#include <afxdb.h>
//#include "image.h"
#include "Option.h"
#include "Inet.h"
#include "HtmlParser.h"
#include "exclusive.h"
#include "save.h"
typedef struct {
CString sitename;
CString url;
CTime lasttime;
int lastnum;
BOOL status;
BOOL bdownload;
short min_height;
short max_height;
short min_width;
short max_width;
short imagetype;
short max_level;
byte priority;
short m_exclusive_level;
}SITEINFO;
typedef CArray<SITEINFO,SITEINFO&> SITEINFOARRAY;
typedef struct {
CString strDirectory;
CString strProxy;
int max_thread;
BOOL bProxy;
int image_min_size;
int unlike_level;
} LOCALSET;
extern CImageApp theApp;
class CProgress;
class CImageDoc : public CDocument
{
protected: // create from serialization only
CImageDoc();
DECLARE_DYNCREATE(CImageDoc)
// Attributes
public:
// Operations
public:
CTodownloadurl *m_todownloadurl;
CHistory *m_history;
CDoneurl *m_doneurl;
CLog * m_log;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CImageDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
CWinThread * m_pThread;
int m_count;
CStringArray m_includeList;
CInclude * m_include;
CStringArray m_exclusiveList;
CExclusive * m_exclusive;
CSave * m_save;
CString m_Directory;
LOCALSET localset;
SITEINFOARRAY m_siteinfo;
void MakeURLValid(CString &strURL);
static UINT DownloadThread(LPVOID lpvData);
void BeginToDownLoad();
//CStringArray& GetDirectoryArray(){ return m_arrDirectory;}
CStringArray& GetURLArray(){ return m_arrLink;}
Option * GetOption(){ return &m_Option ;}
virtual ~CImageDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
CString m_strObject;
CString m_strServer;
bool URLParser(LPCTSTR pstrURL);
bool ShouldQueuePage(CString& strPage);
CProgress * m_pProgress;
CStringArray m_arrLink;//要下载的网站的数组
bool GenerateUniqueFileName(CString &strName);
CInet m_Inet;
BYTE m_byBuffer[MAX_INET_BUFFER];
bool GetPage(CString &strPage,int level);
bool GetImage(CString &strImage,CString&strFileName);
bool ShouldGetLink(CString &strPage);
CStringArray m_arrImage;//用来保存下载的web页面中的图片的链接
Option m_Option;
//{{AFX_MSG(CImageDoc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_IMAGEDOC_H__1310C848_D6A3_451F_A8A8_FE395956DD57__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -