|
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 __IEENGINEIMP_H__ |
|
19 #define __IEENGINEIMP_H__ |
|
20 |
|
21 #define _FACEBROWSING |
|
22 |
|
23 // Include files |
|
24 #include <e32cons.h> |
|
25 #include <e32base.h> |
|
26 #include <F32file.h> |
|
27 #include <FBS.h> |
|
28 |
|
29 #include <IEEngine.h> |
|
30 #include <IEImageProcessing.h>//thumbnail client |
|
31 #include <exifmodify.h> |
|
32 |
|
33 #ifdef IMAGE_EDITOR |
|
34 #include "IEEditor.h" |
|
35 #endif |
|
36 #include "IEBitmapLoader.h" |
|
37 #include "IEFileloader.h" |
|
38 #include "IEBgpsController.h" |
|
39 #include "ImagicConsts.h" |
|
40 |
|
41 #include "IEEngineUtils.h" |
|
42 //#ifdef _S60_5x_ACCELEROMETER_ |
|
43 #include "IESensorMonitor.h" |
|
44 //#endif |
|
45 |
|
46 // Forward class declarations |
|
47 #ifdef IMAGE_EDITOR |
|
48 class CIEEditor; |
|
49 #endif |
|
50 class CIEFileLoader; |
|
51 class CIEBitmapLoader; |
|
52 class CIETNController; |
|
53 class CIEImageProcessing; |
|
54 class CImageData; |
|
55 class CIEEngineUtils; |
|
56 class MBitmapLoaderObserver; |
|
57 //#ifdef _S60_5x_ACCELEROMETER_ |
|
58 //class TSensrvOrientationData; |
|
59 //#endif |
|
60 |
|
61 // Class declaration |
|
62 class CIEEngineImp : public CIEEngine, public MBitmapLoaderObserver , public MIEBgpsControllerObserver |
|
63 #ifdef _ACCELEROMETER_SUPPORTED_ |
|
64 ,public MIESensorMonitorObserver |
|
65 #endif |
|
66 #ifdef IMAGE_EDITOR |
|
67 , public MIEObserver |
|
68 #endif |
|
69 { |
|
70 public: // First phase constructor and destructor |
|
71 static CIEEngineImp* NewL(MIEEngineObserver& aObserver); |
|
72 ~CIEEngineImp(); |
|
73 |
|
74 private: // Second phase constructot and C++ default constructor |
|
75 void ConstructL(); |
|
76 CIEEngineImp(MIEEngineObserver& aObserver); |
|
77 |
|
78 public: // From CIEEngine |
|
79 // General Functions |
|
80 void SetDBChanged(CImageData* aImageData); |
|
81 TInt GetTotalNumOfImages(); |
|
82 void GetTotalNumOfImages(TInt& aNumOfImages, TInt& aNumOfFaces); |
|
83 TInt DeleteFile(TInt aIndex); |
|
84 TInt GetImageName(const TInt aIndex, TFileName& aFileName, TThumbSize aThumbRes); |
|
85 void GetBitmapL(CImageData* aImageData, CFbsBitmap* aBitmap, TThumbSize aThumbRes); |
|
86 void SetImageDataMode(TImageArrayMode aMode); |
|
87 void AppUIReady(); |
|
88 void CancelFullSizeLoading(); |
|
89 //New functions for handling UI access to Filename array |
|
90 CImageData* GetImageData(TInt aIndex); |
|
91 void SetImageData(TInt aIndex, CImageData* aGridData); |
|
92 TBool IsScanningFiles() const; |
|
93 CIEImageList& GetImageList(); |
|
94 |
|
95 // TN related functions |
|
96 void GetFileNameL(const TInt aIndex, TThumbSize aThumbRes, TFileName& aFilename); |
|
97 void StopTNGeneration(TInt &aValue); |
|
98 TReal GetAspectRatio(TInt aIndex); |
|
99 TReal GetFacesAspectRatio(TInt aIndex); |
|
100 void GenerateThumbNailL(const TDes &aOrgFile, TThumbSize aTNResolution); |
|
101 |
|
102 // Face Detection related functions |
|
103 void GetFaceCoordinates(const TFileName a128x128TNFileName, RArray<TRect>& aFaceCoordinateArray); |
|
104 void RemoveFaceCoordinate(const TFileName a128x128TNFileName, RArray<TRect>& aCordArray); |
|
105 void GetSingleFaceCoordinates(TInt aIndex, const TFileName aTNFileName, RArray<TRect>& aFaceCoordinateArray); |
|
106 |
|
107 public: //From MBitmapLoaderObserver |
|
108 CIEFileLoader* GetFileLoader(); |
|
109 void BitmapsLoadedL(TInt aError); |
|
110 |
|
111 public: // From |
|
112 inline void Something(){}; |
|
113 void TNGenerationComplete(TThumbSize aTNRes); |
|
114 void SingleTNGenerationComplete(TInt aIndex, TThumbSize aTNRes); |
|
115 void FaceDetectionComplete(); |
|
116 void SingleFaceDetectionComplete(); |
|
117 void SetGridRotationAngle(TReal aAngle); |
|
118 TBool IsAccelerometerExists(); |
|
119 |
|
120 #ifdef _ACCELEROMETER_SUPPORTED_ |
|
121 void SensorDataAvailable(TImagicDeviceOrientation aOrientation, TBool aValue); |
|
122 void SetImageRotation(TInt aIndex); |
|
123 TImagicDeviceOrientation GetDeviceOrientation(); |
|
124 void SetDeviceOrientation(TImagicDeviceOrientation aOrientation); |
|
125 void StartAccSensorMonitoring(); |
|
126 void StopAccSensorMonitoring(); |
|
127 #endif |
|
128 |
|
129 public: // New public functions |
|
130 CIEEngineUtils *GetEngineUtils(); |
|
131 void AllFilesAddedToFilenameArrayL(); |
|
132 MIEEngineObserver& GetObserver(); |
|
133 |
|
134 TInt GetSelectedImageIndex(); |
|
135 void Stop(); |
|
136 TBool IsRunning(); |
|
137 TInt GetGleMaxRes(); |
|
138 |
|
139 private: |
|
140 void AddImageToFaceNameArray(); |
|
141 |
|
142 private: |
|
143 MIEEngineObserver& iEngineObserver; |
|
144 RFs iFileServer; |
|
145 #ifdef IMAGE_EDITOR |
|
146 CIEEditor* iImageEditor; |
|
147 #endif |
|
148 CIEFileLoader* iFileLoader; |
|
149 CIEBitmapLoader* iBitmapLoader; |
|
150 CIEEngineUtils iIEEngineUtils; |
|
151 CIEBgpsController* iIEBgpsController; |
|
152 TBool iAllFilesScanned; |
|
153 #ifdef _ACCELEROMETER_SUPPORTED_ |
|
154 CIESensorMonitor* iSensorMonitor; |
|
155 TImagicDeviceOrientation iPrevDeviceOrientation; |
|
156 TImagicDeviceOrientation iDeviceOrientation; |
|
157 #endif |
|
158 |
|
159 TIEEditingMode iEditingMode; |
|
160 TIEEditingMode iCurrentEditingMode; |
|
161 |
|
162 TBool iImageEdited; |
|
163 CIEImageProcessing* iIEBgpsClient; |
|
164 RCriticalSection iCritical; |
|
165 |
|
166 TFileName iSavedFileName; |
|
167 |
|
168 TImageArrayMode iImageArrayMode; |
|
169 RArray<TFileName> iCroppedFilenames; |
|
170 }; |
|
171 |
|
172 #endif // __IEENGINEIMP_H__ |