1 /* |
|
2 * Copyright (c) 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 * |
|
16 */ |
|
17 |
|
18 #include "barsc.h" |
|
19 #include <musaiwprovider.rsg> |
|
20 |
|
21 _LIT8( KMusOnHold, "On hold" ); |
|
22 _LIT8( KMusNetworkIncompatible, "Network incompatible" ); |
|
23 _LIT8( KMusConferenceCall, "Conference call" ); |
|
24 _LIT8( KMusRecipientIncapable, "Recipient incapable" ); |
|
25 _LIT8( KMusNoReg, "No registration" ); |
|
26 _LIT8( KMusGeneral, "Application error" ); |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 EXPORT_C RResourceFile::RResourceFile() |
|
33 { |
|
34 } |
|
35 |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 EXPORT_C void RResourceFile::Close() |
|
42 { |
|
43 delete iBuffer; |
|
44 iIsWarning = EFalse ; |
|
45 } |
|
46 |
|
47 |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 EXPORT_C void RResourceFile::OpenL(RFs& /*aFs*/,const TDesC& /*aName*/) |
|
53 { |
|
54 iBuffer = HBufC8::NewL( 10 ); // Reserve just to leak memory if not closed |
|
55 iIsWarning = ETrue ; |
|
56 } |
|
57 |
|
58 |
|
59 |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 EXPORT_C HBufC8* RResourceFile::AllocReadL( TInt aResourceId ) const |
|
65 { |
|
66 if ( !iBuffer ) |
|
67 { |
|
68 User::Panic( _L("ResourceFile not opened"), KErrNotReady ); |
|
69 } |
|
70 |
|
71 HBufC8* resourceText = NULL; |
|
72 |
|
73 // The following values concearn AIW Provider. If same values are used, make |
|
74 // diffrence with checking of resource file name. |
|
75 |
|
76 switch( aResourceId ) |
|
77 { |
|
78 case R_MUSAIWPROVIDER_ON_HOLD: |
|
79 { |
|
80 resourceText = KMusOnHold().AllocL(); |
|
81 break; |
|
82 } |
|
83 case R_MUSAIWPROVIDER_NETWORK_INCOMPATIBLE: |
|
84 { |
|
85 resourceText = KMusNetworkIncompatible().AllocL(); |
|
86 break; |
|
87 } |
|
88 case R_MUSAIWPROVIDER_CONFERENCE_CALL: |
|
89 { |
|
90 resourceText = KMusConferenceCall().AllocL(); |
|
91 break; |
|
92 } |
|
93 case R_MUSAIWPROVIDER_RECIPIENT_INCAPABLE: |
|
94 { |
|
95 resourceText = KMusRecipientIncapable().AllocL(); |
|
96 break; |
|
97 } |
|
98 case R_MUSAIWPROVIDER_NO_REG: |
|
99 { |
|
100 resourceText = KMusNoReg().AllocL(); |
|
101 break; |
|
102 } |
|
103 default: |
|
104 { |
|
105 resourceText = KMusGeneral().AllocL(); |
|
106 break; |
|
107 } |
|
108 } |
|
109 |
|
110 return resourceText; |
|
111 } |
|
112 |
|
113 |
|