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