|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Sent SWIS capability query (OPTIONS) |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMUSAVACAPABILITYQUERY_H |
|
20 #define CMUSAVACAPABILITYQUERY_H |
|
21 |
|
22 |
|
23 #include "musavacapabilityquerybase.h" |
|
24 #include "musavacapabilitytimer.h" |
|
25 |
|
26 class CSIPResponseElements; |
|
27 class CMusAvaCapability; |
|
28 class CSdpDocument; |
|
29 |
|
30 const TInt KCapabilityTimervalue = 20 * 1000000; |
|
31 |
|
32 /** |
|
33 * Sent SWIS capability query (OPTIONS) |
|
34 * |
|
35 * @lib AlwaysOnlineSwisPlugin.dll |
|
36 */ |
|
37 class CMusAvaCapabilityQuery : public CMusAvaCapabilityQueryBase, |
|
38 public CMusAvaCapabilityTimer::MTimeOutNotify |
|
39 { |
|
40 |
|
41 public: // constructors and destructor |
|
42 |
|
43 static CMusAvaCapabilityQuery* NewL( CMusAvaCapability& aCapability, |
|
44 CSIPConnection& aSIPConnection, |
|
45 CSIPProfile& aProfile, |
|
46 const TDesC& aSipAddress ); |
|
47 |
|
48 |
|
49 virtual ~CMusAvaCapabilityQuery(); |
|
50 |
|
51 |
|
52 protected: // constructors |
|
53 |
|
54 CMusAvaCapabilityQuery( CMusAvaCapability& aCapability, |
|
55 CSIPConnection& aSIPConnection, |
|
56 CSIPProfile& aProfile ); |
|
57 |
|
58 void ConstructL( const TDesC& aSipAddress ); |
|
59 |
|
60 |
|
61 public: // from CMusAvaCapabilityTimer::MTimeOutNotify |
|
62 |
|
63 /** |
|
64 * Called when timer expires |
|
65 * |
|
66 * @param aStatus status |
|
67 */ |
|
68 void OnExpiredL( TInt aStatus ); |
|
69 |
|
70 |
|
71 protected: // from CMusAvaCapabilityQueryBase |
|
72 |
|
73 /** |
|
74 * Prepares query |
|
75 * |
|
76 * @param aRequestHeaders headers container for request |
|
77 */ |
|
78 void Prepare( RPointerArray<CSIPHeaderBase>& aRequestHeaders ); |
|
79 |
|
80 /** |
|
81 * Complets the query |
|
82 * |
|
83 * @param aResponse a response to query as SIP client transaction |
|
84 */ |
|
85 void DoCompletedL( const CSIPClientTransaction& aResponse ); |
|
86 |
|
87 /** |
|
88 * Complets the query with 200 OK |
|
89 * |
|
90 * @param aResponse a response to query as SIP client transaction |
|
91 */ |
|
92 virtual void DoCompleted200OKL( |
|
93 const CSIPClientTransaction& aResponse ); |
|
94 |
|
95 /** |
|
96 * Validates and store the supported codecs |
|
97 * |
|
98 * @param aSDP SDP document |
|
99 * @return ETrue, if validation is OK |
|
100 */ |
|
101 virtual TBool ValidateAndStoreCodecsL( CSdpDocument& aSDP ); |
|
102 |
|
103 |
|
104 /** |
|
105 * Validates atributes |
|
106 * |
|
107 * @param aSDP SDP document |
|
108 * @return ETrue, if OK |
|
109 */ |
|
110 virtual TBool ValidateAttributesL( CSdpDocument& aSDP ); |
|
111 |
|
112 /** |
|
113 * Validates Contact header parameters |
|
114 * |
|
115 * @param aResponse a response to query as SIP client transaction |
|
116 * @return ETrue, if OK |
|
117 */ |
|
118 virtual TBool ValidateContactL( const CSIPClientTransaction& aResponse ); |
|
119 |
|
120 /** |
|
121 * Retries query |
|
122 * |
|
123 */ |
|
124 void DoRetryL(); |
|
125 |
|
126 /** |
|
127 * Set/Get re-trying status |
|
128 * |
|
129 * @return re-trying status |
|
130 */ |
|
131 TBool& Retrying(); |
|
132 |
|
133 |
|
134 private: // OWNED data |
|
135 |
|
136 |
|
137 CMusAvaCapabilityTimer* iTimer; |
|
138 |
|
139 |
|
140 private: // data |
|
141 |
|
142 TBool iRetrying; |
|
143 |
|
144 //for unit testing |
|
145 CAPABILITY_UT_DEFINITIONS |
|
146 |
|
147 }; |
|
148 |
|
149 |
|
150 #endif // CMUSAVACAPABILITYQUERY_H |