|
1 /* |
|
2 * ============================================================================= |
|
3 * Name : CMsrpStatusHeader.h |
|
4 * Part of : MSRP Client |
|
5 * Interface : SDK API, MSRP API |
|
6 * Description : |
|
7 * Version : %version: 1 % << Don't touch! Updated by Synergy at check-out. |
|
8 * |
|
9 * Copyright © 2007 Nokia. All rights reserved. |
|
10 * This material, including documentation and any related |
|
11 * computer programs, is protected by copyright controlled by |
|
12 * Nokia Corporation. All rights are reserved. Copying, |
|
13 * including reproducing, storing, adapting or translating, any |
|
14 * or all of this material requires the prior written consent of |
|
15 * Nokia Corporation. This material also contains confidential |
|
16 * information which may not be disclosed to others without the |
|
17 * prior written consent of Nokia Corporation. |
|
18 * ============================================================================= |
|
19 */ |
|
20 |
|
21 #ifndef CMSRPSTATUSHEADER_H |
|
22 #define CMSRPSTATUSHEADER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include "CMsrpHeaderBase.h" |
|
26 |
|
27 // CONSTANTS |
|
28 const TInt KMaxLengthOfStatusCodeValue = 100; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * @publishedAll |
|
33 * |
|
34 * Class provides functions for setting and getting MSRP "Status" header field |
|
35 * |
|
36 * @lib msrpclient.lib |
|
37 */ |
|
38 class CMSRPStatusHeader : public CMSRPHeaderBase |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Creates a new instance of CMSRMessageIdHeader |
|
44 * @param aStatusCode status code |
|
45 * @return a new instance of CMSRPStatusHeader |
|
46 */ |
|
47 IMPORT_C static CMSRPStatusHeader* NewL( TInt aStatusCode ); |
|
48 |
|
49 /** |
|
50 * Creates a new instance of CMSRPStatusHeader and puts it to CleanupStack |
|
51 * @param aStatusCode status code |
|
52 * @return a new instance of CMSRPStatusHeader |
|
53 */ |
|
54 IMPORT_C static CMSRPStatusHeader* NewLC( TInt aStatusCode ); |
|
55 |
|
56 /** |
|
57 * Creates a new instance of CMSRMessageIdHeader |
|
58 * @return a new instance of CMSRPStatusHeader |
|
59 */ |
|
60 static CMSRPStatusHeader* NewL( ); |
|
61 |
|
62 /** |
|
63 * Destructor, deletes the resources of CMSRPStatusHeader. |
|
64 */ |
|
65 IMPORT_C ~CMSRPStatusHeader(); |
|
66 |
|
67 public: // New functions |
|
68 |
|
69 /** |
|
70 * Constructs an instance of a CMSRPStatusHeader from a RReadStream |
|
71 * @param aReadStream a stream containing the value of the |
|
72 * externalized object (header name not included). |
|
73 * @return an instance of a CMSRPStatusHeader |
|
74 */ |
|
75 IMPORT_C static CMSRPStatusHeader* |
|
76 InternalizeValueL( RReadStream& aReadStream ); |
|
77 |
|
78 /** |
|
79 * Sets the status code value |
|
80 * @param aStatusCode status code |
|
81 */ |
|
82 IMPORT_C void SetStatusCode( TInt aStartPos ); |
|
83 |
|
84 /** |
|
85 * Gets the status code value |
|
86 */ |
|
87 IMPORT_C TInt StatusCode( ) const; |
|
88 |
|
89 public: // From CMSRPHeaderBase |
|
90 |
|
91 IMPORT_C void ExternalizeValueL( RWriteStream& aWriteStream ) const; |
|
92 |
|
93 public: // From CMSRPHeaderBase |
|
94 |
|
95 RStringF Name() const; |
|
96 HBufC8* ToTextValueL() const; |
|
97 |
|
98 private: // Constructors |
|
99 |
|
100 /** |
|
101 * Contructor. |
|
102 */ |
|
103 CMSRPStatusHeader( ); |
|
104 /** |
|
105 * Contructor. |
|
106 * @param aStatusCode status code |
|
107 */ |
|
108 CMSRPStatusHeader( TInt aStatusCode ); |
|
109 /** |
|
110 * two-phased contructor. |
|
111 */ |
|
112 void ConstructL( ) const; |
|
113 |
|
114 private: // new functions |
|
115 /** |
|
116 * Internalize external object data |
|
117 * @param aReadStream a stream containing the value of the |
|
118 * externalized object (header name not included). |
|
119 */ |
|
120 void DoInternalizeValueL( RReadStream& aReadStream ); |
|
121 |
|
122 private: // variables |
|
123 |
|
124 // status code value |
|
125 TInt iStatusCode; |
|
126 |
|
127 __DECLARE_TEST; |
|
128 }; |
|
129 |
|
130 #endif // CMSRPSTATUSHEADER_H |
|
131 |
|
132 // End of File |