libupnpp 0.16.0
A C++ wrapper for the Portable UPnP reference library
ohproduct.hxx
1/* Copyright (C) 2006-2016 J.F.Dockes
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301 USA
17 */
18#ifndef _OHPRODUCT_HXX_INCLUDED_
19#define _OHPRODUCT_HXX_INCLUDED_
20
21#include <unordered_map>
22#include <string>
23#include <vector>
24
25#include "service.hxx"
26
27
28namespace UPnPClient {
29
30class OHProduct;
31class UPnPDeviceDesc;
32class UPnPServiceDesc;
33
34typedef std::shared_ptr<OHProduct> OHPRH;
35
40class UPNPP_API OHProduct : public Service {
41public:
42 using Service::Service;
43
45 static bool isOHPrService(const std::string& st);
46 bool serviceTypeMatch(const std::string& tp) override;
47
48 struct Source {
49 std::string name;
50 std::string type;
51 bool visible{false};
52 };
53
54 static bool parseSourceXML(std::string& sxml, std::vector<Source>& sources);
55
57 int getSources(std::vector<Source>& sources);
58 int sourceIndex(int *index);
59 int setSourceIndex(int index);
60 int setSourceIndexByName(const std::string& name);
61 int standby(bool *value);
62 int setStanby(bool value);
63
64protected:
65 /* My service type string */
66 static const std::string SType;
67private:
68 void UPNPP_LOCAL evtCallback(const std::unordered_map<std::string, std::string>&);
69 void UPNPP_LOCAL registerCallback() override;
70};
71
72} // namespace UPnPClient
73
74#endif /* _OHPRODUCT_HXX_INCLUDED_ */
OHProduct Service client class.
Definition ohproduct.hxx:40
Definition service.hxx:88
UPnP Description phase: interpreting the device description which we downloaded from the URL obtained...
Definition avlastchg.cxx:28
Definition ohproduct.hxx:48