|
1 /* |
|
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: |
|
15 * Name : sipclientdiscovery.h |
|
16 * Part of : SIP Client Resolver |
|
17 * Interface : SIP Client Discovery API |
|
18 * Version : 1.0 |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 #ifndef CSIPCLIENTDISCOVERY_H |
|
25 #define CSIPCLIENTDISCOVERY_H |
|
26 |
|
27 // INCLUDES |
|
28 #include <e32base.h> |
|
29 #include <stringpool.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class MSIPClientDiscoveryObserver; |
|
33 class CSIPClientDiscoveryImpl; |
|
34 class CSIPHeaderBase; |
|
35 class CSIPContentTypeHeader; |
|
36 |
|
37 // CLASS DECLARATION |
|
38 /** |
|
39 * @publishedPartner |
|
40 * @released |
|
41 * |
|
42 * Class for managing connected client's channels. |
|
43 * This class provides services for Symbian OS servers to determine |
|
44 * client's channel to which the SIP request must be routed. |
|
45 * |
|
46 * @lib siprsvclient.lib |
|
47 */ |
|
48 class CSIPClientDiscovery : public CBase |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Creates an object representing the session with the server. |
|
54 * |
|
55 * @param aObserver an observer for receiving events about |
|
56 * resolved client's communication channel UIDs |
|
57 * @param aSelf the UID of the server itself |
|
58 * that will handle multiple simultaneous clients |
|
59 */ |
|
60 IMPORT_C static CSIPClientDiscovery* NewL( |
|
61 MSIPClientDiscoveryObserver& aObserver, |
|
62 TUid aSelf); |
|
63 |
|
64 /** |
|
65 * Creates an object representing the session with the server |
|
66 * and pushes it to CleanupStack. |
|
67 * |
|
68 * @param aObserver an observer for receiving events about |
|
69 * resolved client's communication channel UIDs |
|
70 * @param aSelf the UID of the server itself that will handle |
|
71 * multiple simultaneous clients |
|
72 */ |
|
73 IMPORT_C static CSIPClientDiscovery* NewLC( |
|
74 MSIPClientDiscoveryObserver& aObserver, |
|
75 TUid aSelf); |
|
76 |
|
77 /** |
|
78 * Destructor. |
|
79 */ |
|
80 IMPORT_C ~CSIPClientDiscovery(); |
|
81 |
|
82 public: // New functions |
|
83 |
|
84 /** |
|
85 * Registers handled client |
|
86 * |
|
87 * @param aChannel the communication channel UID of the connected client |
|
88 */ |
|
89 IMPORT_C void RegisterL(TUid aChannel); |
|
90 |
|
91 /** |
|
92 * Deregisters handled client |
|
93 * @param aChannel the communication channel UID of the connected client |
|
94 * @return KErrNone if successful, KErrNotFound if not found |
|
95 */ |
|
96 IMPORT_C TInt Deregister(TUid aChannel); |
|
97 |
|
98 /** |
|
99 * Request to provide the communication channel for the SIP request |
|
100 * received outside the SIP dialog |
|
101 * |
|
102 * @param aRequestMethod the method of the SIP request |
|
103 * @param aRequestUri the request-URI of the SIP request as text |
|
104 * @param aHeaders all the headers in the SIP request |
|
105 * @param aContent SIP request body if present. |
|
106 * If not present a zero-length descriptor. |
|
107 * @param aContentType the content-type of the SIP request body |
|
108 * if present. If not present a NULL pointer. |
|
109 * The ownership is not transferred. |
|
110 * @return a request ID |
|
111 */ |
|
112 IMPORT_C TUint32 ChannelL( |
|
113 RStringF aRequestMethod, |
|
114 const TDesC8& aRequestUri, |
|
115 const RPointerArray<CSIPHeaderBase>& aHeaders, |
|
116 const TDesC8& aContent, |
|
117 const CSIPContentTypeHeader* aContentType=0); |
|
118 |
|
119 /** |
|
120 * Request to provide the communication channel for the SIP request |
|
121 * received outside the SIP dialog |
|
122 * |
|
123 * @param aResolver a specialized ECOM resolver to be applied for |
|
124 * resolving target client |
|
125 * @param aRequestMethod the method of the SIP request |
|
126 * @param aRequestUri the request-URI of the SIP request as text |
|
127 * @param aHeaders all the headers in the SIP request |
|
128 * @param aContent SIP request body if present. |
|
129 * If not present a zero-length descriptor. |
|
130 * @param aContentType the content-type of the SIP request body |
|
131 * if present. If not present a NULL pointer. |
|
132 * The ownership is not transferred. |
|
133 * @return a request ID |
|
134 */ |
|
135 IMPORT_C TUint32 ChannelL( |
|
136 TUid aResolver, |
|
137 RStringF aRequestMethod, |
|
138 const TDesC8& aRequestUri, |
|
139 const RPointerArray<CSIPHeaderBase>& aHeaders, |
|
140 const TDesC8& aContent, |
|
141 const CSIPContentTypeHeader* aContentType=0); |
|
142 |
|
143 /** |
|
144 * Cancels a particular outstanding request |
|
145 * |
|
146 * @param aRequestId a request ID to be canceled |
|
147 */ |
|
148 IMPORT_C void Cancel(TUint32 aRequestId); |
|
149 |
|
150 /** |
|
151 * Cancels all outstanding requests |
|
152 */ |
|
153 IMPORT_C void CancelAll(); |
|
154 |
|
155 private: |
|
156 |
|
157 void ConstructL (MSIPClientDiscoveryObserver& aObserver, TUid aSelf); |
|
158 |
|
159 private: // Data |
|
160 |
|
161 CSIPClientDiscoveryImpl* iCSIPClientDiscoveryImpl; |
|
162 |
|
163 private: // For testing purposes |
|
164 #ifdef CPPUNIT_TEST |
|
165 friend class CSIPClientDiscoveryTest; |
|
166 #endif |
|
167 }; |
|
168 |
|
169 #endif // CSIPCLIENTDISCOVERY_H |
|
170 |
|
171 // End of File |