|
1 /* |
|
2 * Copyright (c) 2006-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 : CSIPITCReceiverBase.h |
|
16 * Part of : SIPClient |
|
17 * Version : SIP/5.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 |
|
29 #ifndef CSIPITCRECEIVERBASE_H |
|
30 #define CSIPITCRECEIVERBASE_H |
|
31 |
|
32 #include <e32base.h> |
|
33 #include <s32mem.h> |
|
34 #include "sipclientserver.h" |
|
35 #include "_sipcodecdefs.h" |
|
36 |
|
37 class MSIPITC; |
|
38 class CSIPRequestElements; |
|
39 class CSIPResponseElements; |
|
40 class MSIPHttpDigestChallengeObserver; |
|
41 class MSIPHttpDigestChallengeObserver2; |
|
42 |
|
43 |
|
44 class CSIPITCReceiverBase : public CActive |
|
45 { |
|
46 public: |
|
47 |
|
48 virtual ~CSIPITCReceiverBase(); |
|
49 |
|
50 void SetHttpDigestObserver(MSIPHttpDigestChallengeObserver& aObserver); |
|
51 |
|
52 void SetHttpDigestObserver(MSIPHttpDigestChallengeObserver2& aObserver); |
|
53 |
|
54 void RemoveHttpDigestObserver(); |
|
55 |
|
56 protected: |
|
57 |
|
58 CSIPITCReceiverBase (MSIPITC& aITC); |
|
59 |
|
60 virtual void IncomingRequestL (TSIPIds& aIds, |
|
61 CSIPRequestElements* aRequest) = 0; |
|
62 |
|
63 virtual void IncomingResponseL (TSIPIds& aIds, |
|
64 CSIPResponseElements* aResponse) = 0; |
|
65 |
|
66 virtual void ErrorOccuredL (TSIPIds& aIds, TInt aError) = 0; |
|
67 |
|
68 private: // From CActive |
|
69 |
|
70 void RunL(); |
|
71 TInt RunError(TInt aError); |
|
72 void DoCancel(); |
|
73 |
|
74 private: // New functions |
|
75 |
|
76 void ReceiveNext (); |
|
77 |
|
78 void ChallengeReceivedL (TSIPIds& aIds); |
|
79 |
|
80 void IncomingMessageL (TSIPIds& aIds); |
|
81 |
|
82 void IncomingRequestL (RReadStream& aReadStream, |
|
83 HBufC8* aContent, |
|
84 TSIPIds& aIds); |
|
85 |
|
86 void IncomingResponseL (RReadStream& aReadStream, |
|
87 HBufC8* aContent, |
|
88 TSIPIds& aIds); |
|
89 |
|
90 void ReadHeadersAndContentLC(HBufC8*& aHeaders, HBufC8*& aContent); |
|
91 |
|
92 static void DetachContent (TAny* aElements); |
|
93 |
|
94 protected: // Data |
|
95 |
|
96 MSIPHttpDigestChallengeObserver2* iHttpDigestObserver2; // Not owned |
|
97 |
|
98 private: // Data |
|
99 |
|
100 MSIPITC& iITC; |
|
101 TIpcArgs iITCMsgArgs; |
|
102 TPckgBuf<TSIPIds> iIdsPckg; |
|
103 TPckgBuf<TSIPMessageBufSizes> iSizesPckg; |
|
104 MSIPHttpDigestChallengeObserver* iHttpDigestObserver; // Not owned |
|
105 |
|
106 private: // For testing purposes |
|
107 |
|
108 UNIT_TEST(CSIPITCReceiverBaseTest) |
|
109 UNIT_TEST(CSIPClientReceiverTest) |
|
110 UNIT_TEST(CSIPClientConnectionReceiverTest) |
|
111 }; |
|
112 |
|
113 #endif // CSIPITCRECEIVERBASE_H |
|
114 |
|
115 // End of File |