1 /* |
|
2 * Copyright (c) 2002-2005 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: This class is used for reading pbkinfoview resources. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDES |
|
20 #include "pbkinfoviewreshandler.h" |
|
21 #include "pbkinfoviewutil.h" |
|
22 |
|
23 #include <data_caging_path_literals.hrh> // For resource and bitmap directories |
|
24 |
|
25 // ============================ MEMBER FUNCTIONS =============================== |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CPbkInfoViewResHandler::NewL |
|
29 // |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 CPbkInfoViewResHandler* CPbkInfoViewResHandler::NewL() |
|
33 { |
|
34 CPbkInfoViewResHandler* self = new (ELeave) CPbkInfoViewResHandler(); |
|
35 CleanupStack::PushL(self); |
|
36 self->ConstructL(); |
|
37 CleanupStack::Pop(self); |
|
38 return self; |
|
39 } |
|
40 |
|
41 // ----------------------------------------------------------------------------- |
|
42 // CPbkInfoViewResHandler::CPbkInfoViewResHandler |
|
43 // |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 CPbkInfoViewResHandler::CPbkInfoViewResHandler() |
|
47 { |
|
48 // Nothing |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CPbkInfoViewResHandler::~CPbkInfoViewResHandler() |
|
53 // Destructor. |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 CPbkInfoViewResHandler::~CPbkInfoViewResHandler() |
|
57 { |
|
58 if ( iResId ) |
|
59 { |
|
60 CEikonEnv::Static()->DeleteResourceFile( iResId ); |
|
61 } |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // CPbkInfoViewResHandler::ConstructL |
|
66 // |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 void CPbkInfoViewResHandler::ConstructL( void ) |
|
70 { |
|
71 // Add resource file |
|
72 TFileName buf; |
|
73 GetResFileName( buf ); |
|
74 iResId = TPbkInfoViewUtil::AddResFileL( buf ); |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CPbkInfoViewResHandler::GetResFileName |
|
79 // Finds out the pbkinfoview resource file name. |
|
80 // @param aText File name will be put here. |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 void CPbkInfoViewResHandler::GetResFileName( TDes& aText ) |
|
84 { |
|
85 TParse parse; |
|
86 parse.Set( KResFileName, &KDC_RESOURCE_FILES_DIR, NULL ); |
|
87 TPbkInfoViewUtil::StrCopy( aText, parse.FullName() ); |
|
88 } |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CAspResHandler::GetBitmapFileName |
|
92 // Finds out the phonebook bitmap file name. |
|
93 // @param aText File name will be put here. |
|
94 // ----------------------------------------------------------------------------- |
|
95 // |
|
96 void CPbkInfoViewResHandler::GetBitmapFileName(TDes& aText) |
|
97 { |
|
98 TParse parse; |
|
99 parse.Set( KBitmapFileName, &KDC_APP_BITMAP_DIR, NULL ); |
|
100 TPbkInfoViewUtil::StrCopy( aText, parse.FullName() ); |
|
101 } |
|
102 |
|
103 // End of file |
|