MythTV  master
upnpcmgr.h
Go to the documentation of this file.
1 // Program Name: UPnpCMGR.h
3 // Created : Dec. 28, 2006
4 //
5 // Purpose : uPnp Connection Manager Service
6 //
7 // Copyright (c) 2006 David Blain <dblain@mythtv.org>
8 //
9 // Licensed under the GPL v2 or later, see COPYING for details
10 //
12 
13 #ifndef UPnpCMGR_H_
14 #define UPnpCMGR_H_
15 
16 #include "httpserver.h"
17 #include "eventing.h"
18 
20 {
27 };
28 
30 
32 {
38 };
39 
42 //
43 // UPnpCMGR Class Definition
44 //
47 
49 {
50  private:
51 
53  QString m_sControlUrl;
54 
56 
57  static UPnpCMGRMethod GetMethod ( const QString &sURI );
58 
59  void HandleGetProtocolInfo ( HTTPRequest *pRequest );
60  static void HandleGetCurrentConnectionInfo( HTTPRequest *pRequest );
61  void HandleGetCurrentConnectionIDs ( HTTPRequest *pRequest );
62  void HandleGetFeatureList ( HTTPRequest *pRequest );
63 
64  protected:
65 
66  // Implement UPnpServiceImpl methods that we can
67 
68  QString GetServiceType() override // UPnpServiceImpl
69  { return "urn:schemas-upnp-org:service:ConnectionManager:3"; }
70  QString GetServiceId() override // UPnpServiceImpl
71  { return "urn:upnp-org:serviceId:ConnectionManager"; }
72  QString GetServiceControlURL() override // UPnpServiceImpl
73  { return m_sControlUrl.mid( 1 ); }
74  QString GetServiceDescURL() override // UPnpServiceImpl
75  { return m_sControlUrl.mid( 1 ) + "/GetServDesc"; }
76 
77  public:
78  UPnpCMGR( UPnpDevice *pDevice,
79  const QString &sSharePath,
80  const QString &sSourceProtocols = "",
81  const QString &sSinkProtocols = "" );
82 
83  ~UPnpCMGR() override = default;
84 
85  void AddSourceProtocol( const QString &sProtocol );
86  void AddSinkProtocol ( const QString &sProtocol );
87 
88  QStringList GetBasePaths() override; // Eventing
89 
90  bool ProcessRequest( HTTPRequest *pRequest ) override; // Eventing
91 };
92 
93 #endif
HTTPRequest
Definition: httprequest.h:108
UPnpCMGR::m_sControlUrl
QString m_sControlUrl
Definition: upnpcmgr.h:53
CMGRM_GetServiceDescription
@ CMGRM_GetServiceDescription
Definition: upnpcmgr.h:22
Eventing::GetBasePaths
QStringList GetBasePaths() override
Definition: eventing.cpp:129
Eventing
Definition: eventing.h:254
Eventing::ProcessRequest
bool ProcessRequest(HTTPRequest *pRequest) override
Definition: eventing.cpp:141
CMGRM_GetFeatureList
@ CMGRM_GetFeatureList
Definition: upnpcmgr.h:26
UPnpCMGRMethod
UPnpCMGRMethod
Definition: upnpcmgr.h:20
eventing.h
CMGRSTATUS_ContentFormatMismatch
@ CMGRSTATUS_ContentFormatMismatch
Definition: upnpcmgr.h:35
CMGRM_Unknown
@ CMGRM_Unknown
Definition: upnpcmgr.h:21
UPnpCMGR::GetServiceId
QString GetServiceId() override
Provides the device specific urn.
Definition: upnpcmgr.h:70
UPnpDevice
Definition: upnpdevice.h:100
UPnpCMGR::GetServiceDescURL
QString GetServiceDescURL() override
Provices the URL of the service description XML.
Definition: upnpcmgr.h:74
CMGRM_GetProtocolInfo
@ CMGRM_GetProtocolInfo
Definition: upnpcmgr.h:23
UPnpCMGR::m_features
UPnPFeatureList m_features
Definition: upnpcmgr.h:55
CMGRM_GetCurrentConnectionIDs
@ CMGRM_GetCurrentConnectionIDs
Definition: upnpcmgr.h:25
UPnpCMGR
Definition: upnpcmgr.h:49
UPnpCMGRConnectionStatus
UPnpCMGRConnectionStatus
Definition: upnpcmgr.h:32
CMGRSTATUS_OK
@ CMGRSTATUS_OK
Definition: upnpcmgr.h:34
CMGRM_GetCurrentConnectionInfo
@ CMGRM_GetCurrentConnectionInfo
Definition: upnpcmgr.h:24
UPnpCMGR::m_sServiceDescFileName
QString m_sServiceDescFileName
Definition: upnpcmgr.h:52
UPnPFeatureList
Definition: upnpserviceimpl.h:66
CMGRSTATUS_Unknown
@ CMGRSTATUS_Unknown
Definition: upnpcmgr.h:33
UPNP_PUBLIC
#define UPNP_PUBLIC
Definition: upnpexp.h:9
httpserver.h
UPnpCMGR::GetServiceControlURL
QString GetServiceControlURL() override
Provices the base URL for control commands.
Definition: upnpcmgr.h:72
CMGRSTATUS_UnreliableChannel
@ CMGRSTATUS_UnreliableChannel
Definition: upnpcmgr.h:37
CMGRSTATUS_InsufficientBandwidth
@ CMGRSTATUS_InsufficientBandwidth
Definition: upnpcmgr.h:36
UPnpCMGR::GetServiceType
QString GetServiceType() override
Provices the schema urn.
Definition: upnpcmgr.h:68
UPnpCMGR::~UPnpCMGR
~UPnpCMGR() override=default