|
1 /** @file |
|
2 * Copyright (c) 2007-2007 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: Declares simple device description process. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CUPNPCPBSIMPLEDEVICEDESCRIPTION_H |
|
20 #define C_CUPNPCPBSIMPLEDEVICEDESCRIPTION_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 #include "upnpcpbdevicedescription.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CUpnpDevice; |
|
29 class CUpnpContentHandlersController; |
|
30 |
|
31 /** |
|
32 * Class handling discovery process of simple device. |
|
33 * It is checking only services of device. Subdevices are not processed. |
|
34 * |
|
35 * @lib controlpointbase.lib |
|
36 * @since S60 v5.0 |
|
37 */ |
|
38 NONSHARABLE_CLASS( CUpnpCpbSimpleDeviceDescription ) : public CUpnpCpbDeviceDescription |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Two-phased constructor |
|
43 * @since S60 v5.0 |
|
44 */ |
|
45 static CUpnpCpbSimpleDeviceDescription* |
|
46 CUpnpCpbSimpleDeviceDescription::NewL( |
|
47 MUpnpCpbHttpMessageController& aMessanger, |
|
48 CUpnpCpbDeviceRepository& aRepository); |
|
49 |
|
50 /** |
|
51 * Start processing device. |
|
52 * |
|
53 * @since S60 v5.0 |
|
54 * @param aDevice Device that should be discovered |
|
55 * @return 0 - if discovery process is finished correctly |
|
56 * 1 - if discovery was not finished correctly |
|
57 * 2 - if discovery is in progress |
|
58 */ |
|
59 TInt DiscoverDeviceL(CUpnpDevice* aDevice); |
|
60 |
|
61 /** |
|
62 * Function processing service description. |
|
63 * |
|
64 * @since S60 v5.0 |
|
65 * @param aMsg Service message |
|
66 * @return 0 - if discovery process is finished correctly |
|
67 * 1 - if discovery was not finished correctly |
|
68 * 2 - if discovery is in progress |
|
69 */ |
|
70 TInt ServiceDescriptionL(CUpnpHttpMessage* aMsg); |
|
71 |
|
72 /** |
|
73 * Append discovered devices to array |
|
74 * |
|
75 * @since S60 v5.0 |
|
76 * @param aArray array where devices should be appended |
|
77 */ |
|
78 void GetDiscoveredDeviceL(RPointerArray<CUpnpDevice>& aArray, TBool aRemove = EFalse ); |
|
79 |
|
80 /** |
|
81 * Append not discovered (does not match the type) devices to array |
|
82 * |
|
83 * @since S60 v5.0 |
|
84 * @param aArray array where devices should be appended |
|
85 */ |
|
86 void GetUnnededDeviceL(RPointerArray<CUpnpDevice>& aArray, TBool aRemove = EFalse ); |
|
87 |
|
88 /** |
|
89 * Append discovered but not metching target types devices to array |
|
90 * |
|
91 * @since S60 v5.0 |
|
92 * @param aArray array where devices should be appended |
|
93 */ |
|
94 void GetUninterestingDeviceL(RPointerArray<CUpnpDevice>& aArray, TBool aRemove = EFalse ); |
|
95 |
|
96 /** |
|
97 * Get currently processed device, if it is inclomplete one. |
|
98 * |
|
99 * @since S60 v5.0 |
|
100 * @return Pointer to processed device |
|
101 */ |
|
102 CUpnpDevice* GetIncompliteRootDevice(); |
|
103 |
|
104 /** |
|
105 * Set target device as null. |
|
106 * |
|
107 * @since S60 v5.0 |
|
108 */ |
|
109 void NullTargetDevice(); |
|
110 |
|
111 /** |
|
112 * Delete target device. |
|
113 * |
|
114 * @since S60 v5.0 |
|
115 */ |
|
116 void DeleteTargetDevice(); |
|
117 |
|
118 /** |
|
119 * Return incorect uuids |
|
120 * |
|
121 * @since S60 v5.0 |
|
122 * @return Uuids pointer |
|
123 */ |
|
124 const TPtrC8 FailedUuidsL(); |
|
125 |
|
126 /** |
|
127 * Destructor |
|
128 * @since S60 v5.0 |
|
129 */ |
|
130 ~CUpnpCpbSimpleDeviceDescription(); |
|
131 |
|
132 private: |
|
133 /** |
|
134 * Constructor |
|
135 * @since S60 v5.0 |
|
136 */ |
|
137 CUpnpCpbSimpleDeviceDescription(MUpnpCpbHttpMessageController& aMessanger, |
|
138 CUpnpCpbDeviceRepository& aRepository); |
|
139 |
|
140 /** |
|
141 * Parses service description and add it to device |
|
142 * |
|
143 * @since S60 v5.0 |
|
144 * @param aMsg Service message |
|
145 * @return 0 - if discovery process is finished correctly |
|
146 * 1 - if discovery was not finished correctly |
|
147 * 2 - if discovery is in progress |
|
148 */ |
|
149 TInt ProcessServiceDescriptionL(CUpnpHttpMessage* aMsg); |
|
150 |
|
151 // Inform if root device should be destroyed or not |
|
152 TBool iIsNull; |
|
153 }; |
|
154 |
|
155 #endif // C_CUPNPCPBSIMPLEDEVICEDESCRIPTION_H |