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 
19 typedef enum
20 {
27 
29 
31 
32 typedef enum
33 {
39 
41 
44 //
45 // UPnpCMGR Class Definition
46 //
49 
51 {
52  private:
53 
55  QString m_sControlUrl;
56 
58 
59  UPnpCMGRMethod GetMethod ( const QString &sURI );
60 
61  void HandleGetProtocolInfo ( HTTPRequest *pRequest );
62  void HandleGetCurrentConnectionInfo( HTTPRequest *pRequest );
63  void HandleGetCurrentConnectionIDs ( HTTPRequest *pRequest );
64  void HandleGetFeatureList ( HTTPRequest *pRequest );
65 
66  protected:
67 
68  // Implement UPnpServiceImpl methods that we can
69 
70  QString GetServiceType() override // UPnpServiceImpl
71  { return "urn:schemas-upnp-org:service:ConnectionManager:3"; }
72  QString GetServiceId() override // UPnpServiceImpl
73  { return "urn:upnp-org:serviceId:ConnectionManager"; }
74  QString GetServiceControlURL() override // UPnpServiceImpl
75  { return m_sControlUrl.mid( 1 ); }
76  QString GetServiceDescURL() override // UPnpServiceImpl
77  { return m_sControlUrl.mid( 1 ) + "/GetServDesc"; }
78 
79  public:
80  UPnpCMGR( UPnpDevice *pDevice,
81  const QString &sSharePath,
82  const QString &sSourceProtocols = "",
83  const QString &sSinkProtocols = "" );
84 
85  virtual ~UPnpCMGR() = default;
86 
87  void AddSourceProtocol( const QString &sProtocol );
88  void AddSinkProtocol ( const QString &sProtocol );
89 
90  QStringList GetBasePaths() override; // Eventing
91 
92  bool ProcessRequest( HTTPRequest *pRequest ) override; // Eventing
93 };
94 
95 #endif
QStringList GetBasePaths() override
Definition: eventing.cpp:135
QString GetServiceId() override
Provides the device specific urn.
Definition: upnpcmgr.h:72
UPnPFeatureList m_features
Definition: upnpcmgr.h:57
QString GetServiceDescURL() override
Provices the URL of the service description XML.
Definition: upnpcmgr.h:76
UPnpCMGRMethod
Definition: upnpcmgr.h:19
bool ProcessRequest(HTTPRequest *pRequest) override
Definition: eventing.cpp:147
UPnpCMGRConnectionStatus
Definition: upnpcmgr.h:32
QString m_sServiceDescFileName
Definition: upnpcmgr.h:54
#define UPNP_PUBLIC
Definition: upnpexp.h:9
QString GetServiceType() override
Provices the schema urn.
Definition: upnpcmgr.h:70
QString GetServiceControlURL() override
Provices the base URL for control commands.
Definition: upnpcmgr.h:74
QString m_sControlUrl
Definition: upnpcmgr.h:55