|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CWSPPRIMITIVESENDER_H__ |
|
17 #define __CWSPPRIMITIVESENDER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <wsp/wsptypes.h> |
|
21 |
|
22 class MWspPrimitiveSenderCallback; |
|
23 |
|
24 // Types used for arguments in this file (e.g. TWspBearer) are from the Wap namespace |
|
25 using namespace Wap; |
|
26 |
|
27 // @todo docing |
|
28 //##ModelId=3C4C41B4025C |
|
29 class CWspPrimitiveSender : public CActive |
|
30 { |
|
31 public: // Methods |
|
32 |
|
33 /** @fn NewL(MWspPrimitiveSenderCallback& aCallback) |
|
34 Intended Usage : Static factory constructor. |
|
35 @since 7.0 |
|
36 @param aCallback A reference to the callback object that will |
|
37 send the WSP primitive. |
|
38 @return A pointer to a fully initialised object. |
|
39 */ |
|
40 //##ModelId=3C4C41B402A5 |
|
41 static CWspPrimitiveSender* NewL(MWspPrimitiveSenderCallback& aCallback); |
|
42 |
|
43 /** @fn ~CWspPrimitiveSender() |
|
44 Intended Usage : Destructor. |
|
45 @since 7.0 |
|
46 */ |
|
47 //##ModelId=3C4C41B402A4 |
|
48 ~CWspPrimitiveSender(); |
|
49 |
|
50 /** @fn InitiateSend(TWspPrimitive aPrimitive) |
|
51 Intended Usage : Sets this object active and completes it self. This |
|
52 ensures that the RunL() is entered as soon as possible |
|
53 after this function ends. The RunL() does the session |
|
54 connect. |
|
55 @since 7.0 |
|
56 @post The embeddded active object has been set active and |
|
57 completed. |
|
58 */ |
|
59 //##ModelId=3C4C41B402A2 |
|
60 void InitiateSend(TWspPrimitive aPrimitive); |
|
61 |
|
62 private: // Methods from CActive |
|
63 |
|
64 /** @fn RunL() |
|
65 Intended Usage : Called by active schedule when the request is complete. |
|
66 This will invoke the callback object to send the WSP |
|
67 primitive. |
|
68 @since 7.0 |
|
69 @todo adds leaves |
|
70 @pre The request has been completed |
|
71 @post The WSP primitive has been sent. |
|
72 */ |
|
73 //##ModelId=3C4C41B4029A |
|
74 virtual void RunL(); |
|
75 |
|
76 /** @fn RunError(TInt aError) |
|
77 Intended Usage : Error handling function for when RunL() leaves. Defers |
|
78 action to callback object. |
|
79 @since 7.0 |
|
80 @param aError The error with which RunL() left. |
|
81 @return An error code. If the input error value could be handled, |
|
82 then KErrNone is returned, otherwise the input error code |
|
83 is returned. This will cause a panic. |
|
84 */ |
|
85 //##ModelId=3C4C41B40298 |
|
86 virtual TInt RunError(TInt aError); |
|
87 |
|
88 /** @fn DoCancel() |
|
89 Intended Usage : Part of Active Objects framework. For this active object |
|
90 this function does nothing. |
|
91 @since 7.0 |
|
92 */ |
|
93 //##ModelId=3C4C41B40291 |
|
94 virtual void DoCancel(); |
|
95 |
|
96 private: // Methods |
|
97 |
|
98 /** @fn CWspPrimitiveSender(MWspPrimitiveSenderCallback& aCallback) |
|
99 Intended Usage : First phase constructor. |
|
100 @since 7.0 |
|
101 @param aCallback A reference to the callback object that will |
|
102 send the WSP primitive. |
|
103 */ |
|
104 //##ModelId=3C4C41B4028F |
|
105 CWspPrimitiveSender(MWspPrimitiveSenderCallback& aCallback); |
|
106 |
|
107 /** @fn ContructL() |
|
108 Intended Usage : Second phase constructor. Does any necessary allocations. |
|
109 @since 7.0 |
|
110 @pre First phase construction has been done. |
|
111 @post The object is fully initialised. |
|
112 */ |
|
113 //##ModelId=3C4C41B4028E |
|
114 void ConstructL(); |
|
115 |
|
116 private: // Attributes |
|
117 |
|
118 /** The callback object that will send the WSP primitive. |
|
119 */ |
|
120 //##ModelId=3C4C41B4027C |
|
121 MWspPrimitiveSenderCallback& iCallback; |
|
122 |
|
123 /** The primitive to be sent. |
|
124 */ |
|
125 //##ModelId=3C4C41B40273 |
|
126 TWspPrimitive iPrimitive; |
|
127 |
|
128 }; |
|
129 |
|
130 #endif // __CWSPPRIMITIVESENDER_H__ |