equal
deleted
inserted
replaced
42 // e.g. "@c:root file" |
42 // e.g. "@c:root file" |
43 const TInt KFilePluginBaseAppClassMaxLen = 64; |
43 const TInt KFilePluginBaseAppClassMaxLen = 64; |
44 |
44 |
45 class CFilePlugin : public CIndexingPlugin |
45 class CFilePlugin : public CIndexingPlugin |
46 { |
46 { |
47 public: |
47 public: |
|
48 |
|
49 struct TRecord |
|
50 { |
|
51 TFileName iUri; |
|
52 TCPixActionType iActionType; |
|
53 TBool isFolder; |
|
54 }; |
|
55 |
48 static CFilePlugin* NewL(); |
56 static CFilePlugin* NewL(); |
49 static CFilePlugin* NewLC(); |
57 static CFilePlugin* NewLC(); |
50 virtual ~CFilePlugin(); |
58 virtual ~CFilePlugin(); |
51 |
59 |
52 /** |
60 /** |
53 * From CIndexingPlugin |
61 * From CIndexingPlugin |
54 */ |
62 */ |
55 void StartPluginL(); |
63 void StartPluginL(); |
56 void StartHarvestingL(const TDesC& aQualifiedBaseAppClass); |
64 void StartHarvestingL(const TDesC& aQualifiedBaseAppClass); |
57 |
65 void PausePluginL(); |
|
66 void ResumePluginL(); |
58 /** |
67 /** |
59 * CreateContentIndexItemL sends a file for indexing contents |
68 * CreateContentIndexItemL sends a file for indexing contents |
60 * @aFilename full path and filename of the file to be indexed |
69 * @aFilename full path and filename of the file to be indexed |
61 * @aActionType action to be taken on the file |
70 * @aActionType action to be taken on the file |
62 */ |
71 */ |
65 * CreateFolderIndexItemL sends a folder/file for indexing |
74 * CreateFolderIndexItemL sends a folder/file for indexing |
66 * @aFilename full path and filename of the file to be indexed |
75 * @aFilename full path and filename of the file to be indexed |
67 * @aActionType action to be taken on the file |
76 * @aActionType action to be taken on the file |
68 */ |
77 */ |
69 void CreateFolderFileIndexItemL(const TDesC& aFilename, TCPixActionType aActionType, TBool aIsDir = ETrue); |
78 void CreateFolderFileIndexItemL(const TDesC& aFilename, TCPixActionType aActionType, TBool aIsDir = ETrue); |
|
79 /** |
|
80 * Get the current file plugin harvesting state |
|
81 * ETrue on pause, EFalse on resume |
|
82 */ |
|
83 TBool GetHarvesterState(); |
70 private: |
84 private: |
71 /** |
85 /** |
72 * CreateCpixDocumentL creates a document file |
86 * CreateCpixDocumentL creates a document file |
73 * @aFilePath full path of the file/folder to be indexed |
87 * @aFilePath full path of the file/folder to be indexed |
74 */ |
88 */ |
77 /** |
91 /** |
78 * IsFileTypeMedia checks for vaild extention type to be indexed |
92 * IsFileTypeMedia checks for vaild extention type to be indexed |
79 * @aExt file extention |
93 * @aExt file extention |
80 */ |
94 */ |
81 TBool IsFileTypeMedia(const TDesC& aExt); |
95 TBool IsFileTypeMedia(const TDesC& aExt); |
|
96 |
|
97 /** |
|
98 * RemoveFileDatabaseL deletes the database file from the requested drive |
|
99 * @aDrive drive number |
|
100 */ |
|
101 void RemoveFileDatabaseL(TDriveNumber aDrive); |
82 |
102 |
83 public: |
103 public: |
84 // |
104 // |
85 // New Functions |
105 // New Functions |
86 // |
106 // |
130 * DatabasePathL - Forms IndexDb path. |
150 * DatabasePathL - Forms IndexDb path. |
131 * @param aMedia - The drive for which the path should be constructed. |
151 * @param aMedia - The drive for which the path should be constructed. |
132 * returns pointer to the IndexDb path. |
152 * returns pointer to the IndexDb path. |
133 */ |
153 */ |
134 HBufC* DatabasePathLC(TDriveNumber aMedia,const TDesC& aPath); |
154 HBufC* DatabasePathLC(TDriveNumber aMedia,const TDesC& aPath); |
|
155 |
|
156 void MountAvailableDrivesInQueue(); |
|
157 |
|
158 void AddToQueueL(const TDesC& aFilename, TCPixActionType aActionType, TBool aIsFolder); |
|
159 |
|
160 void IndexQueuedItems(); |
135 |
161 |
136 protected: |
162 protected: |
137 CFilePlugin(); |
163 CFilePlugin(); |
138 void ConstructL(); |
164 void ConstructL(); |
139 |
165 |
140 private: |
166 private: |
141 // CPix database |
167 // CPix database |
142 CCPixIndexer* iIndexer[EDriveZ+1]; // EDriveZ enum value is 25, so add 1. |
168 CCPixIndexer* iIndexer[EDriveZ+1]; // EDriveZ enum value is 25, so add 1. |
143 |
169 |
144 CCPixIndexer* iFolderIndexer[EDriveZ+1]; |
170 CCPixIndexer* iFolderIndexer[EDriveZ+1]; |
|
171 |
|
172 RArray<TDriveNumber> iMountDrives; |
|
173 |
|
174 RArray<TRecord> iJobQueue; |
145 |
175 |
146 // File system session |
176 // File system session |
147 RFs iFs; |
177 RFs iFs; |
148 |
178 |
149 // Harvester |
179 // Harvester |
152 // Monitor |
182 // Monitor |
153 //TBool iIsMonitorInit; unused variable |
183 //TBool iIsMonitorInit; unused variable |
154 CFileMonitor* iMonitor; |
184 CFileMonitor* iMonitor; |
155 |
185 |
156 // MMC monitor |
186 // MMC monitor |
157 CMMCMonitor* iMmcMonitor; |
187 CMMCMonitor* iMmcMonitor; |
|
188 |
|
189 TBool iIndexState; |
158 |
190 |
159 //for unit testing. |
191 //for unit testing. |
160 #ifdef HARVESTERPLUGINTESTER_FRIEND |
192 #ifdef HARVESTERPLUGINTESTER_FRIEND |
161 friend class CHarvesterPluginTester; |
193 friend class CHarvesterPluginTester; |
162 #endif |
194 #endif |