|
1 /* |
|
2 * Copyright (c) 2010 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 #ifndef CEMAILPLUGIN_H |
|
20 #define CEMAILPLUGIN_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <cindexingplugin.h> |
|
24 #include <common.h> |
|
25 #include <memailitemobserver.h> |
|
26 |
|
27 class CSearchDocument; |
|
28 class CCPixIndexer; |
|
29 class QEmailFetcher; |
|
30 |
|
31 class CEmailPlugin : public CIndexingPlugin, public MEmailItemObserver |
|
32 { |
|
33 public: |
|
34 static CEmailPlugin* NewL(); |
|
35 static CEmailPlugin* NewLC(); |
|
36 virtual ~CEmailPlugin(); |
|
37 |
|
38 /** |
|
39 * From CIndexingPlugin |
|
40 */ |
|
41 void StartPluginL(); |
|
42 void StartHarvestingL(const TDesC& aQualifiedBaseAppClass); |
|
43 |
|
44 /** |
|
45 * From MEmailItemObserver |
|
46 */ |
|
47 void HandleDocumentL(const CSearchDocument* aSearchDocument, TCPixActionType aActionType); |
|
48 |
|
49 /** |
|
50 * Gets the database observer class |
|
51 */ |
|
52 CCPixIndexer* GetIndexer(); //SPB { return iIndexer; } |
|
53 |
|
54 /** |
|
55 * MountL - Mount an IndexDB. |
|
56 * @aMedia drive to mount. |
|
57 * @aForceReharvesting to reharvest or not |
|
58 */ |
|
59 void MountL(TDriveNumber aMedia, TBool aForceReharvesting=EFalse); |
|
60 |
|
61 /** |
|
62 * UnMount - Dismount a IndexDB for drive aMedia. |
|
63 * @aMedia drive to unmount. |
|
64 * @aUndefineAsWell if ETrue then undefine the volume as well |
|
65 * |
|
66 */ |
|
67 void UnMount(TDriveNumber aMedia, TBool aUndefineAsWell = ETrue); |
|
68 |
|
69 /** |
|
70 * FormBaseAppClass - constructs a baseAppClass for the given drive. |
|
71 * @aMedia drive to form the baseAppClass for. |
|
72 * @aBaseAppClass return descriptor containing the baseAppClass |
|
73 * returns KErrNone on success or a standard error code |
|
74 */ |
|
75 static TInt FormBaseAppClass(TDriveNumber aMedia, TDes& aBaseAppClass); |
|
76 |
|
77 /** |
|
78 * DatabasePathL - Forms IndexDb path. |
|
79 * @param aMedia - The drive for which the path should be constructed. |
|
80 * returns pointer to the IndexDb path. |
|
81 */ |
|
82 HBufC* DatabasePathLC(TDriveNumber aMedia); |
|
83 |
|
84 public: |
|
85 /* |
|
86 * Notifies the indexing manager of completed harvesting, called by CMessageHarvester |
|
87 */ |
|
88 void HarvestingCompleted(TInt aError); |
|
89 |
|
90 protected: |
|
91 CEmailPlugin(); |
|
92 void ConstructL(); |
|
93 |
|
94 private: |
|
95 // CPix indexer |
|
96 CCPixIndexer* iIndexer[EDriveZ+1]; // EDriveZ enum value is 25, so add 1. |
|
97 //Currently used Drive by messaging application it is Default drive |
|
98 TInt iCurrentDrive; |
|
99 // File system session |
|
100 RFs iFs; |
|
101 //Email fecther from Qt Module |
|
102 QEmailFetcher* iQEmailFetcher; |
|
103 #ifdef __PERFORMANCE_DATA |
|
104 TTime iStartTime; |
|
105 TTime iCompleteTime; |
|
106 void UpdatePerformaceDataL(); |
|
107 void UpdatePerformaceDataL(TMsvSessionEvent); |
|
108 #endif |
|
109 }; |
|
110 |
|
111 #endif // CEMAILPLUGIN_H |