/src/Modules/FileTransfer/FileTransferUIThread.h
https://gitlab.com/yoage/TTWinClient · C Header · 87 lines · 37 code · 9 blank · 41 comment · 0 complexity · 033062b960ead41b98e073a4a5ba4ca8 MD5 · raw file
- /*******************************************************************************
- * @file FileTransferUIThread.h 2014\9\17 16:32:15 $
- * @author ¿ìµ¶<kuaidao@mogujie.com>
- * @brief °üº¬¶à¸ösocketµÄÎļþ´«ÊäUI thread
- ******************************************************************************/
- #ifndef FILETRANSFERUITHREAD_16C2B941_3E94_4B6F_B488_0B82EC2B3F26_H__
- #define FILETRANSFERUITHREAD_16C2B941_3E94_4B6F_B488_0B82EC2B3F26_H__
- #include "utility/TTThread.h"
- #include "utility/TTAutoLock.h"
- #include <list>
- /******************************************************************************/
- using namespace util;
- class FileTransferSocket;
- #define WM_FILE_TRANSFER WM_USER + 888
- /**
- * The class <code>°üº¬¶à¸ösocketµÄÎļþ´«ÊäUI thread</code>
- *
- */
- class FileTransferUIThread : public TTThread
- {
- public:
- /** @name Constructors and Destructor*/
- //@{
- /**
- * Constructor
- */
- FileTransferUIThread();
- /**
- * Destructor
- */
- virtual ~FileTransferUIThread();
- //@}
- public:
- void Shutdown();
- virtual UInt32 process();
- public:
- /**
- * ÔÚUI threadÖÐÒì²½´´½¨Îļþ´«Êäsocket
- *
- * @param std::string & taskId Îļþ´«ÊäÈÎÎñid
- * @return void
- * @exception there is no any exception to throw.
- */
- void openFileSocketByTaskId(std::string& taskId);
- /**
- * ÔÚUI threadÖйرÕÎļþ´«Êäsocket
- *
- * @param std::string & taskId Îļþ´«ÊäÈÎÎñid
- * @return void
- * @exception there is no any exception to throw.
- */
- void closeFileSocketByTaskId(std::string& taskId);
- /**
- * ÏòÎļþ´«Êä·þÎñÆ÷·¢ËͽÓÊÕÎļþÐÅÁî
- *
- * @param std::string & taskId
- * @return BOOL
- * @exception there is no any exception to throw.
- */
- BOOL acceptFileTransfer(const std::string& taskId);
- BOOL rejectFileTransfer(const std::string& taskId);
- BOOL cancelFileTransfer(const std::string& taskId);
- private:
- HWND _createWnd();
- void _releaseWnd();
- void _closeAllFileSockets();
- static LRESULT _stdcall _WndProc(HWND hWnd
- , UINT message
- , WPARAM wparam
- , LPARAM lparam);
- FileTransferSocket* _findFileSocketByTaskId(const std::string& taskId);
- public:
- HWND m_hWnd;
- std::list<FileTransferSocket*> m_lstFileTransSockets;
- util::TTFastLock m_lock;
- };
- /******************************************************************************/
- #endif// FILETRANSFERUITHREAD_16C2B941_3E94_4B6F_B488_0B82EC2B3F26_H__