examples/Multimedia/ImageConv/src/CImageHandler.h

00001 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 // CImageAppView.H
00015 //
00016 
00017 #ifndef CIMAGEHANDLER_H
00018 #define CIMAGEHANDLER_H
00019 
00020 #include <e32base.h> 
00021 #include <fbs.h>
00022 
00023 // Image converter library API header
00024 #include <imageconversion.h>
00025 // Bitmap transforms API header
00026 #include <bitmaptransforms.h>
00027 
00028 // Callback from image handler
00029 class MImageHandlerCallback
00030         {
00031 public:
00032         // Handler calls when image manipulation is completed
00033         virtual void ImageOperationCompleteL(TInt aError) = 0;
00034         };
00035 
00036 // Loads, saves and manipulates a bitmap
00037 class CImageHandler : public CActive
00038     {
00039 public:
00040         // Construction
00041         CImageHandler(CFbsBitmap& aBitmap, RFs& aFs, MImageHandlerCallback& aCallback);
00042     void ConstructL();
00043         ~CImageHandler();
00044 
00045         // Load/save operations
00046         void LoadFileL(const TFileName& aFileName, TInt aSelectedFrame = 0);
00047         void SaveFileL(const TFileName& aFileName, const TUid& aImageType, const TUid& aImageSubType);
00048 
00049         // Image command handling functions
00050         void FrameRotate(TBool aClockwise);
00051         void Mirror();
00052         void Flip();
00053         void ZoomFrame(TBool aZoomIn);
00054 
00055         // Frame information
00056         const TFrameInfo& FrameInfo() const {return iFrameInfo;}
00057         // Frame count
00058         TInt FrameCount() const {return iFrameCount;}
00059 
00060 private:
00061         // Active object interface
00062         void RunL(); 
00063         void DoCancel();
00064 
00065 private:
00066         // Bitmap
00067         CFbsBitmap& iBitmap; 
00068         // File server handle
00069         RFs& iFs;
00070         // Callback interface
00071         MImageHandlerCallback& iCallback;
00072         // Frame information
00073         TFrameInfo iFrameInfo;
00074         // Frame count
00075         TInt iFrameCount;
00076         // Image file loader
00077         CImageDecoder* iLoadUtil;
00078         // Image files saver
00079         CImageEncoder* iSaveUtil;
00080         // Bitmap rotator
00081         CBitmapRotator* iBitmapRotator;
00082         // Bitmap zoomer
00083         CBitmapScaler* iBitmapScaler;
00084     };
00085 
00086 #endif

Generated on Thu Jan 21 10:32:59 2010 for TB10.1 Example Applications by  doxygen 1.5.3