00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef CIMAGEHANDLER_H
00018 #define CIMAGEHANDLER_H
00019
00020 #include <e32base.h>
00021 #include <fbs.h>
00022
00023
00024 #include <imageconversion.h>
00025
00026 #include <bitmaptransforms.h>
00027
00028
00029 class MImageHandlerCallback
00030 {
00031 public:
00032
00033 virtual void ImageOperationCompleteL(TInt aError) = 0;
00034 };
00035
00036
00037 class CImageHandler : public CActive
00038 {
00039 public:
00040
00041 CImageHandler(CFbsBitmap& aBitmap, RFs& aFs, MImageHandlerCallback& aCallback);
00042 void ConstructL();
00043 ~CImageHandler();
00044
00045
00046 void LoadFileL(const TFileName& aFileName, TInt aSelectedFrame = 0);
00047 void SaveFileL(const TFileName& aFileName, const TUid& aImageType, const TUid& aImageSubType);
00048
00049
00050 void FrameRotate(TBool aClockwise);
00051 void Mirror();
00052 void Flip();
00053 void ZoomFrame(TBool aZoomIn);
00054
00055
00056 const TFrameInfo& FrameInfo() const {return iFrameInfo;}
00057
00058 TInt FrameCount() const {return iFrameCount;}
00059
00060 private:
00061
00062 void RunL();
00063 void DoCancel();
00064
00065 private:
00066
00067 CFbsBitmap& iBitmap;
00068
00069 RFs& iFs;
00070
00071 MImageHandlerCallback& iCallback;
00072
00073 TFrameInfo iFrameInfo;
00074
00075 TInt iFrameCount;
00076
00077 CImageDecoder* iLoadUtil;
00078
00079 CImageEncoder* iSaveUtil;
00080
00081 CBitmapRotator* iBitmapRotator;
00082
00083 CBitmapScaler* iBitmapScaler;
00084 };
00085
00086 #endif