00001
00002
00003
00004
00005
00006
00007
00008
00010
00011 #ifndef UPnpCMGR_H_
00012 #define UPnpCMGR_H_
00013
00014 #include "httpserver.h"
00015 #include "eventing.h"
00016
00017 typedef enum
00018 {
00019 CMGRM_Unknown = 0,
00020 CMGRM_GetServiceDescription = 1,
00021 CMGRM_GetProtocolInfo = 2,
00022 CMGRM_GetCurrentConnectionInfo = 3,
00023 CMGRM_GetCurrentConnectionIDs = 4
00024
00025 } UPnpCMGRMethod;
00026
00028
00029 typedef enum
00030 {
00031 CMGRSTATUS_Unknown = 0,
00032 CMGRSTATUS_OK = 1,
00033 CMGRSTATUS_ContentFormatMismatch = 2,
00034 CMGRSTATUS_InsufficientBandwidth = 3,
00035 CMGRSTATUS_UnreliableChannel = 4
00036
00037 } UPnpCMGRConnectionStatus;
00038
00041
00042
00043
00046
00047 class UPnpCMGR : public Eventing
00048 {
00049 private:
00050
00051 QString m_sServiceDescFileName;
00052 QString m_sControlUrl;
00053
00054 UPnpCMGRMethod GetMethod ( const QString &sURI );
00055
00056 void HandleGetProtocolInfo ( HTTPRequest *pRequest );
00057 void HandleGetCurrentConnectionInfo( HTTPRequest *pRequest );
00058 void HandleGetCurrentConnectionIDs ( HTTPRequest *pRequest );
00059
00060 protected:
00061
00062
00063
00064 virtual QString GetServiceType () { return "urn:schemas-upnp-org:service:ConnectionManager:1"; }
00065 virtual QString GetServiceId () { return "urn:upnp-org:serviceId:CMGR_1-0"; }
00066 virtual QString GetServiceControlURL() { return m_sControlUrl.mid( 1 ); }
00067 virtual QString GetServiceDescURL () { return m_sControlUrl.mid( 1 ) + "/GetServDesc"; }
00068
00069 public:
00070 UPnpCMGR( UPnpDevice *pDevice,
00071 const QString &sSharePath,
00072 const QString &sSourceProtocols = "",
00073 const QString &sSinkProtocols = "" );
00074
00075 virtual ~UPnpCMGR();
00076
00077 void AddSourceProtocol( const QString &sProtocol );
00078 void AddSinkProtocol ( const QString &sProtocol );
00079
00080 virtual bool ProcessRequest( HttpWorkerThread *pThread, HTTPRequest *pRequest );
00081 };
00082
00083 #endif