examples/Multimedia/ImageConv/src/CImageAppUi.h

00001 // Copyright (c) 2001-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 //
00015 
00016 #ifndef CIMAGEAPPUI
00017 #define CIMAGEAPPUI
00018 
00019 #include <fbs.h>
00020 #include <eikappui.h>
00021 #include <eikdialg.h>
00022 #include <eikcfdlg.h>
00023 #include <eikchlst.h>
00024 #include <eikmfne.h>
00025 
00026 #include "CImageHandler.h"
00027 
00028 
00029 // TFileSaveDialogOptions
00030 // Options that specify how an image should be saved
00031 class TFileSaveDialogOptions
00032         {
00033 public:
00034         TUid iImageType;                // Image type
00035         TUid iImageSubType;             // Image sub-type
00036         };
00037 
00038 class CImageAppView;
00039 
00040 // CImageAppUi
00041 // Handles commands, and invokes ICL functions appropriately
00042 class CImageAppUi : public CEikAppUi, public MImageHandlerCallback
00043     {
00044 public:
00045     void ConstructL();
00046         ~CImageAppUi();
00047 
00048 private:
00049         // Image operation complete, so need to refresh view
00050         void ImageOperationCompleteL(TInt aError);
00051 
00052         // From CCoeAppUi
00053         TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00054         
00055         // From CEikAppUi
00056         void HandleCommandL(TInt aCommand);
00057         void DynInitMenuBarL(TInt aResourceId, CEikMenuBar* aMenuBar);
00058         
00059         // File command handling functions
00060         void OpenFileL();
00061         void SaveAsL();
00062         void ExtractFrameL();
00063 
00064 private:
00065         CImageHandler* iImageHandler;
00066     CImageAppView* iAppView;                    // App view             
00067         CFbsBitmap* iBitmap;                            // Bitmap
00068         TFileName iLoadFileName;                        // File name to load
00069         TFileName iSaveFileName;                        // File name to save
00070         TFileSaveDialogOptions iSaveInfo;       // Save options
00071         };
00072 
00073 
00074 // CImageCurrentFrameDialog
00075 // Selects frame to extract
00076 class CImageCurrentFrameDialog : public CEikDialog
00077         {
00078 public:
00079         CImageCurrentFrameDialog(TInt& aCurrentFrame,TInt aNumberOfFrames);
00080 
00081 protected:
00082         // From CEikDialog
00083         virtual void PreLayoutDynInitL();
00084         virtual TBool OkToExitL(TInt aButtonId);
00085 
00086 private:
00087         TInt& iCurrentFrame;
00088         TInt iNumberOfFrames;
00089         };
00090 
00091 // CImageSaveAsDialog
00092 // Save As dialog
00093 class CImageSaveAsDialog : public CEikFileSaveAsDialog
00094         {
00095 public:
00096         CImageSaveAsDialog(TDes* aFileName, TFileSaveDialogOptions& aSaveInfo);
00097         ~CImageSaveAsDialog();
00098 
00099 private:
00100         // from CEikDialog
00101         void PreLayoutDynInitL();
00102         TBool OkToExitL(TInt aButtonId);
00103         void HandleControlStateChangeL(TInt aControlId);
00104         void SetImageSubTypesL();
00105 
00106 private:
00107         // dialog settings returned
00108         TFileSaveDialogOptions& iSaveInfo;
00109         // stores dynamic list of image types available
00110         RImageTypeDescriptionArray iImageTypes;
00111         // stores dynamic list of image subtypes available
00112         RImageTypeDescriptionArray iImageSubTypes;
00113         // flag set if sub-type set
00114         TBool iSubtypeSet;
00115         };
00116 
00117 #endif //CIMAGEAPPUI

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