|
1 /* |
|
2 * Copyright (c) 2006 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: AV Controller server session |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef C_CUPNPAVCONTROLLERSESSION_H |
|
24 #define C_CUPNPAVCONTROLLERSESSION_H |
|
25 |
|
26 // INCLUDES |
|
27 #include "upnpavcontrollerglobals.h" |
|
28 |
|
29 #include <e32base.h> |
|
30 #include "upnpconnectionmonitorobserver.h" |
|
31 |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CUpnpAVControllerServer; |
|
35 class CUPnPAVControllerImpl; |
|
36 class CUpnpAVDeviceExtended; |
|
37 class CUpnpDevice; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 An instance of class CUpnpAVControllerSession is created for each client |
|
43 */ |
|
44 class CUpnpAVControllerSession : public CSession2, |
|
45 public MUPnPConnectionMonitorObserver |
|
46 { |
|
47 |
|
48 public: // New methods |
|
49 |
|
50 /** |
|
51 * Create a CUpnpAVControllerSession object using two phase construction, |
|
52 * and return a pointer to the created object |
|
53 * @result pointer to new session |
|
54 */ |
|
55 static CUpnpAVControllerSession* NewL( |
|
56 CUpnpAVControllerServer& aServer ); |
|
57 |
|
58 /** |
|
59 * Create a CUpnpAVControllerSession object using two phase construction, |
|
60 * and return a pointer to the created object |
|
61 * @result pointer to new session |
|
62 */ |
|
63 static CUpnpAVControllerSession* NewLC( |
|
64 CUpnpAVControllerServer& aServer ); |
|
65 |
|
66 /** |
|
67 * Destroy the object and release all memory objects |
|
68 */ |
|
69 virtual ~CUpnpAVControllerSession(); |
|
70 |
|
71 |
|
72 public: // From CSession |
|
73 /** |
|
74 * Called after a service request from client; from class CSession |
|
75 * @param aMessage message from client |
|
76 * (containing requested operation and any data) |
|
77 */ |
|
78 void ServiceL( const RMessage2& aMessage ); |
|
79 public: // From MUPnPConnectionMonitorObserver |
|
80 |
|
81 /** |
|
82 * Handles UPnP device discoveries. |
|
83 * @since Series 60 2.6 |
|
84 * @param aDevice Device that is discovered. |
|
85 */ |
|
86 void DeviceDiscoveredL( CUpnpAVDeviceExtended& aDevice ); |
|
87 |
|
88 /** |
|
89 * Handles UPnP device disappears. |
|
90 * @since Series 60 2.6 |
|
91 * @param aDevice Device that disappeared. |
|
92 */ |
|
93 void DeviceDisappearedL( CUpnpAVDeviceExtended& aDevice ); |
|
94 |
|
95 |
|
96 void ConnectionLost(); |
|
97 |
|
98 private: // New methods |
|
99 |
|
100 /** |
|
101 * Perform the first phase of two phase construction |
|
102 */ |
|
103 CUpnpAVControllerSession( CUpnpAVControllerServer& aServer ); |
|
104 |
|
105 /** |
|
106 * Perform the second phase construction of the object |
|
107 */ |
|
108 void ConstructL() ; |
|
109 |
|
110 /** |
|
111 * Causes the client thread to panic |
|
112 * @param panic code |
|
113 */ |
|
114 void PanicClient( const RMessage2& aMessage, TInt aPanic ) const; |
|
115 |
|
116 private: |
|
117 |
|
118 /** @var iMediaServer pointer to Media Server */ |
|
119 |
|
120 CUpnpAVControllerServer& iAVControllerServer; |
|
121 CUPnPAVControllerImpl* iAVController; |
|
122 }; |
|
123 |
|
124 #endif // C_CUPNPAVCONTROLLERSESSION_H |