|
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 : CSIPProxyResolver.h |
|
16 * Part of : ProxyResolver |
|
17 * Version : SIP/4.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 #ifndef CSIPPROXYRESOLVER_H |
|
29 #define CSIPPROXYRESOLVER_H |
|
30 |
|
31 // INCLUDES |
|
32 #include <e32base.h> |
|
33 |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class MSIPProxyResolverObserver; |
|
37 class CProxyResolveActor; |
|
38 |
|
39 #ifdef CPPUNIT_TEST |
|
40 #undef IMPORT_C |
|
41 #define IMPORT_C |
|
42 #endif |
|
43 |
|
44 class CSIPProxyResolver : public CBase |
|
45 { |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Creates a new CSIPProxyResolver instance |
|
50 * @returns a new instance of CSIPProxyResolver |
|
51 */ |
|
52 IMPORT_C static CSIPProxyResolver* NewL (); |
|
53 |
|
54 /** |
|
55 * Creates a new CSIPProxyResolver instance and pushes it to CleanupStack |
|
56 * @returns a new instance of CSIPProxyResolver |
|
57 */ |
|
58 IMPORT_C static CSIPProxyResolver* NewLC (); |
|
59 |
|
60 /** |
|
61 * Destructor |
|
62 */ |
|
63 IMPORT_C ~CSIPProxyResolver (); |
|
64 |
|
65 /** |
|
66 * Resolves a list of outbound proxies asynchronously. |
|
67 * Multiple resolving request can be outstanding for the same observer. |
|
68 * This is why request ids are needed. |
|
69 * CSIPProxyResolver implements a queue of the requests. |
|
70 * Once a request completes the first is taken from the queue |
|
71 * and resolved. If the queue is empty, new requests are waited. |
|
72 * |
|
73 * @param aRequestId on return contains a unique id |
|
74 * of the resolving request |
|
75 * @param aIapId the IAP id to be used |
|
76 * @param aObserver a callback to be called when resolving |
|
77 * completes succefully or an error occures. |
|
78 */ |
|
79 IMPORT_C void ResolveProxyL (TUint& aRequestId, |
|
80 TUint32 aIapId, |
|
81 MSIPProxyResolverObserver& aObserver); |
|
82 |
|
83 /** |
|
84 * Cancels an outstanding resolving request. |
|
85 * |
|
86 * @param aRequestId the id of the resolving request to be cancelled |
|
87 * issued by calling ResolveProxyL. |
|
88 */ |
|
89 IMPORT_C void Cancel (TUint aRequestId); |
|
90 |
|
91 private: |
|
92 |
|
93 CSIPProxyResolver (); |
|
94 void ConstructL (); |
|
95 |
|
96 private: // data |
|
97 |
|
98 // active object handles the resolving request asynchronously |
|
99 CProxyResolveActor* iResolver; |
|
100 }; |
|
101 |
|
102 #endif // CSIPPROXYRESOLVER_H |
|
103 |
|
104 // End of File |