|
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: Meta data Access Singleton |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMMMTPDPACCESSSINGLETON_H |
|
20 #define CMMMTPDPACCESSSINGLETON_H |
|
21 |
|
22 /** |
|
23 * Implements the MM MTP Data Priovider access singletons reference manager. |
|
24 */ |
|
25 |
|
26 class RFs; |
|
27 class CMmMtpDpMetadataAccessWrapper; |
|
28 class MMTPDataProviderFramework; |
|
29 |
|
30 class CMmMtpDpAccessSingleton : public CObject |
|
31 { |
|
32 public: |
|
33 /** |
|
34 * Create Singleton instance |
|
35 * need Release(), if no use |
|
36 * @param aRFs RFs reference |
|
37 * @param aFramework framework reference |
|
38 */ |
|
39 IMPORT_C static void CreateL( RFs& aRfs, |
|
40 MMTPDataProviderFramework& aFramework ); |
|
41 |
|
42 /** |
|
43 * release singleton instance |
|
44 */ |
|
45 IMPORT_C static void Release(); |
|
46 |
|
47 /** |
|
48 * get metadata access wrapper reference |
|
49 */ |
|
50 IMPORT_C static CMmMtpDpMetadataAccessWrapper& GetAccessWrapperL(); |
|
51 |
|
52 /** |
|
53 * do some special process with assess DBs when receives opensession command |
|
54 */ |
|
55 IMPORT_C static void OpenSessionL(); |
|
56 |
|
57 /** |
|
58 * do some special process with assess DBs when receives closesession command |
|
59 */ |
|
60 IMPORT_C static void CloseSessionL(); |
|
61 |
|
62 private: |
|
63 /* |
|
64 * get singleton instance, for internal use |
|
65 */ |
|
66 static CMmMtpDpAccessSingleton* Instance(); |
|
67 |
|
68 /* |
|
69 * 2-phase construction |
|
70 */ |
|
71 static CMmMtpDpAccessSingleton* NewL( RFs& aRfs, |
|
72 MMTPDataProviderFramework& aFramework ); |
|
73 |
|
74 /* |
|
75 * 2-phase construction |
|
76 */ |
|
77 void ConstructL( RFs& aRfs, |
|
78 MMTPDataProviderFramework& aFramework ); |
|
79 /* |
|
80 * destruction |
|
81 */ |
|
82 ~CMmMtpDpAccessSingleton(); |
|
83 |
|
84 private: |
|
85 CMmMtpDpMetadataAccessWrapper* iWrapper; |
|
86 }; |
|
87 |
|
88 #endif // CMMMTPDPACCESSSINGLETON_H |