MythTV  master
upnpserviceimpl.h
Go to the documentation of this file.
1 // Program Name: upnpserviceimpl.h
3 // Created : Jan 15, 2007
4 //
5 // Purpose : UPnp Device Description parser/generator
6 //
7 // Copyright (c) 2007 David Blain <dblain@mythtv.org>
8 //
9 // Licensed under the GPL v2 or later, see COPYING for details
10 //
12 
13 #ifndef UPNPSERVICEIMPL_H
14 #define UPNPSERVICEIMPL_H
15 
16 #include <utility>
17 
18 // Qt headers
19 #include <QString>
20 
21 // MythTV headers
22 #include "upnpexp.h"
23 #include "upnputil.h"
24 
25 
26 class UPnpDevice;
27 
30 {
31  public:
32  UPnpServiceImpl() = default;
33  virtual ~UPnpServiceImpl() = default;
34 
35  void RegisterService(UPnpDevice *device);
36 
37  protected:
39  virtual QString GetServiceType(void) = 0;
41  virtual QString GetServiceId(void) = 0;
43  virtual QString GetServiceControlURL(void) = 0;
45  virtual QString GetServiceDescURL(void) = 0;
47  virtual QString GetServiceEventURL(void) { return QString(); }
48 };
49 
51 {
52  public:
53  UPnPFeature(QString name, int version) :
54  m_name(std::move(name)), m_version(version) {}
55  virtual ~UPnPFeature() = default;
56 
57  QString toXML();
58  virtual QString CreateXML() = 0;
59 
60  protected:
61  QString m_name;
62  int m_version;
63 };
64 
66 {
67  public:
68  UPnPFeatureList() = default;
69  ~UPnPFeatureList();
70 
71  void AddFeature( UPnPFeature *feature );
72  void AddAttribute( const NameValue &attribute );
73  QString toXML();
74 
75  private:
77  QList<UPnPFeature*> m_features;
78 
79 };
80 
81 #endif // UPNPSERVICEIMPL_H
NameValue
Definition: upnputil.h:53
UPnPFeature::m_name
QString m_name
Definition: upnpserviceimpl.h:61
UPnpServiceImpl::GetServiceControlURL
virtual QString GetServiceControlURL(void)=0
Provices the base URL for control commands.
UPnpServiceImpl::GetServiceEventURL
virtual QString GetServiceEventURL(void)
Provides the URL of the event portion of the service.
Definition: upnpserviceimpl.h:47
UPnpServiceImpl::~UPnpServiceImpl
virtual ~UPnpServiceImpl()=default
UPnPFeature::UPnPFeature
UPnPFeature(QString name, int version)
Definition: upnpserviceimpl.h:53
NameValues
Definition: upnputil.h:89
feature
static const std::array< featureStruct, 7 > feature
Definition: audiooutputsettings.cpp:433
UPnpDevice
Definition: upnpdevice.h:100
UPnPFeatureList::UPnPFeatureList
UPnPFeatureList()=default
UPnPFeatureList::m_features
QList< UPnPFeature * > m_features
Definition: upnpserviceimpl.h:77
UPnpServiceImpl::GetServiceId
virtual QString GetServiceId(void)=0
Provides the device specific urn.
UPnPFeatureList
Definition: upnpserviceimpl.h:66
UPnPFeatureList::m_attributes
NameValues m_attributes
Definition: upnpserviceimpl.h:76
UPnPFeature::~UPnPFeature
virtual ~UPnPFeature()=default
UPnpServiceImpl::GetServiceDescURL
virtual QString GetServiceDescURL(void)=0
Provices the URL of the service description XML.
UPnpServiceImpl::UPnpServiceImpl
UPnpServiceImpl()=default
UPNP_PUBLIC
#define UPNP_PUBLIC
Definition: upnpexp.h:9
UPnPFeature
Definition: upnpserviceimpl.h:51
UPnpServiceImpl::GetServiceType
virtual QString GetServiceType(void)=0
Provices the schema urn.
upnputil.h
UPnPFeature::CreateXML
virtual QString CreateXML()=0
nv_python_libs.bbciplayer.bbciplayer_api.version
string version
Definition: bbciplayer_api.py:81
UPnpServiceImpl
Base class for services we offer to other UPnP devices.
Definition: upnpserviceimpl.h:30
UPnPFeature::m_version
int m_version
Definition: upnpserviceimpl.h:62
upnpexp.h