comparison deps/Platinum/Source/Core/PltCtrlPointTask.h @ 0:3425707ddbf6

Initial import (hopefully this mercurial stuff works...)
author fraserofthenight
date Mon, 06 Jul 2009 08:06:28 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:3425707ddbf6
1 /*****************************************************************
2 |
3 | Platinum - Control Point Tasks
4 |
5 | Copyright (c) 2004-2008, Plutinosoft, LLC.
6 | All rights reserved.
7 | http://www.plutinosoft.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 | OEMs, ISVs, VARs and other distributors that combine and
15 | distribute commercially licensed software with Platinum software
16 | and do not wish to distribute the source code for the commercially
17 | licensed software under version 2, or (at your option) any later
18 | version, of the GNU General Public License (the "GPL") must enter
19 | into a commercial license agreement with Plutinosoft, LLC.
20 |
21 | This program is distributed in the hope that it will be useful,
22 | but WITHOUT ANY WARRANTY; without even the implied warranty of
23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 | GNU General Public License for more details.
25 |
26 | You should have received a copy of the GNU General Public License
27 | along with this program; see the file LICENSE.txt. If not, write to
28 | the Free Software Foundation, Inc.,
29 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30 | http://www.gnu.org/licenses/gpl-2.0.html
31 |
32 ****************************************************************/
33
34 #ifndef _PLT_CONTROL_POINT_TASK_H_
35 #define _PLT_CONTROL_POINT_TASK_H_
36
37 /*----------------------------------------------------------------------
38 | includes
39 +---------------------------------------------------------------------*/
40 #include "Neptune.h"
41 #include "PltHttpClientTask.h"
42 #include "PltDatagramStream.h"
43 #include "PltDeviceData.h"
44 #include "PltCtrlPoint.h"
45
46 /*----------------------------------------------------------------------
47 | forward declarations
48 +---------------------------------------------------------------------*/
49 class PLT_Action;
50
51 /*----------------------------------------------------------------------
52 | PLT_CtrlPointGetDescriptionTask class
53 +---------------------------------------------------------------------*/
54 class PLT_CtrlPointGetDescriptionTask : public PLT_HttpClientSocketTask
55 {
56 public:
57 PLT_CtrlPointGetDescriptionTask(const NPT_HttpUrl& url,
58 PLT_CtrlPoint* ctrl_point,
59 PLT_DeviceDataReference& device);
60 virtual ~PLT_CtrlPointGetDescriptionTask();
61
62 protected:
63 // PLT_HttpClientSocketTask methods
64 NPT_Result ProcessResponse(NPT_Result res,
65 NPT_HttpRequest* request,
66 const NPT_HttpRequestContext& context,
67 NPT_HttpResponse* response);
68
69 protected:
70 PLT_CtrlPoint* m_CtrlPoint;
71 PLT_DeviceDataReference m_Device;
72 };
73
74 /*----------------------------------------------------------------------
75 | PLT_CtrlPointGetSCPDTask class
76 +---------------------------------------------------------------------*/
77 class PLT_CtrlPointGetSCPDTask : public PLT_HttpClientSocketTask
78 {
79 public:
80 PLT_CtrlPointGetSCPDTask(const NPT_HttpUrl& url,
81 PLT_CtrlPoint* ctrl_point,
82 PLT_DeviceDataReference& m_Device);
83 virtual ~PLT_CtrlPointGetSCPDTask();
84
85 protected:
86 // PLT_HttpClientSocketTask methods
87 NPT_Result ProcessResponse(NPT_Result res,
88 NPT_HttpRequest* request,
89 const NPT_HttpRequestContext& context,
90 NPT_HttpResponse* response);
91
92 protected:
93 PLT_CtrlPoint* m_CtrlPoint;
94 PLT_DeviceDataReference m_Device;
95 };
96
97 /*----------------------------------------------------------------------
98 | PLT_CtrlPointInvokeActionTask class
99 +---------------------------------------------------------------------*/
100 class PLT_CtrlPointInvokeActionTask : public PLT_HttpClientSocketTask
101 {
102 public:
103 PLT_CtrlPointInvokeActionTask(NPT_HttpRequest* request,
104 PLT_CtrlPoint* ctrl_point,
105 PLT_ActionReference& action,
106 void* userdata);
107 virtual ~PLT_CtrlPointInvokeActionTask();
108
109 protected:
110 // PLT_HttpClientSocketTask methods
111 NPT_Result ProcessResponse(NPT_Result res,
112 NPT_HttpRequest* request,
113 const NPT_HttpRequestContext& context,
114 NPT_HttpResponse* response);
115
116 protected:
117 PLT_CtrlPoint* m_CtrlPoint;
118 PLT_ActionReference m_Action;
119 void* m_Userdata;
120 };
121
122 /*----------------------------------------------------------------------
123 | PLT_CtrlPointHouseKeepingTask class
124 +---------------------------------------------------------------------*/
125 class PLT_CtrlPointHouseKeepingTask : public PLT_ThreadTask
126 {
127 public:
128 PLT_CtrlPointHouseKeepingTask(PLT_CtrlPoint* ctrl_point,
129 NPT_TimeInterval timer = NPT_TimeInterval(10, 0));
130
131 protected:
132 ~PLT_CtrlPointHouseKeepingTask() {}
133
134 // PLT_ThreadTask methods
135 virtual void DoRun();
136
137 protected:
138 PLT_CtrlPoint* m_CtrlPoint;
139 NPT_TimeInterval m_Timer;
140 };
141
142 /*----------------------------------------------------------------------
143 | PLT_CtrlPointSubscribeEventTask class
144 +---------------------------------------------------------------------*/
145 class PLT_CtrlPointSubscribeEventTask : public PLT_HttpClientSocketTask
146 {
147 public:
148 PLT_CtrlPointSubscribeEventTask(NPT_HttpRequest* request,
149 PLT_CtrlPoint* ctrl_point,
150 PLT_Service* service,
151 void* userdata);
152 virtual ~PLT_CtrlPointSubscribeEventTask();
153
154 protected:
155 // PLT_HttpClientSocketTask methods
156 NPT_Result ProcessResponse(NPT_Result res,
157 NPT_HttpRequest* request,
158 const NPT_HttpRequestContext& context,
159 NPT_HttpResponse* response);
160
161 protected:
162 PLT_CtrlPoint* m_CtrlPoint;
163 PLT_Service* m_Service;
164 void* m_Userdata;
165 };
166
167 #endif /* _PLT_CONTROL_POINT_TASK_H_ */