KVIrc  4.9.2
DeveloperAPIs
RootService.h
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // File : RootService.h
4 // Creation date : Fri Aug 08 18:00:00 2008 GMT by Fabio Bas
5 //
6 // This file is part of the KVIrc IRC client distribution
7 // Copyright (C) 2008 Fabio Bas (ctrlaltca at gmail dot com)
8 //
9 // This program is FREE software. You can redistribute it and/or
10 // modify it under the terms of the GNU General Public License
11 // as published by the Free Software Foundation; either version 2
12 // of the License, or (at your option) any later version.
13 //
14 // This program is distributed in the HOPE that it will be USEFUL,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 // See the GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program. If not, write to the Free Software Foundation,
21 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // Original Copyright follows:
24 //=============================================================================
25 
26 /***************************************************************************
27  RootService.h - description
28  -------------------
29  begin : Mon Jul 25 2005
30  copyright : (C) 2005 by Diederik van der Boor
31  email : vdboor --at-- codingdomain.com
32  ***************************************************************************/
33 
34 #ifndef UPNP_ROOTSERVICE_H
35 #define UPNP_ROOTSERVICE_H
36 
37 #include "Service.h"
38 
39 namespace UPnP
40 {
41 
42 #define InternetGatewayDeviceType "urn:schemas-upnp-org:device:InternetGatewayDevice:1"
43 
52  class RootService : public Service
53  {
54  public: // public methods
55  // The constructor
56  RootService(const QString & hostname, int port, const QString & rootUrl);
57  // The destructor
58  virtual ~RootService();
59 
60  // Return the device type
61  QString getDeviceType() const;
62 
63  // Return a service from the cached root device entry
64  ServiceParameters getServiceById(const QString & serviceId) const;
65  // Return a service from a cached embedded device entry
66  bool getServiceById(const QString & serviceId, const QString & deviceUdn, ServiceParameters & params) const;
67  // Return a service from the cached root device entry
68  ServiceParameters getServiceByType(const QString & serviceType) const;
69  // Return a service from a cached embedded device entry
70  bool getServiceByType(const QString & serviceType, const QString & deviceUdn, ServiceParameters & params) const;
71 
72  // Query the device for its service list
73  void queryDevice();
74 
75  protected: // Protected methods
76  // The control point received a response to callInformationUrl()
77  virtual void gotInformationResponse(const QDomNode & response);
78 
79  private: // Private methods
80  // Recursively add all devices and embedded devices to the deviceServices_ map
81  void addDeviceServices(const QDomNode & device);
82 
83  private:
84  // The device type
85  QString m_szDeviceType;
86  // A collection of all services provided by the device
87  QMap<QString, QDomNodeList> m_deviceServices;
88  // The hostname of the device
89  QString m_szHostname;
90  // The port of the device
91  int m_iPort;
92  // The udn of the root device
93  QString m_szRootUdn;
94  };
95 }
96 
97 #endif
ServiceParameters getServiceByType(const QString &serviceType) const
Definition: RootService.cpp:139
QString m_szRootUdn
Definition: RootService.h:93
int m_iPort
Definition: RootService.h:91
virtual ~RootService()
Definition: Service.h:68
void queryDevice()
Definition: RootService.cpp:200
QString m_szHostname
Definition: RootService.h:89
QMap< QString, QDomNodeList > m_deviceServices
Definition: RootService.h:87
Definition: Service.h:47
Definition: RootService.h:52
QString m_szDeviceType
Definition: RootService.h:85
RootService(const QString &hostname, int port, const QString &rootUrl)
Definition: RootService.cpp:46
virtual void gotInformationResponse(const QDomNode &response)
Definition: RootService.cpp:184
ServiceParameters getServiceById(const QString &serviceId) const
Definition: RootService.cpp:97
void addDeviceServices(const QDomNode &device)
Definition: RootService.cpp:56
QString getDeviceType() const
Definition: RootService.cpp:91
QString hostname()
Definition: KviRuntimeInfo.cpp:720