|
1 /* |
|
2 * Copyright (c) 2004 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: Structure to hold MMS encapsulation 1.1 version |
|
15 * previoulsy-sent-by and previously-sent-date information |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <msvstore.h> |
|
24 #include "mmsmmboxflags.h" |
|
25 |
|
26 // EXTERNAL DATA STRUCTURES |
|
27 |
|
28 // EXTERNAL FUNCTION PROTOTYPES |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // MACROS |
|
33 |
|
34 // LOCAL CONSTANTS AND MACROS |
|
35 |
|
36 // MODULE DATA STRUCTURES |
|
37 |
|
38 // LOCAL FUNCTION PROTOTYPES |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 |
|
42 // ============================= LOCAL FUNCTIONS =============================== |
|
43 |
|
44 // ============================ MEMBER FUNCTIONS =============================== |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CMmsMMBoxFlags::CMmsMMBoxFlags |
|
48 // C++ default constructor can NOT contain any code, that |
|
49 // might leave. |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 CMmsMMBoxFlags::CMmsMMBoxFlags() |
|
53 { |
|
54 // everything is initailized to 0 by CBase |
|
55 } |
|
56 |
|
57 |
|
58 // Destructor |
|
59 CMmsMMBoxFlags::~CMmsMMBoxFlags() |
|
60 { |
|
61 delete iKeyword; |
|
62 } |
|
63 |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // CMmsMMBoxFlags::Internalize |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 void CMmsMMBoxFlags::InternalizeL( RMsvReadStream& aStream ) |
|
70 { |
|
71 iOperationToken = aStream.ReadInt32L(); |
|
72 TInt32 length = 0; |
|
73 length = aStream.ReadInt32L(); |
|
74 delete iKeyword; |
|
75 iKeyword = NULL; |
|
76 if ( length > 0 ) |
|
77 { |
|
78 iKeyword = HBufC::NewL( aStream, length ); |
|
79 } |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CMmsMMBoxFlags::ExternalizeL |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 void CMmsMMBoxFlags::ExternalizeL( RMsvWriteStream& aStream ) const |
|
87 { |
|
88 aStream.WriteInt32L( iOperationToken ); |
|
89 TInt32 length = Keyword().Length(); |
|
90 aStream.WriteInt32L( length ); |
|
91 if ( length > 0 ) |
|
92 { |
|
93 aStream << Keyword(); |
|
94 } |
|
95 } |
|
96 |
|
97 // ----------------------------------------------------------------------------- |
|
98 // CMmsMMBoxFlags::SetKeywordL |
|
99 // ----------------------------------------------------------------------------- |
|
100 // |
|
101 |
|
102 void CMmsMMBoxFlags::SetKeywordL( const TDesC& aKeyword ) |
|
103 { |
|
104 delete iKeyword; |
|
105 iKeyword = NULL; |
|
106 iKeyword = aKeyword.AllocL(); |
|
107 } |
|
108 |
|
109 // ----------------------------------------------------------------------------- |
|
110 // CMmsMMBoxFlags::Size |
|
111 // ----------------------------------------------------------------------------- |
|
112 // |
|
113 TInt CMmsMMBoxFlags::Size() const |
|
114 { |
|
115 TInt size = 0; |
|
116 size += sizeof( iOperationToken ); |
|
117 size += sizeof( TInt32 ); |
|
118 size += Keyword().Size(); |
|
119 return size; |
|
120 } |
|
121 |
|
122 |
|
123 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
124 |
|
125 // End of File |