Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

HostBrowser.h

Go to the documentation of this file.
00001 //
00002 // HostBrowser.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #if !defined(AFX_HOSTBROWSER_H__062DB5F6_EAE7_484D_BA12_28B4BCD99599__INCLUDED_)
00023 #define AFX_HOSTBROWSER_H__062DB5F6_EAE7_484D_BA12_28B4BCD99599__INCLUDED_
00024 
00025 #pragma once
00026 
00027 #include "Transfer.h"
00028 
00029 class CG1Packet;
00030 class CG2Packet;
00031 class CGProfile;
00032 class CBuffer;
00033 class CVendor;
00034 class CBrowseHostWnd;
00035 
00036 
00037 class CHostBrowser : public CTransfer
00038 {
00039 // Construction
00040 public:
00041         CHostBrowser(CBrowseHostWnd* pNotify = NULL, IN_ADDR* pAddress = NULL, WORD nPort = 0, BOOL bMustPush = FALSE, GGUID* pClientID = NULL);
00042         virtual ~CHostBrowser();
00043 
00044 // Attributes
00045 public:
00046         int                             m_nState;
00047         CBrowseHostWnd* m_pNotify;
00048         CGProfile*              m_pProfile;
00049 public:
00050         BOOL                    m_bNewBrowse;
00051         IN_ADDR                 m_pAddress;
00052         WORD                    m_nPort;
00053         BOOL                    m_bMustPush;
00054         BOOL                    m_bCanPush;
00055         GGUID                   m_pPushID;
00056         GGUID                   m_pClientID;
00057         DWORD                   m_tPushed;
00058         BOOL                    m_bConnect;
00059         int                             m_nHits;
00060         CVendor*                m_pVendor;
00061         BOOL                    m_bCanChat;
00062 public:
00063         CString                 m_sServer;
00064         DWORD                   m_nProtocol;
00065         BOOL                    m_bDeflate;
00066         DWORD                   m_nLength;
00067         DWORD                   m_nReceived;
00068         CBuffer*                m_pBuffer;
00069         LPVOID                  m_pInflate;
00070 
00071         enum { hbsNull, hbsConnecting, hbsRequesting, hbsHeaders, hbsContent };
00072 
00073 // Operations
00074 public:
00075         BOOL            Browse();
00076         void            Stop(BOOL bCompleted = FALSE);
00077         BOOL            IsBrowsing() const;
00078         float           GetProgress() const;
00079 protected:
00080         BOOL            SendPush(BOOL bMessage);
00081         void            SendRequest();
00082         BOOL            ReadResponseLine();
00083         BOOL            ReadContent();
00084         BOOL            StreamContent();
00085         BOOL            StreamPacketsG1();
00086         BOOL            StreamPacketsG2();
00087         BOOL            StreamHTML();
00088         BOOL            OnPacket(CG1Packet* pPacket);
00089         BOOL            OnPacket(CG2Packet* pPacket);
00090         void            OnProfilePacket(CG2Packet* pPacket);
00091 protected:
00092         virtual BOOL    OnConnected();
00093         virtual BOOL    OnRead();
00094         virtual void    OnDropped(BOOL bError);
00095         virtual BOOL    OnHeaderLine(CString& strHeader, CString& strValue);
00096         virtual BOOL    OnHeadersComplete();
00097         virtual BOOL    OnRun();
00098 public:
00099         virtual BOOL    OnPush(GGUID* pClientID, CConnection* pConnection);
00100 
00101 };
00102 
00103 #endif // !defined(AFX_HOSTBROWSER_H__062DB5F6_EAE7_484D_BA12_28B4BCD99599__INCLUDED_)

Generated on Thu Dec 15 10:39:43 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2