|
1 /** @file |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Control point with some basic AV services |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CUPNPAVCONTROLPOINT_H |
|
21 #define C_CUPNPAVCONTROLPOINT_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include "upnpcontrolpoint.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MUpnpAVControlPointObserver; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Control point services. |
|
34 * This class inherits control point base class and provides just a little |
|
35 * added value on top of that. Some default construction has been taken |
|
36 * care of, and some low level messaging is taken care of. Everything else |
|
37 * is up to the client. |
|
38 * |
|
39 * @lib - |
|
40 * @since S60 5.2 |
|
41 */ |
|
42 NONSHARABLE_CLASS ( CUpnpAVControlPoint ): public CUpnpControlPoint |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** static constructor. */ |
|
47 static CUpnpAVControlPoint* NewL( |
|
48 MUpnpAVControlPointObserver& aAVControlPointObserver |
|
49 ); |
|
50 |
|
51 /** Destructor. */ |
|
52 virtual ~CUpnpAVControlPoint(); |
|
53 |
|
54 private: // private construction part |
|
55 |
|
56 /** constructor */ |
|
57 CUpnpAVControlPoint(MUpnpAVControlPointObserver& aAVControlPointObserver); |
|
58 |
|
59 /** 2nd phase constructor */ |
|
60 void ConstructL(); |
|
61 |
|
62 public: // services |
|
63 |
|
64 /** |
|
65 * Returns the internally cached service for given device and |
|
66 * service type. |
|
67 * |
|
68 * @since S60 5.2 |
|
69 * @param aDevice the device for which service is requested for. |
|
70 * @param aServiceType the upnp service required, for instance CDS. |
|
71 * @return Cached service. |
|
72 */ |
|
73 CUpnpService* Service( |
|
74 const CUpnpDevice* aDevice, |
|
75 const TDesC8& aServiceType ); |
|
76 |
|
77 /** |
|
78 * Helper method to create new action with given action name. |
|
79 * |
|
80 * New action is created by internally cached service. The service is |
|
81 * identified with given device and service type. |
|
82 * |
|
83 * @since S60 5.2 |
|
84 * @param aDevice the device for which service is requested for |
|
85 * @param aServiceType the upnp service required, for instance CDS |
|
86 * @param aActionName Name of the action. |
|
87 * @return New action object |
|
88 * @leave KErrUnknown if internally cached service could not be found. |
|
89 * KErrGeneral if service doesn't support action. |
|
90 * Systemwide error code otherwise. |
|
91 */ |
|
92 CUpnpAction* CreateActionLC( |
|
93 const CUpnpDevice* aDevice, |
|
94 const TDesC8& aServiceType, |
|
95 const TDesC8& aActionName ); |
|
96 |
|
97 /** |
|
98 * Starts up the av control point by creating SSDP search. |
|
99 * |
|
100 * @param None. |
|
101 * @return None. |
|
102 */ |
|
103 void StartUpL(); |
|
104 |
|
105 private: // Virtual method overrides from base classes |
|
106 |
|
107 /** |
|
108 * From CUpnpControlPoint Device discovery handler. |
|
109 */ |
|
110 void DeviceDiscoveredL( CUpnpDevice* aDevice ); |
|
111 |
|
112 /** |
|
113 * From CUpnpControlPoint Device dissappear handler. |
|
114 */ |
|
115 void DeviceDisappearedL( CUpnpDevice* aDevice ); |
|
116 |
|
117 /** |
|
118 * From CUpnpControlPoint Action response handler function. |
|
119 */ |
|
120 void ActionResponseReceivedL( CUpnpAction* aAction ); |
|
121 |
|
122 /** |
|
123 * From CUpnpControlPoint State update handler. |
|
124 */ |
|
125 void StateUpdatedL( CUpnpService* aService ); |
|
126 |
|
127 /** |
|
128 * From CUpnpControlPoint HTTP message handler function. |
|
129 */ |
|
130 void HttpResponseReceivedL( CUpnpHttpMessage* aMessage ); |
|
131 |
|
132 /** |
|
133 * This function will be invoke if some network event will occure |
|
134 * for example IP Address of UPnP changes |
|
135 */ |
|
136 void NetworkEvent( CUpnpNetworkEventBase* aEvent ); |
|
137 |
|
138 private: // Data |
|
139 |
|
140 //AV control point observer (engine) |
|
141 MUpnpAVControlPointObserver& iAVControlPointObserver; |
|
142 }; |
|
143 |
|
144 #endif // C_CUPNPAVCONTROLPOINT_H |
|
145 |
|
146 // End of File |