|
1 /* |
|
2 * Copyright (c) 2007-2007 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: Internet Radio RFS ECOM plugin implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <apacmdln.h> |
|
20 #include <apgcli.h> |
|
21 |
|
22 #include "irrfsplugin.h" |
|
23 |
|
24 // Files that are deleted upon RFS. |
|
25 _LIT( KIRLastPlayedFile, "c:\\private\\2000b499\\lastPlayed.dat" ); |
|
26 _LIT( KIRCacheDatabaseFile, "c:\\private\\2000b499\\cacheDb.db" ); |
|
27 _LIT( KIRSdsResponseFile, "c:\\private\\2000b499\\iSdsResponse.xml" ); |
|
28 _LIT( KIRSessionFile, "c:\\private\\2000b499\\Session" ); |
|
29 _LIT( KIRRadioReportFile, "c:\\private\\2000b499\\RadioReport.xml" ); |
|
30 _LIT( KIRLogUsageFile, "c:\\private\\2000b499\\LogUsage.gz" ); |
|
31 _LIT( KIRSettingsFile, "c:\\private\\2000b499\\irsettings.ini" ); |
|
32 _LIT( KIRBackedUpSettingsFile, "c:\\private\\2000b499\\irsettings_backed_up.ini" ); |
|
33 _LIT( KIRSettingscreFile, "c:\\private\\10202be9\\persists\\2000B499.cre" ); |
|
34 |
|
35 //for History Database Deletion |
|
36 _LIT(KSongHistoryDbFile,"songhistoryDb.db"); |
|
37 |
|
38 // ======== LOCAL FUNCTIONS ======== |
|
39 |
|
40 // ======== MEMBER FUNCTIONS ======== |
|
41 |
|
42 // --------------------------------------------------------------------------- |
|
43 // Two-phased constructor. |
|
44 // --------------------------------------------------------------------------- |
|
45 // |
|
46 CIRRfsPlugin* CIRRfsPlugin::NewL( TAny* aInitParams ) |
|
47 { |
|
48 CIRRfsPlugin* self = new ( ELeave ) CIRRfsPlugin( aInitParams ); |
|
49 CleanupStack::PushL( self ); |
|
50 self->ConstructL(); |
|
51 CleanupStack::Pop( self ); |
|
52 return self; |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // Constructor. |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 CIRRfsPlugin::CIRRfsPlugin( TAny* /*aInitParams*/ ) |
|
60 { |
|
61 } |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // Second-phase constructor. |
|
65 // --------------------------------------------------------------------------- |
|
66 // |
|
67 void CIRRfsPlugin::ConstructL() |
|
68 { |
|
69 return; |
|
70 } |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // Destructor. |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 CIRRfsPlugin::~CIRRfsPlugin() |
|
77 { |
|
78 // Base class handles the ECOM cleanup. |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------------------------- |
|
82 // From base class CRFSPlugin |
|
83 // --------------------------------------------------------------------------- |
|
84 // |
|
85 void CIRRfsPlugin::RestoreFactorySettingsL( const TRfsReason aType ) |
|
86 { |
|
87 if ( aType == ENormalRfs ) |
|
88 { |
|
89 RFs fsSession; |
|
90 User::LeaveIfError( fsSession.Connect() ); |
|
91 |
|
92 fsSession.Delete( KIRLastPlayedFile ); |
|
93 fsSession.Delete( KIRCacheDatabaseFile ); |
|
94 fsSession.Delete( KIRSdsResponseFile ); |
|
95 fsSession.Delete( KIRSessionFile ); |
|
96 fsSession.Delete( KIRRadioReportFile ); |
|
97 fsSession.Delete( KIRLogUsageFile ); |
|
98 |
|
99 fsSession.Delete( KIRSettingsFile ); |
|
100 fsSession.Delete( KIRBackedUpSettingsFile ); |
|
101 fsSession.Delete( KIRSettingscreFile ); |
|
102 fsSession.Delete(KSongHistoryDbFile); |
|
103 |
|
104 fsSession.Close(); |
|
105 } |
|
106 else |
|
107 { |
|
108 // RFS type not supported. |
|
109 } |
|
110 } |
|
111 |
|
112 // --------------------------------------------------------------------------- |
|
113 // From base class CRFSPlugin |
|
114 // --------------------------------------------------------------------------- |
|
115 // |
|
116 void CIRRfsPlugin::GetScriptL( const TRfsReason /*aType*/, TDes& aPath ) |
|
117 { |
|
118 aPath.Zero(); |
|
119 return; |
|
120 } |
|
121 |
|
122 // --------------------------------------------------------------------------- |
|
123 // From base class CRFSPlugin |
|
124 // --------------------------------------------------------------------------- |
|
125 // |
|
126 void CIRRfsPlugin::ExecuteCustomCommandL( const TRfsReason /*aType*/, TDesC& /*aCommand*/ ) |
|
127 { |
|
128 return; |
|
129 } |
|
130 |
|
131 // ======== GLOBAL FUNCTIONS ======== |
|
132 |