MythTV master
upnpserviceimpl.h
Go to the documentation of this file.
1
2// 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 <QList>
20#include <QString>
21
22// MythTV headers
23#include "upnpexp.h"
24#include "upnputil.h"
25
26
27class UPnpDevice;
28
31{
32 public:
33 UPnpServiceImpl() = default;
34 virtual ~UPnpServiceImpl() = default;
35
36 void RegisterService(UPnpDevice *device);
37
38 protected:
40 virtual QString GetServiceType(void) = 0;
42 virtual QString GetServiceId(void) = 0;
44 virtual QString GetServiceControlURL(void) = 0;
46 virtual QString GetServiceDescURL(void) = 0;
48 virtual QString GetServiceEventURL(void) { return {}; }
49};
50
52{
53 public:
54 UPnPFeature(QString name, int version) :
55 m_name(std::move(name)), m_version(version) {}
56 virtual ~UPnPFeature() = default;
57
58 QString toXML();
59 virtual QString CreateXML() = 0;
60
61 protected:
62 QString m_name;
64};
65
67{
68 public:
69 UPnPFeatureList() = default;
71
72 void AddFeature( UPnPFeature *feature );
73 void AddAttribute( const NameValue &attribute );
74 QString toXML();
75
76 private:
78 QList<UPnPFeature*> m_features;
79
80};
81
82#endif // UPNPSERVICEIMPL_H
static const std::array< featureStruct, 7 > feature
QList< UPnPFeature * > m_features
UPnPFeatureList()=default
NameValues m_attributes
virtual QString CreateXML()=0
virtual ~UPnPFeature()=default
QString m_name
UPnPFeature(QString name, int version)
Base class for services we offer to other UPnP devices.
virtual QString GetServiceId(void)=0
Provides the device specific urn.
virtual ~UPnpServiceImpl()=default
virtual QString GetServiceControlURL(void)=0
Provices the base URL for control commands.
virtual QString GetServiceType(void)=0
Provices the schema urn.
virtual QString GetServiceEventURL(void)
Provides the URL of the event portion of the service.
UPnpServiceImpl()=default
virtual QString GetServiceDescURL(void)=0
Provices the URL of the service description XML.
string version
Definition: giantbomb.py:185
STL namespace.
#define UPNP_PUBLIC
Definition: upnpexp.h:9