1 /* |
|
2 * Copyright (c) 2008-2008 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: Parsing options for optional data |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <ipvoicemailengine.rsg> |
|
21 |
|
22 #include "ipvmbxparsetype.h" |
|
23 |
|
24 |
|
25 _LIT8( KTo8, "To" ); |
|
26 _LIT8( KToShort8, "t" ); |
|
27 _LIT8( KFrom8, "From" ); |
|
28 _LIT8( KFromShort8, "f" ); |
|
29 _LIT8( KSubject8, "Subject" ); |
|
30 _LIT8( KSubjectShort8, "s" ); |
|
31 _LIT8( KDate8, "Date" ); |
|
32 _LIT8( KPriority8, "Priority" ); |
|
33 _LIT8( KId8, "Message-ID" ); |
|
34 |
|
35 |
|
36 // ======== MEMBER FUNCTIONS ======== |
|
37 |
|
38 |
|
39 // --------------------------------------------------------------------------- |
|
40 // Set type of tag this instance presents |
|
41 // --------------------------------------------------------------------------- |
|
42 // |
|
43 TIpVmbxParseType::TIpVmbxParseType( const TParseTypes aType ) |
|
44 { |
|
45 Set( aType ); |
|
46 } |
|
47 |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 // --------------------------------------------------------------------------- |
|
52 // |
|
53 TIpVmbxParseType::TIpVmbxParseType() : |
|
54 iTag( &KNullDesC8 ), iResourceId( KErrNotFound ) |
|
55 { |
|
56 } |
|
57 |
|
58 |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 // --------------------------------------------------------------------------- |
|
62 // |
|
63 const TDesC8& TIpVmbxParseType::Tag() const |
|
64 { |
|
65 return *iTag; |
|
66 } |
|
67 |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 TInt32 TIpVmbxParseType::ResourceId() const |
|
74 { |
|
75 return iResourceId; |
|
76 } |
|
77 |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 void TIpVmbxParseType::Set( const TParseTypes aType ) |
|
84 { |
|
85 // Set instance content |
|
86 switch ( aType ) |
|
87 { |
|
88 case EDetailTo: |
|
89 { |
|
90 iTag = &KTo8; |
|
91 iResourceId = R_VOIP_VM_TO; |
|
92 break; |
|
93 } |
|
94 case EDetailToShort: |
|
95 { |
|
96 iTag = &KToShort8; |
|
97 iResourceId = R_VOIP_VM_TO; |
|
98 break; |
|
99 } |
|
100 case EDetailFrom: |
|
101 { |
|
102 iTag = &KFrom8; |
|
103 iResourceId = R_VOIP_VM_FROM; |
|
104 break; |
|
105 } |
|
106 case EDetailFromShort: |
|
107 { |
|
108 iTag = &KFromShort8; |
|
109 iResourceId = R_VOIP_VM_FROM; |
|
110 break; |
|
111 } |
|
112 case EDetailSubject: |
|
113 { |
|
114 iTag = &KSubject8; |
|
115 iResourceId = R_VOIP_VM_SUBJECT; |
|
116 break; |
|
117 } |
|
118 case EDetailSubjectShort: |
|
119 { |
|
120 iTag = &KSubjectShort8; |
|
121 iResourceId = R_VOIP_VM_SUBJECT; |
|
122 break; |
|
123 } |
|
124 case EDetailDate: |
|
125 { |
|
126 iTag = &KDate8; |
|
127 iResourceId = R_VOIP_VM_DATE; |
|
128 break; |
|
129 } |
|
130 case EDetailPriority: |
|
131 { |
|
132 iTag = &KPriority8; |
|
133 iResourceId = R_VOIP_VM_PRIORITY; |
|
134 break; |
|
135 } |
|
136 case EDetailId: |
|
137 { |
|
138 iTag = &KId8; |
|
139 iResourceId = R_VOIP_VM_MSG_ID; |
|
140 break; |
|
141 } |
|
142 default: |
|
143 iTag = &KNullDesC8; |
|
144 iResourceId = KErrNotFound; |
|
145 } |
|
146 } |
|
147 |
|