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 LICENSE 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 {}; }
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:40
UPnPFeature::m_name
QString m_name
Definition: upnpserviceimpl.h:61
UPnpServiceImpl::GetServiceEventURL
virtual QString GetServiceEventURL(void)
Provides the URL of the event portion of the service.
Definition: upnpserviceimpl.h:47
UPnPFeature::UPnPFeature
UPnPFeature(QString name, int version)
Definition: upnpserviceimpl.h:53
NameValues
Definition: upnputil.h:77
feature
static const std::array< featureStruct, 7 > feature
Definition: audiooutputsettings.cpp:434
UPnpDevice
Definition: upnpdevice.h:102
UPnPFeatureList::m_features
QList< UPnPFeature * > m_features
Definition: upnpserviceimpl.h:77
UPnPFeatureList
Definition: upnpserviceimpl.h:65
UPnPFeatureList::m_attributes
NameValues m_attributes
Definition: upnpserviceimpl.h:76
UPNP_PUBLIC
#define UPNP_PUBLIC
Definition: upnpexp.h:9
UPnPFeature
Definition: upnpserviceimpl.h:50
upnputil.h
nv_python_libs.bbciplayer.bbciplayer_api.version
string version
Definition: bbciplayer_api.py:77
UPnpServiceImpl
Base class for services we offer to other UPnP devices.
Definition: upnpserviceimpl.h:29
UPnPFeature::m_version
int m_version
Definition: upnpserviceimpl.h:62
upnpexp.h