|
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: Juha Kauppinen, Mika Hokkanen |
|
13 * |
|
14 * Description: Photo Browser |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __FILEFINDERTHREAD_H__ |
|
19 #define __FILEFINDERTHREAD_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include <badesca.h> |
|
24 #include <IEBgpsInfo.h> |
|
25 #include <PathInfo.h> |
|
26 #include <BAUTILS.H> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class IEImageFinderAO; |
|
30 class CImageData; |
|
31 class CIEFileLoader; |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 class CMediator: public CBase |
|
37 { |
|
38 public: |
|
39 RArray<CImageData*>* iFileNameData; |
|
40 RArray<CImageData*>* iFaceFileNameData; |
|
41 TBool* iAll128x128TNsDone; |
|
42 TBool* iAll640x480TNsDone; |
|
43 TBool* iAll320x320TNsDone; |
|
44 CIEFileLoader* iFileLoader; |
|
45 RCriticalSection* iCritical; |
|
46 TFileName iFileName; |
|
47 }; |
|
48 |
|
49 |
|
50 /** |
|
51 * CFileFinderThread application engine class. |
|
52 */ |
|
53 class CFileFinderThread: public CBase |
|
54 { |
|
55 public: |
|
56 |
|
57 static CFileFinderThread* NewL(CIEFileLoader* aFileLoader, |
|
58 RArray<CImageData*>& aFileNameData, |
|
59 RArray<CImageData*>& aFaceFileNameData, |
|
60 RCriticalSection* aCritical, TDesC& aFileName); |
|
61 |
|
62 static CFileFinderThread* NewLC(CIEFileLoader* aFileLoader, |
|
63 RArray<CImageData*>& aFileNameData, |
|
64 RArray<CImageData*>& aFaceFileNameData, |
|
65 RCriticalSection* aCritical, TDesC& aFileName); |
|
66 |
|
67 CFileFinderThread(CIEFileLoader* aFileLoader, |
|
68 RArray<CImageData*>& aFileNameData, |
|
69 RArray<CImageData*>& aFaceFileNameData, |
|
70 RCriticalSection* aCritical, TDesC& aFileName); |
|
71 |
|
72 ~CFileFinderThread(void); |
|
73 |
|
74 void StartL(); |
|
75 void Stop(); |
|
76 static TInt ExecuteThreadOne(TAny *aPtr); |
|
77 static void CreateFileFinderL(CMediator* aMediator); |
|
78 |
|
79 private: //functions |
|
80 void CreateThreadsL(); |
|
81 |
|
82 private: // Basic two-phase Symbian OS constructors |
|
83 void ConstructL(); |
|
84 CFileFinderThread(); |
|
85 |
|
86 private: // data members |
|
87 |
|
88 // a handle for thread1 |
|
89 RThread iThreadOne; |
|
90 TBool iCreatedThreads; |
|
91 CMediator* iSMediator; |
|
92 RArray<CImageData*>& iFileNameData; |
|
93 RArray<CImageData*>& iFaceFileNameData; |
|
94 CIEFileLoader* iFileLoader; |
|
95 RCriticalSection* iCritical; |
|
96 TBufC<KMaxFileName> iRootPath; |
|
97 TBufC<KMaxFileName> iSearchName; |
|
98 TFileName iFilename; |
|
99 }; |
|
100 |
|
101 #endif // __FILEFINDERTHREAD_H__ |