|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __RPNPPSERVICEDISCOVER_H__ |
|
17 #define __RPNPPSERVICEDISCOVER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 |
|
21 class RControlChannel; |
|
22 class CPnPServiceDiscoveryBase; |
|
23 class RPnPParameterBundle; |
|
24 |
|
25 /** |
|
26 A generic class which provides the functionality to provision the applications who want to discover services |
|
27 and listen for service related notifications. The service discovery and related notification are technology specific. |
|
28 @publishedPartner |
|
29 @prototype |
|
30 */ |
|
31 class RPnPServiceDiscovery |
|
32 { |
|
33 public: |
|
34 /** |
|
35 Constructor |
|
36 */ |
|
37 IMPORT_C RPnPServiceDiscovery( ); |
|
38 |
|
39 /** |
|
40 Resolves the technology. |
|
41 @param aTierID implementation UID. Identifies technology for which service discovery is requested. |
|
42 @return KErrNone if successful. Returns system wide error codes on failure |
|
43 */ |
|
44 IMPORT_C TInt Open ( TUint aTierID ); |
|
45 |
|
46 /** |
|
47 Issues a discovery request. The technology specific discovery information is packed |
|
48 in aServiceInfo parameter. The caller should set a callback function of type MPnPCallBack in aServiceInfo |
|
49 to retrieve discovery responses. |
|
50 When the responses are received, MPnPObserver::OnPnPEventL is called for each response and calling clients |
|
51 must provide the implementation to handle the responses. |
|
52 |
|
53 In case of invalid input is provided in the form of corrupted uris for searching or low memory conditions,the application returns |
|
54 synchronously with MPnPObserver::OnPnPError |
|
55 @param aServiceInfo Parameter bundle contains the discovery information. |
|
56 */ |
|
57 IMPORT_C void Discover ( const RPnPParameterBundle& aServiceInfo ); |
|
58 |
|
59 /** |
|
60 Retrieves the description of the remote service. The technology specific description information is packed |
|
61 in aServiceInfo parameter. The caller should set a callback function of type MPnPObserver |
|
62 in aServiceInfo to retrieve description responses. |
|
63 When the responses are received MPnPObserver ::OnPnPEventL is called for each response and calling clients must provide |
|
64 the implementation to handle the responses. |
|
65 |
|
66 In case invalid input is provided in the form of corrupted uris for describe or low memory conditions,the application returns |
|
67 synchronously with MPnPObserver::OnPnPError.However application is not able to filter out all invalid URLs |
|
68 @param Parameter bundle contains the information about remote service(s) to be described. |
|
69 */ |
|
70 IMPORT_C void Describe ( const RPnPParameterBundle& aServiceInfo ); |
|
71 |
|
72 /** |
|
73 Subscribes for event notifications to the remote service or device . |
|
74 The technology specific description information is packed in aServiceInfo parameter. |
|
75 The caller should set a callback function of type MPnPObserver in aServiceInfo to retrieve description responses. |
|
76 When the responses are received MPnPObserver ::OnPnPEventL is called for each response and calling clients must provide |
|
77 the implementation to handle the responses. |
|
78 |
|
79 In case invalid input is provided in the form of corrupted uris for subscribe or low memory conditions,the application returns |
|
80 synchronously with MPnPObserver::OnPnPError.However application is not able to filter out all invalid URLs |
|
81 |
|
82 @param Parameter bundle contains the information about remote service(s) to be described. |
|
83 */ |
|
84 |
|
85 IMPORT_C void Subscribe ( const RPnPParameterBundle& aServiceInfo ); |
|
86 |
|
87 /** |
|
88 Registers for events of remote service. The technology specific registration information |
|
89 is packed in aServiceInfo. The caller can set a callback function of type MPnPObserver in aServiceInfo |
|
90 to retrieve response of registration. |
|
91 |
|
92 |
|
93 In case invalid input is provided in the form of corrupted uris for registration or low memory conditions,the application returns |
|
94 synchronously with MPnPObserver::OnPnPError. |
|
95 |
|
96 @param Parameter bundle contains the register information to be sent to remote service. |
|
97 */ |
|
98 IMPORT_C void RegisterNotify ( const RPnPParameterBundle& aServiceInfo ); |
|
99 |
|
100 /** |
|
101 Issues a cancel request to ongoing discoveries, describe , subscribe requests .This also cancels notify |
|
102 of previously registered events from remote service. The technology specific discovery cancellation information |
|
103 is packed in aServiceInfo. |
|
104 |
|
105 @param Parameter bundle contains the cancel requests. |
|
106 */ |
|
107 IMPORT_C void Cancel ( const RPnPParameterBundle& aServiceInfo ); |
|
108 |
|
109 /** |
|
110 It enables to send and receive messages. |
|
111 @return KErrNone if successful. Returns system wide error codes on failure. |
|
112 */ |
|
113 IMPORT_C TInt InitiateControl ( RControlChannel& aControlChannel, const TDesC8& aUri ); |
|
114 |
|
115 /** |
|
116 Close technology specific session. |
|
117 */ |
|
118 IMPORT_C void Close ( ); |
|
119 |
|
120 private: |
|
121 CPnPServiceDiscoveryBase* iPnPServiceDiscoveryImpl; |
|
122 }; |
|
123 |
|
124 #endif /*__RPNPPSERVICEDISCOVER_H__*/ |