|
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 : CSipAcceptContactStrategy.h |
|
16 * Part of : SIP Client Resolver |
|
17 * Version : 1.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 #ifndef CSIPACCEPTCONTACTSTRATEGY_H |
|
29 #define CSIPACCEPTCONTACTSTRATEGY_H |
|
30 |
|
31 #include "CSipHeaderStrategyBase.h" |
|
32 |
|
33 class CSIPAcceptContactHeader; |
|
34 class CSIPFeatureSet; |
|
35 |
|
36 |
|
37 class CSipAcceptContactStrategy : public CSipHeaderStrategyBase |
|
38 { |
|
39 public: |
|
40 |
|
41 static CSipAcceptContactStrategy* NewL( |
|
42 MSipClients& aSipClients, |
|
43 CSipHeaderStrategyBase* aNextStrategy, |
|
44 CSipHeaderStrategyBase* aNextStrategy2 ); |
|
45 |
|
46 static CSipAcceptContactStrategy* NewLC( |
|
47 MSipClients& aSipClients, |
|
48 CSipHeaderStrategyBase* aNextStrategy, |
|
49 CSipHeaderStrategyBase* aNextStrategy2 ); |
|
50 |
|
51 ~CSipAcceptContactStrategy(); |
|
52 |
|
53 public: // From CSipHeaderStrategyBase |
|
54 |
|
55 /// The returned UIDs are ordered so that |
|
56 /// the most preferred one is the first in the array. |
|
57 CSIPResponse* ApplyL( |
|
58 CSIPRequest& aRequest, |
|
59 RArray<TUid>& aUids, |
|
60 TBool& aContinueSearch, |
|
61 CSIPClientResolver2& aClientResolver2 ); |
|
62 |
|
63 protected: // From CSipHeaderStrategyBase |
|
64 |
|
65 CSIPResponse* CreateResponseL(); |
|
66 |
|
67 TBool CompareHeaders( |
|
68 CSIPRequest& aRequest, |
|
69 MSipClient& aClient); |
|
70 |
|
71 private: // Constructors |
|
72 |
|
73 CSipAcceptContactStrategy( |
|
74 MSipClients& aSipClients, |
|
75 CSipHeaderStrategyBase* aNextStrategy, |
|
76 CSipHeaderStrategyBase* aNextStrategy2 ); |
|
77 |
|
78 private: // New functions |
|
79 |
|
80 RPointerArray<CSIPFeatureSet> CreateFeatureSetsL( |
|
81 CSIPRequest& aRequest); |
|
82 |
|
83 TInt CalculateScore( |
|
84 MSipClient& aClient, |
|
85 const RPointerArray<CSIPFeatureSet>& aRequestFeatureSets) const; |
|
86 |
|
87 static void DestroyFeatureSets(TAny* aFeatureSets); |
|
88 |
|
89 private: // Data |
|
90 |
|
91 RStringF iAcceptContactHeaderName; |
|
92 |
|
93 private: // For testing purposes |
|
94 |
|
95 UNIT_TEST(CSipAcceptContactStrategyTest) |
|
96 }; |
|
97 |
|
98 #endif // CSIPACCEPTCONTACTSTRATEGY_H |
|
99 |
|
100 // End of File |