00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
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
00030
00031 class TFileSaveDialogOptions
00032 {
00033 public:
00034 TUid iImageType;
00035 TUid iImageSubType;
00036 };
00037
00038 class CImageAppView;
00039
00040
00041
00042 class CImageAppUi : public CEikAppUi, public MImageHandlerCallback
00043 {
00044 public:
00045 void ConstructL();
00046 ~CImageAppUi();
00047
00048 private:
00049
00050 void ImageOperationCompleteL(TInt aError);
00051
00052
00053 TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00054
00055
00056 void HandleCommandL(TInt aCommand);
00057 void DynInitMenuBarL(TInt aResourceId, CEikMenuBar* aMenuBar);
00058
00059
00060 void OpenFileL();
00061 void SaveAsL();
00062 void ExtractFrameL();
00063
00064 private:
00065 CImageHandler* iImageHandler;
00066 CImageAppView* iAppView;
00067 CFbsBitmap* iBitmap;
00068 TFileName iLoadFileName;
00069 TFileName iSaveFileName;
00070 TFileSaveDialogOptions iSaveInfo;
00071 };
00072
00073
00074
00075
00076 class CImageCurrentFrameDialog : public CEikDialog
00077 {
00078 public:
00079 CImageCurrentFrameDialog(TInt& aCurrentFrame,TInt aNumberOfFrames);
00080
00081 protected:
00082
00083 virtual void PreLayoutDynInitL();
00084 virtual TBool OkToExitL(TInt aButtonId);
00085
00086 private:
00087 TInt& iCurrentFrame;
00088 TInt iNumberOfFrames;
00089 };
00090
00091
00092
00093 class CImageSaveAsDialog : public CEikFileSaveAsDialog
00094 {
00095 public:
00096 CImageSaveAsDialog(TDes* aFileName, TFileSaveDialogOptions& aSaveInfo);
00097 ~CImageSaveAsDialog();
00098
00099 private:
00100
00101 void PreLayoutDynInitL();
00102 TBool OkToExitL(TInt aButtonId);
00103 void HandleControlStateChangeL(TInt aControlId);
00104 void SetImageSubTypesL();
00105
00106 private:
00107
00108 TFileSaveDialogOptions& iSaveInfo;
00109
00110 RImageTypeDescriptionArray iImageTypes;
00111
00112 RImageTypeDescriptionArray iImageSubTypes;
00113
00114 TBool iSubtypeSet;
00115 };
00116
00117 #endif //CIMAGEAPPUI