|
1 /* |
|
2 * Copyright (c) 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: Static interface of the storage manager |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <e32std.h> |
|
22 #include "PEngStorageManager.h" |
|
23 #include "CPEngStorageManagerFactory.h" |
|
24 |
|
25 #include "CPEngStorageManager.h" |
|
26 #include "CPEngStorageManagerWatcher.h" |
|
27 #include "MPEngGlobalEventObserver.h" |
|
28 |
|
29 // Debug prints |
|
30 #include "PresenceDebugPrint.h" |
|
31 |
|
32 |
|
33 // ============================ MEMBER FUNCTIONS =============================== |
|
34 |
|
35 // ----------------------------------------------------------------------------- |
|
36 // PEngStorageManager::GetStorageManagerL() |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 EXPORT_C MPEngStorageManager* PEngStorageManager::GetStorageManagerL( |
|
40 const CPEngSessionSlotId& aSessionSlot ) |
|
41 { |
|
42 CPEngStorageManagerFactory* storageFactory = |
|
43 CPEngStorageManagerFactory::InstanceLC(); |
|
44 MPEngStorageManager* manager = |
|
45 storageFactory->StorageManagerL( aSessionSlot ); |
|
46 CleanupStack::PopAndDestroy(); //storageFactory |
|
47 return manager; |
|
48 } |
|
49 |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // PEngStorageManager::GetStorageManagerWatcherL() |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 EXPORT_C MPEngStorageManagerWatcher* PEngStorageManager::GetStorageManagerWatcherL( |
|
56 const CPEngSessionSlotId& aSessionSlot ) |
|
57 { |
|
58 CPEngStorageManagerFactory* storageFactory = |
|
59 CPEngStorageManagerFactory::InstanceLC(); |
|
60 MPEngStorageManagerWatcher* watcher = |
|
61 storageFactory->StorageManagerWatcherL( aSessionSlot ); |
|
62 CleanupStack::PopAndDestroy(); //storageFactory |
|
63 return watcher; |
|
64 } |
|
65 |
|
66 |
|
67 // ----------------------------------------------------------------------------- |
|
68 // PEngStorageManager::CreateSessionFolderL |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 EXPORT_C void PEngStorageManager::CreateSessionFolderL( |
|
72 const CPEngSessionSlotId& aSessionSlot, |
|
73 const TDesC& aApplicationId ) |
|
74 { |
|
75 CPEngStorageManagerFactory* storageFactory = |
|
76 CPEngStorageManagerFactory::InstanceLC(); |
|
77 storageFactory->CreateSessionFolderL( aSessionSlot, aApplicationId ); |
|
78 CleanupStack::PopAndDestroy(); // storageFactory |
|
79 } |
|
80 |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // PEngStorageManager::RemoveSessionFolderL |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 EXPORT_C void PEngStorageManager::RemoveSessionFolderL( |
|
87 const CPEngSessionSlotId& aSessionSlot, |
|
88 const TDesC& aApplicationId ) |
|
89 { |
|
90 CPEngStorageManagerFactory* storageFactory = |
|
91 CPEngStorageManagerFactory::InstanceLC(); |
|
92 |
|
93 storageFactory->RemoveSessionFolderL( aSessionSlot, aApplicationId ); |
|
94 CleanupStack::PopAndDestroy(); // storageFactory |
|
95 } |
|
96 |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // PEngStorageManager::SessionSlotStateL |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 EXPORT_C void PEngStorageManager::SessionSlotStateL( |
|
103 const CPEngSessionSlotId& aSessionSlot, |
|
104 CPEngSessionSlotState& aSessionSlotState ) |
|
105 { |
|
106 CPEngStorageManagerFactory* storageFactory = |
|
107 CPEngStorageManagerFactory::InstanceLC(); |
|
108 |
|
109 storageFactory->SessionSlotStateL( aSessionSlot, aSessionSlotState ); |
|
110 CleanupStack::PopAndDestroy(); // storageFactory |
|
111 } |
|
112 |
|
113 |
|
114 // ----------------------------------------------------------------------------- |
|
115 // PEngStorageManager::AllSessionSlotsStatesL |
|
116 // ----------------------------------------------------------------------------- |
|
117 // |
|
118 EXPORT_C void PEngStorageManager::AllSessionSlotsStatesL( |
|
119 RObjectArray<CPEngSessionSlotState>& aSessionSlots ) |
|
120 { |
|
121 CPEngStorageManagerFactory* storageFactory = |
|
122 CPEngStorageManagerFactory::InstanceLC(); |
|
123 |
|
124 storageFactory->AllSessionSlotsStatesL( aSessionSlots ); |
|
125 CleanupStack::PopAndDestroy(); // storageFactory |
|
126 } |
|
127 |
|
128 |
|
129 // ----------------------------------------------------------------------------- |
|
130 // PEngStorageManager::RegisterGlobalEventListenerL |
|
131 // ----------------------------------------------------------------------------- |
|
132 // |
|
133 EXPORT_C void PEngStorageManager::RegisterGlobalEventObserverL( |
|
134 MPEngGlobalEventObserver& aGlobalObserver ) |
|
135 { |
|
136 CPEngStorageManagerFactory* storageFactory = |
|
137 CPEngStorageManagerFactory::InstanceLC(); |
|
138 |
|
139 storageFactory->RegisterGlobalEventObserverL( aGlobalObserver ); |
|
140 CleanupStack::PopAndDestroy(); // storageFactory |
|
141 } |
|
142 |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // PEngStorageManager::UnregisterGlobalObserver |
|
146 // ----------------------------------------------------------------------------- |
|
147 // |
|
148 EXPORT_C void PEngStorageManager::UnregisterGlobalObserver( |
|
149 MPEngGlobalEventObserver& aGlobalObserver ) |
|
150 { |
|
151 CPEngStorageManagerFactory* storageFactory = |
|
152 CPEngStorageManagerFactory::Instance(); |
|
153 if ( storageFactory ) |
|
154 { |
|
155 storageFactory->UnregisterGlobalObserver( aGlobalObserver ); |
|
156 } |
|
157 } |
|
158 |
|
159 // End of File |