|
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 |
|
19 |
|
20 #ifndef _SYMBIAN_METADATA_UTIL_IMP_H_ |
|
21 #define _SYMBIAN_METADATA_UTIL_IMP_H_ |
|
22 |
|
23 // Symbian includes |
|
24 #include <f32file.h> // RFile |
|
25 |
|
26 #include "hxmetadatakeys.h" |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 // CHXMetaDataUtility is the entry point for metadata engine. |
|
32 // This hides all the implmentation details of the actual metadata engine |
|
33 // including Helix specfic details like GlobalManager, Location of the dlls etc. |
|
34 |
|
35 class CHXMetaDataUtility : public CBase |
|
36 { |
|
37 public: |
|
38 ~CHXMetaDataUtility(); |
|
39 static CHXMetaDataUtility* NewL(); |
|
40 |
|
41 // Opens the file aFileName for metadata reading. |
|
42 // descriptor aFileName can be deleted after the OpenFileL returns. |
|
43 void OpenFileL( const TDesC& aFileName ); |
|
44 |
|
45 // Opens the descriptor for metadata reading. |
|
46 // descriptor is required to be present till ResetL is being called. |
|
47 void OpenDesL(const TDesC8& aDes); |
|
48 |
|
49 // Opens the descriptor for metadata reading. |
|
50 // File Handle can be closed after the OpenFileL returns. |
|
51 void OpenFileL(RFile& aFile); |
|
52 |
|
53 // Resets the utility. Must be called before OpenFileL() or |
|
54 // OpenDesL() can be called again. |
|
55 // |
|
56 void ResetL(); |
|
57 |
|
58 // returns the count of metadata entries. |
|
59 TInt GetMetaDataCount(TUint &aCount); |
|
60 |
|
61 // returns the Metadata entry at index a Index. |
|
62 // pDes is not owned by the caller. |
|
63 TInt GetMetaDataAt(TUint aIndex, |
|
64 HXMetaDataKeys::EHXMetaDataId &id, HBufC*& pDes); |
|
65 |
|
66 private: |
|
67 CHXMetaDataUtility(); |
|
68 CHXMetaDataUtility* ConstructL(); |
|
69 |
|
70 // utility functions |
|
71 void* GetSymbol(RLibrary &rlib, const char *symbolName); |
|
72 void ConvertMetaDataL(); |
|
73 |
|
74 private: |
|
75 typedef int (*GetSym2Ord)(const char* pSymbolName); |
|
76 RLibrary m_rlib; |
|
77 |
|
78 TBool m_bLibLoaded; |
|
79 TBool m_bCloseNeeded; |
|
80 |
|
81 }; |
|
82 |
|
83 #endif _SYMBIAN_METADATA_UTIL_IMP_H_ |
|
84 |