00001 #ifndef UPnpMSRR_H_ 00002 #define UPnpMSRR_H_ 00003 00004 #include <qdom.h> 00005 #include <qdatetime.h> 00006 00007 #include "httpserver.h" 00008 #include "eventing.h" 00009 00010 class UPnpMSRR; 00011 00012 typedef enum 00013 { 00014 MSRR_Unknown = 0, 00015 MSRR_GetServiceDescription = 1, 00016 MSRR_IsAuthorized = 2, 00017 MSRR_RegisterDevice = 3, 00018 MSRR_IsValidated = 4 00019 00020 } UPnpMSRRMethod; 00021 00023 // 00024 // UPnpMSRR Class Definition 00025 // 00028 00029 class UPnpMSRR : public Eventing 00030 { 00031 private: 00032 00033 QString m_sServiceDescFileName; 00034 QString m_sControlUrl; 00035 00036 UPnpMSRRMethod GetMethod ( const QString &sURI ); 00037 00038 void HandleIsAuthorized ( HTTPRequest *pRequest ); 00039 void HandleRegisterDevice ( HTTPRequest *pRequest ); 00040 void HandleIsValidated ( HTTPRequest *pRequest ); 00041 00042 protected: 00043 00044 // Implement UPnpServiceImpl methods that we can 00045 00046 virtual QString GetServiceType () { return "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1"; } 00047 virtual QString GetServiceId () { return "urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar"; } 00048 virtual QString GetServiceControlURL() { return m_sControlUrl.mid( 1 ); } 00049 virtual QString GetServiceDescURL () { return m_sControlUrl.mid( 1 ) + "/GetServDesc"; } 00050 00051 public: 00052 UPnpMSRR( UPnpDevice *pDevice, 00053 const QString &sSharePath ); 00054 00055 virtual ~UPnpMSRR(); 00056 00057 bool ProcessRequest( HttpWorkerThread *pThread, HTTPRequest *pRequest ); 00058 }; 00059 00060 #endif
1.5.5