CategoryBarWnd.h
资源名称:GGBT.rar [点击查看]
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:5k
源码类别:
P2P编程
开发平台:
Visual C++
- #if !defined(AFX_CATEGORYBARWND_H__E3D48BF4_C720_47E5_BF74_F883FD69DD58__INCLUDED_)
- #define AFX_CATEGORYBARWND_H__E3D48BF4_C720_47E5_BF74_F883FD69DD58__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // CategoryBarWnd.h : header file
- //
- #include "ctrlext.h"
- #include "val.h"
- #include "FileDB.h"
- #include "DownloadEngine.h"
- #include "CategoryFileDB.h"
- #include "CategoryDownload.h"
- class CFilesListCtrl;
- /////////////////////////////////////////////////////////////////////////////
- // CCategoryBarWnd window
- class CCategoryBarWnd : public CCategoryDownload// CCategoryFileDB //CTreeCtrlEx
- {
- // Construction
- public:
- CCategoryBarWnd();
- // Attributes
- public:
- CImageList m_ctlImage;
- UINT m_nIDClipFormat;
- // Operations
- public:
- void OpenTorrentFile(string strTorrentFileName,
- HTREEITEM hItemSel = 0, string strDirectorySave = string(), bool bOverwrite = false);
- bool CreateNewCategory(CTreeCursor curSel, CTreeCursor& curNew);
- // command handler from mainframe.
- void OnUpdateMenuitem(CCmdUI* pCmdUI);
- void OnCommandMenuitem(UINT iID);
- void OnFindFile();
- void OnFindNext();
- void OnPopupCommand(UINT nMenuID);
- void OnFileListViewInitialUpdate();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CCategoryBarWnd)
- public:
- //}}AFX_VIRTUAL
- virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
- virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);
- virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
- // Implementation
- public:
- virtual ~CCategoryBarWnd();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CCategoryBarWnd)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnDestroy();
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- void OnRightClick(NMHDR *pNotifyStruct,LRESULT *result);
- void DoPopupMenu(UINT nMenuID);
- void OnNodeSelect(NMHDR *pNotifyStruct,LRESULT *result);
- friend class CDownloadEngine;
- private:
- bool CopyFileTorrent(string strTorrentFileName, string& strTorrentFileNameNoPath);
- CTreeCursor findFileExist(CTreeCursor& curItem, string strInfohash, CFileDBItem*& pExistFileDBItem);
- void findFileByConditions(bool bRefind, string strFindContion = "");
- static bool findDownloading(CTreeCursor curItem);
- bool GetChildCount(CTreeCursor& curSrc, long& lCategoryCount, long& lFilesCount);
- static bool IsChild(CTreeCursor curSrc, CTreeCursor curTarget);
- static CTreeCursor MoveTree(CTreeCursor curSrc, CTreeCursor curTarget);
- static bool MoveTreeEx(CTreeCursor curSrc, CTreeCursor curTarget);
- CTreeCursor m_ItemSel;
- /**************************************************************
- CFindFileByConditions
- **************************************************************/
- class CFindFileByConditions
- {
- public:
- CFindFileByConditions();
- void Create(CCategoryBarWnd* pCategoryBarWnd);
- int findFileByConditions(bool bRefind, string strCondition);
- void SetNewStartLocation(CTreeCursor curLocate, CFileDBItem* pFileDBItem);
- bool CanFindNext();
- CTreeCursor m_curLast;
- CFileDBItem* m_pFileItem;
- private:
- CTreeCursor findFileByConditionsrec(CTreeCursor& curItem, string strCondition);
- CCategoryBarWnd* m_pCategoryBarWnd;
- bool m_bStart;
- string m_strCondition;
- }m_FindFileByConditions;
- friend class CFindFileByConditions;
- /**************************************************************
- CCategoryTarget
- **************************************************************/
- class CCategoryTarget : public COleDropTarget
- {
- public:
- DROPEFFECT OnDragEnter( CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
- {
- return ((CCategoryBarWnd*) pWnd)->OnDragEnter(pDataObject, dwKeyState, point);
- }
- virtual DROPEFFECT OnDragOver( CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
- {
- return ((CCategoryBarWnd*) pWnd)->OnDragOver( pDataObject, dwKeyState, point);
- }
- virtual BOOL OnDrop( CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point)
- {
- return ((CCategoryBarWnd*) pWnd)->OnDrop(pDataObject, dropEffect, point);
- }
- void OnDragLeave(CWnd* pWnd)
- {
- COleDropTarget::OnDragLeave(pWnd);
- }
- }m_dropTarget;
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_CATEGORYBARWND_H__E3D48BF4_C720_47E5_BF74_F883FD69DD58__INCLUDED_)