|
1 /* |
|
2 * Copyright (c) 2002-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 the License "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: Supports common base functionality for DMgr user interfaces |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "CDownloadMgrUiBase.h" |
|
22 #include "UiLibLogger.h" |
|
23 #include <e32std.h> |
|
24 #include <e32def.h> |
|
25 #include <coemain.h> |
|
26 #include <data_caging_path_literals.hrh> |
|
27 #include <f32file.h> |
|
28 |
|
29 // CONSTANTS |
|
30 /// DLL rsource file name with path |
|
31 _LIT( KUiLibResourceFileName, "\\resource\\DownloadMgrUiLib.rsc" ); |
|
32 |
|
33 // ============================ MEMBER FUNCTIONS =============================== |
|
34 |
|
35 // ----------------------------------------------------------------------------- |
|
36 // CDownloadMgrUiBase::CDownloadMgrUiBase |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 CDownloadMgrUiBase::CDownloadMgrUiBase( CDownloadMgrUiLibRegistry& aRegistryModel ) |
|
40 : iCoeEnv( *CCoeEnv::Static() ), |
|
41 iRegistryModel( aRegistryModel ), |
|
42 iResourceFileName( KNullDesC ), |
|
43 iResourceLoader( iCoeEnv ), |
|
44 iResourceOpened( EFalse ), |
|
45 iExtension( 0 ) |
|
46 { |
|
47 } |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CDownloadMgrUiBase::BaseConstructL |
|
51 // ----------------------------------------------------------------------------- |
|
52 // |
|
53 void CDownloadMgrUiBase::BaseConstructL() |
|
54 { |
|
55 TParse* fileParser = new (ELeave) TParse; |
|
56 CleanupStack::PushL( fileParser ); |
|
57 |
|
58 Dll::FileName (iResourceFileName); |
|
59 |
|
60 fileParser->Set(KUiLibResourceFileName, &iResourceFileName, NULL); |
|
61 iResourceFileName = fileParser->FullName(); |
|
62 iResourceLoader.OpenL( iResourceFileName ); |
|
63 iResourceOpened = ETrue; |
|
64 |
|
65 CleanupStack::PopAndDestroy( fileParser ); // fileParser |
|
66 } |
|
67 |
|
68 // Destructor |
|
69 CDownloadMgrUiBase::~CDownloadMgrUiBase() |
|
70 { |
|
71 if ( iResourceOpened ) |
|
72 { |
|
73 iResourceLoader.Close(); |
|
74 iResourceOpened = EFalse; |
|
75 } |
|
76 //iExtension is not used yet. |
|
77 //delete iExtension; |
|
78 iExtension = NULL; |
|
79 } |
|
80 |
|
81 // ----------------------------------------------------------------------------- |
|
82 // CDownloadMgrUiBase::ResourceFileName |
|
83 // ----------------------------------------------------------------------------- |
|
84 // |
|
85 TPtrC CDownloadMgrUiBase::ResourceFileName() const |
|
86 { |
|
87 return (iResourceFileName); |
|
88 } |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CDownloadMgrUiBase::SetServerAppExitObserver |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 EXPORT_C |
|
95 void CDownloadMgrUiBase::SetServerAppExitObserver( MAknServerAppExitObserver* aObserver ) |
|
96 { |
|
97 CLOG_WRITE_FORMAT("aObserver: 0x%x",aObserver); |
|
98 iServerAppExitObserver = aObserver; |
|
99 } |
|
100 |
|
101 // End of file. |