*m enhance
authorqifeima <>
Thu, 03 Jun 2010 18:57:10 +0800
changeset 8 18b321db4884
parent 1 edfc90759b9f
child 9 a5c0fe6456b2
*m enhance
group/bld.inf
imageeditor/ImageEditorManager/src/ImageEditorPluginScanner.cpp
imageeditor/ImageEditorUI/bwins/ImageEditorUI.DEF
imageeditor/ImageEditorUI/group/ImageEditorUI.mmp
imageeditor/ImageEditorUI/inc/ImageEditorUIContainer.h
imageeditor/ImageEditorUI/src/ColorSelectionPopup.cpp
imageeditor/ImageEditorUI/src/ImageEditorUIContainer.cpp
imageeditor/ImageEditorUI/src/ImageEditorUIView.cpp
imageeditor/ImageEditorUI/src/PreviewControlBase.cpp
imageeditor/group/bld.inf
imageeditor/imageeditorApp/inc/ImageEditorAppUi.h
imageeditor/imageeditorApp/src/ImageEditorAppUi.cpp
imageeditor/inc/ImageEditorControlBase.h
imageeditor/inc/ImageEditorUI.hrh
imageeditor/inc/ImageEditorUIView.h
imageeditor/inc/PreviewControlBase.h
imageeditor/plugins/DrawPlugin/data/PenSize.svg
imageeditor/plugins/DrawPlugin/data/menu.svg
imageeditor/plugins/DrawPlugin/data/palette.svg
imageeditor/plugins/DrawPlugin/data/save.svg
imageeditor/plugins/DrawPlugin/data/undo.svg
imageeditor/plugins/DrawPlugin/gfx/15A.bmp
imageeditor/plugins/DrawPlugin/gfx/Left.bmp
imageeditor/plugins/DrawPlugin/gfx/Leftmask.bmp
imageeditor/plugins/DrawPlugin/gfx/Right.bmp
imageeditor/plugins/DrawPlugin/gfx/bottom.bmp
imageeditor/plugins/DrawPlugin/gfx/bottommask.bmp
imageeditor/plugins/DrawPlugin/gfx/menumask.bmp
imageeditor/plugins/DrawPlugin/gfx/rightmask.bmp
imageeditor/plugins/DrawPlugin/gfx/top.bmp
imageeditor/plugins/DrawPlugin/gfx/topmask.bmp
imageeditor/plugins/DrawPlugin/group/bld.inf
imageeditor/plugins/DrawPlugin/group/drawplugin.mmp
imageeditor/plugins/DrawPlugin/group/icons_doodle.mk
imageeditor/plugins/DrawPlugin/inc/AnimationAO.h
imageeditor/plugins/DrawPlugin/inc/CImageLabel.h
imageeditor/plugins/DrawPlugin/inc/CustomerComponet.h
imageeditor/plugins/DrawPlugin/inc/MCountTime.h
imageeditor/plugins/DrawPlugin/inc/RollAO.h
imageeditor/plugins/DrawPlugin/inc/TimeAO.h
imageeditor/plugins/DrawPlugin/inc/draw.hrh
imageeditor/plugins/DrawPlugin/inc/imageeditordrawcontrol.h
imageeditor/plugins/DrawPlugin/inc/imageeditordrawplugin.h
imageeditor/plugins/DrawPlugin/inc/selectionpopup.h
imageeditor/plugins/DrawPlugin/src/AnimationAO.cpp
imageeditor/plugins/DrawPlugin/src/CImageLabel.cpp
imageeditor/plugins/DrawPlugin/src/CustomerComponet.cpp
imageeditor/plugins/DrawPlugin/src/RollAO.cpp
imageeditor/plugins/DrawPlugin/src/TimeAO.cpp
imageeditor/plugins/DrawPlugin/src/imageeditordrawcontrol.cpp
imageeditor/plugins/DrawPlugin/src/imageeditordrawplugin.cpp
imageeditor/plugins/DrawPlugin/src/selectionpopup.cpp
imageeditorengine/EngineWrapper/src/ImageEditorEngineWrapper.cpp
imageeditorengine/filters/FilterDraw/Inc/cfilterdraw.h
imageeditorengine/filters/FilterDraw/Inc/drawpath.h
imageeditorengine/filters/FilterDraw/Src/cfilterdraw.cpp
imageeditorengine/filters/FilterDraw/Src/drawpath.cpp
imageeditorengine/group/bld.inf
--- a/group/bld.inf	Fri Jan 29 13:53:17 2010 +0200
+++ b/group/bld.inf	Thu Jun 03 18:57:10 2010 +0800
@@ -20,9 +20,11 @@
 #include <platform_paths.hrh>
 
 #include "../imgeditor_plat/group/bld.inf" 
+#include "../imageeditorengine/group/bld.inf"
 #include "../imageeditor/group/bld.inf"
-#include "../imageeditorengine/group/bld.inf"
+
 
  
 PRJ_EXPORTS
  
+PRJ_MMPFILES
--- a/imageeditor/ImageEditorManager/src/ImageEditorPluginScanner.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/ImageEditorManager/src/ImageEditorPluginScanner.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -178,7 +178,7 @@
     if( scanCount == matchCount && matchCount == iStorage->CountPlugins() )
     {
         LOG(KImageEditorLogFile, "CPluginScanner: plug-in storage up to date");
-        return EFalse; // no update needed
+        return ETrue; // no update needed
     }
     else
     {
--- a/imageeditor/ImageEditorUI/bwins/ImageEditorUI.DEF	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/ImageEditorUI/bwins/ImageEditorUI.DEF	Thu Jun 03 18:57:10 2010 +0800
@@ -1,129 +1,130 @@
-EXPORTS
-	?LaunchSendQueryL@CImageEditorUIView@@QBEXABVTSendingCapabilities@@AAVRFile@@@Z @ 1 NONAME ; void CImageEditorUIView::LaunchSendQueryL(class TSendingCapabilities const &, class RFile &) const
-	?ShowToolTip@SDrawUtils@@SAXPAVCAknInfoPopupNoteController@@PAVCCoeControl@@VTPoint@@W4TGulAlignmentValue@@ABVTDesC16@@@Z @ 2 NONAME ; void SDrawUtils::ShowToolTip(class CAknInfoPopupNoteController *, class CCoeControl *, class TPoint, enum TGulAlignmentValue, class TDesC16 const &)
-	?LaunchSaveChangesQueryL@CImageEditorUIView@@QBEHXZ @ 3 NONAME ; int CImageEditorUIView::LaunchSaveChangesQueryL(void) const
-	?LaunchExitWithoutSavingQueryL@CImageEditorUIView@@QBEHXZ @ 4 NONAME ; int CImageEditorUIView::LaunchExitWithoutSavingQueryL(void) const
-	?SetImageL@CImageEditorControlBase@@UAEXPAVCFbsBitmap@@@Z @ 5 NONAME ; void CImageEditorControlBase::SetImageL(class CFbsBitmap *)
-	?SetSliderPosition@CSingleParamControl@@QAEXH@Z @ 6 NONAME ; void CSingleParamControl::SetSliderPosition(int)
-	?SetSaveFlag@CImageEditorUIView@@QAEXH@Z @ 7 NONAME ; void CImageEditorUIView::SetSaveFlag(int)
-	?LaunchProgressNoteL@SDrawUtils@@SAXPAPAVCAknProgressDialog@@HABVTDesC16@@HPAVMProgressDialogCallback@@@Z @ 8 NONAME ; void SDrawUtils::LaunchProgressNoteL(class CAknProgressDialog * *, int, class TDesC16 const &, int, class MProgressDialogCallback *)
-	?GetTouchPanDirections@CImageEditorUIView@@QAEXAAH0@Z @ 9 NONAME ; void CImageEditorUIView::GetTouchPanDirections(int &, int &)
-	?CountComponentControls@CImageEditorControlBase@@UBEHXZ @ 10 NONAME ; int CImageEditorControlBase::CountComponentControls(void) const
-	?SetBusy@CImageEditorControlBase@@UAEXXZ @ 11 NONAME ; void CImageEditorControlBase::SetBusy(void)
-	?SetCaption@CSingleParamControl@@QAEXABVTDesC16@@@Z @ 12 NONAME ; void CSingleParamControl::SetCaption(class TDesC16 const &)
-	?LaunchLoadWaitDialogL@CImageEditorUIView@@QBEXPAPAVCAknWaitDialog@@PAVMProgressDialogCallback@@@Z @ 13 NONAME ; void CImageEditorUIView::LaunchLoadWaitDialogL(class CAknWaitDialog * *, class MProgressDialogCallback *) const
-	?LaunchListQueryDialogL@SDrawUtils@@SAHPAVMDesC16Array@@ABVTDesC16@@@Z @ 14 NONAME ; int SDrawUtils::LaunchListQueryDialogL(class MDesC16Array *, class TDesC16 const &)
-	??0CImageEditorControlBase@@QAE@XZ @ 15 NONAME ; CImageEditorControlBase::CImageEditorControlBase(void)
-	?GetDimmedMenuItems@CImageEditorControlBase@@UAE?AVTBitField@@XZ @ 16 NONAME ; class TBitField CImageEditorControlBase::GetDimmedMenuItems(void)
-	?SetView@CSingleParamControl@@UAEXPAVCAknView@@@Z @ 17 NONAME ; void CSingleParamControl::SetView(class CAknView *)
-	?Draw@CSingleParamControl@@EBEXABVTRect@@@Z @ 18 NONAME ; void CSingleParamControl::Draw(class TRect const &) const
-	?HandleStatusPaneSizeChange@CImageEditorUIView@@UAEXXZ @ 19 NONAME ; void CImageEditorUIView::HandleStatusPaneSizeChange(void)
-	?DynInitMenuPaneL@CImageEditorUIView@@UAEXHPAVCEikMenuPane@@@Z @ 20 NONAME ; void CImageEditorUIView::DynInitMenuPaneL(int, class CEikMenuPane *)
-	?DoDeactivate@CImageEditorUIView@@EAEXXZ @ 21 NONAME ; void CImageEditorUIView::DoDeactivate(void)
-	?SetImageL@CImageEditorControlBase@@UAEXPBVCFbsBitmap@@@Z @ 22 NONAME ; void CImageEditorControlBase::SetImageL(class CFbsBitmap const *)
-	?GetSoftkeyIndexL@CImageEditorControlBase@@UAEHXZ @ 23 NONAME ; int CImageEditorControlBase::GetSoftkeyIndexL(void)
-	?LaunchColorSelectionGridL@SDrawUtils@@SAHAAVTRgb@@@Z @ 24 NONAME ; int SDrawUtils::LaunchColorSelectionGridL(class TRgb &)
-	?AddPluginUiItemL@CImageEditorUIView@@QAEXPBVCPluginInfo@@@Z @ 25 NONAME ; void CImageEditorUIView::AddPluginUiItemL(class CPluginInfo const *)
-	?SetUndoFlag@CImageEditorUIView@@QAEXH@Z @ 26 NONAME ; void CImageEditorUIView::SetUndoFlag(int)
-	?SetFullScreen@CImageEditorUIView@@QAEXXZ @ 27 NONAME ; void CImageEditorUIView::SetFullScreen(void)
-	?ResetBusy@CImageEditorUIView@@QAEXXZ @ 28 NONAME ; void CImageEditorUIView::ResetBusy(void)
-	??1CColorSelectionGrid@@UAE@XZ @ 29 NONAME ; CColorSelectionGrid::~CColorSelectionGrid(void)
-	??1CSingleParamControl@@UAE@XZ @ 30 NONAME ; CSingleParamControl::~CSingleParamControl(void)
-	?ResetFullScreen@CImageEditorUIView@@QAEXXZ @ 31 NONAME ; void CImageEditorUIView::ResetFullScreen(void)
-	?Id@CImageEditorUIView@@UBE?AVTUid@@XZ @ 32 NONAME ; class TUid CImageEditorUIView::Id(void) const
-	?SetTitlePaneTextL@CImageEditorUIView@@QAEXABVTDesC16@@@Z @ 33 NONAME ; void CImageEditorUIView::SetTitlePaneTextL(class TDesC16 const &)
-	?DrawGuide@SDrawUtils@@SAXAAVCGraphicsContext@@ABVTRect@@W4TGuideType@1@ABVTRgb@@@Z @ 34 NONAME ; void SDrawUtils::DrawGuide(class CGraphicsContext &, class TRect const &, enum SDrawUtils::TGuideType, class TRgb const &)
-	?ShowConfirmationNoteL@CImageEditorUIView@@QBEXABVTDesC16@@@Z @ 35 NONAME ; void CImageEditorUIView::ShowConfirmationNoteL(class TDesC16 const &) const
-	?InZoomingState@CImageEditorUIView@@QAEHXZ @ 36 NONAME ; int CImageEditorUIView::InZoomingState(void)
-	?ConstructL@CPreviewControlBase@@UAEXABVTRect@@PAVCCoeControl@@@Z @ 37 NONAME ; void CPreviewControlBase::ConstructL(class TRect const &, class CCoeControl *)
-	??0CColorSelectionGrid@@QAE@XZ @ 38 NONAME ; CColorSelectionGrid::CColorSelectionGrid(void)
-	??0CSingleParamControl@@QAE@XZ @ 39 NONAME ; CSingleParamControl::CSingleParamControl(void)
-	?CountImageSizesAndPositions@CSingleParamControl@@AAEXXZ @ 40 NONAME ; void CSingleParamControl::CountImageSizesAndPositions(void)
-	?SetSelectedUiItemL@CSingleParamControl@@UAEXPAVCPluginInfo@@@Z @ 41 NONAME ; void CSingleParamControl::SetSelectedUiItemL(class CPluginInfo *)
-	?SizeChanged@CSingleParamControl@@UAEXXZ @ 42 NONAME ; void CSingleParamControl::SizeChanged(void)
-	?NewL@CSingleParamControl@@SAPAV1@ABVTRect@@PAVCCoeControl@@H@Z @ 43 NONAME ; class CSingleParamControl * CSingleParamControl::NewL(class TRect const &, class CCoeControl *, int)
-	?ComponentControl@CImageEditorControlBase@@UBEPAVCCoeControl@@H@Z @ 44 NONAME ; class CCoeControl * CImageEditorControlBase::ComponentControl(int) const
-	?ConstructL@CImageEditorUIView@@QAEXXZ @ 45 NONAME ; void CImageEditorUIView::ConstructL(void)
-	?LaunchColorSelectionPopupL@SDrawUtils@@SAHPBVCFbsBitmap@@VTRect@@AAVTRgb@@@Z @ 46 NONAME ; int SDrawUtils::LaunchColorSelectionPopupL(class CFbsBitmap const *, class TRect, class TRgb &)
-	?GetNaviPaneTextL@CImageEditorControlBase@@UAE?AVTPtrC16@@AAH0@Z @ 47 NONAME ; class TPtrC16 CImageEditorControlBase::GetNaviPaneTextL(int &, int &)
-	?ConstructL@CColorSelectionGrid@@UAEXPBVCCoeControl@@H@Z @ 48 NONAME ; void CColorSelectionGrid::ConstructL(class CCoeControl const *, int)
-	?SetSliderMinimumAndMaximum@CSingleParamControl@@QAEXHH@Z @ 49 NONAME ; void CSingleParamControl::SetSliderMinimumAndMaximum(int, int)
-	?HandleCommandL@CImageEditorUIView@@UAEXH@Z @ 50 NONAME ; void CImageEditorUIView::HandleCommandL(int)
-	?ViewScreenModeCompatible@CImageEditorUIView@@MAEHH@Z @ 51 NONAME ; int CImageEditorUIView::ViewScreenModeCompatible(int)
-	?SizeChanged@CImageEditorControlBase@@MAEXXZ @ 52 NONAME ; void CImageEditorControlBase::SizeChanged(void)
-	?OfferKeyEventL@CSingleParamControl@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 53 NONAME ; enum TKeyResponse CSingleParamControl::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode)
-	?ResetBusy@CImageEditorControlBase@@UAEXXZ @ 54 NONAME ; void CImageEditorControlBase::ResetBusy(void)
-	??1CMultiLineQueryDialog@@UAE@XZ @ 55 NONAME ; CMultiLineQueryDialog::~CMultiLineQueryDialog(void)
-	?SetImageL@CImageEditorUIView@@QAEXPAVCFbsBitmap@@@Z @ 56 NONAME ; void CImageEditorUIView::SetImageL(class CFbsBitmap *)
-	?LaunchTextQueryDialogL@SDrawUtils@@SAHAAVTDes16@@ABVTDesC16@@@Z @ 57 NONAME ; int SDrawUtils::LaunchTextQueryDialogL(class TDes16 &, class TDesC16 const &)
-	??0CImageEditorUIView@@QAE@XZ @ 58 NONAME ; CImageEditorUIView::CImageEditorUIView(void)
-	?SetMiddleSoftKeyL@CImageEditorUIView@@QAEXABVTDesC16@@H@Z @ 59 NONAME ; void CImageEditorUIView::SetMiddleSoftKeyL(class TDesC16 const &, int)
-	?HandlePluginCommandL@CSingleParamControl@@UAEXH@Z @ 60 NONAME ; void CSingleParamControl::HandlePluginCommandL(int)
-	?HandleClientRectChange@CImageEditorUIView@@QAEXXZ @ 61 NONAME ; void CImageEditorUIView::HandleClientRectChange(void)
-	?DrawBeveledRect@SDrawUtils@@SAXAAVCGraphicsContext@@ABVTRect@@ABVTRgb@@22@Z @ 62 NONAME ; void SDrawUtils::DrawBeveledRect(class CGraphicsContext &, class TRect const &, class TRgb const &, class TRgb const &, class TRgb const &)
-	?OfferKeyEventL@CMultiLineQueryDialog@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 63 NONAME ; enum TKeyResponse CMultiLineQueryDialog::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode)
-	??1CImageEditorControlBase@@UAE@XZ @ 64 NONAME ; CImageEditorControlBase::~CImageEditorControlBase(void)
-	?ClearTitlePaneTextL@CImageEditorUIView@@QAEXXZ @ 65 NONAME ; void CImageEditorUIView::ClearTitlePaneTextL(void)
-	?DoActivateL@CImageEditorUIView@@EAEXABVTVwsViewId@@VTUid@@ABVTDesC8@@@Z @ 66 NONAME ; void CImageEditorUIView::DoActivateL(class TVwsViewId const &, class TUid, class TDesC8 const &)
-	??0CMultiLineQueryDialog@@AAE@AAVTDes16@@ABW4TTone@CAknQueryDialog@@@Z @ 67 NONAME ; CMultiLineQueryDialog::CMultiLineQueryDialog(class TDes16 &, enum CAknQueryDialog::TTone const &)
-	?OfferKeyEventL@CImageEditorControlBase@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 68 NONAME ; enum TKeyResponse CImageEditorControlBase::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode)
-	?SetSoftKey2L@CImageEditorUIView@@QAEXABVTDesC16@@H@Z @ 69 NONAME ; void CImageEditorUIView::SetSoftKey2L(class TDesC16 const &, int)
-	?GetSoftkeyIndexL@CSingleParamControl@@UAEHXZ @ 70 NONAME ; int CSingleParamControl::GetSoftkeyIndexL(void)
-	?LaunchSaveWaitDialogL@CImageEditorUIView@@QBEXPAPAVCAknProgressDialog@@HPAVMProgressDialogCallback@@@Z @ 71 NONAME ; void CImageEditorUIView::LaunchSaveWaitDialogL(class CAknProgressDialog * *, int, class MProgressDialogCallback *) const
-	??1CImageEditorUIView@@UAE@XZ @ 72 NONAME ; CImageEditorUIView::~CImageEditorUIView(void)
-	?GetNaviPaneTextL@CSingleParamControl@@UAE?AVTPtrC16@@AAH0@Z @ 73 NONAME ; class TPtrC16 CSingleParamControl::GetNaviPaneTextL(int &, int &)
-	?SetImageL@CPreviewControlBase@@UAEXPAVCFbsBitmap@@@Z @ 74 NONAME ; void CPreviewControlBase::SetImageL(class CFbsBitmap *)
-	??1CPreviewControlBase@@UAE@XZ @ 75 NONAME ; CPreviewControlBase::~CPreviewControlBase(void)
-	?LaunchQueryDialogL@SDrawUtils@@SAHABVTDesC16@@@Z @ 76 NONAME ; int SDrawUtils::LaunchQueryDialogL(class TDesC16 const &)
-	?SetParObserver@CSingleParamControl@@QAEXPAVMSingleParControlObserver@@@Z @ 77 NONAME ; void CSingleParamControl::SetParObserver(class MSingleParControlObserver *)
-	?NewL@CPreviewControlBase@@SAPAV1@ABVTRect@@PAVCCoeControl@@@Z @ 78 NONAME ; class CPreviewControlBase * CPreviewControlBase::NewL(class TRect const &, class CCoeControl *)
-	?LaunchSaveImageQueryL@CImageEditorUIView@@QBEHXZ @ 79 NONAME ; int CImageEditorUIView::LaunchSaveImageQueryL(void) const
-	?ComponentControl@CSingleParamControl@@UBEPAVCCoeControl@@H@Z @ 80 NONAME ; class CCoeControl * CSingleParamControl::ComponentControl(int) const
-	?SetView@CImageEditorControlBase@@UAEXPAVCAknView@@@Z @ 81 NONAME ; void CImageEditorControlBase::SetView(class CAknView *)
-	?HandlePointerEventL@CSingleParamControl@@UAEXABUTPointerEvent@@@Z @ 82 NONAME ; void CSingleParamControl::HandlePointerEventL(struct TPointerEvent const &)
-	?LaunchMultiLineTextQueryDialogL@SDrawUtils@@SAHAAVTDes16@@ABVTDesC16@@@Z @ 83 NONAME ; int SDrawUtils::LaunchMultiLineTextQueryDialogL(class TDes16 &, class TDesC16 const &)
-	?NewL@CMultiLineQueryDialog@@SAPAV1@AAVTDes16@@ABW4TTone@CAknQueryDialog@@@Z @ 84 NONAME ; class CMultiLineQueryDialog * CMultiLineQueryDialog::NewL(class TDes16 &, enum CAknQueryDialog::TTone const &)
-	?ActivatePluginL@CImageEditorUIView@@QAEXPAVCCoeControl@@@Z @ 85 NONAME ; void CImageEditorUIView::ActivatePluginL(class CCoeControl *)
-	?Draw@CImageEditorControlBase@@EBEXABVTRect@@@Z @ 86 NONAME ; void CImageEditorControlBase::Draw(class TRect const &) const
-	?DrawFlatRect@SDrawUtils@@SAXAAVCGraphicsContext@@ABVTRect@@ABVTRgb@@22@Z @ 87 NONAME ; void SDrawUtils::DrawFlatRect(class CGraphicsContext &, class TRect const &, class TRgb const &, class TRgb const &, class TRgb const &)
-	?CountComponentControls@CSingleParamControl@@UBEHXZ @ 88 NONAME ; int CSingleParamControl::CountComponentControls(void) const
-	?LaunchCancelTextInputQueryL@CImageEditorUIView@@QBEHXZ @ 89 NONAME ; int CImageEditorUIView::LaunchCancelTextInputQueryL(void) const
-	?SetIcon@CSingleParamControl@@QAEXPAVCEikImage@@@Z @ 90 NONAME ; void CSingleParamControl::SetIcon(class CEikImage *)
-	?UpdateLayoutL@CImageEditorUIView@@QBEXH@Z @ 91 NONAME ; void CImageEditorUIView::UpdateLayoutL(int) const
-	?SetImageL@CPreviewControlBase@@UAEXPBVCFbsBitmap@@@Z @ 92 NONAME ; void CPreviewControlBase::SetImageL(class CFbsBitmap const *)
-	?ShowInformationNoteL@CImageEditorUIView@@QBEXABVTDesC16@@@Z @ 93 NONAME ; void CImageEditorUIView::ShowInformationNoteL(class TDesC16 const &) const
-	?SetImageFileName@CImageEditorUIView@@QAEXABVTDesC16@@@Z @ 94 NONAME ; void CImageEditorUIView::SetImageFileName(class TDesC16 const &)
-	?SetSendAppUi@CImageEditorUIView@@QAEXPAVCSendUi@@@Z @ 95 NONAME ; void CImageEditorUIView::SetSendAppUi(class CSendUi *)
-	?SetSelectedUiItemL@CImageEditorControlBase@@UAEXPAVCPluginInfo@@@Z @ 96 NONAME ; void CImageEditorControlBase::SetSelectedUiItemL(class CPluginInfo *)
-	?LaunchWaitNoteL@SDrawUtils@@SAXPAPAVCAknWaitDialog@@HABVTDesC16@@PAVMProgressDialogCallback@@@Z @ 97 NONAME ; void SDrawUtils::LaunchWaitNoteL(class CAknWaitDialog * *, int, class TDesC16 const &, class MProgressDialogCallback *)
-	?ConstructL@CImageEditorControlBase@@UAEXABVTRect@@PAVCCoeControl@@@Z @ 98 NONAME ; void CImageEditorControlBase::ConstructL(class TRect const &, class CCoeControl *)
-	?SetZoomModeL@CImageEditorUIView@@QAEXABW4TZoomMode@@@Z @ 99 NONAME ; void CImageEditorUIView::SetZoomModeL(enum TZoomMode const &)
-	?MoveSlider@CSingleParamControl@@AAEXH@Z @ 100 NONAME ; void CSingleParamControl::MoveSlider(int)
-	?Draw@CPreviewControlBase@@EBEXABVTRect@@@Z @ 101 NONAME ; void CPreviewControlBase::Draw(class TRect const &) const
-	?SetSliderStepAmount@CSingleParamControl@@QAEXE@Z @ 102 NONAME ; void CSingleParamControl::SetSliderStepAmount(unsigned char)
-	?SetNaviPaneTextL@CImageEditorUIView@@QAEXABVTDesC16@@HH@Z @ 103 NONAME ; void CImageEditorUIView::SetNaviPaneTextL(class TDesC16 const &, int, int)
-	?SetCustomButtonsL@CImageEditorUIView@@QBEXH@Z @ 104 NONAME ; void CImageEditorUIView::SetCustomButtonsL(int) const
-	?GetIndicatorBitmapL@SDrawUtils@@SAHAAPAVCFbsBitmap@@0HH@Z @ 105 NONAME ; int SDrawUtils::GetIndicatorBitmapL(class CFbsBitmap * &, class CFbsBitmap * &, int, int)
-	?HandlePluginCommandL@CImageEditorControlBase@@UAEXH@Z @ 106 NONAME ; void CImageEditorControlBase::HandlePluginCommandL(int)
-	?Busy@CImageEditorControlBase@@UBEHXZ @ 107 NONAME ; int CImageEditorControlBase::Busy(void) const
-	?ActivateMainViewL@CImageEditorUIView@@QAEXXZ @ 108 NONAME ; void CImageEditorUIView::ActivateMainViewL(void)
-	?GetSelectedPluginInfoL@CImageEditorUIView@@QAEPAVCPluginInfo@@XZ @ 109 NONAME ; class CPluginInfo * CImageEditorUIView::GetSelectedPluginInfoL(void)
-	?HandlePointerEventL@CImageEditorControlBase@@MAEXABUTPointerEvent@@@Z @ 110 NONAME ; void CImageEditorControlBase::HandlePointerEventL(struct TPointerEvent const &)
-	?SetSliderStep@CSingleParamControl@@QAEXI@Z @ 111 NONAME ; void CSingleParamControl::SetSliderStep(unsigned int)
-	?LaunchWaitDialog@CImageEditorUIView@@QBEXXZ @ 112 NONAME ; void CImageEditorUIView::LaunchWaitDialog(void) const
-	?GetContextMenuResourceId@CImageEditorControlBase@@UAEHXZ @ 113 NONAME ; int CImageEditorControlBase::GetContextMenuResourceId(void)
-	?LaunchQueryDialogOkOnlyL@SDrawUtils@@SAHABVTDesC16@@@Z @ 114 NONAME ; int SDrawUtils::LaunchQueryDialogOkOnlyL(class TDesC16 const &)
-	?DrawPreviewImage@CPreviewControlBase@@UBEXABVTRect@@@Z @ 115 NONAME ; void CPreviewControlBase::DrawPreviewImage(class TRect const &) const
-	?HideWaitDialog@CImageEditorUIView@@QBEXXZ @ 116 NONAME ; void CImageEditorUIView::HideWaitDialog(void) const
-	?PrepareL@CImageEditorControlBase@@UAEXXZ @ 117 NONAME ; void CImageEditorControlBase::PrepareL(void)
-	?LaunchSendQueryL@CImageEditorUIView@@QBEXABVTSendingCapabilities@@AAV?$TBuf@$0BAA@@@@Z @ 118 NONAME ; void CImageEditorUIView::LaunchSendQueryL(class TSendingCapabilities const &, class TBuf<256> &) const
-	?ClearNaviPaneTextL@CImageEditorUIView@@QAEXXZ @ 119 NONAME ; void CImageEditorUIView::ClearNaviPaneTextL(void)
-	?SizeChanged@CColorSelectionGrid@@MAEXXZ @ 120 NONAME ; void CColorSelectionGrid::SizeChanged(void)
-	?ConstructL@CSingleParamControl@@UAEXABVTRect@@PAVCCoeControl@@H@Z @ 121 NONAME ; void CSingleParamControl::ConstructL(class TRect const &, class CCoeControl *, int)
-	?ShowToolTip@SDrawUtils@@SAXPAVCAknInfoPopupNoteController@@PAVCCoeControl@@VTRect@@ABVTDesC16@@@Z @ 122 NONAME ; void SDrawUtils::ShowToolTip(class CAknInfoPopupNoteController *, class CCoeControl *, class TRect, class TDesC16 const &)
-	?SetSoftKey1L@CImageEditorUIView@@QAEXABVTDesC16@@H@Z @ 123 NONAME ; void CImageEditorUIView::SetSoftKey1L(class TDesC16 const &, int)
-	?SetBusy@CImageEditorUIView@@QAEXXZ @ 124 NONAME ; void CImageEditorUIView::SetBusy(void)
-	?Position@CSingleParamControl@@QBEHXZ @ 125 NONAME ; int CSingleParamControl::Position(void) const
-	?GetContainer@CImageEditorUIView@@QBEPAVCCoeControl@@XZ @ 126 NONAME ; class CCoeControl * CImageEditorUIView::GetContainer(void) const
-	?IsMemoryInCriticalLevel@CImageEditorUIView@@QAEHXZ @ 127 NONAME ; int CImageEditorUIView::IsMemoryInCriticalLevel(void)
-
+EXPORTS
+	?ShowToolTip@SDrawUtils@@SAXPAVCAknInfoPopupNoteController@@PAVCCoeControl@@VTPoint@@W4TGulAlignmentValue@@ABVTDesC16@@@Z @ 1 NONAME ; void SDrawUtils::ShowToolTip(class CAknInfoPopupNoteController *, class CCoeControl *, class TPoint, enum TGulAlignmentValue, class TDesC16 const &)
+	?LaunchExitWithoutSavingQueryL@CImageEditorUIView@@QBEHXZ @ 2 NONAME ; int CImageEditorUIView::LaunchExitWithoutSavingQueryL(void) const
+	?SetSliderPosition@CSingleParamControl@@QAEXH@Z @ 3 NONAME ; void CSingleParamControl::SetSliderPosition(int)
+	?LaunchProgressNoteL@SDrawUtils@@SAXPAPAVCAknProgressDialog@@HABVTDesC16@@HPAVMProgressDialogCallback@@@Z @ 4 NONAME ; void SDrawUtils::LaunchProgressNoteL(class CAknProgressDialog * *, int, class TDesC16 const &, int, class MProgressDialogCallback *)
+	?IsMemoryInCriticalLevel@CImageEditorUIView@@QAEHXZ @ 5 NONAME ; int CImageEditorUIView::IsMemoryInCriticalLevel(void)
+	?GetTouchPanDirections@CImageEditorUIView@@QAEXAAH0@Z @ 6 NONAME ; void CImageEditorUIView::GetTouchPanDirections(int &, int &)
+	?CountComponentControls@CImageEditorControlBase@@UBEHXZ @ 7 NONAME ; int CImageEditorControlBase::CountComponentControls(void) const
+	?SetCaption@CSingleParamControl@@QAEXABVTDesC16@@@Z @ 8 NONAME ; void CSingleParamControl::SetCaption(class TDesC16 const &)
+	?LaunchLoadWaitDialogL@CImageEditorUIView@@QBEXPAPAVCAknWaitDialog@@PAVMProgressDialogCallback@@@Z @ 9 NONAME ; void CImageEditorUIView::LaunchLoadWaitDialogL(class CAknWaitDialog * *, class MProgressDialogCallback *) const
+	?LaunchListQueryDialogL@SDrawUtils@@SAHPAVMDesC16Array@@ABVTDesC16@@@Z @ 10 NONAME ; int SDrawUtils::LaunchListQueryDialogL(class MDesC16Array *, class TDesC16 const &)
+	??0CImageEditorControlBase@@QAE@XZ @ 11 NONAME ; CImageEditorControlBase::CImageEditorControlBase(void)
+	?GetDimmedMenuItems@CImageEditorControlBase@@UAE?AVTBitField@@XZ @ 12 NONAME ; class TBitField CImageEditorControlBase::GetDimmedMenuItems(void)
+	?Draw@CSingleParamControl@@EBEXABVTRect@@@Z @ 13 NONAME ; void CSingleParamControl::Draw(class TRect const &) const
+	?DoDeactivate@CImageEditorUIView@@EAEXXZ @ 14 NONAME ; void CImageEditorUIView::DoDeactivate(void)
+	?LaunchColorSelectionGridL@SDrawUtils@@SAHAAVTRgb@@@Z @ 15 NONAME ; int SDrawUtils::LaunchColorSelectionGridL(class TRgb &)
+	?ResetBusy@CImageEditorUIView@@QAEXXZ @ 16 NONAME ; void CImageEditorUIView::ResetBusy(void)
+	?ResetFullScreen@CImageEditorUIView@@QAEXXZ @ 17 NONAME ; void CImageEditorUIView::ResetFullScreen(void)
+	?Id@CImageEditorUIView@@UBE?AVTUid@@XZ @ 18 NONAME ; class TUid CImageEditorUIView::Id(void) const
+	?SetTitlePaneTextL@CImageEditorUIView@@QAEXABVTDesC16@@@Z @ 19 NONAME ; void CImageEditorUIView::SetTitlePaneTextL(class TDesC16 const &)
+	?CountImageSizesAndPositions@CSingleParamControl@@AAEXXZ @ 20 NONAME ; void CSingleParamControl::CountImageSizesAndPositions(void)
+	?SizeChanged@CSingleParamControl@@UAEXXZ @ 21 NONAME ; void CSingleParamControl::SizeChanged(void)
+	?NewL@CSingleParamControl@@SAPAV1@ABVTRect@@PAVCCoeControl@@H@Z @ 22 NONAME ; class CSingleParamControl * CSingleParamControl::NewL(class TRect const &, class CCoeControl *, int)
+	?ComponentControl@CImageEditorControlBase@@UBEPAVCCoeControl@@H@Z @ 23 NONAME ; class CCoeControl * CImageEditorControlBase::ComponentControl(int) const
+	?LaunchColorSelectionPopupL@SDrawUtils@@SAHPBVCFbsBitmap@@VTRect@@AAVTRgb@@@Z @ 24 NONAME ; int SDrawUtils::LaunchColorSelectionPopupL(class CFbsBitmap const *, class TRect, class TRgb &)
+	?GetNaviPaneTextL@CImageEditorControlBase@@UAE?AVTPtrC16@@AAH0@Z @ 25 NONAME ; class TPtrC16 CImageEditorControlBase::GetNaviPaneTextL(int &, int &)
+	?OfferKeyEventL@CSingleParamControl@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 26 NONAME ; enum TKeyResponse CSingleParamControl::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?ResetBusy@CImageEditorControlBase@@UAEXXZ @ 27 NONAME ; void CImageEditorControlBase::ResetBusy(void)
+	??1CMultiLineQueryDialog@@UAE@XZ @ 28 NONAME ; CMultiLineQueryDialog::~CMultiLineQueryDialog(void)
+	?SetMiddleSoftKeyL@CImageEditorUIView@@QAEXABVTDesC16@@H@Z @ 29 NONAME ; void CImageEditorUIView::SetMiddleSoftKeyL(class TDesC16 const &, int)
+	?HandlePluginCommandL@CSingleParamControl@@UAEXH@Z @ 30 NONAME ; void CSingleParamControl::HandlePluginCommandL(int)
+	?DrawBeveledRect@SDrawUtils@@SAXAAVCGraphicsContext@@ABVTRect@@ABVTRgb@@22@Z @ 31 NONAME ; void SDrawUtils::DrawBeveledRect(class CGraphicsContext &, class TRect const &, class TRgb const &, class TRgb const &, class TRgb const &)
+	?OfferKeyEventL@CMultiLineQueryDialog@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 32 NONAME ; enum TKeyResponse CMultiLineQueryDialog::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?ClearTitlePaneTextL@CImageEditorUIView@@QAEXXZ @ 33 NONAME ; void CImageEditorUIView::ClearTitlePaneTextL(void)
+	?SetSoftKey2L@CImageEditorUIView@@QAEXABVTDesC16@@H@Z @ 34 NONAME ; void CImageEditorUIView::SetSoftKey2L(class TDesC16 const &, int)
+	??1CImageEditorUIView@@UAE@XZ @ 35 NONAME ; CImageEditorUIView::~CImageEditorUIView(void)
+	?GetNaviPaneTextL@CSingleParamControl@@UAE?AVTPtrC16@@AAH0@Z @ 36 NONAME ; class TPtrC16 CSingleParamControl::GetNaviPaneTextL(int &, int &)
+	??1CPreviewControlBase@@UAE@XZ @ 37 NONAME ; CPreviewControlBase::~CPreviewControlBase(void)
+	?LaunchQueryDialogL@SDrawUtils@@SAHABVTDesC16@@@Z @ 38 NONAME ; int SDrawUtils::LaunchQueryDialogL(class TDesC16 const &)
+	?LaunchSaveImageQueryL@CImageEditorUIView@@QBEHXZ @ 39 NONAME ; int CImageEditorUIView::LaunchSaveImageQueryL(void) const
+	?ComponentControl@CSingleParamControl@@UBEPAVCCoeControl@@H@Z @ 40 NONAME ; class CCoeControl * CSingleParamControl::ComponentControl(int) const
+	?SetView@CImageEditorControlBase@@UAEXPAVCAknView@@@Z @ 41 NONAME ; void CImageEditorControlBase::SetView(class CAknView *)
+	?LaunchMultiLineTextQueryDialogL@SDrawUtils@@SAHAAVTDes16@@ABVTDesC16@@@Z @ 42 NONAME ; int SDrawUtils::LaunchMultiLineTextQueryDialogL(class TDes16 &, class TDesC16 const &)
+	?ActivatePluginL@CImageEditorUIView@@QAEXPAVCCoeControl@@@Z @ 43 NONAME ; void CImageEditorUIView::ActivatePluginL(class CCoeControl *)
+	?CountComponentControls@CSingleParamControl@@UBEHXZ @ 44 NONAME ; int CSingleParamControl::CountComponentControls(void) const
+	?SetIcon@CSingleParamControl@@QAEXPAVCEikImage@@@Z @ 45 NONAME ; void CSingleParamControl::SetIcon(class CEikImage *)
+	?UpdateLayoutL@CImageEditorUIView@@QBEXH@Z @ 46 NONAME ; void CImageEditorUIView::UpdateLayoutL(int) const
+	?MoveSlider@CSingleParamControl@@AAEXH@Z @ 47 NONAME ; void CSingleParamControl::MoveSlider(int)
+	?Draw@CPreviewControlBase@@EBEXABVTRect@@@Z @ 48 NONAME ; void CPreviewControlBase::Draw(class TRect const &) const
+	?SetNaviPaneTextL@CImageEditorUIView@@QAEXABVTDesC16@@HH@Z @ 49 NONAME ; void CImageEditorUIView::SetNaviPaneTextL(class TDesC16 const &, int, int)
+	?HandlePluginCommandL@CImageEditorControlBase@@UAEXH@Z @ 50 NONAME ; void CImageEditorControlBase::HandlePluginCommandL(int)
+	?Busy@CImageEditorControlBase@@UBEHXZ @ 51 NONAME ; int CImageEditorControlBase::Busy(void) const
+	?HandlePointerEventL@CImageEditorControlBase@@MAEXABUTPointerEvent@@@Z @ 52 NONAME ; void CImageEditorControlBase::HandlePointerEventL(struct TPointerEvent const &)
+	?SetSliderStep@CSingleParamControl@@QAEXI@Z @ 53 NONAME ; void CSingleParamControl::SetSliderStep(unsigned int)
+	?LaunchWaitDialog@CImageEditorUIView@@QBEXXZ @ 54 NONAME ; void CImageEditorUIView::LaunchWaitDialog(void) const
+	?GetContextMenuResourceId@CImageEditorControlBase@@UAEHXZ @ 55 NONAME ; int CImageEditorControlBase::GetContextMenuResourceId(void)
+	?DrawPreviewImage@CPreviewControlBase@@UBEXABVTRect@@@Z @ 56 NONAME ; void CPreviewControlBase::DrawPreviewImage(class TRect const &) const
+	?HideWaitDialog@CImageEditorUIView@@QBEXXZ @ 57 NONAME ; void CImageEditorUIView::HideWaitDialog(void) const
+	?PrepareL@CImageEditorControlBase@@UAEXXZ @ 58 NONAME ; void CImageEditorControlBase::PrepareL(void)
+	?LaunchSendQueryL@CImageEditorUIView@@QBEXABVTSendingCapabilities@@AAV?$TBuf@$0BAA@@@@Z @ 59 NONAME ; void CImageEditorUIView::LaunchSendQueryL(class TSendingCapabilities const &, class TBuf<256> &) const
+	?ClearNaviPaneTextL@CImageEditorUIView@@QAEXXZ @ 60 NONAME ; void CImageEditorUIView::ClearNaviPaneTextL(void)
+	?SetSoftKey1L@CImageEditorUIView@@QAEXABVTDesC16@@H@Z @ 61 NONAME ; void CImageEditorUIView::SetSoftKey1L(class TDesC16 const &, int)
+	?SetBusy@CImageEditorUIView@@QAEXXZ @ 62 NONAME ; void CImageEditorUIView::SetBusy(void)
+	?Position@CSingleParamControl@@QBEHXZ @ 63 NONAME ; int CSingleParamControl::Position(void) const
+	?GetContainer@CImageEditorUIView@@QBEPAVCCoeControl@@XZ @ 64 NONAME ; class CCoeControl * CImageEditorUIView::GetContainer(void) const
+	?LaunchSendQueryL@CImageEditorUIView@@QBEXABVTSendingCapabilities@@AAVRFile@@@Z @ 65 NONAME ; void CImageEditorUIView::LaunchSendQueryL(class TSendingCapabilities const &, class RFile &) const
+	?LaunchSaveChangesQueryL@CImageEditorUIView@@QBEHXZ @ 66 NONAME ; int CImageEditorUIView::LaunchSaveChangesQueryL(void) const
+	?SetImageL@CImageEditorControlBase@@UAEXPAVCFbsBitmap@@@Z @ 67 NONAME ; void CImageEditorControlBase::SetImageL(class CFbsBitmap *)
+	?SetSaveFlag@CImageEditorUIView@@QAEXH@Z @ 68 NONAME ; void CImageEditorUIView::SetSaveFlag(int)
+	?SetBusy@CImageEditorControlBase@@UAEXXZ @ 69 NONAME ; void CImageEditorControlBase::SetBusy(void)
+	?SetView@CSingleParamControl@@UAEXPAVCAknView@@@Z @ 70 NONAME ; void CSingleParamControl::SetView(class CAknView *)
+	?HandleStatusPaneSizeChange@CImageEditorUIView@@UAEXXZ @ 71 NONAME ; void CImageEditorUIView::HandleStatusPaneSizeChange(void)
+	?DynInitMenuPaneL@CImageEditorUIView@@UAEXHPAVCEikMenuPane@@@Z @ 72 NONAME ; void CImageEditorUIView::DynInitMenuPaneL(int, class CEikMenuPane *)
+	?SetImageL@CImageEditorControlBase@@UAEXPBVCFbsBitmap@@@Z @ 73 NONAME ; void CImageEditorControlBase::SetImageL(class CFbsBitmap const *)
+	?GetSoftkeyIndexL@CImageEditorControlBase@@UAEHXZ @ 74 NONAME ; int CImageEditorControlBase::GetSoftkeyIndexL(void)
+	?AddPluginUiItemL@CImageEditorUIView@@QAEXPBVCPluginInfo@@@Z @ 75 NONAME ; void CImageEditorUIView::AddPluginUiItemL(class CPluginInfo const *)
+	??1CColorSelectionGrid@@UAE@XZ @ 76 NONAME ; CColorSelectionGrid::~CColorSelectionGrid(void)
+	?SetFullScreen@CImageEditorUIView@@QAEXXZ @ 77 NONAME ; void CImageEditorUIView::SetFullScreen(void)
+	?SetUndoFlag@CImageEditorUIView@@QAEXH@Z @ 78 NONAME ; void CImageEditorUIView::SetUndoFlag(int)
+	??1CSingleParamControl@@UAE@XZ @ 79 NONAME ; CSingleParamControl::~CSingleParamControl(void)
+	?DrawGuide@SDrawUtils@@SAXAAVCGraphicsContext@@ABVTRect@@W4TGuideType@1@ABVTRgb@@@Z @ 80 NONAME ; void SDrawUtils::DrawGuide(class CGraphicsContext &, class TRect const &, enum SDrawUtils::TGuideType, class TRgb const &)
+	?InZoomingState@CImageEditorUIView@@QAEHXZ @ 81 NONAME ; int CImageEditorUIView::InZoomingState(void)
+	?ShowConfirmationNoteL@CImageEditorUIView@@QBEXABVTDesC16@@@Z @ 82 NONAME ; void CImageEditorUIView::ShowConfirmationNoteL(class TDesC16 const &) const
+	?ConstructL@CPreviewControlBase@@UAEXABVTRect@@PAVCCoeControl@@@Z @ 83 NONAME ; void CPreviewControlBase::ConstructL(class TRect const &, class CCoeControl *)
+	??0CColorSelectionGrid@@QAE@XZ @ 84 NONAME ; CColorSelectionGrid::CColorSelectionGrid(void)
+	??0CSingleParamControl@@QAE@XZ @ 85 NONAME ; CSingleParamControl::CSingleParamControl(void)
+	?SetSelectedUiItemL@CSingleParamControl@@UAEXPAVCPluginInfo@@@Z @ 86 NONAME ; void CSingleParamControl::SetSelectedUiItemL(class CPluginInfo *)
+	?ConstructL@CImageEditorUIView@@QAEXXZ @ 87 NONAME ; void CImageEditorUIView::ConstructL(void)
+	?ConstructL@CColorSelectionGrid@@UAEXPBVCCoeControl@@H@Z @ 88 NONAME ; void CColorSelectionGrid::ConstructL(class CCoeControl const *, int)
+	?HandleCommandL@CImageEditorUIView@@UAEXH@Z @ 89 NONAME ; void CImageEditorUIView::HandleCommandL(int)
+	?SetSliderMinimumAndMaximum@CSingleParamControl@@QAEXHH@Z @ 90 NONAME ; void CSingleParamControl::SetSliderMinimumAndMaximum(int, int)
+	?ViewScreenModeCompatible@CImageEditorUIView@@MAEHH@Z @ 91 NONAME ; int CImageEditorUIView::ViewScreenModeCompatible(int)
+	?SizeChanged@CImageEditorControlBase@@MAEXXZ @ 92 NONAME ; void CImageEditorControlBase::SizeChanged(void)
+	?SetImageL@CImageEditorUIView@@QAEXPAVCFbsBitmap@@@Z @ 93 NONAME ; void CImageEditorUIView::SetImageL(class CFbsBitmap *)
+	??0CImageEditorUIView@@QAE@XZ @ 94 NONAME ; CImageEditorUIView::CImageEditorUIView(void)
+	?LaunchTextQueryDialogL@SDrawUtils@@SAHAAVTDes16@@ABVTDesC16@@@Z @ 95 NONAME ; int SDrawUtils::LaunchTextQueryDialogL(class TDes16 &, class TDesC16 const &)
+	?HandleClientRectChange@CImageEditorUIView@@QAEXXZ @ 96 NONAME ; void CImageEditorUIView::HandleClientRectChange(void)
+	??1CImageEditorControlBase@@UAE@XZ @ 97 NONAME ; CImageEditorControlBase::~CImageEditorControlBase(void)
+	?DoActivateL@CImageEditorUIView@@EAEXABVTVwsViewId@@VTUid@@ABVTDesC8@@@Z @ 98 NONAME ; void CImageEditorUIView::DoActivateL(class TVwsViewId const &, class TUid, class TDesC8 const &)
+	??0CMultiLineQueryDialog@@AAE@AAVTDes16@@ABW4TTone@CAknQueryDialog@@@Z @ 99 NONAME ; CMultiLineQueryDialog::CMultiLineQueryDialog(class TDes16 &, enum CAknQueryDialog::TTone const &)
+	?IsDrawPlugin@CImageEditorUIContainer@@QAEXH@Z @ 100 NONAME ; void CImageEditorUIContainer::IsDrawPlugin(int)
+	?OfferKeyEventL@CImageEditorControlBase@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 101 NONAME ; enum TKeyResponse CImageEditorControlBase::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?GetSoftkeyIndexL@CSingleParamControl@@UAEHXZ @ 102 NONAME ; int CSingleParamControl::GetSoftkeyIndexL(void)
+	?LaunchSaveWaitDialogL@CImageEditorUIView@@QBEXPAPAVCAknProgressDialog@@HPAVMProgressDialogCallback@@@Z @ 103 NONAME ; void CImageEditorUIView::LaunchSaveWaitDialogL(class CAknProgressDialog * *, int, class MProgressDialogCallback *) const
+	?SetImageL@CPreviewControlBase@@UAEXPAVCFbsBitmap@@@Z @ 104 NONAME ; void CPreviewControlBase::SetImageL(class CFbsBitmap *)
+	?SetParObserver@CSingleParamControl@@QAEXPAVMSingleParControlObserver@@@Z @ 105 NONAME ; void CSingleParamControl::SetParObserver(class MSingleParControlObserver *)
+	?NewL@CPreviewControlBase@@SAPAV1@ABVTRect@@PAVCCoeControl@@@Z @ 106 NONAME ; class CPreviewControlBase * CPreviewControlBase::NewL(class TRect const &, class CCoeControl *)
+	?HandlePointerEventL@CSingleParamControl@@UAEXABUTPointerEvent@@@Z @ 107 NONAME ; void CSingleParamControl::HandlePointerEventL(struct TPointerEvent const &)
+	?NewL@CMultiLineQueryDialog@@SAPAV1@AAVTDes16@@ABW4TTone@CAknQueryDialog@@@Z @ 108 NONAME ; class CMultiLineQueryDialog * CMultiLineQueryDialog::NewL(class TDes16 &, enum CAknQueryDialog::TTone const &)
+	?DrawFlatRect@SDrawUtils@@SAXAAVCGraphicsContext@@ABVTRect@@ABVTRgb@@22@Z @ 109 NONAME ; void SDrawUtils::DrawFlatRect(class CGraphicsContext &, class TRect const &, class TRgb const &, class TRgb const &, class TRgb const &)
+	?Draw@CImageEditorControlBase@@EBEXABVTRect@@@Z @ 110 NONAME ; void CImageEditorControlBase::Draw(class TRect const &) const
+	?LaunchCancelTextInputQueryL@CImageEditorUIView@@QBEHXZ @ 111 NONAME ; int CImageEditorUIView::LaunchCancelTextInputQueryL(void) const
+	?SetImageL@CPreviewControlBase@@UAEXPBVCFbsBitmap@@@Z @ 112 NONAME ; void CPreviewControlBase::SetImageL(class CFbsBitmap const *)
+	?SetImageFileName@CImageEditorUIView@@QAEXABVTDesC16@@@Z @ 113 NONAME ; void CImageEditorUIView::SetImageFileName(class TDesC16 const &)
+	?ShowInformationNoteL@CImageEditorUIView@@QBEXABVTDesC16@@@Z @ 114 NONAME ; void CImageEditorUIView::ShowInformationNoteL(class TDesC16 const &) const
+	?ConstructL@CImageEditorControlBase@@UAEXABVTRect@@PAVCCoeControl@@@Z @ 115 NONAME ; void CImageEditorControlBase::ConstructL(class TRect const &, class CCoeControl *)
+	?LaunchWaitNoteL@SDrawUtils@@SAXPAPAVCAknWaitDialog@@HABVTDesC16@@PAVMProgressDialogCallback@@@Z @ 116 NONAME ; void SDrawUtils::LaunchWaitNoteL(class CAknWaitDialog * *, int, class TDesC16 const &, class MProgressDialogCallback *)
+	?SetSelectedUiItemL@CImageEditorControlBase@@UAEXPAVCPluginInfo@@@Z @ 117 NONAME ; void CImageEditorControlBase::SetSelectedUiItemL(class CPluginInfo *)
+	?SetSendAppUi@CImageEditorUIView@@QAEXPAVCSendUi@@@Z @ 118 NONAME ; void CImageEditorUIView::SetSendAppUi(class CSendUi *)
+	?SetZoomModeL@CImageEditorUIView@@QAEXABW4TZoomMode@@@Z @ 119 NONAME ; void CImageEditorUIView::SetZoomModeL(enum TZoomMode const &)
+	?SetCustomButtonsL@CImageEditorUIView@@QBEXH@Z @ 120 NONAME ; void CImageEditorUIView::SetCustomButtonsL(int) const
+	?SetSliderStepAmount@CSingleParamControl@@QAEXE@Z @ 121 NONAME ; void CSingleParamControl::SetSliderStepAmount(unsigned char)
+	?GetIndicatorBitmapL@SDrawUtils@@SAHAAPAVCFbsBitmap@@0HH@Z @ 122 NONAME ; int SDrawUtils::GetIndicatorBitmapL(class CFbsBitmap * &, class CFbsBitmap * &, int, int)
+	?ActivateMainViewL@CImageEditorUIView@@QAEXXZ @ 123 NONAME ; void CImageEditorUIView::ActivateMainViewL(void)
+	?GetSelectedPluginInfoL@CImageEditorUIView@@QAEPAVCPluginInfo@@XZ @ 124 NONAME ; class CPluginInfo * CImageEditorUIView::GetSelectedPluginInfoL(void)
+	?LaunchQueryDialogOkOnlyL@SDrawUtils@@SAHABVTDesC16@@@Z @ 125 NONAME ; int SDrawUtils::LaunchQueryDialogOkOnlyL(class TDesC16 const &)
+	?SizeChanged@CColorSelectionGrid@@MAEXXZ @ 126 NONAME ; void CColorSelectionGrid::SizeChanged(void)
+	?ConstructL@CSingleParamControl@@UAEXABVTRect@@PAVCCoeControl@@H@Z @ 127 NONAME ; void CSingleParamControl::ConstructL(class TRect const &, class CCoeControl *, int)
+	?ShowToolTip@SDrawUtils@@SAXPAVCAknInfoPopupNoteController@@PAVCCoeControl@@VTRect@@ABVTDesC16@@@Z @ 128 NONAME ; void SDrawUtils::ShowToolTip(class CAknInfoPopupNoteController *, class CCoeControl *, class TRect, class TDesC16 const &)
+
--- a/imageeditor/ImageEditorUI/group/ImageEditorUI.mmp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/ImageEditorUI/group/ImageEditorUI.mmp	Thu Jun 03 18:57:10 2010 +0800
@@ -69,7 +69,6 @@
 SOURCE				ImageEditorUIView.cpp
 SOURCE				ImageEditorUIContainer.cpp
 SOURCE				ImageEditorControlBase.cpp
-SOURCE				PreviewControlBase.cpp
 SOURCE				SingleParamControl.cpp
 SOURCE				ColorSelectionGrid.cpp
 SOURCE				DrawUtils.cpp
@@ -77,7 +76,7 @@
 SOURCE				WaitIndicator.cpp
 SOURCE				TControlItem.cpp
 SOURCE				ColorSelectionPopup.cpp 
-SOURCE				CMultiLineQueryDialog.cpp
+SOURCE				CMultiLineQueryDialog.cpp PreviewControlBase.cpp
 
 USERINCLUDE			.
 USERINCLUDE			../inc
--- a/imageeditor/ImageEditorUI/inc/ImageEditorUIContainer.h	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/ImageEditorUI/inc/ImageEditorUIContainer.h	Thu Jun 03 18:57:10 2010 +0800
@@ -54,11 +54,17 @@
 /** @name Methods:*/
 //@{
 
+	/*	IsDrawPlugin
+	*
+	*	Judge if it is draw plug-in.
+	*   @return - 
+	*/
+	IMPORT_C void IsDrawPlugin(TBool aFlag);
 	/*	Second phase constructor
 	*
 	*   @param aRect - frame rectangle for container
 	*   @return
-	*/
+	*/		
     void ConstructL (const TRect & aRect);
 
 	/*	Destructor
@@ -116,8 +122,7 @@
     *   @param aKeyEvent - the key event
     *   @return -
     */
-    virtual void CImageEditorUIContainer::HandlePointerEventL( 
-                                        const TPointerEvent &aPointerEvent );
+    virtual void CImageEditorUIContainer::HandlePointerEventL(const TPointerEvent &aPointerEvent);
     
 	/*	CountComponentControls
 	*
@@ -246,11 +251,6 @@
 	*/
 	virtual TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
 
-
-//@}
-
-/** @name Members:*/
-//@{
 //@}
 
 private:
@@ -308,6 +308,8 @@
     TInt                        iXDirChange;
     TInt                        iYDirChange;
     
+    //for draw plguin
+    TBool iIsDrawPlugin;
     // Wait indicator (own)
     CWaitIndicator* iWaitIndicator;
     
--- a/imageeditor/ImageEditorUI/src/ColorSelectionPopup.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/ImageEditorUI/src/ColorSelectionPopup.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -264,8 +264,6 @@
     
     CWindowGc& gc = SystemGc();
     
-    CPreviewControlBase::DrawPreviewImage (Rect());
-    
     // Change brush to null to enable transparent drawing
     gc.SetBrushStyle (CGraphicsContext::ENullBrush);
                 
@@ -904,7 +902,6 @@
     {    
     if( AknLayoutUtils::PenEnabled() )
 	    {
-        TBool draw( EFalse );
         switch( aPointerEvent.iType )
 			{
 			case TPointerEvent::EButton1Down:
@@ -920,7 +917,6 @@
 	                	}
 #endif /* RD_TACTILE_FEEDBACK  */			        	        
 			        iPopup->HandlePointerEventL( aPointerEvent );			        
-			        draw = ETrue;
 			        }    		        
 				break;
 				}
@@ -936,7 +932,6 @@
 	                	}
 #endif /* RD_TACTILE_FEEDBACK  */
 			        iPopup->HandlePointerEventL( aPointerEvent );
-			        draw = ETrue;
 			        }
 				break;		
 				}
@@ -954,11 +949,6 @@
 				break;	
 				}	
 			}
-			
-	    if ( draw )
-	        {
-		    DrawDeferred();    
-	        }	
         }
     }
     
--- a/imageeditor/ImageEditorUI/src/ImageEditorUIContainer.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/ImageEditorUI/src/ImageEditorUIContainer.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -67,6 +67,12 @@
 	ActivateL();
 	}
 
+//judge if it is draw plug-in
+EXPORT_C void CImageEditorUIContainer::IsDrawPlugin(TBool aFlag)
+	{
+	iIsDrawPlugin = aFlag;
+	}
+
 //=============================================================================
 CImageEditorUIContainer::~CImageEditorUIContainer()
 	{
@@ -95,7 +101,10 @@
 	if (iControl)
 		{
 		((CImageEditorControlBase *)iControl)->SetView(iEditorView);
-		iControl->SetRect(Rect() );
+		if(!iIsDrawPlugin)
+			{
+			iControl->SetRect(Rect() );
+			}		
 		}
 	DrawDeferred();
 	}
@@ -111,8 +120,7 @@
 	}
 
 //=============================================================================
-TKeyResponse CImageEditorUIContainer::OfferKeyEventL(
-		const TKeyEvent & aKeyEvent, TEventCode aType)
+TKeyResponse CImageEditorUIContainer::OfferKeyEventL(const TKeyEvent & aKeyEvent, TEventCode aType)
 	{
 	if (Busy() )
 		{
@@ -123,8 +131,7 @@
 		TKeyResponse res = EKeyWasNotConsumed;
 		if (iControl)
 			{
-			res = ((CCoeControl*)iControl)->OfferKeyEventL(aKeyEvent,
-					aType);
+			res = ((CCoeControl*)iControl)->OfferKeyEventL(aKeyEvent,aType);
 			}
 		return res;
 		}
@@ -147,8 +154,7 @@
 	}
 
 //=============================================================================
-void CImageEditorUIContainer::HandlePointerEventL(
-		const TPointerEvent &aPointerEvent)
+void CImageEditorUIContainer::HandlePointerEventL(const TPointerEvent &aPointerEvent)
 	{
 	if (Busy() )
 		{
@@ -162,12 +168,10 @@
 			}
 		else
 			{
-
 			switch (aPointerEvent.iType)
 				{
 				case TPointerEvent::EButton1Down:
-					{
-					
+					{					
 #ifdef RD_TACTILE_FEEDBACK
 						if ( iTouchFeedBack )
 							{
@@ -175,8 +179,7 @@
 							RDebug::Printf( "ImageEditor::ImageEditorUIContainer: ETouchFeedback" );
 							}
 #endif /* RD_TACTILE_FEEDBACK  */
-						
-					if ( !iEditorView->InZoomingState() )
+						if ( !iEditorView->InZoomingState() )
 						{
 						iEditorView->HandleCommandL(EImageEditorMenuCmdApplyEffect);
 						}
@@ -188,21 +191,17 @@
 					}
 				case TPointerEvent::EDrag:
 					{
-					iXDirChange = iTappedPosition.iX
-							- aPointerEvent.iPosition.iX;
-					iYDirChange = iTappedPosition.iY
-							- aPointerEvent.iPosition.iY;
+					iXDirChange = iTappedPosition.iX - aPointerEvent.iPosition.iX;
+					iYDirChange = iTappedPosition.iY - aPointerEvent.iPosition.iY;
 
 					// Compare total change in pixels (absolute value) to 
 					// threshold value. This is to prevent calling engine's 
 					// Pan-function in every minimal movement                                                         
-					if ( (Abs(iXDirChange) + Abs(iYDirChange) )
-							> KTouchPanTotalMoveThreshold)
+					if ( (Abs(iXDirChange) + Abs(iYDirChange) )	> KTouchPanTotalMoveThreshold )
 						{
 						iTappedPosition = aPointerEvent.iPosition;
 						iEditorView->HandleCommandL(EImageEditorCmdTouchPan);
 						}
-
 					break;
 					}
 				case TPointerEvent::EButton1Up:
@@ -216,11 +215,8 @@
 					break;
 					}
 				}
-
 			}
-
 		}
-
 	}
 
 //=============================================================================
@@ -314,17 +310,14 @@
 			MAknsControlContext* cc = AknsDrawUtils::ControlContext( this);
 			AknsDrawUtils::DrawBackground(skin, cc, this, gc, TPoint(0, 0),
 					Rect(), KAknsDrawParamDefault);
-
 			}
 		}
-
 	iWaitIndicator->DrawItem(gc);
 	}
 
 //=============================================================================
 void CImageEditorUIContainer::HandleControlEventL(CCoeControl * /*aControl*/,
-		TCoeEvent /*aEventType*/
-)
+		TCoeEvent /*aEventType*/)
 	{
 
 	}
--- a/imageeditor/ImageEditorUI/src/ImageEditorUIView.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/ImageEditorUI/src/ImageEditorUIView.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -1,29 +1,25 @@
 /*
-* Copyright (c) 2010 Ixonos Plc.
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - Initial contribution
-*
-* Contributors:
-* Ixonos Plc
-*
-* Description: 
-* Image Editor's view class that handles all view related issues.
-*
-*/
-
-
-
+ * Copyright (c) 2010 Ixonos Plc.
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - Initial contribution
+ *
+ * Contributors:
+ * Ixonos Plc
+ *
+ * Description: 
+ * Image Editor's view class that handles all view related issues.
+ *
+ */
 // INCLUDE FILES
 #include <eikmenub.h>
 #include <eikbtgpc.h>
 #include <bautils.h>
-
 #include <avkon.hrh>
 #include <aknviewappui.h>
 #include <aknconsts.h>
@@ -36,36 +32,30 @@
 #include <CMessageData.h>
 #include <AknInfoPopupNoteController.h>
 #include <Avkon.rsg>
-
 #include <apgcli.h>
 #include <apadef.h>
 #include <apaid.h>
 #include <StringLoader.h>
 #include <pathinfo.h> 
-
 #include <ImageEditorUI.rsg>
 #include "ImageEditorUI.hrh"
 #include "ImageEditorUIPanics.h"
 #include "ImageEditorUIView.h"
 #include "ImageEditorUIContainer.h" 
 #include "ImageEditorUtils.h"
-
 #include "DrawUtils.h" 
 #include "PluginInfo.h" 
 #include "ResolutionUtil.h"
-
 #include "ImageEditorControlBase.h" 
 #include "SingleParamControl.h" 
 #include "imageeditordebugutils.h"
 #include "plugingrid.h"	
-//#include "platform_security_literals.hrh"
-
+#include "text.rsg"
 #ifdef AIW_PRINT_PROVIDER_USED
 #include <AiwServiceHandler.h>
 #include <AiwMenu.h>
 #include <AiwCommon.hrh>
 #endif
-
 // CONSTANTS
 _LIT (KResourceDir, "\\resource\\apps\\");
 _LIT (KResourceFile, "imageeditorui.rsc");
@@ -80,1436 +70,1384 @@
 #define LANDSCAPE_ARG(x)
 #endif
 
-
 //=============================================================================
 EXPORT_C void CImageEditorUIView::ConstructL()
-{
-    LOG(KImageEditorLogFile, "CImageEditorUIView::ConstructL()");
+	{
+	LOG(KImageEditorLogFile, "CImageEditorUIView::ConstructL()");
 
-    //	Read resource	
+	//	Read resource	
 	TFileName resourcefile;
 	resourcefile.Append(KResourceDir);
 	resourcefile.Append(KResourceFile);
 
-    User::LeaveIfError( CompleteWithAppPath( resourcefile ) );
-    // Implementation of RConeResourceLoader uses BaflUtils::NearestLanguageFile 
-    // to search for a localised resource in proper search order
-    iResLoader.OpenL ( resourcefile );
-    
-    //	Construct base view
-    BaseConstructL (R_IMAGEEDITORUI_VIEW);
+	User::LeaveIfError(CompleteWithAppPath(resourcefile));
+	// Implementation of RConeResourceLoader uses BaflUtils::NearestLanguageFile 
+	// to search for a localised resource in proper search order
+	iResLoader.OpenL(resourcefile);
+
+	//	Construct base view
+	BaseConstructL(R_IMAGEEDITORUI_VIEW);
 
-    //  Get reference to status pane 
-    CEikStatusPane * sp = AppUi()->StatusPane();
+	//  Get reference to status pane 
+	CEikStatusPane * sp = AppUi()->StatusPane();
 
-    //  Get reference to navi pane
-    iNaviPane = 
-        (CAknNavigationControlContainer *) sp->ControlL (TUid::Uid (EEikStatusPaneUidNavi));
+	//  Get reference to navi pane
+	iNaviPane = (CAknNavigationControlContainer *) sp->ControlL(TUid::Uid(
+			EEikStatusPaneUidNavi));
 
-    //  Get reference to title pane
-    iTitlePane = 
-        (CAknTitlePane *) sp->ControlL (TUid::Uid (EEikStatusPaneUidTitle));
+	//  Get reference to title pane
+	iTitlePane = (CAknTitlePane *) sp->ControlL(TUid::Uid(
+			EEikStatusPaneUidTitle));
 
 	// Initialize soft key ID:s (needs to be changed if cba resource in 
 	// R_IMAGEEDITORUI_VIEW changes)
 	iSoftkey1 = EAknSoftkeyEmpty;
 	iSoftkey2 = EAknSoftkeyEmpty;
 	iMSK = EAknSoftkeyEmpty;
-	
-    iInPlugin = EFalse;
-        
-    iPopupController = CAknInfoPopupNoteController::NewL();
-    
+
+	iInPlugin = EFalse;
+
+	iPopupController = CAknInfoPopupNoteController::NewL();
+
 	// Read strings needed for zoom popup
-    HBufC8 * res8 = CEikonEnv::Static()->AllocReadResourceAsDes8LC ( R_ZOOM_TEXTS );
-    TResourceReader resource;
-    //Set resource reader buffer
-    resource.SetBuffer( res8 );
+	HBufC8 * res8 =	CEikonEnv::Static()->AllocReadResourceAsDes8LC(R_ZOOM_TEXTS);
+	TResourceReader resource;
+	//Set resource reader buffer
+	resource.SetBuffer(res8);
+
+	//Read zoom text count
+	TInt16 arraycount = (TInt16) resource.ReadInt16();
+
+	// There have to be as many zoom texts as there are zoom states
+	__ASSERT_ALWAYS( arraycount == ENumOfZooms, User::Panic(KComponentName,
+					EImageEditorPanicZoomTextCountDoesntMatch) );
 
-    //Read zoom text count
-    TInt16 arraycount = ( TInt16 )resource.ReadInt16();
-    
-    // There have to be as many zoom texts as there are zoom states
-    __ASSERT_ALWAYS( arraycount == ENumOfZooms, User::Panic(KComponentName, 
-                                    EImageEditorPanicZoomTextCountDoesntMatch) );
-    
-    if ( arraycount > 0 )
-        {
-        //Construct a new descriptor array
-        if ( !iZoomTexts )
-            {
-            iZoomTexts = new ( ELeave ) CDesCArraySeg( 16 );
-            }
+	if (arraycount > 0)
+		{
+		//Construct a new descriptor array
+		if (!iZoomTexts)
+			{
+			iZoomTexts = new (ELeave) CDesCArraySeg(16);
+			}
 
-        //Read text to array
-        for ( TInt i = 0; i < arraycount; ++i )
-            {
-            //Construct a flat descriptor array and read all the texts
-            HBufC * parameter = resource.ReadHBufCL();
-            CleanupStack::PushL( parameter );
-            TPtrC ptr = parameter->Des();
-            iZoomTexts->AppendL ( ptr );
-            CleanupStack::PopAndDestroy(); // parameter
-            }
-        }
-    CleanupStack::PopAndDestroy (); // res8
+		//Read text to array
+		for (TInt i = 0; i < arraycount; ++i)
+			{
+			//Construct a flat descriptor array and read all the texts
+			HBufC * parameter = resource.ReadHBufCL();
+			CleanupStack::PushL(parameter);
+			TPtrC ptr = parameter->Des();
+			iZoomTexts->AppendL(ptr);
+			CleanupStack::PopAndDestroy(); // parameter
+			}
+		}
+	CleanupStack::PopAndDestroy(); // res8
 
 
 #ifdef AIW_PRINT_PROVIDER_USED
-    iServiceHandler = CAiwServiceHandler::NewL();
+	iServiceHandler = CAiwServiceHandler::NewL();
 	// Attach menu services.
-	iServiceHandler->AttachMenuL(R_IMAGEEDITORUI_MENUPANE, R_IMAGE_EDITOR_INTEREST);
+	iServiceHandler->AttachMenuL(R_IMAGEEDITORUI_MENUPANE,
+			R_IMAGE_EDITOR_INTEREST);
 #endif   
-    LOG(KImageEditorLogFile, "CImageEditorUIView: Constructred succesfully");
-}
+	LOG(KImageEditorLogFile, "CImageEditorUIView: Constructred succesfully");
+	}
 
 //=============================================================================
 EXPORT_C CImageEditorUIView::CImageEditorUIView() :
-CAknView (),
-iResLoader ( *iEikonEnv ), 
-iBusy(ETrue),
-iContainerInStack(EFalse)
-{
-
-}
+	CAknView(), iResLoader(*iEikonEnv), iBusy(ETrue), iContainerInStack(EFalse)
+	{
+	}
 
 //=============================================================================
 EXPORT_C CImageEditorUIView::~CImageEditorUIView()
-{
+	{
 	LOG(KImageEditorLogFile, "CImageEditorUIView::~CImageEditorUIView()");
 
 	iResLoader.Close();
 
 #ifdef AIW_PRINT_PROVIDER_USED
-    delete iServiceHandler;
+	delete iServiceHandler;
 #endif
 
-    if (iNaviPane && iNaviDecorator)
-    {
-        iNaviPane->Pop (iNaviDecorator);
-        delete iNaviDecorator;
-        iNaviDecorator = 0;
-    }
-    iNaviDecorator = 0;
-	
-	if ( iNaviPane && iPreviousNaviDecorator )
-    {
-        iNaviPane->Pop ( iPreviousNaviDecorator );
-        delete iPreviousNaviDecorator;
-        iPreviousNaviDecorator = 0;
-    }
-    iPreviousNaviDecorator = 0;
-    
+	if (iNaviPane && iNaviDecorator)
+		{
+		iNaviPane->Pop(iNaviDecorator);
+		delete iNaviDecorator;
+		iNaviDecorator = 0;
+		}
+	iNaviDecorator = 0;
+
+	if (iNaviPane && iPreviousNaviDecorator)
+		{
+		iNaviPane->Pop(iPreviousNaviDecorator);
+		delete iPreviousNaviDecorator;
+		iPreviousNaviDecorator = 0;
+		}
+	iPreviousNaviDecorator = 0;
+
 	RemoveContainerFromStack();
-    if ( iContainer )
-	{
-        delete iContainer;
-        iContainer = 0;
-    }
-     
-    iArray.Reset();
+	if (iContainer)
+		{
+		delete iContainer;
+		iContainer = 0;
+		}
+
+	iArray.Reset();
+
+	iNaviPane = NULL;
+	iTitlePane = NULL;
+	iControl = NULL;
+	iPreview = NULL;
+	iSendAppUi = NULL;
 
-    iNaviPane = NULL;
-    iTitlePane = NULL;
-    iControl = NULL;
-    iPreview = NULL;
-    iSendAppUi = NULL;
-    
-    if ( iPopupController )
-        {
-        delete iPopupController;    
-        }
-        
-    if ( iZoomTexts )
-        {
-        iZoomTexts->Reset();  
-        delete iZoomTexts;
-        }
-	
+	if (iPopupController)
+		{
+		delete iPopupController;
+		}
+
+	if (iZoomTexts)
+		{
+		iZoomTexts->Reset();
+		delete iZoomTexts;
+		}
+
 	LOG(KImageEditorLogFile, "CImageEditorUIView: View deleted");
-}
+	}
 
 //=============================================================================
 EXPORT_C TUid CImageEditorUIView::Id() const
-{
-    return KViewId;
-}
+	{
+	return KViewId;
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::UpdateLayoutL ( TInt LANDSCAPE_ARG(aScreenMode) ) const
-    {
-    CEikStatusPane* sp = StatusPane();
-    __ASSERT_ALWAYS( sp, User::Panic(KComponentName, EImageEditorPanicStatusPaneNotAccessible) );
+EXPORT_C void CImageEditorUIView::UpdateLayoutL(TInt LANDSCAPE_ARG(aScreenMode)) const
+	{
+	CEikStatusPane* sp = StatusPane();
+	__ASSERT_ALWAYS( sp, User::Panic(KComponentName, EImageEditorPanicStatusPaneNotAccessible) );
 
 #ifdef LANDSCAPE_SUPPORT
 
-    TPixelsAndRotation rotation;
-    iEikonEnv->ScreenDevice()->GetScreenModeSizeAndRotation(aScreenMode, rotation);
+	TPixelsAndRotation rotation;
+	iEikonEnv->ScreenDevice()->GetScreenModeSizeAndRotation(aScreenMode,rotation);
 
 	LOGFMT2(KImageEditorLogFile, "CImageEditorUIView: View mode: ScreenMode: %d, Rotation: %d", aScreenMode, rotation.iRotation);
 
-    switch (rotation.iRotation)
-    {
-    case CFbsBitGc::EGraphicsOrientationRotated270: // view mode
-        {
-		LOG(KImageEditorLogFile, "CImageEditorUIView: EGraphicsOrientationRotated270");
+	switch (rotation.iRotation)
+		{
+		case CFbsBitGc::EGraphicsOrientationRotated270: // view mode
+			{
+			LOG(KImageEditorLogFile, "CImageEditorUIView: EGraphicsOrientationRotated270");
 
 #ifndef SWAP_SOFTKEY_POSITIONS		
-		sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_RIGHT);
+			sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_RIGHT);
 #else								
-		sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_LEFT);
+			sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_LEFT);
 #endif
-        break;
-        }
+			break;
+			}
 
-    case CFbsBitGc::EGraphicsOrientationRotated90: // camcorder mode
-        {
-		LOG(KImageEditorLogFile, "CImageEditorUIView: EGraphicsOrientationRotated90");
+		case CFbsBitGc::EGraphicsOrientationRotated90: // camcorder mode
+			{
+			LOG(KImageEditorLogFile, "CImageEditorUIView: EGraphicsOrientationRotated90");
 
 #ifndef SWAP_SOFTKEY_POSITIONS		
-		sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_LEFT);
+			sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_LEFT);
 #else						
-		sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_RIGHT);
+			sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_RIGHT);
 #endif
-        break;
-        }
+			break;
+			}
 
-    case CFbsBitGc::EGraphicsOrientationNormal:
-    default:
-        {
-        if( CResolutionUtil::Self()->GetLandscape() )
-            {
-            sp->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL /*R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT*/ );
-            }
-        else
-            {
-            sp->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL );
-            }            
-        break;
-        }
-    }
+		case CFbsBitGc::EGraphicsOrientationNormal:
+		default:
+			{
+			if (CResolutionUtil::Self()->GetLandscape())
+				{
+				sp->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL /*R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT*/);
+				}
+			else
+				{
+				sp->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
+				}
+			break;
+			}
+		}
 
 #endif  
 
-    if (iFullScreen)
-        {
-        //  Hide status pane
-        sp->MakeVisible (EFalse);
-        }
-    else
-        {
-        //  Make status pane visible
-        sp->MakeVisible (ETrue);
+	if (iFullScreen)
+		{
+		//  Hide status pane
+		sp->MakeVisible(EFalse);
+		}
+	else
+		{
+		//  Make status pane visible
+		sp->MakeVisible(ETrue);
 
 #ifdef LANDSCAPE_SUPPORT
 
-        // And now the CBA...
-	    TRect rect = ClientRect();
+		// And now the CBA...
+		TRect rect = ClientRect();
 
-        CEikButtonGroupContainer* cba = Cba();
-        __ASSERT_ALWAYS( cba, User::Panic(KComponentName, EImageEditorPanicCbaNotAccessible) );
+		CEikButtonGroupContainer* cba = Cba();
+		__ASSERT_ALWAYS( cba, User::Panic(KComponentName, EImageEditorPanicCbaNotAccessible) );
 
-	    MEikButtonGroup* bgrp = cba->ButtonGroup();
-	    STATIC_CAST( CEikCba*, bgrp)->SetBoundingRect(rect);
-	    cba->HandleResourceChange(KEikDynamicLayoutVariantSwitch);
+		MEikButtonGroup* bgrp = cba->ButtonGroup();
+		STATIC_CAST( CEikCba*, bgrp)->SetBoundingRect(rect);
+		cba->HandleResourceChange(KEikDynamicLayoutVariantSwitch);
 
 #endif
-        }
-
-    }
+		}
+	}
 
 //=============================================================================
 EXPORT_C TBool CImageEditorUIView::ViewScreenModeCompatible(TInt /*aScreenMode*/)
-    {
-    // Supports any screen size
-    return ETrue;
-    }
-
+	{
+	// Supports any screen size
+	return ETrue;
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::HandleCommandL (TInt aCommand)
-{   
+EXPORT_C void CImageEditorUIView::HandleCommandL(TInt aCommand)
+	{
 
-    // If focus is gained or lost
-    if ( (aCommand == EImageEditorFocusGained) || (aCommand == EImageEditorFocusLost) )
-    {
-    	if (iContainer && iControl)
-    	{
-          	((CImageEditorControlBase *)iControl)->HandlePluginCommandL (aCommand);
+	// If focus is gained or lost
+	if ((aCommand == EImageEditorFocusGained) || (aCommand
+			== EImageEditorFocusLost))
+		{
+		if (iContainer && iControl)
+			{
+			((CImageEditorControlBase *) iControl)->HandlePluginCommandL(aCommand);
+			}
 		}
-    }
-  	//  If soft key 1 pressed
-   	else if ( iInPlugin &&  (aCommand == iSoftkey1) && (aCommand != EAknSoftkeyOptions) )
-   	{
-    	if ( iContainer && iContainer->Busy() )
-    	{
+	//  If soft key 1 pressed
+	else if (iInPlugin && (aCommand == iSoftkey1) && (aCommand
+			!= EAknSoftkeyOptions))
+		{
+		if (iContainer && iContainer->Busy())
+			{
 			return;
-		}
-        else
-    	{
-       	((CImageEditorControlBase *)iControl)->HandlePluginCommandL (aCommand);
-		}
-   	}
-
-   	//  If soft key 2 pressed
-   	else if ( iInPlugin && (aCommand == iSoftkey2)  )
-   	{
-    	if ( iContainer && iContainer->Busy() )
-    	{
-			return;
+			}
+		else
+			{
+			((CImageEditorControlBase *) iControl)->HandlePluginCommandL(aCommand);
+			}
 		}
-        else
-    	{
-            ((CImageEditorControlBase *)iControl)->HandlePluginCommandL (aCommand);
-		}
-   	}
-   	
-   	//  If msk pressed
-   	else if ( iInPlugin && (aCommand == iMSK)  )
-   	{
-    	if ( iContainer && iContainer->Busy() )
-    	{
+
+	//  If soft key 2 pressed
+	else if (iInPlugin && (aCommand == iSoftkey2))
+		{
+		if (iContainer && iContainer->Busy())
+			{
 			return;
-		}
-        else
-    	{
-            ((CImageEditorControlBase *)iControl)->HandlePluginCommandL (aCommand);
+			}
+		else
+			{
+			((CImageEditorControlBase *) iControl)->HandlePluginCommandL(
+					aCommand);
+			}
 		}
-   	}
-   	
-    //  Menu plug-in item selected
-    else if ( iInPlugin && MenuItemPressedL(aCommand) )
-    {
-        ((CImageEditorControlBase *)iControl)->HandlePluginCommandL (aCommand);
-    }
+
+	//  If msk pressed
+	else if (iInPlugin && (aCommand == iMSK))
+		{
+		if (iContainer && iContainer->Busy())
+			{
+			return;
+			}
+		else
+			{
+			((CImageEditorControlBase *) iControl)->HandlePluginCommandL(aCommand);
+			}
+		}
 
-    else
-    {
-        switch (aCommand)
-        {
-            case EImageEditorPreGlobalZoomChange:
-            case EImageEditorGlobalZoomChanged:
-            case EImageEditorGlobalCropChanged:
-            case EImageEditorPreGlobalPanChange:
-            case EImageEditorGlobalPanChanged:
-            case EImageEditorGlobalRotationChanged:
+	//  Menu plug-in item selected
+	else if (iInPlugin && MenuItemPressedL(aCommand))
+		{
+		((CImageEditorControlBase *) iControl)->HandlePluginCommandL(aCommand);
+		}
+
+	else
+		{
+		switch (aCommand)
+			{
+			case EImageEditorPreGlobalZoomChange:
+			case EImageEditorGlobalZoomChanged:
+			case EImageEditorGlobalCropChanged:
+			case EImageEditorPreGlobalPanChange:
+			case EImageEditorGlobalPanChanged:
+			case EImageEditorGlobalRotationChanged:
 			case EImageEditorPreScreenModeChange:
 			case EImageEditorPostScreenModeChange:
-			{
-                if (iInPlugin)
-                {
-					((CImageEditorControlBase *)iControl)->HandlePluginCommandL (aCommand);
-				}
-				return;
-			}
-
-            case EAknSoftkeyBack:
-            {
-   			if ( iContainer && iContainer->Busy() )
-    			{
+				{
+				if (iInPlugin)
+					{
+					((CImageEditorControlBase *) iControl)->HandlePluginCommandL(aCommand);
+					}
 				return;
 				}
-        	else
-    			{
-                AppUi()->HandleCommandL (EImageEditorSoftkeyCmdBack);
-                break;
-				}				
-            }
-            case EImageEditorUpdateSoftkeys:
-            {
-                if (iInPlugin)
-                {
-                    UpdateSoftkeysL();
-                }
-                break;
-            }
-            case EImageEditorUpdateNavipane:
-            {
-                if (iInPlugin)
-                {
-                    UpdateNaviPaneL();
-                }
-                break;
-            }
-            case EImageEditorTryDisplayMenuBar:
-            {
-                CEikMenuBar* menu = MenuBar();
-                __ASSERT_ALWAYS( menu, User::Panic(KComponentName, EImageEditorPanicMenuNotAccessible) );
-                menu->TryDisplayMenuBarL();
-                break;
-            }
-            case EImageEditorDoPrint:
-            {
+			case EAknSoftkeyBack:
+				{
+				if (iContainer && iContainer->Busy())
+					{
+					return;
+					}
+				else
+					{
+					AppUi()->HandleCommandL(EImageEditorSoftkeyCmdBack);
+					break;
+					}
+				}
+			case EImageEditorUpdateSoftkeys:
+				{
+				if (iInPlugin)
+					{
+					UpdateSoftkeysL();
+					}
+				break;
+				}
+			case EImageEditorUpdateNavipane:
+				{
+				if (iInPlugin)
+					{
+					UpdateNaviPaneL();
+					}
+				break;
+				}
+			case EImageEditorTryDisplayMenuBar:
+				{
+				CEikMenuBar* menu = MenuBar();
+				__ASSERT_ALWAYS( menu, User::Panic(KComponentName, EImageEditorPanicMenuNotAccessible) );
+				menu->TryDisplayMenuBarL();
+				break;
+				}
+			case EImageEditorDoPrint:
+				{
 #ifdef AIW_PRINT_PROVIDER_USED
 
-                CAiwGenericParamList& in = iServiceHandler->InParamListL();
+				CAiwGenericParamList& in = iServiceHandler->InParamListL();
 
-		        TFileName filename(iImageFileName);
-		        TAiwVariant variant(filename);
-		        TAiwGenericParam param(EGenericParamFile, variant);
-            
-		        in.AppendL(param);	
+				TFileName filename(iImageFileName);
+				TAiwVariant variant(filename);
+				TAiwGenericParam param(EGenericParamFile, variant);
 
-                iServiceHandler->ExecuteMenuCmdL(
-                    iSelectedPrintMenuCmd, 
-                    in, 
-                    iServiceHandler->OutParamListL()
-                    );
+				in.AppendL(param);
+
+				iServiceHandler->ExecuteMenuCmdL(iSelectedPrintMenuCmd, in,
+						iServiceHandler->OutParamListL());
 #endif       
-                break;
-            }
-            default:
-            {
-                // Print and save
-                if (aCommand >= EImageEditorMenuAiwPrintBase &&
-                    aCommand <= EImageEditorMenuAiwPrintLast)
-                    {
-                    iSelectedPrintMenuCmd = aCommand;
-                    AppUi()->HandleCommandL (EImageEditorSaveAndPrint);
-                    }
-                else
-                    {
-                    AppUi()->HandleCommandL (aCommand);
-                    }
-                break;
-            }
-        }
-    }
-}
+				break;
+				}
+			default:
+				{
+				// Print and save
+				if (aCommand >= EImageEditorMenuAiwPrintBase && aCommand
+						<= EImageEditorMenuAiwPrintLast)
+					{
+					iSelectedPrintMenuCmd = aCommand;
+					AppUi()->HandleCommandL(EImageEditorSaveAndPrint);
+					}
+				else
+					{
+					AppUi()->HandleCommandL(aCommand);
+					}
+				break;
+				}
+			}
+		}
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::HandleClientRectChange()
-{
-    LOG(KImageEditorLogFile, "CImageEditorUIView: Client rect changed");
+	{
+	LOG(KImageEditorLogFile, "CImageEditorUIView: Client rect changed");
 
-    if (iContainer)
-    {
-        iContainer->SetRect ( ClientRect() );
-    }
-}
+	if (iContainer)
+		{
+		iContainer->SetRect(ClientRect());
+		}
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::SetImageL (CFbsBitmap * aBitmap)
-{
-    iPreview = aBitmap;
-    if (iContainer)
-    {
-	    iContainer->SetImageL (aBitmap);
-    }
-}
+EXPORT_C void CImageEditorUIView::SetImageL(CFbsBitmap * aBitmap)
+	{
+	iPreview = aBitmap;
+	if (iContainer)
+		{
+		iContainer->SetImageL(aBitmap);
+		}
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::SetImageFileName (const TDesC& aFileName)
-{
-    iImageFileName.Copy(aFileName);
-}
-
-
+EXPORT_C void CImageEditorUIView::SetImageFileName(const TDesC& aFileName)
+	{
+	iImageFileName.Copy(aFileName);
+	}
 
 //=============================================================================
-EXPORT_C CCoeControl * CImageEditorUIView::GetContainer () const
-{
+EXPORT_C CCoeControl * CImageEditorUIView::GetContainer() const
+	{
 	return iContainer;
-}
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::ActivatePluginL (CCoeControl * aControl)
-{
-    LOG(KImageEditorLogFile, "CImageEditorUIView: Activating plugin");
+EXPORT_C void CImageEditorUIView::ActivatePluginL(CCoeControl * aControl)
+	{
+	LOG(KImageEditorLogFile, "CImageEditorUIView: Activating plugin");
 
-    // Activate the plugin based on UI type
-    switch ( iArray[iIndex]->PluginUiType() ) 
-    {
-    case 1: // EPluginUiTypeNone
-        {
-            // For non-UI plug-ins active main view and render
-            iInPlugin = EFalse;
-            ActivateMainViewL();
-            HandleCommandL (EImageEditorCmdRender);
-            break;
+	// Activate the plugin based on UI type
+	switch (iArray[iIndex]->PluginUiType())
+		{
+		case 1: // EPluginUiTypeNone
+			{
+			// For non-UI plug-ins active main view and render
+			iInPlugin = EFalse;
+			ActivateMainViewL();
+			HandleCommandL(EImageEditorCmdRender);
+			break;
 
+			}
+		case 2: // EPluginUiTypeSingleParam
+		case 3: // EPluginUiTypeMultiParam
+		case 4: // EPluginUiTypeCustomized
+			{
+			iInPlugin = ETrue;
 
-        }
-    case 2: // EPluginUiTypeSingleParam
-    case 3: // EPluginUiTypeMultiParam
-    case 4: // EPluginUiTypeCustomized
-        {
-            iInPlugin = ETrue;
+			//  Set control
+			iControl = aControl;
+			if (iContainer)
+				{
+				iContainer->SetControl(iControl);
+				}
 
-            //  Set control
-            iControl = aControl;
-            if (iContainer)
-            {
-                iContainer->SetControl (iControl);
-            }
+			//  Set plug-in item
+			if (iControl)
+				{
+				LOG(KImageEditorLogFile, "CImageEditorUIView: Activating plugin: calling SetSelectedUiItemL");
 
-            //  Set plug-in item
-            if (iControl)
-            {
-                LOG(KImageEditorLogFile, "CImageEditorUIView: Activating plugin: calling SetSelectedUiItemL");
+				((CImageEditorControlBase *) iControl)->SetSelectedUiItemL(	iArray[iIndex]);
+				}
 
-                ((CImageEditorControlBase *)iControl)->SetSelectedUiItemL (iArray[iIndex]);
-            }
+			//  Prepare the plug-in item
+			if (iControl)
+				{
+				LOG(KImageEditorLogFile, "CImageEditorUIView: Activating plugin: calling ");
 
-            //  Prepare the plug-in item
-            if (iControl)
-            {
-                LOG(KImageEditorLogFile, "CImageEditorUIView: Activating plugin: calling PrepareL");
+				((CImageEditorControlBase *) iControl)->PrepareL();
+				}
 
-                ((CImageEditorControlBase *)iControl)->PrepareL ();
-            }
+			//  Update soft keys
+			UpdateSoftkeysL();
 
-            //  Update soft keys
-            UpdateSoftkeysL();
+			//  Update navigation pane
+			UpdateNaviPaneL();
 
-            //  Update navigation pane
-            UpdateNaviPaneL();
-			
-            break;
-        }
-    default:
-        {
-            iInPlugin = ETrue;
+			break;
+			}
+		default:
+			{
+			iInPlugin = ETrue;
 
-            //  Set control
-            iControl = aControl;
-            if (iContainer)
-            {
-                iContainer->SetControl (iControl);
-            }
-    	    break;
-        }
-    }
-}
+			//  Set control
+			iControl = aControl;
+			if (iContainer)
+				{
+				iContainer->SetControl(iControl);
+				}
+			break;
+			}
+		}
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::ActivateMainViewL()
-{
+	{
 
-    LOG(KImageEditorLogFile, "CImageEditorUIView: Activating main view");
+	LOG(KImageEditorLogFile, "CImageEditorUIView: Activating main view");
 
-    iInPlugin = EFalse;
+	iInPlugin = EFalse;
 
-    //  Reset buttons
+	//  Reset buttons
 	iSoftkey1 = EAknSoftkeyOptions;
 	iSoftkey2 = EAknSoftkeyBack;
 	iMSK = EImageEditorMenuCmdApplyEffect;
-	
-    if ( InZoomingState() )
-        {
-        if ( iZoomMode == ( ENumOfZooms - 1 ) )
-            {
-            SetCustomButtonsL( R_IMAGEEDITORUI_SK_OPTIONS_CANCEL );
-            }
-        else
-            {
-            SetCustomButtonsL( R_IMAGEEDITORUI_SK_OPTIONS_CANCEL_ZOOMIN );
-            }        
-        }
-     else
-        {
-        SetCustomButtonsL( R_IMAGEEDITORUI_SK_OPTIONS_BACK_APPLY );
-        }
 
-    //  Reset navi pane
-    ClearNaviPaneTextL();
+	if (InZoomingState())
+		{
+		if (iZoomMode == (ENumOfZooms - 1))
+			{
+			SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL);
+			}
+		else
+			{
+			SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL_ZOOMIN);
+			}
+		}
+	else
+		{
+		SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_BACK_APPLY);
+		}
 
-    //  Set control in container to NULL
-    iControl = 0;
-    if (iContainer)
-    {
-        iContainer->SetControl (iControl);
-    }
-    
-}
+	//  Reset navi pane
+	ClearNaviPaneTextL();
+
+	//  Set control in container to NULL
+	iControl = 0;
+	if (iContainer)
+		{
+		iContainer->SetControl(iControl);
+		}
+
+	}
 
 //=============================================================================
-EXPORT_C CPluginInfo * CImageEditorUIView::GetSelectedPluginInfoL ()
-{
-    TInt selectedItem;
-    TInt dialog_ok = CPluginSelectionDialog::RunDlgLD(&iPreview, selectedItem, &iArray, ClientRect());
+EXPORT_C CPluginInfo * CImageEditorUIView::GetSelectedPluginInfoL()
+	{
+	TInt selectedItem;
+	TInt dialog_ok = CPluginSelectionDialog::RunDlgLD(&iPreview, selectedItem,
+			&iArray, ClientRect());
 
-    if (dialog_ok && selectedItem != KErrCancel)
-    {
-        iIndex = selectedItem;
-        return iArray[selectedItem];
-    }
-    else
-    {
-     if ( InZoomingState() )
-        {
-        if ( iZoomMode == ( ENumOfZooms - 1 ) )
-            {
-            SetCustomButtonsL( R_IMAGEEDITORUI_SK_OPTIONS_CANCEL );
-            }
-        else
-            {
-            SetCustomButtonsL( R_IMAGEEDITORUI_SK_OPTIONS_CANCEL_ZOOMIN );
-            }        
-        }
-     else
-        {
-        SetCustomButtonsL( R_IMAGEEDITORUI_SK_OPTIONS_BACK_APPLY );
-        }           
-        return NULL;
-    }
-}
+	if (dialog_ok && selectedItem != KErrCancel)
+		{
+		iIndex = selectedItem;
+		return iArray[selectedItem];
+		}
+	else
+		{
+		if (InZoomingState())
+			{
+			if (iZoomMode == (ENumOfZooms - 1))
+				{
+				SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL);
+				}
+			else
+				{
+				SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL_ZOOMIN);
+				}
+			}
+		else
+			{
+			SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_BACK_APPLY);
+			}
+		return NULL;
+		}
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::AddPluginUiItemL (const CPluginInfo * aPluginInfo)
-{
-    TLinearOrder<CPluginInfo> order (CPluginInfo::ComparePluginOrder);
-    iArray.InsertInOrder (aPluginInfo, order);
-}
+EXPORT_C void CImageEditorUIView::AddPluginUiItemL(
+		const CPluginInfo * aPluginInfo)
+	{
+	TLinearOrder<CPluginInfo> order(CPluginInfo::ComparePluginOrder);
+	iArray.InsertInOrder(aPluginInfo, order);
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::SetCustomButtonsL (TInt aResourceID) const
-{
-    LOG(KImageEditorLogFile, "CImageEditorUIView: Setting buttons");
+EXPORT_C void CImageEditorUIView::SetCustomButtonsL(TInt aResourceID) const
+	{
+	LOG(KImageEditorLogFile, "CImageEditorUIView: Setting buttons");
 
-    CEikButtonGroupContainer* cba = Cba();
-    __ASSERT_ALWAYS( cba, User::Panic(KComponentName, EImageEditorPanicCbaNotAccessible) );
+	CEikButtonGroupContainer* cba = Cba();
+	__ASSERT_ALWAYS( cba, User::Panic(KComponentName, EImageEditorPanicCbaNotAccessible) );
 
-    cba->SetCommandSetL (aResourceID);
-    cba->DrawDeferred();
-}
+	cba->SetCommandSetL(aResourceID);
+	cba->DrawDeferred();
+	}
 
 //=============================================================================
-EXPORT_C TInt CImageEditorUIView::LaunchSaveChangesQueryL () const
-{
+EXPORT_C TInt CImageEditorUIView::LaunchSaveChangesQueryL() const
+	{
 	//	Create dialog prompt
-    HBufC * prompt = iEikonEnv->AllocReadResourceLC (R_LIST_QUERY_SAVE_CONFIRMATION);
-    
+	HBufC * prompt = iEikonEnv->AllocReadResourceLC(
+			R_LIST_QUERY_SAVE_CONFIRMATION);
+
 	//	Execute query dialog
-	TInt ret = SDrawUtils::LaunchQueryDialogL (*prompt);
+	TInt ret = SDrawUtils::LaunchQueryDialogL(*prompt);
 
 	CleanupStack::PopAndDestroy(); // prompt
 
 	return ret;
-}
+	}
 
 //=============================================================================
-EXPORT_C TInt CImageEditorUIView::LaunchExitWithoutSavingQueryL () const
-{
+EXPORT_C TInt CImageEditorUIView::LaunchExitWithoutSavingQueryL() const
+	{
 	//	Create dialog prompt
-    HBufC * prompt = iEikonEnv->AllocReadResourceLC (R_LIST_QUERY_EXIT_WITHOUT_SAVING_CONFIRMATION);
-    
+	HBufC * prompt = iEikonEnv->AllocReadResourceLC(
+			R_LIST_QUERY_EXIT_WITHOUT_SAVING_CONFIRMATION);
+
 	//	Execute query dialog
-	TInt ret = SDrawUtils::LaunchQueryDialogL (*prompt);
+	TInt ret = SDrawUtils::LaunchQueryDialogL(*prompt);
 
 	CleanupStack::PopAndDestroy(); // prompt
 
 	return ret;
-}
+	}
 
 //=============================================================================
-EXPORT_C TInt CImageEditorUIView::LaunchCancelTextInputQueryL () const
-{
-   
+EXPORT_C TInt CImageEditorUIView::LaunchCancelTextInputQueryL() const
+	{
+
 	// Create dialog prompt
 	// At the moment query is not in use and corresponding string is removed
 	// from the loc file. To enable this, a new string has to be defined. 
-    HBufC * prompt = iEikonEnv->AllocReadResourceLC(R_LIST_QUERY_CANCEL_TEXT_INPUT);
-    
+	HBufC * prompt = iEikonEnv->AllocReadResourceLC(
+			R_LIST_QUERY_CANCEL_TEXT_INPUT);
+
 	//	Execute query dialog
-	TInt ret = SDrawUtils::LaunchQueryDialogOkOnlyL (*prompt);
+	TInt ret = SDrawUtils::LaunchQueryDialogOkOnlyL(*prompt);
 
 	CleanupStack::PopAndDestroy(); // save_conf, prompt
 
 	return ret;
-}
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::LaunchSendQueryL (
-    const TSendingCapabilities& aCaps,
-    TFileName& aFileName
-    ) const
-{
-    if (iSendAppUi)
-    {
-        CMessageData* msgData = CMessageData::NewLC();        
-        msgData->AppendAttachmentL(aFileName);       	
+EXPORT_C void CImageEditorUIView::LaunchSendQueryL(
+		const TSendingCapabilities& aCaps, TFileName& aFileName) const
+	{
+	if (iSendAppUi)
+		{
+		CMessageData* msgData = CMessageData::NewLC();
+		msgData->AppendAttachmentL(aFileName);
 
-        iSendAppUi->ShowQueryAndSendL (msgData, aCaps);
+		iSendAppUi->ShowQueryAndSendL(msgData, aCaps);
 
 		CleanupStack::PopAndDestroy(msgData);
-    }
-}
+		}
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::LaunchSendQueryL (
-    const TSendingCapabilities& aCaps,
-    RFile& aFileHandle
-    ) const
-{
-    if (iSendAppUi)
-    {
-        CMessageData* msgData = CMessageData::NewLC();        
-        msgData->AppendAttachmentHandleL(aFileHandle);       	
+EXPORT_C void CImageEditorUIView::LaunchSendQueryL(
+		const TSendingCapabilities& aCaps, RFile& aFileHandle) const
+	{
+	if (iSendAppUi)
+		{
+		CMessageData* msgData = CMessageData::NewLC();
+		msgData->AppendAttachmentHandleL(aFileHandle);
 
-        iSendAppUi->ShowQueryAndSendL (msgData, aCaps);
+		iSendAppUi->ShowQueryAndSendL(msgData, aCaps);
 
 		CleanupStack::PopAndDestroy(msgData);
-    }
-}
-
+		}
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::LaunchSaveWaitDialogL(
-    CAknProgressDialog** 			aSelfPtr,
-	TInt							aFinalValue,
-    MProgressDialogCallback*		aCallback
-    ) const
-{
+		CAknProgressDialog** aSelfPtr, TInt aFinalValue,
+		MProgressDialogCallback* aCallback) const
+	{
 	//	Create dialog prompt
 	HBufC * prompt;
-		    
-    TApaAppCaption caption;
-    TRAPD( err, ResolveCaptionNameL( caption ) );
-    
-    // If something goes wrong, show basic "Saving" note
-    if ( err )
-        {
-        prompt = iEikonEnv->AllocReadResourceLC( R_WAIT_NOTE_SAVING );
-        }
-    else
-        {
-        prompt =  StringLoader::LoadLC( R_WAIT_NOTE_SAVING_TO, caption );
-        }        
-        
+
+	TApaAppCaption caption;
+	TRAPD( err, ResolveCaptionNameL( caption ) );
+
+	// If something goes wrong, show basic "Saving" note
+	if (err)
+		{
+		prompt = iEikonEnv->AllocReadResourceLC(R_WAIT_NOTE_SAVING);
+		}
+	else
+		{
+		prompt = StringLoader::LoadLC(R_WAIT_NOTE_SAVING_TO, caption);
+		}
+
 	//	Launch wait dialog with Cancel softkey
-	SDrawUtils::LaunchProgressNoteL (
-        aSelfPtr, 
-        R_PROGRESS_DIALOG, 
-        *prompt, 
-        aFinalValue, 
-        aCallback
-        );
+	SDrawUtils::LaunchProgressNoteL(aSelfPtr, R_PROGRESS_DIALOG, *prompt,
+			aFinalValue, aCallback);
 
 	CleanupStack::PopAndDestroy(); // prompt
-}
+	}
 
 //=============================================================================
-void CImageEditorUIView::ResolveCaptionNameL( TApaAppCaption& aCaption ) const
-    {   
-    RApaLsSession appArcSession;
-    CleanupClosePushL( appArcSession );
-    User::LeaveIfError( appArcSession.Connect() );       	    
-    
-    // Get Media Gallery caption
-    TApaAppInfo appInfo;
-    User::LeaveIfError( appArcSession.GetAppInfo( appInfo, TUid::Uid( KMediaGalleryUID3 ) ) );
-    
-    aCaption = appInfo.iCaption;
-    
-    CleanupStack::PopAndDestroy( &appArcSession );  
-    }
-    
+void CImageEditorUIView::ResolveCaptionNameL(TApaAppCaption& aCaption) const
+	{
+	RApaLsSession appArcSession;
+	CleanupClosePushL(appArcSession);
+	User::LeaveIfError(appArcSession.Connect());
+
+	// Get Media Gallery caption
+	TApaAppInfo appInfo;
+	User::LeaveIfError(appArcSession.GetAppInfo(appInfo, TUid::Uid(
+			KMediaGalleryUID3)));
+
+	aCaption = appInfo.iCaption;
+
+	CleanupStack::PopAndDestroy(&appArcSession);
+	}
+
 //=============================================================================
 EXPORT_C void CImageEditorUIView::LaunchLoadWaitDialogL(
-    CAknWaitDialog** 				aSelfPtr,
-    MProgressDialogCallback*		aCallback
-    ) const
-{
+		CAknWaitDialog** aSelfPtr, MProgressDialogCallback* aCallback) const
+	{
 	//	Create dialog prompt
-	HBufC * prompt = iEikonEnv->AllocReadResourceLC (R_WAIT_NOTE_LOADING);
+	HBufC * prompt = iEikonEnv->AllocReadResourceLC(R_WAIT_NOTE_LOADING);
 
 	//	Launch wait dialog with empty softkeys
-	SDrawUtils::LaunchWaitNoteL (
-        aSelfPtr, 
-        R_WAIT_DIALOG, 
-        *prompt, 
-        aCallback
-        );
+	SDrawUtils::LaunchWaitNoteL(aSelfPtr, R_WAIT_DIALOG, *prompt, aCallback);
 
 	CleanupStack::PopAndDestroy(); // prompt
-}
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::LaunchWaitDialog() const
-{   
-    // Show empty set of cba buttons while animation on the screen
-    SetCustomButtonsL ( R_AVKON_SOFTKEYS_EMPTY );
+	{
+	// Show empty set of cba buttons while animation on the screen
+	SetCustomButtonsL(R_AVKON_SOFTKEYS_EMPTY);
 	iContainer->ShowWaitNote();
-}
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::HideWaitDialog() const
-{
+	{
 	iContainer->HideWaitNote();
-}
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::ShowInformationNoteL (const TDesC& aNoteText) const
-{
+EXPORT_C void CImageEditorUIView::ShowInformationNoteL(const TDesC& aNoteText) const
+	{
 
-    CAknGlobalNote * globalnote = CAknGlobalNote::NewLC();
-    globalnote->ShowNoteL (EAknGlobalInformationNote, aNoteText); 
+	CAknGlobalNote * globalnote = CAknGlobalNote::NewLC();
+	globalnote->ShowNoteL(EAknGlobalInformationNote, aNoteText);
 
-    CleanupStack::PopAndDestroy(); // globalnote
+	CleanupStack::PopAndDestroy(); // globalnote
 
-}
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::ShowConfirmationNoteL (const TDesC& aNoteText) const
-{
+EXPORT_C void CImageEditorUIView::ShowConfirmationNoteL(const TDesC& aNoteText) const
+	{
 
-    CAknGlobalNote * globalnote = CAknGlobalNote::NewLC();
-    globalnote->ShowNoteL (EAknGlobalConfirmationNote, aNoteText); 
+	CAknGlobalNote * globalnote = CAknGlobalNote::NewLC();
+	globalnote->ShowNoteL(EAknGlobalConfirmationNote, aNoteText);
 
-    CleanupStack::PopAndDestroy(); // globalnote
+	CleanupStack::PopAndDestroy(); // globalnote
 
-}
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::SetNaviPaneTextL (
-    const TDesC & aText,
-	TBool aLeftNaviPaneScrollButtonVisibile, 
-	TBool aRightNaviPaneScrollButtonVisible )
-    {
-    LOG(KImageEditorLogFile, "CImageEditorUIView: Setting navi pane text");
+EXPORT_C void CImageEditorUIView::SetNaviPaneTextL(const TDesC & aText,
+		TBool aLeftNaviPaneScrollButtonVisibile,
+		TBool aRightNaviPaneScrollButtonVisible)
+	{
+	LOG(KImageEditorLogFile, "CImageEditorUIView: Setting navi pane text");
+
+	if (iNaviPane)
+		{
+		//  Create a new decorator
+		CAknNavigationDecorator* newNaviDecorator =
+				iNaviPane->CreateNavigationLabelL(aText);
+		CleanupStack::PushL(newNaviDecorator);
 
-    if (iNaviPane )
-        {
-        //  Create a new decorator
-        CAknNavigationDecorator* newNaviDecorator = 
-                                    iNaviPane->CreateNavigationLabelL (aText);
-        CleanupStack::PushL (newNaviDecorator);
-  
-        // Set the navi scroll indicators for the new decorator
-        newNaviDecorator->SetScrollButtonDimmed( 
-                            CAknNavigationDecorator::ELeftButton, 
-                            !aLeftNaviPaneScrollButtonVisibile );
-        newNaviDecorator->SetScrollButtonDimmed( 
-                            CAknNavigationDecorator::ERightButton, 
-                            !aRightNaviPaneScrollButtonVisible );        
-        if ( aLeftNaviPaneScrollButtonVisibile || aRightNaviPaneScrollButtonVisible )
-            {
-            newNaviDecorator->MakeScrollButtonVisible( ETrue );
-            }
-        
-        // Set new decorator on top of Navi Pane's decorator stack 
-        // (topmost decorator is the one to show)
-        iNaviPane->PushL (*newNaviDecorator);
+		// Set the navi scroll indicators for the new decorator
+		newNaviDecorator->SetScrollButtonDimmed(
+				CAknNavigationDecorator::ELeftButton,
+				!aLeftNaviPaneScrollButtonVisibile);
+		newNaviDecorator->SetScrollButtonDimmed(
+				CAknNavigationDecorator::ERightButton,
+				!aRightNaviPaneScrollButtonVisible);
+		if (aLeftNaviPaneScrollButtonVisibile
+				|| aRightNaviPaneScrollButtonVisible)
+			{
+			newNaviDecorator->MakeScrollButtonVisible(ETrue);
+			}
+
+		// Set new decorator on top of Navi Pane's decorator stack 
+		// (topmost decorator is the one to show)
+		iNaviPane->PushL(*newNaviDecorator);
 
-        // remove old "previous decorator" from decorator stack and delete it
-        if ( iPreviousNaviDecorator )
-            {   
-            iNaviPane->Pop( iPreviousNaviDecorator );
-            delete iPreviousNaviDecorator;
-            iPreviousNaviDecorator = NULL;               
-            }
-        
-        // update decorator pointers to new ones    
-        iPreviousNaviDecorator = iNaviDecorator;
-        iNaviDecorator = newNaviDecorator;
-        
-        // set observer for the currently shown decorator
-        (iNaviPane->Top())->SetNaviDecoratorObserver( iContainer );
+		// remove old "previous decorator" from decorator stack and delete it
+		if (iPreviousNaviDecorator)
+			{
+			iNaviPane->Pop(iPreviousNaviDecorator);
+			delete iPreviousNaviDecorator;
+			iPreviousNaviDecorator = NULL;
+			}
 
-        CleanupStack::Pop (newNaviDecorator);  
-        }
+		// update decorator pointers to new ones    
+		iPreviousNaviDecorator = iNaviDecorator;
+		iNaviDecorator = newNaviDecorator;
 
-    }
+		// set observer for the currently shown decorator
+		(iNaviPane->Top())->SetNaviDecoratorObserver(iContainer);
+
+		CleanupStack::Pop(newNaviDecorator);
+		}
+
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::ClearNaviPaneTextL()
-{
-    LOG(KImageEditorLogFile, "CImageEditorUIView: Clearing navi pane text");
-    if (iNaviPane)
-    {
-        if (iNaviDecorator)
-        {
-            iNaviPane->Pop (iNaviDecorator);
-            delete iNaviDecorator;
-            iNaviDecorator = 0;
-        }
-        
-        if (iPreviousNaviDecorator)
-        {
-            iNaviPane->Pop (iPreviousNaviDecorator);
-            delete iPreviousNaviDecorator;
-            iPreviousNaviDecorator = 0;
-        }
-	    HBufC * title = iEikonEnv->AllocReadResourceLC (R_MAIN_VIEW_TITLE);
-        iNaviDecorator = iNaviPane->CreateNavigationLabelL ( title->Des() );
-        iPreviousNaviDecorator = iNaviPane->CreateNavigationLabelL ( title->Des() );
-                
-        iNaviPane->PushL (*iPreviousNaviDecorator); 
-        iNaviPane->PushL (*iNaviDecorator);
-        iNaviPane->DrawDeferred();
-        iNaviDecorator->DrawDeferred();
-        CleanupStack::PopAndDestroy(); // title
-    }
-}
+	{
+	LOG(KImageEditorLogFile, "CImageEditorUIView: Clearing navi pane text");
+	if (iNaviPane)
+		{
+		if (iNaviDecorator)
+			{
+			iNaviPane->Pop(iNaviDecorator);
+			delete iNaviDecorator;
+			iNaviDecorator = 0;
+			}
+
+		if (iPreviousNaviDecorator)
+			{
+			iNaviPane->Pop(iPreviousNaviDecorator);
+			delete iPreviousNaviDecorator;
+			iPreviousNaviDecorator = 0;
+			}
+		HBufC * title = iEikonEnv->AllocReadResourceLC(R_MAIN_VIEW_TITLE);
+		iNaviDecorator = iNaviPane->CreateNavigationLabelL(title->Des());
+		iPreviousNaviDecorator
+				= iNaviPane->CreateNavigationLabelL(title->Des());
+
+		iNaviPane->PushL(*iPreviousNaviDecorator);
+		iNaviPane->PushL(*iNaviDecorator);
+		iNaviPane->DrawDeferred();
+		iNaviDecorator->DrawDeferred();
+		CleanupStack::PopAndDestroy(); // title
+		}
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::SetTitlePaneTextL (const TDesC & aText)
-{
-    iTitlePane->SetTextL (aText);
-}
+EXPORT_C void CImageEditorUIView::SetTitlePaneTextL(const TDesC & aText)
+	{
+	iTitlePane->SetTextL(aText);
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::ClearTitlePaneTextL()
-{
-    iTitlePane->SetTextL ( KNullDesC );
-}
+	{
+	iTitlePane->SetTextL(KNullDesC);
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::SetSoftKey1L (
-	const TDesC &	aText,
-	const TInt		aCommand
-	)
-{
-    CEikButtonGroupContainer * cba = Cba();
-   // TInt replace_position = cba->PositionById (iSoftkey1);
-    TInt replace_position( CEikButtonGroupContainer::ELeftSoftkeyPosition );
-    cba->SetCommandL (replace_position, aCommand, aText);
-    cba->DrawDeferred();
-    iSoftkey1 = aCommand;
-}
+EXPORT_C void CImageEditorUIView::SetSoftKey1L(const TDesC & aText,
+		const TInt aCommand)
+	{
+	CEikButtonGroupContainer * cba = Cba();
+	// TInt replace_position = cba->PositionById (iSoftkey1);
+	TInt replace_position(CEikButtonGroupContainer::ELeftSoftkeyPosition);
+	cba->SetCommandL(replace_position, aCommand, aText);
+	cba->DrawDeferred();
+	iSoftkey1 = aCommand;
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::SetSoftKey2L (
-	const TDesC &	aText,
-	const TInt		aCommand
-	)
-{
-    CEikButtonGroupContainer * cba = Cba();
-    //TInt replace_position = cba->PositionById (iSoftkey2); 
-    TInt replace_position( CEikButtonGroupContainer::ERightSoftkeyPosition );
-    cba->SetCommandL (replace_position, aCommand, aText);
-    cba->DrawDeferred();
-    iSoftkey2 = aCommand;
-}
+EXPORT_C void CImageEditorUIView::SetSoftKey2L(const TDesC & aText,
+		const TInt aCommand)
+	{
+	CEikButtonGroupContainer * cba = Cba();
+	//TInt replace_position = cba->PositionById (iSoftkey2); 
+	TInt replace_position(CEikButtonGroupContainer::ERightSoftkeyPosition);
+	cba->SetCommandL(replace_position, aCommand, aText);
+	cba->DrawDeferred();
+	iSoftkey2 = aCommand;
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::SetMiddleSoftKeyL (
-	const TDesC &	aText,
-	const TInt		aCommand
-	)
-{
-    CEikButtonGroupContainer * cba = Cba();
-    
-    if ( aCommand == EAknSoftkeyContextOptions )
-        {
-        TInt contextMenuId = 
-            ((CImageEditorControlBase *)iControl)->GetContextMenuResourceId();  
-        if ( contextMenuId )
-            {
-            MenuBar()->SetContextMenuTitleResourceId( contextMenuId );
-            }
-        }
-        
-    TInt replace_position( CEikButtonGroupContainer::EMiddleSoftkeyPosition );
-    cba->SetCommandL ( replace_position, aCommand, aText );
-    cba->DrawDeferred();
-    iMSK = aCommand;
-}
+EXPORT_C void CImageEditorUIView::SetMiddleSoftKeyL(const TDesC & aText,
+		const TInt aCommand)
+	{
+	CEikButtonGroupContainer * cba = Cba();
+
+	if (aCommand == EAknSoftkeyContextOptions)
+		{
+		TInt
+				contextMenuId =
+						((CImageEditorControlBase *) iControl)->GetContextMenuResourceId();
+		if (contextMenuId)
+			{
+		//if in doodle don't show select dialog.
+			if (contextMenuId != R_TEXT_CONTEXT_MENUBAR)
+				{
+				MenuBar()->SetContextMenuTitleResourceId(contextMenuId);
+				}
+			}
+		}
+
+	TInt replace_position(CEikButtonGroupContainer::EMiddleSoftkeyPosition);
+	cba->SetCommandL(replace_position, aCommand, aText);
+	cba->DrawDeferred();
+	iMSK = aCommand;
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::SetBusy()
-{
-    
+	{
+
 	if (iContainer)
-	{
+		{
 		iContainer->SetBusy();
+		}
+
+	iBusy = ETrue;
+	RemoveContainerFromStack();
+
 	}
-	
-	iBusy = ETrue;
-	RemoveContainerFromStack();	
-
-}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::ResetBusy()
-{
+	{
 
 	AddContainerToStack();
 	iBusy = EFalse;
-    
-    if (iContainer)
-	{
+
+	if (iContainer)
+		{
 		iContainer->ResetBusy();
+		}
 	}
-}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::SetUndoFlag (const TBool aUndo)
-{
-    iCanUndo = aUndo;
-}
+EXPORT_C void CImageEditorUIView::SetUndoFlag(const TBool aUndo)
+	{
+	iCanUndo = aUndo;
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::SetSaveFlag (const TBool aSave)
-{
-    iCanSave = aSave;
-}
+EXPORT_C void CImageEditorUIView::SetSaveFlag(const TBool aSave)
+	{
+	iCanSave = aSave;
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::SetFullScreen()
-{
-    if (iContainer)
-    {
-        iContainer->SetFullScreen();
-    }
-    iFullScreen = ETrue;
-}
+	{
+	if (iContainer)
+		{
+		iContainer->SetFullScreen();
+		}
+	iFullScreen = ETrue;
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::ResetFullScreen()
-{
-    if (iContainer)
-    {
-        iContainer->ResetFullScreen();
-    }
-    iFullScreen = EFalse;
-}
+	{
+	if (iContainer)
+		{
+		iContainer->ResetFullScreen();
+		}
+	iFullScreen = EFalse;
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::SetZoomModeL ( const TZoomMode& aMode )
-{
+EXPORT_C void CImageEditorUIView::SetZoomModeL(const TZoomMode& aMode)
+	{
 	iZoomMode = aMode;
-	
+
 	HandleZoomModeChangeL();
-	
-}
+	}
 
 //=============================================================================
 void CImageEditorUIView::HandleZoomModeChangeL()
-    {
-    
-    if ( !iInPlugin && iZoomMode != EZoomNormal )
-	    {
-	    if ( iZoomMode != ( ENumOfZooms - 1 ) )
-	        {
-	        SetCustomButtonsL( R_IMAGEEDITORUI_SK_OPTIONS_CANCEL_ZOOMIN );
-	        }
-	    else
-	        {
-	        SetCustomButtonsL( R_IMAGEEDITORUI_SK_OPTIONS_CANCEL );
-	        }	    
-	    }
-	else if ( !iInPlugin && iZoomMode == EZoomNormal )
-	    {
+	{
 
-	    SetCustomButtonsL( R_IMAGEEDITORUI_SK_OPTIONS_BACK_APPLY );
-	    }
-	
+	if (!iInPlugin && iZoomMode != EZoomNormal)
+		{
+		if (iZoomMode != (ENumOfZooms - 1))
+			{
+			SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL_ZOOMIN);
+			}
+		else
+			{
+			SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL);
+			}
+		}
+	else if (!iInPlugin && iZoomMode == EZoomNormal)
+		{
+
+		SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_BACK_APPLY);
+		}
+
 	// hide previous tooltip
 	iPopupController->HideInfoPopupNote();
-    
-    // show tooltip (also if in plugin)
-    if ( iZoomMode != EZoomNormal )
-        {
-                
-        SDrawUtils::ShowToolTip ( iPopupController,
-                                  ( CCoeControl* )iContainer, 
-                                  TPoint( iContainer->Rect().iTl.iX,
-                                          iContainer->Rect().iTl.iY ),
-                                  EHRightVTop,
-                                  iZoomTexts->MdcaPoint( iZoomMode ) ); 
-        }
-    
-    }
+
+	// show tooltip (also if in plugin)
+	if (iZoomMode != EZoomNormal)
+		{
+
+		SDrawUtils::ShowToolTip(iPopupController, (CCoeControl*) iContainer,
+				TPoint(iContainer->Rect().iTl.iX, iContainer->Rect().iTl.iY),
+				EHRightVTop, iZoomTexts->MdcaPoint(iZoomMode));
+		}
+
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::DynInitMenuPaneL (
-	TInt			aResourceId,
-	CEikMenuPane *	aMenuPane
-	)
-    {
-    // This is called by the framework, aMenuPane should never be null pointer...
-    __ASSERT_ALWAYS( aMenuPane, User::Panic(KComponentName, EImageEditorPanicMenuNotAccessible) );
+EXPORT_C void CImageEditorUIView::DynInitMenuPaneL(TInt aResourceId,
+		CEikMenuPane * aMenuPane)
+	{
+	// This is called by the framework, aMenuPane should never be null pointer...
+	__ASSERT_ALWAYS( aMenuPane, User::Panic(KComponentName, EImageEditorPanicMenuNotAccessible) );
 
 #ifdef AIW_PRINT_PROVIDER_USED
-    if ( iServiceHandler->HandleSubmenuL( *aMenuPane ) )
-        {
-        // Return if AIW submenu 
-        return;    
-        }
+	if (iServiceHandler->HandleSubmenuL(*aMenuPane))
+		{
+		// Return if AIW submenu 
+		return;
+		}
 #endif    
-        
-	if ( aResourceId != R_IMAGEEDITORUI_MENUPANE )
-	    {
-        return;
-        }    
+
+	if (aResourceId != R_IMAGEEDITORUI_MENUPANE)
+		{
+		return;
+		}
 
-    // In busy mode
-    if ( iBusy )  
-        {
-        DimAllL ( aResourceId, *aMenuPane );
-        }
-    // In idle mode
-    else
-        {
-        //  In plug-in mode
-        if ( iInPlugin )
-            {
-            DimAllL ( aResourceId, *aMenuPane );
-            InsertPluginItemsL ( *aMenuPane );
-            
+	// In busy mode
+	if (iBusy)
+		{
+		DimAllL(aResourceId, *aMenuPane);
+		}
+	// In idle mode
+	else
+		{
+		//  In plug-in mode
+		if (iInPlugin)
+			{
+			DimAllL(aResourceId, *aMenuPane);
+			InsertPluginItemsL(*aMenuPane);
+
 #ifdef FULLSCREEN_AVAILABLE            
-            // After plugin specific items, add menu commands that are common
-            // for all plugins' options menus
-            // In normal screen mode
-            if ( !iFullScreen )
-                {
-                aMenuPane->SetItemDimmed( EImageEditorMenuCmdFullScreen, EFalse );
-                }
+			// After plugin specific items, add menu commands that are common
+			// for all plugins' options menus
+			// In normal screen mode
+			if ( !iFullScreen )
+				{
+				aMenuPane->SetItemDimmed( EImageEditorMenuCmdFullScreen, EFalse );
+				}
 
-            // In full screen mode
-            else
-                {
-                aMenuPane->SetItemDimmed( EImageEditorMenuCmdNormalScreen, EFalse );
-                }
+			// In full screen mode
+
+			else
+				{
+				aMenuPane->SetItemDimmed( EImageEditorMenuCmdNormalScreen, EFalse );
+				}
 #endif // FULLSCREEN_AVAILABLE        
-   
-            aMenuPane->SetItemDimmed ( EImageEditorMenuCmdHelp, EFalse );
-            aMenuPane->SetItemDimmed ( EImageEditorMenuCmdExit, EFalse );    
-            }
-        else if ( InZoomingState() )
-            {
-            aMenuPane->SetItemDimmed( EImageEditorMenuCmdUndo, ETrue );
+			aMenuPane->SetItemDimmed(EImageEditorMenuCmdHelp, EFalse);
+			aMenuPane->SetItemDimmed(EImageEditorMenuCmdExit, EFalse);
+			}
+		else if (InZoomingState())
+			{
+			aMenuPane->SetItemDimmed(EImageEditorMenuCmdUndo, ETrue);
 #ifdef FULLSCREEN_AVAILABLE
-            aMenuPane->SetItemDimmed( EImageEditorMenuCmdFullScreen, ETrue );
-            aMenuPane->SetItemDimmed( EImageEditorMenuCmdNormalScreen, ETrue );
+			aMenuPane->SetItemDimmed( EImageEditorMenuCmdFullScreen, ETrue );
+			aMenuPane->SetItemDimmed( EImageEditorMenuCmdNormalScreen, ETrue );
 #endif // FULLSCREEN_AVAILABLE  
-            
-            if ( !iCanSave || IsMemoryInCriticalLevel() )
-                {
-                aMenuPane->SetItemDimmed( EImageEditorMenuCmdSave, ETrue );
-                }      
-            
-            TInt position;
-            if ( aMenuPane->MenuItemExists( EImageEditorMenuCmdSend, 
-                                            position ) )
-                {
-                aMenuPane->SetItemDimmed( EImageEditorMenuCmdSend, ETrue );
-                }                           
-            if ( aMenuPane->MenuItemExists( EImageEditorAiwCriteriaPrint, 
-                                            position ) )
-                {
-                aMenuPane->SetItemDimmed( EImageEditorAiwCriteriaPrint, ETrue );
-                }    
-            
-            if ( iZoomMode == EZoomIn3 )
-                {
-                aMenuPane->SetItemDimmed( EImageEditorMenuCmdZoomIn, ETrue );
-                }
-            // Set "Apply Effect" item to be after "Zoom Out" in zooming 
-            // state's options menu
-            if ( aMenuPane->MenuItemExists( EImageEditorMenuCmdApplyEffect, 
-                                            position ) )
-                {
-                CEikMenuPaneItem::SData data = 
-                        aMenuPane->ItemData( EImageEditorMenuCmdApplyEffect );
-                aMenuPane->DeleteMenuItem( EImageEditorMenuCmdApplyEffect );
-                aMenuPane->AddMenuItemL( data, EImageEditorMenuCmdZoomOut );
-                }
-            }
-        //  In main view mode
-        else
-            {
+			if (!iCanSave || IsMemoryInCriticalLevel())
+				{
+				aMenuPane->SetItemDimmed(EImageEditorMenuCmdSave, ETrue);
+				}
+
+			TInt position;
+			if (aMenuPane->MenuItemExists(EImageEditorMenuCmdSend, position))
+				{
+				aMenuPane->SetItemDimmed(EImageEditorMenuCmdSend, ETrue);
+				}
+			if (aMenuPane->MenuItemExists(EImageEditorAiwCriteriaPrint,position))
+				{
+				aMenuPane->SetItemDimmed(EImageEditorAiwCriteriaPrint, ETrue);
+				}
+
+			if (iZoomMode == EZoomIn3)
+				{
+				aMenuPane->SetItemDimmed(EImageEditorMenuCmdZoomIn, ETrue);
+				}
+			// Set "Apply Effect" item to be after "Zoom Out" in zooming 
+			// state's options menu
+			if (aMenuPane->MenuItemExists(EImageEditorMenuCmdApplyEffect,position))
+				{
+				CEikMenuPaneItem::SData data = aMenuPane->ItemData(
+						EImageEditorMenuCmdApplyEffect);
+				aMenuPane->DeleteMenuItem(EImageEditorMenuCmdApplyEffect);
+				aMenuPane->AddMenuItemL(data, EImageEditorMenuCmdZoomOut);
+				}
+			}
+		//  In main view mode
+		else
+			{
 
 #ifdef AIW_PRINT_PROVIDER_USED
-    
+
 #else
-            aMenuPane->SetItemDimmed( EImageEditorAiwCriteriaPrint, ETrue );
+			aMenuPane->SetItemDimmed( EImageEditorAiwCriteriaPrint, ETrue );
 #endif   
 
-            //  Display CSendUi menu item
-            if ( iSendAppUi )
-                {
-         		iSendAppUi->AddSendMenuItemL( 
-         			*aMenuPane,
-         			SIE_SENDUI_MENU_ITEM_INDEX,
-         			EImageEditorMenuCmdSend,
-         			TSendingCapabilities (0, 0, TSendingCapabilities::ESupportsAttachments) );
-                }
+			//  Display CSendUi menu item
+			if (iSendAppUi)
+				{
+				iSendAppUi->AddSendMenuItemL(*aMenuPane,
+						SIE_SENDUI_MENU_ITEM_INDEX, EImageEditorMenuCmdSend,
+						TSendingCapabilities(0, 0,
+								TSendingCapabilities::ESupportsAttachments));
+				}
 
-            //  Nothing to undo
-            if ( !iCanUndo )
-                {
-                aMenuPane->SetItemDimmed( EImageEditorMenuCmdUndo, ETrue );
-                }
+			//  Nothing to undo
+			if (!iCanUndo)
+				{
+				aMenuPane->SetItemDimmed(EImageEditorMenuCmdUndo, ETrue);
+				}
 #ifdef FULLSCREEN_AVAILABLE
-            // In full screen mode
-            if ( iFullScreen )
-                {
-                aMenuPane->SetItemDimmed( EImageEditorMenuCmdFullScreen, ETrue );
-                }
+			// In full screen mode
+			if ( iFullScreen )
+				{
+				aMenuPane->SetItemDimmed( EImageEditorMenuCmdFullScreen, ETrue );
+				}
 
-            // In normal screen mode
-            else
-                {
-                aMenuPane->SetItemDimmed( EImageEditorMenuCmdNormalScreen, ETrue );
-                }
+			// In normal screen mode
+
+			else
+				{
+				aMenuPane->SetItemDimmed( EImageEditorMenuCmdNormalScreen, ETrue );
+				}
 #endif // FULLSCREEN_AVAILABLE
-            if ( !iCanSave || IsMemoryInCriticalLevel() )
-                {
-                aMenuPane->SetItemDimmed( EImageEditorMenuCmdSave, ETrue );
-                }
-                
-            if ( iZoomMode == EZoomNormal )
-                {
-                aMenuPane->SetItemDimmed( EImageEditorMenuCmdZoomOut, ETrue );
-		        aMenuPane->SetItemDimmed( EImageEditorMenuCmdFitToScreen, ETrue );
-                }
-			    
+			if (!iCanSave || IsMemoryInCriticalLevel())
+				{
+				aMenuPane->SetItemDimmed(EImageEditorMenuCmdSave, ETrue);
+				}
+
+			if (iZoomMode == EZoomNormal)
+				{
+				aMenuPane->SetItemDimmed(EImageEditorMenuCmdZoomOut, ETrue);
+				aMenuPane->SetItemDimmed(EImageEditorMenuCmdFitToScreen, ETrue);
+				}
+
 #ifdef AIW_PRINT_PROVIDER_USED
-            if ( iServiceHandler->IsAiwMenu( aResourceId ) )
-    		    {
-                CAiwGenericParamList& in = iServiceHandler->InParamListL();
-    	
-    		    TFileName filename( iImageFileName );
-    		    TAiwVariant variant( filename );
-    		    TAiwGenericParam param( EGenericParamFile, variant );
-                
-    		    in.AppendL( param );	
+			if (iServiceHandler->IsAiwMenu(aResourceId))
+				{
+				CAiwGenericParamList& in = iServiceHandler->InParamListL();
 
-    		    iServiceHandler->InitializeMenuPaneL( *aMenuPane, 
-    		                                          aResourceId, 
-    		                                          EImageEditorMenuAiwPrintBase, 
-    		                                          in);
-    		    }  
+				TFileName filename(iImageFileName);
+				TAiwVariant variant(filename);
+				TAiwGenericParam param(EGenericParamFile, variant);
+
+				in.AppendL(param);
+
+				iServiceHandler->InitializeMenuPaneL(*aMenuPane, aResourceId,
+						EImageEditorMenuAiwPrintBase, in);
+				}
 #endif
 
-            }
-        }
-    }
+			}
+		}
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::SetSendAppUi(CSendUi* aSendAppUi)
-    {
-    iSendAppUi = aSendAppUi;
-    }
-
+	{
+	iSendAppUi = aSendAppUi;
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::HandleStatusPaneSizeChange()
-{
-
-}
-
-//=============================================================================
-void CImageEditorUIView::DimAllL (
-	TInt			/*aResourceId*/,
-	CEikMenuPane &	aMenuPane
-	) const
-{
-	LOG(KImageEditorLogFile, "CImageEditorUIView::DimAllL");
+	{
 
-    aMenuPane.SetItemDimmed (EImageEditorMenuCmdApplyEffect, ETrue);
-    aMenuPane.SetItemDimmed (EImageEditorMenuCmdExit, ETrue);
-    aMenuPane.SetItemDimmed (EImageEditorMenuCmdUndo, ETrue);
-#ifdef FULLSCREEN_AVAILABLE    
-    aMenuPane.SetItemDimmed (EImageEditorMenuCmdFullScreen, ETrue);
-    aMenuPane.SetItemDimmed (EImageEditorMenuCmdNormalScreen, ETrue);
-#endif // FULLSCREEN_AVAILABLE    
-    aMenuPane.SetItemDimmed (EImageEditorMenuCmdZoomIn, ETrue);
-    aMenuPane.SetItemDimmed (EImageEditorMenuCmdZoomOut, ETrue);
-    aMenuPane.SetItemDimmed (EImageEditorMenuCmdSave, ETrue);
-    aMenuPane.SetItemDimmed (EImageEditorAiwCriteriaPrint, ETrue);
-    aMenuPane.SetItemDimmed (EImageEditorMenuCmdHelp, ETrue);
-    aMenuPane.SetItemDimmed (EImageEditorMenuCmdFitToScreen, ETrue);    
-}
+	}
 
 //=============================================================================
-void CImageEditorUIView::UpdateSoftkeysL ()
-{
-    __ASSERT_ALWAYS( iControl, User::Panic(KComponentName, EImageEditorPanicControlIsNull) );
+void CImageEditorUIView::DimAllL(TInt /*aResourceId*/, CEikMenuPane & aMenuPane) const
+	{
+	LOG(KImageEditorLogFile, "CImageEditorUIView::DimAllL");
 
-    //  Get plug-in info
-    CPluginInfo * pgn_info = iArray[iIndex];
-
-    //  Get soft key pair index 
-    TInt sk_index = ((CImageEditorControlBase *)iControl)->GetSoftkeyIndexL();
+	aMenuPane.SetItemDimmed(EImageEditorMenuCmdApplyEffect, ETrue);
+	aMenuPane.SetItemDimmed(EImageEditorMenuCmdExit, ETrue);
+	aMenuPane.SetItemDimmed(EImageEditorMenuCmdUndo, ETrue);
+#ifdef FULLSCREEN_AVAILABLE    
+	aMenuPane.SetItemDimmed (EImageEditorMenuCmdFullScreen, ETrue);
+	aMenuPane.SetItemDimmed (EImageEditorMenuCmdNormalScreen, ETrue);
+#endif // FULLSCREEN_AVAILABLE    
+	aMenuPane.SetItemDimmed(EImageEditorMenuCmdZoomIn, ETrue);
+	aMenuPane.SetItemDimmed(EImageEditorMenuCmdZoomOut, ETrue);
+	aMenuPane.SetItemDimmed(EImageEditorMenuCmdSave, ETrue);
+	aMenuPane.SetItemDimmed(EImageEditorAiwCriteriaPrint, ETrue);
+	aMenuPane.SetItemDimmed(EImageEditorMenuCmdHelp, ETrue);
+	aMenuPane.SetItemDimmed(EImageEditorMenuCmdFitToScreen, ETrue);
+	}
 
-    //  Set soft key 1
-    SetSoftKey1L ( 
-        pgn_info->Sk1Texts()[sk_index], 
-        pgn_info->Sk1Cmds()[sk_index] 
-        );
+//=============================================================================
+void CImageEditorUIView::UpdateSoftkeysL()
+	{
+	__ASSERT_ALWAYS( iControl, User::Panic(KComponentName, EImageEditorPanicControlIsNull) );
+
+	//  Get plug-in info
+	CPluginInfo * pgn_info = iArray[iIndex];
+
+	//  Get soft key pair index 
+	TInt sk_index = ((CImageEditorControlBase *) iControl)->GetSoftkeyIndexL();
 
-    //  Set soft key 2
-    SetSoftKey2L ( 
-        pgn_info->Sk2Texts()[sk_index], 
-        pgn_info->Sk2Cmds()[sk_index] 
-        );
-        
-    //  Set middle soft key
-    SetMiddleSoftKeyL ( 
-        pgn_info->MSKTexts()[sk_index], 
-        pgn_info->MSKCmds()[sk_index] 
-        );    
-}
+	//  Set soft key 1
+	SetSoftKey1L(pgn_info->Sk1Texts()[sk_index], pgn_info->Sk1Cmds()[sk_index]);
+
+	//  Set soft key 2
+	SetSoftKey2L(pgn_info->Sk2Texts()[sk_index], pgn_info->Sk2Cmds()[sk_index]);
+
+	//  Set middle soft key
+	SetMiddleSoftKeyL(pgn_info->MSKTexts()[sk_index],
+			pgn_info->MSKCmds()[sk_index]);
+	}
 
 //=============================================================================
 void CImageEditorUIView::UpdateNaviPaneL()
-{
-    __ASSERT_ALWAYS( iControl, User::Panic(KComponentName, EImageEditorPanicControlIsNull) );
+	{
+	__ASSERT_ALWAYS( iControl, User::Panic(KComponentName, EImageEditorPanicControlIsNull) );
 
-    TBool leftNaviPaneScrollButtonVisibile;
-    TBool rightNaviPaneScrollButtonVisible;
-    TPtrC naviText =  ((CImageEditorControlBase *)iControl)->GetNaviPaneTextL(
-        leftNaviPaneScrollButtonVisibile,
-        rightNaviPaneScrollButtonVisible );
+	TBool leftNaviPaneScrollButtonVisibile;
+	TBool rightNaviPaneScrollButtonVisible;
+	TPtrC naviText = ((CImageEditorControlBase *) iControl)->GetNaviPaneTextL(
+			leftNaviPaneScrollButtonVisibile, rightNaviPaneScrollButtonVisible);
 
-    SetNaviPaneTextL ( 
-        naviText,
-        leftNaviPaneScrollButtonVisibile,
-        rightNaviPaneScrollButtonVisible );
-}
+	SetNaviPaneTextL(naviText, leftNaviPaneScrollButtonVisibile,
+			rightNaviPaneScrollButtonVisible);
+	}
 
 //=============================================================================
-void CImageEditorUIView::InsertPluginItemsL (CEikMenuPane &	aMenuPane)
-{
-    __ASSERT_ALWAYS( iControl, User::Panic(KComponentName, EImageEditorPanicControlIsNull) );
+void CImageEditorUIView::InsertPluginItemsL(CEikMenuPane & aMenuPane)
+	{
+	__ASSERT_ALWAYS( iControl, User::Panic(KComponentName, EImageEditorPanicControlIsNull) );
 
-    // Insert the plug-in commands
-    CMenuItemArray & menu_items = iArray[iIndex]->MenuItems();
-    TBitField dimmed = ((CImageEditorControlBase *)iControl)->GetDimmedMenuItems();
-    for (TInt i = 0; i < menu_items.Count(); ++i)
-    {
-        // Check the visibility for each menu item.
-        if ( ! dimmed.GetBit(i) )
-        {
-            aMenuPane.InsertMenuItemL ( menu_items[i], i );
-        }
-    }
-}
+	// Insert the plug-in commands
+	CMenuItemArray & menu_items = iArray[iIndex]->MenuItems();
+	TBitField dimmed =
+			((CImageEditorControlBase *) iControl)->GetDimmedMenuItems();
+	for (TInt i = 0; i < menu_items.Count(); ++i)
+		{
+		// Check the visibility for each menu item.
+		if (!dimmed.GetBit(i))
+			{
+			aMenuPane.InsertMenuItemL(menu_items[i], i);
+			}
+		}
+	}
 
 //=============================================================================
-TBool CImageEditorUIView::MenuItemPressedL (TInt aCommand)
-{ 
-    CMenuItemArray & menu_items = iArray[iIndex]->MenuItems();
-    for (TInt i = 0; i < menu_items.Count(); ++i)
-    {
-        if ( menu_items[i].iCommandId == aCommand )
-        {
-            return ETrue;
-        }
-    }
-    return EFalse;
-}
+TBool CImageEditorUIView::MenuItemPressedL(TInt aCommand)
+	{
+	CMenuItemArray & menu_items = iArray[iIndex]->MenuItems();
+	for (TInt i = 0; i < menu_items.Count(); ++i)
+		{
+		if (menu_items[i].iCommandId == aCommand)
+			{
+			return ETrue;
+			}
+		}
+	return EFalse;
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::DoActivateL (
-   const TVwsViewId &		/*aPrevViewId*/,
-   TUid						/*aCustomMessageId*/,
-   const TDesC8 &			/*aCustomMessage*/
-   )
-{
-    LOG(KImageEditorLogFile, "CImageEditorUIView: Activating view");
-    //  Construct container
-    iContainer = new (ELeave) CImageEditorUIContainer;
-    iContainer->SetMopParent (this);
-    iContainer->ConstructL ( ClientRect() );
-	iContainer->SetView (this);
-    HandleCommandL (EImageEditorCmdViewReady);
-  
-}
+EXPORT_C void CImageEditorUIView::DoActivateL(
+		const TVwsViewId & /*aPrevViewId*/, TUid /*aCustomMessageId*/,
+		const TDesC8 & /*aCustomMessage*/
+)
+	{
+	LOG(KImageEditorLogFile, "CImageEditorUIView: Activating view");
+	//  Construct container
+	iContainer = new (ELeave) CImageEditorUIContainer;
+	iContainer->SetMopParent(this);
+	iContainer->ConstructL(ClientRect());
+	iContainer->SetView(this);
+	HandleCommandL(EImageEditorCmdViewReady);
 
+	}
 
 //=============================================================================
 EXPORT_C void CImageEditorUIView::DoDeactivate()
-{
-    LOG(KImageEditorLogFile, "CImageEditorUIView: Deactivating view");
-    
-    RemoveContainerFromStack();
-    
-    if ( iContainer )
 	{
+	LOG(KImageEditorLogFile, "CImageEditorUIView: Deactivating view");
+
+	RemoveContainerFromStack();
+
+	if (iContainer)
+		{
 		delete iContainer;
 		iContainer = 0;
-    }
-}
+		}
+	}
 
 //=============================================================================
 void CImageEditorUIView::AddContainerToStack()
-{
+	{
 	if (!iContainerInStack && iContainer)
-	{
+		{
 		TRAPD(err, AppUi()->AddToViewStackL (*this, iContainer); );
 		if (err == KErrNone)
-		{
-			iContainerInStack = ETrue;		
+			{
+			iContainerInStack = ETrue;
+			}
 		}
-	}	
-}
-
-
+	}
 
 //=============================================================================
 void CImageEditorUIView::RemoveContainerFromStack()
-{
+	{
 	if (iContainerInStack)
-	{
-		AppUi()->RemoveFromViewStack (*this, iContainer);	
-		iContainerInStack = EFalse;	
-	}	
-}
+		{
+		AppUi()->RemoveFromViewStack(*this, iContainer);
+		iContainerInStack = EFalse;
+		}
+	}
 
 //=============================================================================
 EXPORT_C TBool CImageEditorUIView::InZoomingState()
-    {
-    if ( iZoomMode == EZoomIn1 || 
-         iZoomMode == EZoomIn2 ||
-         iZoomMode == EZoomIn3 )
-        {
-        return ETrue;
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
+	{
+	if (iZoomMode == EZoomIn1 || iZoomMode == EZoomIn2 || iZoomMode == EZoomIn3)
+		{
+		return ETrue;
+		}
+	else
+		{
+		return EFalse;
+		}
+	}
 
 //=============================================================================
-EXPORT_C TInt CImageEditorUIView::LaunchSaveImageQueryL () const
-{
-
+EXPORT_C TInt CImageEditorUIView::LaunchSaveImageQueryL() const
+	{
 	//	Create dialog heading and options
-    HBufC * heading = CEikonEnv::Static()->AllocReadResourceLC (R_SIE_LIST_QUERY_HEADING_SAVE);
-    HBufC * option1 = CEikonEnv::Static()->AllocReadResourceLC (R_SIE_LIST_QUERY_SAVE_NEW); 
-    HBufC * option2 = CEikonEnv::Static()->AllocReadResourceLC (R_SIE_LIST_QUERY_SAVE_REPLACE);       
-                
+	HBufC * heading = CEikonEnv::Static()->AllocReadResourceLC(
+			R_SIE_LIST_QUERY_HEADING_SAVE);
+	HBufC * option1 = CEikonEnv::Static()->AllocReadResourceLC(
+			R_SIE_LIST_QUERY_SAVE_NEW);
+	HBufC * option2 = CEikonEnv::Static()->AllocReadResourceLC(
+			R_SIE_LIST_QUERY_SAVE_REPLACE);
+
 	//	Query dialog texts
-	CDesCArray * options = new (ELeave) CDesCArraySeg (2);
-	CleanupStack::PushL (options);
-	options->AppendL( option1->Des() );
-	options->AppendL( option2->Des() );
+	CDesCArray * options = new (ELeave) CDesCArraySeg(2);
+	CleanupStack::PushL(options);
+	options->AppendL(option1->Des());
+	options->AppendL(option2->Des());
 
 	//	Execute query dialog
-	TInt ret = SDrawUtils::LaunchListQueryDialogL (options, *heading);
+	TInt ret = SDrawUtils::LaunchListQueryDialogL(options, *heading);
 
 	options->Reset();
-	
+
 	CleanupStack::PopAndDestroy(4); //options, option2, option1, heading
-	
+
 	return ret;
-}
+	}
 
 //=============================================================================
-EXPORT_C void CImageEditorUIView::GetTouchPanDirections( TInt& xMovement, 
-                                                         TInt& yMovement )
-    {
+EXPORT_C void CImageEditorUIView::GetTouchPanDirections(TInt& xMovement,
+		TInt& yMovement)
+	{
 
-    xMovement = 0;
-    yMovement = 0;
-    iContainer->GetDragDirections( xMovement, yMovement );
-    }
-    
+	xMovement = 0;
+	yMovement = 0;
+	iContainer->GetDragDirections(xMovement, yMovement);
+	}
+
 EXPORT_C TBool CImageEditorUIView::IsMemoryInCriticalLevel()
 	{
 	TEntry entry;
-	RFs & fs = iEikonEnv->FsSession(); 
-	fs.Entry( iImageFileName, entry );
+	RFs & fs = iEikonEnv->FsSession();
+	fs.Entry(iImageFileName, entry);
 	TFileName driveAndPath;
-	driveAndPath.Copy( PathInfo::PhoneMemoryRootPath() );
-	driveAndPath.Append( PathInfo::ImagesPath() );
-	return !ImageEditorUtils::ImageFitsToDriveL( fs, iImageFileName, driveAndPath);
+	driveAndPath.Copy(PathInfo::PhoneMemoryRootPath());
+	driveAndPath.Append(PathInfo::ImagesPath());
+	return !ImageEditorUtils::ImageFitsToDriveL(fs, iImageFileName,
+			driveAndPath);
 	}
 
 // End of File
--- a/imageeditor/ImageEditorUI/src/PreviewControlBase.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/ImageEditorUI/src/PreviewControlBase.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -19,6 +19,7 @@
 
 
 #include "PreviewControlBase.h"
+#include <AknUtils.h>
 
 //=============================================================================
 EXPORT_C CPreviewControlBase * CPreviewControlBase::NewL (
@@ -45,6 +46,7 @@
 	//	Set extent
     SetRect (aRect);
 
+    iStatuspaneHeight = aRect.iBr.iY;
     //  Activate
     ActivateL();
 }
@@ -78,11 +80,15 @@
 	gc.SetPenColor (KRgbBlack);
     gc.SetBrushStyle (CGraphicsContext::ESolidBrush);
 	gc.SetBrushColor (KRgbBlack);
-
+//	TRect rect;
+//	AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow,rect );
+//	TRect ImageRect(iSysPars->VisibleImageRectPrev());
+//
+//	TInt ImageStartPosition = (rect.Height() - aRect.Height())/2;
 	//	Draw preview image if found
 	if ( iPreview && iPreview->Handle() )
 	{
-		gc.BitBlt (TPoint(0,0), iPreview);
+		gc.BitBlt (TPoint(0,iStatuspaneHeight), iPreview);
 	}
     else
     {
--- a/imageeditor/group/bld.inf	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/group/bld.inf	Thu Jun 03 18:57:10 2010 +0800
@@ -38,6 +38,7 @@
 #include "../ImageEditorApp/group/bld.inf"
 
 /// Plugins
+//#ifdef RD_IE_DRAW_PLUGIN
 #include "../plugins/BlackWhitePlugin/group/bld.inf"
 #include "../plugins/NegativePlugin/group/bld.inf"
 #include "../plugins/SepiaPlugin/group/bld.inf"
@@ -54,9 +55,10 @@
 #include "../plugins/RotateRPlugin/group/bld.inf"
 #include "../plugins/ResizePlugin/group/bld.inf"
 #include "../plugins/TextPlugin/group/bld.inf"
-#ifdef RD_IE_DRAW_PLUGIN
+//#endif // RD_IE_DRAW_PLUGIN
+//
 #include "../plugins/DrawPlugin/group/bld.inf"
-#endif // RD_IE_DRAW_PLUGIN
+//
 // Editor AIW Provider
 #include "../EditorProvider/group/bld.inf"
 
--- a/imageeditor/imageeditorApp/inc/ImageEditorAppUi.h	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/imageeditorApp/inc/ImageEditorAppUi.h	Thu Jun 03 18:57:10 2010 +0800
@@ -189,13 +189,15 @@
         
 protected:
 
-/** @name Methods:*/
-//@{
-//@}
+	/**	InitialHorizontalDrawPlugin 
+	*
+	*	Called when screen mode changes.
+	*
+	*	@param -
+	*	@return -
+	*/
+	void InitialHorizontalDrawPlugin();
 
-/** @name Members:*/
-//@{
-//@}
 
 private:
 
@@ -738,7 +740,11 @@
 	CImageEditorRemConObserver*		iVolumeKeyObserver;
 	
 	TBool							iSavingQuery;
-      
+	//The pluginName is draw plug-ins
+	TBuf<32>						iPluginName;
+   //The phone is standby   
+	TBool                           iStandby;
+	
 #ifdef S60_31_VOLUME_KEYS
 	/// Remote connection API used to handle the volume keys
 	/// (implementation borrowed from Media gallery)
--- a/imageeditor/imageeditorApp/src/ImageEditorAppUi.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/imageeditorApp/src/ImageEditorAppUi.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -1,30 +1,27 @@
 /*
-* Copyright (c) 2010 Ixonos Plc.
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - Initial contribution
-*
-* Contributors:
-* Ixonos Plc
-*
-* Description: 
-* Image Editor AppUI class.
-*
-*/
-
-
+ * Copyright (c) 2010 Ixonos Plc.
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - Initial contribution
+ *
+ * Contributors:
+ * Ixonos Plc
+ *
+ * Description: 
+ * Image Editor AppUI class.
+ *
+ */
 //	INCLUDE FILES
 #include <fbs.h>
 #include <f32file.h>
 #include <badesca.h> 
 #include <bautils.h> 
 #include <e32math.h>
- 
 #include <aknnotifystd.h> 
 #include <aknwaitdialog.h> 
 #include <AknGlobalNote.h>
@@ -34,1110 +31,1097 @@
 #include <aknnotewrappers.h> 
 #include <CMessageData.h>
 #include <e32property.h>
-
 #include <AknDlgShut.h>
 #include <CAknFileNamePromptDialog.h> 
 #include <CAknMemorySelectionDialog.h>
 #include <PathInfo.h> 
 #include <csxhelp/sie.hlp.hrh>
-
 #ifdef VERBOSE
 #include <eikenv.h>
 #endif
-
 #include <AknCommonDialogsDynMem.h> 
 #include <CAknMemorySelectionDialogMultiDrive.h> 
-
 #include <ImageEditor.rsg>
 #include "ImageEditorUI.hrh"
 #include "ImageEditorPanics.h"
-
 #include "imageeditoruids.hrh"
 #include "commondefs.h"
-//#include "platform_security_literals.hrh"
-
 #include "ImageEditorApp.h"
 #include "ImageEditorAppUi.h"
 #include "ImageEditorUIView.h"
 #include "ImageEditorUI.hrh"
 #include "ImageEditorError.h"
 #include "PluginInfo.h"
-
 #include "ImageEditorPluginLocator.h"
 #include "ImageEditorPluginManager.h"
 #include "ImageEditorImageController.h"
-
+#include "ImageEditorUIContainer.h"
 #include "ImageEditorUtils.h"
 #include "ResolutionUtil.h"
 #include "Callback.h"
 
-
 //	CONSTANTS
-
 //  Panic category
 _LIT(KComponentName, "ImageEditorAppUi");
-
-const TInt	KObConstructCallBackID          = 1;
-const TInt	KObInitPluginID				    = 1000;
-const TInt	KObReturnFromPluginID           = 1001;
-const TInt  KObCancelCallbackID				= 1002;
-const TInt  KObUndoDCallbackID				= 1003;
-const TInt  KObSendCallbackID               = 1004;
-const TInt  KObPrintCallbackID              = 1005;
-const TInt  KObSaveCallbackID				= 1006;
+_LIT(KDrawPlugin,"draw.pgn");
+_LIT(KNull,"");
+
+const TInt KObConstructCallBackID = 1;
+const TInt KObInitPluginID = 1000;
+const TInt KObReturnFromPluginID = 1001;
+const TInt KObCancelCallbackID = 1002;
+const TInt KObUndoDCallbackID = 1003;
+const TInt KObSendCallbackID = 1004;
+const TInt KObPrintCallbackID = 1005;
+const TInt KObSaveCallbackID = 1006;
 
 //=============================================================================
 CImageEditorAppUi::CImageEditorAppUi() :
-    //  Initialize application flags and variables
-	iDocumentName(),
-	iSourceFileName(),
-    iImageSaved             (EFalse),
-    iForeground             (ETrue),
-    iExitFromApp            (EFalse),
-    iSaveOnExit             (ETrue),
-    iSysExit                (EFalse),
-    iBusy                   (ETrue),
-    iOrientationChanged     (EFalse),
-    iSaving                 (EFalse),
-    iSending                (EFalse),
-    iPrinting               (EFalse),
-    iCancelling				(EFalse),
-    iFullScreen             (EFalse),
-    iPluginsScanned         (EFalse),
-    iImageLoaded            (EFalse),
-    iEditorReady            (EFalse),
-    iCancelTextInputActive  (EFalse),
-    iProcessPriorityAltered (EFalse)
-{
-
-}
+			//  Initialize application flags and variables
+			iDocumentName(), iSourceFileName(), iImageSaved(EFalse),
+			iForeground(ETrue), iExitFromApp(EFalse), iSaveOnExit(ETrue),
+			iSysExit(EFalse), iBusy(ETrue), iOrientationChanged(EFalse),
+			iSaving(EFalse), iSending(EFalse), iPrinting(EFalse), iCancelling(
+					EFalse), iFullScreen(EFalse), iPluginsScanned(EFalse),
+			iImageLoaded(EFalse), iEditorReady(EFalse), iCancelTextInputActive(
+					EFalse), iProcessPriorityAltered(EFalse)
+	{
+
+	}
 
 //=============================================================================
 void CImageEditorAppUi::ConstructL()
-{
-	LOG(KImageEditorLogFile, "CImageEditorAppUi::ConstructL");
+	{
+		LOG(KImageEditorLogFile, "CImageEditorAppUi::ConstructL");
 
 	//	Initialize UI with standard values, read application resource file,
 	//	read default document
 
 #ifdef LANDSCAPE_ONLY
-    BaseConstructL( EAppOrientationLandscape | EAknEnableSkin | EAknEnableMSK  );
+	BaseConstructL( EAppOrientationLandscape | EAknEnableSkin | EAknEnableMSK );
 #else 
 #ifdef LANDSCAPE_SUPPORT
-    BaseConstructL( EAppOrientationAutomatic|EAknEnableSkin | EAknEnableMSK );
+	BaseConstructL(EAppOrientationAutomatic | EAknEnableSkin | EAknEnableMSK);
 #else
-    BaseConstructL( EAknEnableSkin | EAknEnableMSK );
+	BaseConstructL( EAknEnableSkin | EAknEnableMSK );
 #endif
 #endif // LANDSCAPE_SUPPORT
-
-    //  Set busy
-    SetBusy();
-
-    //	Create main view  
-    CImageEditorUIView * view = new (ELeave) CImageEditorUIView;
-    CleanupStack::PushL (view);
-    view->ConstructL();
-    view->ConstructMenuAndCbaEarlyL();
+	//  Set busy
+	SetBusy();
+
+	//	Create main view  
+	CImageEditorUIView * view = new (ELeave) CImageEditorUIView;
+	CleanupStack::PushL(view);
+	view->ConstructL();
+	view->ConstructMenuAndCbaEarlyL();
 	iEditorView = view;
-    AddViewL (view); // transfers ownership
-    CleanupStack::Pop();	// view
-	LOG (KImageEditorLogFile, "CImageEditorAppUi: Main view created");
-
-    //  Activate view
-	ActivateLocalViewL  ( iEditorView->Id() );
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: View activated");
-
-    //  Set default navi pane text
-    ClearTitlePaneTextL();
-    ClearNaviPaneTextL();
-
-    //	Create CObCallback instance
+	AddViewL(view); // transfers ownership
+	CleanupStack::Pop(); // view
+		LOG (KImageEditorLogFile, "CImageEditorAppUi: Main view created");
+
+	//  Activate view
+	ActivateLocalViewL(iEditorView->Id());
+		LOG(KImageEditorLogFile, "CImageEditorAppUi: View activated");
+
+	//  Set default navi pane text
+	ClearTitlePaneTextL();
+	ClearNaviPaneTextL();
+
+	//	Create CObCallback instance
 	iConstructionState = EConstructionStateAlloc;
-	iCallback = CObCallback::NewL ( (MObCallbackMethod *)this );
-    iCallback->DoCallback (KObConstructCallBackID);
-   
-    // Volume key observer instance
-    iVolumeKeyObserver = CImageEditorRemConObserver::NewL( *this );
-    
+	iCallback = CObCallback::NewL((MObCallbackMethod *) this);
+	iCallback->DoCallback(KObConstructCallBackID);
+
+	// Volume key observer instance
+	iVolumeKeyObserver = CImageEditorRemConObserver::NewL(*this);
+
+	iStandby = EFalse;
 #ifdef S60_31_VOLUME_KEYS
 	iMGXRemConTarget = CMGXRemConTarget::NewL( this );
 #endif
-}
+	}
 
 //=============================================================================
 CImageEditorAppUi::~CImageEditorAppUi()
-{
-    LOG(KImageEditorLogFile, "CImageEditorAppUi::~CImageEditorAppUi() starting...");
+	{
+		LOG(KImageEditorLogFile, "CImageEditorAppUi::~CImageEditorAppUi() starting...");
 
 	//KillWaitNote();
 	if (iWaitNote != NULL)
 		{
-        delete iWaitNote;
-        iWaitNote = NULL;
+		delete iWaitNote;
+		iWaitNote = NULL;
 		}
-    
-    delete iLocator;
-    delete iImageController;
-    delete iEditorManager;
+
+	delete iLocator;
+	delete iImageController;
+	delete iEditorManager;
 	delete iSendAppUi;
 	delete iCallback;
 	iSourceImageMgAlbumIdList.Close();
 
-    iEditorView = NULL;
-    
+	iEditorView = NULL;
+
 	iFile.Close();
-    
+
 #ifdef S60_31_VOLUME_KEYS
 	delete iMGXRemConTarget;
 #endif
-	
+
 	// deleted by CCoeEnv
 	iResolutionUtil = NULL;
 	delete iVolumeKeyObserver;
 
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: AppUi deleted");
-}
+		LOG(KImageEditorLogFile, "CImageEditorAppUi: AppUi deleted");
+	}
 
 //=============================================================================
-void CImageEditorAppUi::OperationReadyL ( 
-	TOperationCode		aOpId,
-	TInt				aError 
-	)
-{
-    LOGFMT2(KImageEditorLogFile, "CImageEditorAppUi:OperationReadyL (aOpId:%d, aError:%d)", (TInt)aOpId, aError);
-
-    //	Kill wait note
-    KillWaitNote();
-
-    //	Handle error
-	if ( aError != KErrNone )
+void CImageEditorAppUi::OperationReadyL(TOperationCode aOpId, TInt aError)
 	{
-		switch ( aOpId ) 
+		LOGFMT2(KImageEditorLogFile, "CImageEditorAppUi:OperationReadyL (aOpId:%d, aError:%d)", (TInt)aOpId, aError);
+
+	//	Kill wait note
+	KillWaitNote();
+
+	//	Handle error
+	if (aError != KErrNone)
 		{
+		switch (aOpId)
+			{
 			case EOperationCodeLoad:
 			case EOperationCodeBlockLoad:
 			case EOperationCodeSearch:
-            {
-
-                if (KErrCancel == aError)
-                {
-                    // Loading image was cancelled. 
-                    User::Leave (KSIEEErrorOkToExit);
-                }
-                else
-                {
-                    User::Leave (KSIEEOpenFile);
-                }
-                break;
-            }
-            case EOperationCodeSave:
-            case EOperationCodeBlockSave:
-            {
-                LOG(KImageEditorLogFile, "CImageEditorAppUi: Save cancelled");
+				{
+
+				if (KErrCancel == aError)
+					{
+					// Loading image was cancelled. 
+					User::Leave(KSIEEErrorOkToExit);
+					}
+				else
+					{
+					User::Leave(KSIEEOpenFile);
+					}
+				break;
+				}
+			case EOperationCodeSave:
+			case EOperationCodeBlockSave:
+				{
+					LOG(KImageEditorLogFile, "CImageEditorAppUi: Save cancelled");
 #ifdef VERBOSE
-                LOGFMT3(KImageEditorLogFile, "\tiSourceFileName: %S, iDocumentName: %S, iTempSaveFileName: %S", &iSourceFileName, &iDocumentName, &iTempSaveFileName);
+				LOGFMT3(KImageEditorLogFile, "\tiSourceFileName: %S, iDocumentName: %S, iTempSaveFileName: %S", &iSourceFileName, &iDocumentName, &iTempSaveFileName);
 #endif
 
-                iSaving = EFalse;
-
-                // delete the temporary files
-                DeleteTempFiles();
-
-                // Reset bitmap sink and screen size
-                UpdateScreenRectL();
-                iOrientationChanged = EFalse;
-
-
-                if (!iExitFromApp)
-                {
-    
-                    if (iSending)
-                    {
-                        // Restore document name
-                        iEditorManager->SetImageName (iDocumentName);
-                        iSending = EFalse;
-                    }
-                    if (KErrCancel == aError)
-                    {
-                        // KErrCancel means user cancel, not an error.
-                        ResetBusy();
-                    }
-                    else
-                    {
-                        // Leave in case of error.
-                        User::Leave (KSIEESaveFile);
-                    }
-                }
-                else
-                {
-                	TInt exit = 0;
-                    if (iSaveOnExit)
-                    {
-	                    exit = ((CImageEditorUIView *)iEditorView)->LaunchExitWithoutSavingQueryL();
-                    }
-
-                    if (exit == EImageEditorSoftkeyCmdYes || !iSaveOnExit)
-                    {
-                        // If the image has not been saved before, the reserved target
-                        // file has zero size and can be deleted.
-                        TEntry entry;
-                        TInt err = iEikonEnv->FsSession().Entry( iDocumentName, entry );
-                        if ( err == KErrNone && entry.iSize == 0 )
-                        {
-                            BaflUtils::DeleteFile (iEikonEnv->FsSession(), iDocumentName);
-                        }
-
-                        // Exit the application
-                        User::Leave (KSIEEErrorOkToExit);
-                    }
-                    else
-                    {
-                        iExitFromApp = EFalse;
-                        ResetBusy();
-                    }
-                }
-                SetOrientationL(EAppUiOrientationUnspecified);
-                break;
-            }
-            default:
-            {
-                User::Leave (aError);
-                break;
-            }
+				iSaving = EFalse;
+
+				// delete the temporary files
+				DeleteTempFiles();
+
+				// Reset bitmap sink and screen size
+				UpdateScreenRectL();
+				iOrientationChanged = EFalse;
+
+				if (!iExitFromApp)
+					{
+
+					if (iSending)
+						{
+						// Restore document name
+						iEditorManager->SetImageName(iDocumentName);
+						iSending = EFalse;
+						}
+					if (KErrCancel == aError)
+						{
+						// KErrCancel means user cancel, not an error.
+						ResetBusy();
+						}
+					else
+						{
+						// Leave in case of error.
+						User::Leave(KSIEESaveFile);
+						}
+					}
+				else
+					{
+					TInt exit = 0;
+					if (iSaveOnExit)
+						{
+						exit
+								= ((CImageEditorUIView *) iEditorView)->LaunchExitWithoutSavingQueryL();
+						}
+
+					if (exit == EImageEditorSoftkeyCmdYes || !iSaveOnExit)
+						{
+						// If the image has not been saved before, the reserved target
+						// file has zero size and can be deleted.
+						TEntry entry;
+						TInt err = iEikonEnv->FsSession().Entry(iDocumentName,
+								entry);
+						if (err == KErrNone && entry.iSize == 0)
+							{
+							BaflUtils::DeleteFile(iEikonEnv->FsSession(),
+									iDocumentName);
+							}
+
+						// Exit the application
+						User::Leave(KSIEEErrorOkToExit);
+						}
+					else
+						{
+						iExitFromApp = EFalse;
+						ResetBusy();
+						}
+					}
+				SetOrientationL(EAppUiOrientationUnspecified);
+				break;
+				}
+			default:
+				{
+				User::Leave(aError);
+				break;
+				}
+			}
 		}
-	}
 	else
-	{
-		switch ( aOpId ) 
 		{
+		switch (aOpId)
+			{
 
 			case EOperationCodeLoad:
 			case EOperationCodeBlockLoad:
-            {
-                LOG(KImageEditorLogFile, "CImageEditorAppUi: Image loaded");
-
-                // Find out whether the source file belongs to any albums
-                ImageEditorUtils::FindAlbumsForImageFileL (
-                    iSourceImageMgAlbumIdList,
-                    iSourceFileName );
-
-                // Generate the name for the saved file
-                TInt err = ImageEditorUtils::GenerateNewDocumentNameL (
-                    iEikonEnv->FsSession(), 
-                    iSourceFileName, 
-                    iDocumentName,
-                    &iSourceImageMgAlbumIdList );
+				{
+					LOG(KImageEditorLogFile, "CImageEditorAppUi: Image loaded");
+
+				// Find out whether the source file belongs to any albums
+				ImageEditorUtils::FindAlbumsForImageFileL(
+						iSourceImageMgAlbumIdList, iSourceFileName);
+
+				// Generate the name for the saved file
+				TInt err = ImageEditorUtils::GenerateNewDocumentNameL(
+						iEikonEnv->FsSession(), iSourceFileName, iDocumentName,
+						&iSourceImageMgAlbumIdList);
 
 				//	Delete old temp files, which could exist if the exit was not clean
 				DeleteTempFiles();
-	
-                // If there is not enough disk space to save the edited image, show
-                // error note but continue anyway (user can free up memory before saving)
-                if (KSIEENotEnoughDiskSpace == err)
-                {
-                    ShowErrorNoteL (err);
-                }
-                else if (KErrNone != err)
-                {
-                    // Fatal error 
-                    User::Leave (err);
-                }                
-                iEditorManager->SetImageName (iDocumentName);
-                iImageLoaded = ETrue;
-                InitializeUiItemsL();
-                
-                if (!iOrientationChanged)
-                {
-                    //  Immediately display the loaded image
-                    ((CImageEditorUIView *)iEditorView)->
-                        SetImageL ( iEditorManager->GetPreviewImage() );
-                }
-                
-                ApplicationReadyL();
-				
+
+				// If there is not enough disk space to save the edited image, show
+				// error note but continue anyway (user can free up memory before saving)
+				if (KSIEENotEnoughDiskSpace == err)
+					{
+					ShowErrorNoteL(err);
+					}
+				else if (KErrNone != err)
+					{
+					// Fatal error 
+					User::Leave(err);
+					}
+				iEditorManager->SetImageName(iDocumentName);
+				iImageLoaded = ETrue;
+				InitializeUiItemsL();
+
+				if (!iOrientationChanged)
+					{
+					//  Immediately display the loaded image
+					((CImageEditorUIView *) iEditorView)-> SetImageL(
+							iEditorManager->GetPreviewImage());
+					}
+
+				ApplicationReadyL();
+
 				// Do not have to keep file open anymore. 
 				// Fixes problem with Online Printing
 				iFile.Close();
 
-                break;
-            }
+				break;
+				}
 
 			case EOperationCodeSave:
 			case EOperationCodeBlockSave:
-            {
-                LOG(KImageEditorLogFile, "CImageEditorAppUi: Image saved");
+				{
+					LOG(KImageEditorLogFile, "CImageEditorAppUi: Image saved");
 #ifdef VERBOSE
-                LOGFMT3(KImageEditorLogFile, "\tiSourceFileName: %S, iDocumentName: %S, iTempSaveFileName: %S", &iSourceFileName, &iDocumentName, &iTempSaveFileName);
+				LOGFMT3(KImageEditorLogFile, "\tiSourceFileName: %S, iDocumentName: %S, iTempSaveFileName: %S", &iSourceFileName, &iDocumentName, &iTempSaveFileName);
 #endif
-                ResetBusy();
-                iSaving = EFalse;
-
-		        RFs & fs = iEikonEnv->FsSession();
-		        if ( BaflUtils::FileExists (fs, iTempSaveFileName ))
-                {
-                    // Image has been successfully saved
-                    iImageSaved = ETrue;                                         
-                
-            		CFileMan* fileMan = CFileMan::NewL( fs );	
-            		CleanupStack::PushL( fileMan );
-            		
-            		// the temporary image file and the target file are located in the same drive
-            	    if ( iTempSaveFileName.Left(1) == iDocumentName.Left(1) )
-            			{
-            			User::LeaveIfError( fileMan->Rename( iTempSaveFileName, iDocumentName ));	
-            			}
-           			// the temporary image file and the target file are not in the same drive
-            		else
-            			{
-            			User::LeaveIfError( fileMan->Move( iTempSaveFileName, iDocumentName ));	
-            			}
-            		CleanupStack::PopAndDestroy(); //fileMan
-                                       
-                    // Source file changes (at least if saved with a new name)
-                    iSourceFileName = iDocumentName;
-                    
-                    // Update title
-                    SetFileNameTitlePaneL(iDocumentName); 
-                    iEditorManager->SetImageName(iDocumentName);
-                    
-                    LOGFMT(KImageEditorLogFile, "CImageEditorAppUi: Temp file renamed to %S", &iDocumentName);
-
-                    // Purge undo stack if on the way to exit.
-                    // Don't purge if printing or sending the image.
-                    if( iExitFromApp )
-                    {
-                        iEditorManager->PurgeUndoRedoHistory();
-                    }
-
-                    FinalizeSaveL();
-                }
-			
-                if (iExitFromApp)
-                {
-                    DeleteTempFiles();
-                    User::Leave (KSIEEErrorOkToExit);
-                }
-                else 
-                {
-                    if (iSending)
-                    {
-                        // Restore document name
-                        SetBusy();
-                        iEditorManager->SetImageName (iDocumentName);
-                        iCallback->DoCallback (KObSendCallbackID);
-                    }
-                    
-                    if (iPrinting)
-                    {
-                        // Restore document name
-                        SetBusy();
-                        iEditorManager->SetImageName (iDocumentName);
-                        iCallback->DoCallback (KObPrintCallbackID);
-                    }
-
-                    // Reset bitmap sink and screen size
-                    UpdateScreenRectL();
-
-                    // Set saved image name for printing
-                    ((CImageEditorUIView *)iEditorView)->SetImageFileName(iDocumentName);
-
-                }
-
-                // Update menu
-                SetUndoFlag ();
-                SetOrientationL(EAppUiOrientationUnspecified);
-                LOG(KImageEditorLogFile, "CImageEditorAppUi: Saving procedure completed");
-                break;
-            }
-
-            default:
-            {
-                break;
-            }
-        }
-    }
-}
+				ResetBusy();
+				iSaving = EFalse;
+
+				RFs & fs = iEikonEnv->FsSession();
+				if (BaflUtils::FileExists(fs, iTempSaveFileName))
+					{
+					// Image has been successfully saved
+					iImageSaved = ETrue;
+
+					CFileMan* fileMan = CFileMan::NewL(fs);
+					CleanupStack::PushL(fileMan);
+
+					// the temporary image file and the target file are located in the same drive
+					if (iTempSaveFileName.Left(1) == iDocumentName.Left(1))
+						{
+						User::LeaveIfError(fileMan->Rename(iTempSaveFileName,
+								iDocumentName));
+						}
+					// the temporary image file and the target file are not in the same drive
+					else
+						{
+						User::LeaveIfError(fileMan->Move(iTempSaveFileName,
+								iDocumentName));
+						}
+					CleanupStack::PopAndDestroy(); //fileMan
+
+					// Source file changes (at least if saved with a new name)
+					iSourceFileName = iDocumentName;
+
+					// Update title
+					SetFileNameTitlePaneL(iDocumentName);
+					iEditorManager->SetImageName(iDocumentName);
+
+						LOGFMT(KImageEditorLogFile, "CImageEditorAppUi: Temp file renamed to %S", &iDocumentName);
+
+					// Purge undo stack if on the way to exit.
+					// Don't purge if printing or sending the image.
+					if (iExitFromApp)
+						{
+						iEditorManager->PurgeUndoRedoHistory();
+						}
+
+					FinalizeSaveL();
+					}
+
+				if (iExitFromApp)
+					{
+					DeleteTempFiles();
+					User::Leave(KSIEEErrorOkToExit);
+					}
+				else
+					{
+					if (iSending)
+						{
+						// Restore document name
+						SetBusy();
+						iEditorManager->SetImageName(iDocumentName);
+						iCallback->DoCallback(KObSendCallbackID);
+						}
+
+					if (iPrinting)
+						{
+						// Restore document name
+						SetBusy();
+						iEditorManager->SetImageName(iDocumentName);
+						iCallback->DoCallback(KObPrintCallbackID);
+						}
+
+					// Reset bitmap sink and screen size
+					UpdateScreenRectL();
+
+					// Set saved image name for printing
+					((CImageEditorUIView *) iEditorView)->SetImageFileName(
+							iDocumentName);
+
+					}
+
+				// Update menu
+				SetUndoFlag();
+				SetOrientationL(EAppUiOrientationUnspecified);
+					LOG(KImageEditorLogFile, "CImageEditorAppUi: Saving procedure completed");
+				break;
+				}
+
+			default:
+				{
+				break;
+				}
+			}
+		}
+	}
 
 //=============================================================================
-void CImageEditorAppUi::RenderL ()
-{
-	LOG(KImageEditorLogFile, "CImageEditorAppUi: Rendering...");
+void CImageEditorAppUi::RenderL()
+	{
+		LOG(KImageEditorLogFile, "CImageEditorAppUi: Rendering...");
 	SetBusy();
 	iEditorManager->ProcessImageL();
-	((CImageEditorUIView *)iEditorView)->GetContainer()->DrawNow();
+	((CImageEditorUIView *) iEditorView)->GetContainer()->DrawNow();
 	ResetBusy();
-}
+	}
 
 //=============================================================================
-TKeyResponse CImageEditorAppUi::HandleKeyEventL (
-    const TKeyEvent &	aKeyEvent,
-	TEventCode			aType
-	)
-{
-    LOGFMT2(KImageEditorLogFile, "CImageEditorAppUi:HandleKeyEventL (aKeyEvent: %d, aType:\t %d)", aKeyEvent,aType);
-
-    TKeyResponse response = EKeyWasNotConsumed;
-
-    // if we are busy doing something
+TKeyResponse CImageEditorAppUi::HandleKeyEventL(const TKeyEvent & aKeyEvent,
+		TEventCode aType)
+	{
+		LOGFMT2(KImageEditorLogFile, "CImageEditorAppUi:HandleKeyEventL (aKeyEvent: %d, aType:\t %d)", aKeyEvent,aType);
+
+	TKeyResponse response = EKeyWasNotConsumed;
+
+	// if we are busy doing something
 	// then we consume the key
-    if ( iBusy || (iConstructionState != EConstructionStateReady) )
-    {
-        response = EKeyWasConsumed;
-    }
+	if (iBusy || (iConstructionState != EConstructionStateReady))
+		{
+		response = EKeyWasConsumed;
+		}
 
 	// we are only interested in real key events
 	// rather than ups or downs
 	else if (aType != EEventKey)
-    {
-        // These are handled separately here because pressing shift key doesn't
-        // give EEventKey event at all
-        if ( aType == EEventKeyDown )
-        {
-            switch (aKeyEvent.iScanCode)
-	        {
-		        case EStdKeyLeftShift:
-		        {
-		            iEditorView->HandleCommandL (EImageEditorPreGlobalZoomChange);
-                    ZoomL( EZoomIn );
-			    	iEditorView->HandleCommandL (EImageEditorGlobalZoomChanged);
-			        response = EKeyWasConsumed;
-			        break;
-		        }
-                case EStdKeyRightShift:
-		        {
-		            iEditorView->HandleCommandL (EImageEditorPreGlobalZoomChange);
-                    ZoomL( EZoomOut );
-			    	iEditorView->HandleCommandL (EImageEditorGlobalZoomChanged);
-			        response = EKeyWasConsumed;
-		            break;
-		        }
-            }
-        }
-            
-	    response = EKeyWasNotConsumed;
-    }
+		{
+		// These are handled separately here because pressing shift key doesn't
+		// give EEventKey event at all
+		if (aType == EEventKeyDown)
+			{
+			switch (aKeyEvent.iScanCode)
+				{
+				case EStdKeyLeftShift:
+					{
+					iEditorView->HandleCommandL(EImageEditorPreGlobalZoomChange);
+					ZoomL(EZoomIn);
+					iEditorView->HandleCommandL(EImageEditorGlobalZoomChanged);
+					response = EKeyWasConsumed;
+					break;
+					}
+				case EStdKeyRightShift:
+					{
+					iEditorView->HandleCommandL(EImageEditorPreGlobalZoomChange);
+					ZoomL(EZoomOut);
+					iEditorView->HandleCommandL(EImageEditorGlobalZoomChanged);
+					response = EKeyWasConsumed;
+					break;
+					}
+				}
+			}
+
+		response = EKeyWasNotConsumed;
+		}
 
 	// scan codes for numbers are their ASCII codes
-    else
-    {
-        TBool rotated = LandscapeScreenOrientation();
-        
-        switch (aKeyEvent.iScanCode)
-	    {
-
-		    case 0x30: // 0
-		    {
-#ifdef FULLSCREEN_AVAILABLE 
-		    	if (iFullScreen)
-			    {
-				    ResetFullScreenL();
-			    }
-			    else
-			    {
-				    SetFullScreenL();
-			    }
-			    response = EKeyWasConsumed;
-#endif // FULLSCREEN_AVAILABLE		    
-                break;
-		    }
-#ifndef LANDSCAPE_ROTATE_HOTKEYS
-	        case 0x31: // 1
-#else
-            case 0x33: // 3
-#endif
-		    {
-		        RotateL (ERotationCounterClockwise);
-			    response = EKeyWasConsumed;
-                break;
-		    }
-
-		    case 0x32: // 2
+	else
+		{
+		TBool rotated = LandscapeScreenOrientation();
+
+		switch (aKeyEvent.iScanCode)
 			{
-				if (!rotated)
-				{
-					PanL (EDirectionUp);
-	                response = EKeyWasConsumed;			
-				}
-				else
+
+			case 0x30: // 0
 				{
-					PanL (EDirectionLeft);
-				    response = EKeyWasConsumed;
+#ifdef FULLSCREEN_AVAILABLE 
+				if (iFullScreen)
+					{
+					ResetFullScreenL();
+					}
+				else
+					{
+					SetFullScreenL();
+					}
+				response = EKeyWasConsumed;
+#endif // FULLSCREEN_AVAILABLE		    
+				break;
 				}
-                break;				
-			}
-
 #ifndef LANDSCAPE_ROTATE_HOTKEYS
-		    case 0x33: // 3
-#else		    
-		    case 0x39: // 9
-#endif		    		    
-		    {
-                RotateL (ERotationClockwise);
-			    response = EKeyWasConsumed;
-                break;
-		    }
-
-		    case 0x34: // 4
-		    {
-				if (!rotated)
+			case 0x31: // 1
+#else
+				case 0x33: // 3
+#endif
 				{
-		            PanL (EDirectionLeft);
-				    response = EKeyWasConsumed;
-				}
-				else
-				{
-					PanL (EDirectionDown);
-				    response = EKeyWasConsumed;	
+				RotateL(ERotationCounterClockwise);
+				response = EKeyWasConsumed;
+				break;
 				}
-                break;
-		    }
-		    case 0x35: // 5
-		    {
-		        // No function		    	
-                break;
-		    }
-		    
-            case 0x36: // 6 
-		    {	
-		    	if (!rotated)
+
+			case 0x32: // 2
+				{
+				if (!rotated)
 					{
-	                PanL (EDirectionRight);
-				    response = EKeyWasConsumed;
+					PanL(EDirectionUp);
+					response = EKeyWasConsumed;
 					}
 				else
 					{
-					PanL (EDirectionUp);
-	                response = EKeyWasConsumed;		
-					}	
-                break;
-		    }
-		    
-		    case 0x38: // 8      		    
-		    {
-		    	if (!rotated)
+					PanL(EDirectionLeft);
+					response = EKeyWasConsumed;
+					}
+				break;
+				}
+
+#ifndef LANDSCAPE_ROTATE_HOTKEYS
+			case 0x33: // 3
+#else		    
+				case 0x39: // 9
+#endif		    		    
+				{
+				RotateL(ERotationClockwise);
+				response = EKeyWasConsumed;
+				break;
+				}
+
+			case 0x34: // 4
+				{
+				if (!rotated)
+					{
+					PanL(EDirectionLeft);
+					response = EKeyWasConsumed;
+					}
+				else
+					{
+					PanL(EDirectionDown);
+					response = EKeyWasConsumed;
+					}
+				break;
+				}
+			case 0x35: // 5
+				{
+				// No function		    	
+				break;
+				}
+
+			case 0x36: // 6 
+				{
+				if (!rotated)
+					{
+					PanL(EDirectionRight);
+					response = EKeyWasConsumed;
+					}
+				else
 					{
-	                PanL (EDirectionDown);
-				    response = EKeyWasConsumed;
+					PanL(EDirectionUp);
+					response = EKeyWasConsumed;
+					}
+				break;
+				}
+
+			case 0x38: // 8      		    
+				{
+				if (!rotated)
+					{
+					PanL(EDirectionDown);
+					response = EKeyWasConsumed;
+					}
+				else
+					{
+					PanL(EDirectionRight);
+					response = EKeyWasConsumed;
+					}
+				break;
+				}
+
+				// following cases handle four directions and select key
+			case EStdKeyRightArrow:
+				{
+				PanL(EDirectionRight);
+				response = EKeyWasConsumed;
+				break;
+				}
+			case EStdKeyLeftArrow:
+				{
+				PanL(EDirectionLeft);
+				response = EKeyWasConsumed;
+				break;
+				}
+			case EStdKeyUpArrow:
+				{
+				PanL(EDirectionUp);
+				response = EKeyWasConsumed;
+				break;
+				}
+			case EStdKeyDownArrow:
+				{
+				PanL(EDirectionDown);
+				response = EKeyWasConsumed;
+				break;
+				}
+			case EStdKeyEnter:
+				{
+				TBool zoomedIn =
+						((CImageEditorUIView *) iEditorView)->InZoomingState();
+				if (zoomedIn)
+					{
+					iEditorView->HandleCommandL(EImageEditorPreGlobalZoomChange);
+					ZoomL(EZoomIn);
+					iEditorView->HandleCommandL(EImageEditorGlobalZoomChanged);
 					}
 				else
 					{
-					PanL (EDirectionRight);
-				    response = EKeyWasConsumed;
+					// display the plugin selection grid if not in zoomed state
+					HandleCommandL(EImageEditorMenuCmdApplyEffect);
+					}
+				response = EKeyWasConsumed;
+				break;
+				}
+			case 0x2a: // *
+			case EStdKeyNkpAsterisk: // *
+			case EStdKeyIncVolume:
+				{
+				if (iEditorManager->IsPluginLoaded())
+					{
+					if (iEditorManager->GetZoomMode() == EZoomIn3)
+						{
+						response = EKeyWasConsumed;
+						break;
+						}
+					}
+				iEditorView->HandleCommandL(EImageEditorPreGlobalZoomChange);
+				ZoomL(EZoomIn);
+				iEditorView->HandleCommandL(EImageEditorGlobalZoomChanged);
+				response = EKeyWasConsumed;
+				break;
+				}
+			case 0x23: // #
+			case EStdKeyHash: // #
+			case EStdKeyDecVolume:
+				{
+				if (iEditorManager->IsPluginLoaded())
+					{
+					if (iEditorManager->GetZoomMode() == EZoomNormal)
+						{
+						response = EKeyWasConsumed;
+						break;
+						}
 					}
-                break;
-		    }
-
-		    // following cases handle four directions and select key
-            case EStdKeyRightArrow: 
-		    {
-                PanL (EDirectionRight);
-			    response = EKeyWasConsumed;
-                break;
-		    }
-		    case EStdKeyLeftArrow: 
-		    {
-                PanL (EDirectionLeft);
-			    response = EKeyWasConsumed;
-                break;
-		    }
-		    case EStdKeyUpArrow: 
-		    {
-                PanL (EDirectionUp);
-			    response = EKeyWasConsumed;
-                break;
-		    }
-		    case EStdKeyDownArrow: 
-		    {
-                PanL (EDirectionDown);
-			    response = EKeyWasConsumed;
-                break;
-		    }
-            case EStdKeyEnter: 
-		    {			    			                    
-                TBool zoomedIn = ( ( CImageEditorUIView *)iEditorView )->InZoomingState();                
-                if ( zoomedIn )
-                    {
-                    iEditorView->HandleCommandL (EImageEditorPreGlobalZoomChange);
-                    ZoomL( EZoomIn );
-    		    	iEditorView->HandleCommandL (EImageEditorGlobalZoomChanged);    		            
-                    }
-                else
-                    {
-                    // display the plugin selection grid if not in zoomed state
-                    HandleCommandL( EImageEditorMenuCmdApplyEffect );
-                    }    
-                response = EKeyWasConsumed;                		        
-                break;
-		    }
-	        case 0x2a: // *
-		    case EStdKeyNkpAsterisk: // *
-		    case EStdKeyIncVolume:
-		    {
-		    	if ( iEditorManager->IsPluginLoaded() )
-		    	{
-		    		if ( iEditorManager->GetZoomMode()== EZoomIn3 )
-		    		{
-		    			  response = EKeyWasConsumed;
-		    			  break;
-		    		}
-		    	}
-			    iEditorView->HandleCommandL (EImageEditorPreGlobalZoomChange);
-                ZoomL (EZoomIn);
-				iEditorView->HandleCommandL (EImageEditorGlobalZoomChanged);
-			    response = EKeyWasConsumed;
-                break;
-		    }
-		    case 0x23: // #
-	        case EStdKeyHash: // #
-	        case EStdKeyDecVolume:
-	        {
-	        	  if ( iEditorManager->IsPluginLoaded() )
-	        	  {
-	        		   if ( iEditorManager->GetZoomMode()== EZoomNormal )
-	        		   {
-	        		       response = EKeyWasConsumed;
-	        		       break;
-	        		   }
-	        	  }
-	            iEditorView->HandleCommandL (EImageEditorPreGlobalZoomChange);
-                ZoomL (EZoomOut);
-				iEditorView->HandleCommandL (EImageEditorGlobalZoomChanged);
+				iEditorView->HandleCommandL(EImageEditorPreGlobalZoomChange);
+				ZoomL(EZoomOut);
+				iEditorView->HandleCommandL(EImageEditorGlobalZoomChanged);
 				response = EKeyWasConsumed;
-	            break;
-	        }
-	        case EStdKeyYes: // green answer call key
-		    {
-                if (!iEditorManager->IsPluginLoaded())
-                {   
-                    // when touch is enabled, dialer application is launched 
-                    // by the framework and application should not consume
-                    // this key. Otherwise image is saved and send menu opened.
-			        if ( !AknLayoutUtils::PenEnabled() )
-			            {
-			            if ( !iSending )
-			            	{
-			            	SaveChangesAndSendL();
-			            	} 
-			            response = EKeyWasConsumed;    
-			            }
-			        else
-			            {
-			            response = EKeyWasNotConsumed;
-			            }    				    
-                }
-                break;
-		    }		    		  
-            case EStdKeyDevice3: // Select key (OK key)
-            {
-                // display the plugin selection grid
-                HandleCommandL(EImageEditorMenuCmdApplyEffect);
-                response = EKeyWasConsumed;
-                break;
-            }
-	        case EStdKeyNo: // end key
-		    {
-		    	iBusy = ETrue;
-			    response = EKeyWasNotConsumed;
-                break;
-		    }		    		  
-
-		    default:
-		    {
-			    response = EKeyWasNotConsumed;
-                break;
-		    }
-        }
-    }
+				break;
+				}
+			case EStdKeyYes: // green answer call key
+				{
+				if (!iEditorManager->IsPluginLoaded())
+					{
+					// when touch is enabled, dialer application is launched 
+					// by the framework and application should not consume
+					// this key. Otherwise image is saved and send menu opened.
+					if (!AknLayoutUtils::PenEnabled())
+						{
+						if (!iSending)
+							{
+							SaveChangesAndSendL();
+							}
+						response = EKeyWasConsumed;
+						}
+					else
+						{
+						response = EKeyWasNotConsumed;
+						}
+					}
+				break;
+				}
+			case EStdKeyDevice3: // Select key (OK key)
+				{
+				// display the plugin selection grid
+				HandleCommandL(EImageEditorMenuCmdApplyEffect);
+				response = EKeyWasConsumed;
+				break;
+				}
+			case EStdKeyNo: // end key
+				{
+				iBusy = ETrue;
+				response = EKeyWasNotConsumed;
+				break;
+				}
+
+			default:
+				{
+				response = EKeyWasNotConsumed;
+				break;
+				}
+			}
+		}
 	return response;
-}
+	}
 
 //=============================================================================
-void CImageEditorAppUi::HandleCommandL (TInt aCommand)
-{
-    LOGFMT(KImageEditorLogFile, "CImageEditorAppUi:HandleCommandL (%d)", aCommand);
-
-    switch ( aCommand )
-    {
-
-        /** 
-        *
-        *   MENU COMMANDS
-        *   
-        */
-
-        //  Launch plug-in selection grid
-        case EImageEditorMenuCmdApplyEffect:
+void CImageEditorAppUi::HandleCommandL(TInt aCommand)
+	{
+		LOGFMT(KImageEditorLogFile, "CImageEditorAppUi:HandleCommandL (%d)", aCommand);
+
+	switch (aCommand)
 		{
+
+		/** 
+		 *
+		 *   MENU COMMANDS
+		 *   
+		 */
+
+		//  Launch plug-in selection grid
+		case EImageEditorMenuCmdApplyEffect:
+			{
 			SetBusy();
-            iCallback->DoCallback (KObInitPluginID);
-            break;
-		}
-	
-        //  Undo effect
+			iCallback->DoCallback(KObInitPluginID);
+			break;
+			}
+
+			//  Undo effect
 		case EImageEditorMenuCmdUndo:
-        {
+			{
 			SetBusy();
-            iCallback->DoCallback (KObUndoDCallbackID);
-            break;
-        }
-
-        //  Switch to full screen
+			iCallback->DoCallback(KObUndoDCallbackID);
+			break;
+			}
+
+			//  Switch to full screen
 		case EImageEditorMenuCmdFullScreen:
-        {
+			{
 #ifdef FULLSCREEN_AVAILABLE         
-            SetFullScreenL();
+			SetFullScreenL();
 #endif // FULLSCREEN_AVAILABLE         
-            break;
-        }
-
-        //  Switch to normal screen
+			break;
+			}
+
+			//  Switch to normal screen
 		case EImageEditorMenuCmdNormalScreen:
-        {
+			{
 #ifdef FULLSCREEN_AVAILABLE         
-            ResetFullScreenL();
+			ResetFullScreenL();
 #endif // FULLSCREEN_AVAILABLE            
-            break;
-        }
-        
-        // Increase Zoom
-        case EImageEditorMenuCmdZoomIn:
-        {
-            ZoomL (EZoomIn);
-            break;
-        }
-
-        // Decrease Zoom
-        case EImageEditorMenuCmdZoomOut:
-        {
-            ZoomL (EZoomOut);
-            break;
-        }
-        
-        // Set zoom to minimum (=normal image)
-        case EImageEditorMenuCmdFitToScreen:
-        {
-           ZoomL( EZoomMin );
-           break;
-        }
-        
-        //  Launch CSHelp
-        case EAknCmdHelp:
-        case EImageEditorMenuCmdHelp:
-        {
-            CArrayFix<TCoeHelpContext>* context = CCoeAppUi::AppHelpContextL();
-            if (context)
-            {
-                HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), context);
-            }
-            break;
-        }
-        case EImageEditorMenuCmdSave:
-        {
-        	if ( ! ((CImageEditorUIView*) iEditorView)->IsMemoryInCriticalLevel() )
-        		{
-        		QueryAndSaveL(); 
-        		}
-            break;
-        }
-        
-        //  Close editor
-        case EImageEditorMenuCmdExit:
-        {
-            TBool exitNow = ETrue;
-            if ( iEditorManager->IsImageChanged() )
-            {
-            	if ( ! ((CImageEditorUIView*) iEditorView)->IsMemoryInCriticalLevel() )
-            		{
-            		// launch "Save changes?" query
-            		TInt result = ((CImageEditorUIView *)iEditorView)->LaunchSaveChangesQueryL();            	
-            		if( result == EImageEditorSoftkeyCmdYes )
-            		{	
-            			if (QueryAndSaveL())
-            			{
-            				SetBusy();
-            				iExitFromApp = ETrue;
-            				exitNow = EFalse;
-            				LOG(KImageEditorLogFile, "CImageEditorAppUi:HandleCommandL: Hide application from Fast-swap window.");
-            				CAknAppUi::HideApplicationFromFSW(ETrue);			     		
-            			}
-            			else
-            			{
-			     			iExitFromApp = EFalse;
-			     			exitNow = EFalse;
-            			}
-
-            		}
-            		else if( result == EImageEditorSoftkeyCmdNo )
-            		{	
-		            	// do nothing, exitNow == ETrue
-            		}
-            		else
-            		{
-	                	// Automatic cancel may have occurred, don't exit
-	                	iExitFromApp = EFalse;
-			     		exitNow = EFalse;
-            		}
-	            }
-            }
-                
-            if (exitNow)
-            {
-                DeleteTempFiles();
-                RunAppShutter();
-               
-                
-                //Exit();
-            }
-            break;
-        } 
-
-        /** 
-        *
-        *   SOFTKEY COMMANDS
-        *   
-        */
-
-        //  Back softkey pressed => Close editor
+			break;
+			}
+
+			// Increase Zoom
+		case EImageEditorMenuCmdZoomIn:
+			{
+			ZoomL(EZoomIn);
+			break;
+			}
+
+			// Decrease Zoom
+		case EImageEditorMenuCmdZoomOut:
+			{
+			ZoomL(EZoomOut);
+			break;
+			}
+
+			// Set zoom to minimum (=normal image)
+		case EImageEditorMenuCmdFitToScreen:
+			{
+			ZoomL(EZoomMin);
+			break;
+			}
+
+			//  Launch CSHelp
+		case EAknCmdHelp:
+		case EImageEditorMenuCmdHelp:
+			{
+			CArrayFix<TCoeHelpContext>* context = CCoeAppUi::AppHelpContextL();
+			if (context)
+				{
+				HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(),
+						context);
+				}
+			break;
+			}
+		case EImageEditorMenuCmdSave:
+			{
+			if (!((CImageEditorUIView*) iEditorView)->IsMemoryInCriticalLevel())
+				{
+				QueryAndSaveL();
+				}
+			break;
+			}
+
+			//  Close editor
+		case EImageEditorMenuCmdExit:
+			{
+			TBool exitNow = ETrue;
+			if (iEditorManager->IsImageChanged())
+				{
+				if (!((CImageEditorUIView*) iEditorView)->IsMemoryInCriticalLevel())
+					{
+					// launch "Save changes?" query
+					TInt
+							result =
+									((CImageEditorUIView *) iEditorView)->LaunchSaveChangesQueryL();
+					if (result == EImageEditorSoftkeyCmdYes)
+						{
+						if (QueryAndSaveL())
+							{
+							SetBusy();
+							iExitFromApp = ETrue;
+							exitNow = EFalse;
+								LOG(KImageEditorLogFile, "CImageEditorAppUi:HandleCommandL: Hide application from Fast-swap window.");
+							CAknAppUi::HideApplicationFromFSW(ETrue);
+							}
+						else
+							{
+							iExitFromApp = EFalse;
+							exitNow = EFalse;
+							}
+
+						}
+					else if (result == EImageEditorSoftkeyCmdNo)
+						{
+						// do nothing, exitNow == ETrue
+						}
+					else
+						{
+						// Automatic cancel may have occurred, don't exit
+						iExitFromApp = EFalse;
+						exitNow = EFalse;
+						}
+					}
+				}
+
+			if (exitNow)
+				{
+				DeleteTempFiles();
+				RunAppShutter();
+
+				//Exit();
+				}
+			break;
+			}
+
+			/** 
+			 *
+			 *   SOFTKEY COMMANDS
+			 *   
+			 */
+
+			//  Back softkey pressed => Close editor
 		case EImageEditorSoftkeyCmdBack:
-        {
-        	TBool exitNow = ETrue;
-        	if (iSaving || iCancelling)
-        	{
-        		// ignore	
-        	}
-        	if ( ! ((CImageEditorUIView*) iEditorView)->IsMemoryInCriticalLevel() )
-        	{
-            	if ( iEditorManager->IsImageChanged() )
-            	{   
-            		// launch "Save changes?" query    
-                	TInt result = ((CImageEditorUIView *)iEditorView)->LaunchSaveChangesQueryL();            	
-                	if( result == EImageEditorSoftkeyCmdYes )
-                	{
-			        	if (QueryAndSaveL())
-			        	{
-				        	SetBusy();
-				        	iExitFromApp = ETrue;
-				        	exitNow = EFalse;
-				        	LOG(KImageEditorLogFile, "CImageEditorAppUi:HandleCommandL: Hide application from Fast-swap window.");
-				        	CAknAppUi::HideApplicationFromFSW(ETrue);			     		
-			        	}
-			        	else
-			        	{
-			     			iExitFromApp = EFalse;
-			     			exitNow = EFalse;
-			        	}
-
-                	}
-                	else if( result == EImageEditorSoftkeyCmdNo )
-                	{
-                		// do nothing, exitNow == ETrue
-                	}
-                	else
-                	{
-                		// Automatic cancel may have occurred, don't exit
-                		iExitFromApp = EFalse;
-                		exitNow = EFalse;
-                	}
-	            }
-            }
-            
-        	if (exitNow)
-        	{
-	            DeleteTempFiles();
-    	        RunAppShutter();
-	            //ProcessCommandL(EAknCmdExit);
-        	}
-           	break;
-        }
-
-        /** 
-        *
-        *   SYSTEM COMMANDS
-        *   
-        */
-
-        case EEikCmdExit:
-        {
-			LOG(KImageEditorLogFile, "CImageEditorAppUi: EEikCmdExit caught");
+			{
+			TBool exitNow = ETrue;
+			if (iSaving || iCancelling)
+				{
+				// ignore	
+				}
+			if (!((CImageEditorUIView*) iEditorView)->IsMemoryInCriticalLevel())
+				{
+				if (iEditorManager->IsImageChanged())
+					{
+					// launch "Save changes?" query    
+					TInt
+							result =
+									((CImageEditorUIView *) iEditorView)->LaunchSaveChangesQueryL();
+					if (result == EImageEditorSoftkeyCmdYes)
+						{
+						if (QueryAndSaveL())
+							{
+							SetBusy();
+							iExitFromApp = ETrue;
+							exitNow = EFalse;
+								LOG(KImageEditorLogFile, "CImageEditorAppUi:HandleCommandL: Hide application from Fast-swap window.");
+							CAknAppUi::HideApplicationFromFSW(ETrue);
+							}
+						else
+							{
+							iExitFromApp = EFalse;
+							exitNow = EFalse;
+							}
+
+						}
+					else if (result == EImageEditorSoftkeyCmdNo)
+						{
+						// do nothing, exitNow == ETrue
+						}
+					else
+						{
+						// Automatic cancel may have occurred, don't exit
+						iExitFromApp = EFalse;
+						exitNow = EFalse;
+						}
+					}
+				}
+
+			if (exitNow)
+				{
+				DeleteTempFiles();
+				RunAppShutter();
+				//ProcessCommandL(EAknCmdExit);
+				}
+			break;
+			}
+
+			/** 
+			 *
+			 *   SYSTEM COMMANDS
+			 *   
+			 */
+
+		case EEikCmdExit:
+			{
+				LOG(KImageEditorLogFile, "CImageEditorAppUi: EEikCmdExit caught");
 			DeleteTempFiles();
-            Exit();
-            break;
-        }
-
-        /** 
-        *
-        *   MISC COMMANDS
-        *   
-        */
-
-        //  Render image
-        case EImageEditorCmdRender:
-        {
-            RenderL();
-            break;
-        }
-
-        case EImageEditorCmdViewReady:
-        {
-
-            LOG(KImageEditorLogFile, "CImageEditorAppUi: View ready");
+			Exit();
+			break;
+			}
+
+			/** 
+			 *
+			 *   MISC COMMANDS
+			 *   
+			 */
+
+			//  Render image
+		case EImageEditorCmdRender:
+			{
+			RenderL();
+			break;
+			}
+		case EImageEditorResetFullScreen:
+			{
+			ResetFullScreenL();
+			}
+		case EImageEditorCmdViewReady:
+			{
+
+				LOG(KImageEditorLogFile, "CImageEditorAppUi: View ready");
 			iEditorReady = ETrue;
 
-            //  Initialize UI items
-            InitializeUiItemsL();
+			//  Initialize UI items
+			InitializeUiItemsL();
 			ApplicationReadyL();
-            break;
-        }
+			break;
+			}
 
 		case EImageEditorApplyPlugin:
-        {
+			{
 			//	Return from plug-in
-            SetBusy();
-            iCallback->DoCallback (KObReturnFromPluginID);
-            break;
-        }
-
-        case EImageEditorCancelPlugin:
-        {
+			SetBusy();
+			iCallback->DoCallback(KObReturnFromPluginID);
+			break;
+			}
+
+		case EImageEditorCancelPlugin:
+			{
 			SetBusy();
 			iCancelling = ETrue;
-            iCallback->DoCallback (KObCancelCallbackID);
-            break;
-        }
-
-        case EImageEditorAddFilterToEngine:
-        {
-            // Add the current plugin parameters to engine
-            // and continue with the same plugin
+//			ResetFullScreenL();
+			iPluginName.Copy(KNull);
+			iCallback->DoCallback(KObCancelCallbackID);
+			break;
+			}
+
+		case EImageEditorAddFilterToEngine:
+			{
+			// Add the current plugin parameters to engine
+			// and continue with the same plugin
 			iEditorManager->AddFilterToEngineL();
-            break;
-        }
-
-        case EImageEditorStoreParameters:
-        {
-            break;
-		}
-
-        case EImageEditorUndoFilter:
-        {
-            // Undo one filter (can be called if one plugin
-            // has put more than one filter to the engine)
-            SetBusy();
-            iEditorManager->UndoL();
-            SetUndoFlag();
-            ((CImageEditorUIView *)iEditorView)->GetContainer()->DrawNow();
+			break;
+			}
+
+		case EImageEditorStoreParameters:
+			{
+			break;
+			}
+
+		case EImageEditorUndoFilter:
+			{
+			// Undo one filter (can be called if one plugin
+			// has put more than one filter to the engine)
+			SetBusy();
+			iEditorManager->UndoL();
+			SetUndoFlag();
+			((CImageEditorUIView *) iEditorView)->GetContainer()->DrawNow();
 			ResetBusy();
-            break;
-        }
-
-        case EImageEditorSaveAndPrint:
-        {
-            if ( iEditorManager->IsImageChanged() )
-            {
-                iPrinting = ETrue;
-                SaveImageL();
-            }
-            else
-            {
-                SetBusy();
-                iCallback->DoCallback (KObPrintCallbackID);
-            }
-            break;
-        }
-        case EImageEditorResetZoom:
-        {
-            // If this is called rendering must be done separately
-            iEditorManager->ZoomL( EZoomMin );
-            ((CImageEditorUIView *)iEditorView)->SetZoomModeL( iEditorManager->GetZoomMode() );
-            break;
-        }
-        case EImageEditorCmdTouchPan:
-            {   
-            TouchPanL();            
-            break;
-            }
-        case EImageEditorOpenContextMenu:
-            {   
-            CAknViewAppUi::ProcessCommandL(EAknSoftkeyContextOptions);
-            break;
-            }
-        default:
-        {
-            // CSendUi commands  
-            if (aCommand >= EImageEditorMenuCmdSend &&
-                aCommand < EImageEditorMenuCmdSendLast)
-    		{
-		    	SetBusy();
-                SaveChangesAndSendL();
-                break;
-            }
-
-            /** 
-            *
-            *   BEVERLY HILLS 
-            *   
-            */
-            else
-            {
-                // Do not handle unknown commands
-                ResetBusy();
-                break;
-            }
-        }
+			break;
+			}
+
+		case EImageEditorSaveAndPrint:
+			{
+			if (iEditorManager->IsImageChanged())
+				{
+				iPrinting = ETrue;
+				SaveImageL();
+				}
+			else
+				{
+				SetBusy();
+				iCallback->DoCallback(KObPrintCallbackID);
+				}
+			break;
+			}
+		case EImageEditorResetZoom:
+			{
+			// If this is called rendering must be done separately
+			iEditorManager->ZoomL(EZoomMin);
+			((CImageEditorUIView *) iEditorView)->SetZoomModeL(
+					iEditorManager->GetZoomMode());
+			break;
+			}
+		case EImageEditorCmdTouchPan:
+			{
+			TouchPanL();
+			break;
+			}
+		case EImageEditorOpenContextMenu:
+			{
+			CAknViewAppUi::ProcessCommandL(EAknSoftkeyContextOptions);
+			break;
+			}
+		default:
+			{
+			// CSendUi commands  
+			if (aCommand >= EImageEditorMenuCmdSend && aCommand
+					< EImageEditorMenuCmdSendLast)
+				{
+				SetBusy();
+				SaveChangesAndSendL();
+				break;
+				}
+
+			/** 
+			 *
+			 *   BEVERLY HILLS 
+			 *   
+			 */
+			else
+				{
+				// Do not handle unknown commands
+				ResetBusy();
+				break;
+				}
+			}
+		}
 	}
-}
 
 //=============================================================================
-void CImageEditorAppUi::HandleWsEventL ( 
-	const TWsEvent &		aEvent,
-	CCoeControl *			aDestination 
-	)
-{
+void CImageEditorAppUi::HandleWsEventL(const TWsEvent & aEvent,
+		CCoeControl * aDestination)
+	{
 #ifdef VERBOSE
-    LOGFMT3 (KImageEditorLogFile, "CImageEditorAppUi::HandleWsEventL: aEvent.Type() == %d, aEvent.Key().iCode == %d, aEvent.Key().iScanCode == %d", aEvent.Type(), (TInt)aEvent.Key()->iCode, (TInt)aEvent.Key()->iScanCode);
+	LOGFMT3 (KImageEditorLogFile, "CImageEditorAppUi::HandleWsEventL: aEvent.Type() == %d, aEvent.Key().iCode == %d, aEvent.Key().iScanCode == %d", aEvent.Type(), (TInt)aEvent.Key()->iCode, (TInt)aEvent.Key()->iScanCode);
 #endif
 
-    switch ( aEvent.Type() )
-    {
-
-        case EEventFocusLost:
-        {
+	switch (aEvent.Type())
+		{
+
+		case EEventFocusLost:
+			{
 			iForeground = EFalse;
 			break;
-        }
-		
-        case EEventFocusGained:
-        {
-
-    	    // Update the screen rect when we gain focus.
-		    // This isn't really needed every time, it should only do this if something has changed
-            if (iImageController)
-            {
-                UpdateScreenRectL();
-            }
-
-            if (iFullScreen)
-            {
-                StatusPane()->MakeVisible ( EFalse );
-            }
+			}
+
+		case EEventFocusGained:
+			{
+
+			// Update the screen rect when we gain focus.
+			// This isn't really needed every time, it should only do this if something has changed
+			if (iImageController)
+				{
+				UpdateScreenRectL();
+				}
+
+			if (iFullScreen)
+				{
+				StatusPane()->MakeVisible(EFalse);
+				}
 			iForeground = ETrue;
 			break;
-        }
+			}
 
 		default:
-        {
+			{
 			break;
-        }
-
-    }
-
-	if ( ( aEvent.Type() == KAknUidValueEndKeyCloseEvent) && iEditorManager->IsImageChanged() )
+			}
+
+		}
+
+	if ((aEvent.Type() == KAknUidValueEndKeyCloseEvent)
+			&& iEditorManager->IsImageChanged())
 		{
 		if (iCancelling)
 			{
 			return;
 			}
-		iExitFromApp = ETrue;            
+		iExitFromApp = ETrue;
 		if (iSaving)
 			{
 			iImageController->CancelOperation(ETrue);
@@ -1146,215 +1130,215 @@
 			return;
 			}
 
-		TInt err = ImageEditorUtils::GenerateNewDocumentNameL (
-											iEikonEnv->FsSession(), 
-											iSourceFileName, 
-											iDocumentName,
-											&iSourceImageMgAlbumIdList 
-											);
-		SaveImageOverWriteL( EFalse );
+		TInt err = ImageEditorUtils::GenerateNewDocumentNameL(
+				iEikonEnv->FsSession(), iSourceFileName, iDocumentName,
+				&iSourceImageMgAlbumIdList);
+		SaveImageOverWriteL(EFalse);
 		}
 	else
 		{
-		TInt err( 0 );    
-		TRAP( err, CAknViewAppUi::HandleWsEventL( aEvent, aDestination ) );
+		TInt err(0);
+			TRAP( err, CAknViewAppUi::HandleWsEventL( aEvent, aDestination ) );
 		}
-}
-
+	}
 
 //=============================================================================
 void CImageEditorAppUi::HandleScreenDeviceChangedL()
-    {
-
-	LOG(KImageEditorLogFile, "CImageEditorAppUi::HandleScreenDeviceChangedL()");
-
-    // Work-a-round to avoid softkeys to drawn incorrectly
-    // when a dialog is open when changing to view mode
-    if (iConstructionState == EConstructionStateReady &&
-        iSaving == EFalse &&
-        iSending == EFalse )
-    {   
-        StopDisplayingMenuBar();
-    }
-    
-    CAknViewAppUi::HandleScreenDeviceChangedL();
-
-    TBool visibleFlag = EFalse;
-    if (((CImageEditorUIView *)iEditorView)->GetContainer())
-    {
-        visibleFlag = ((CImageEditorUIView *)iEditorView)->GetContainer()->IsVisible();
-    }
-
-    // If orientation changes during loading - screen bitmap need to be recreated
-    // In the start-up there can be event from system without screen device change
-    if (!iImageLoaded && iConstructionState != EConstructionStateAlloc )
-	    {
-        iOrientationChanged = ETrue;    
-        // Set landscape parameter
-        if (LandscapeScreenOrientation())
-            {
-            iResolutionUtil->SetLandscape(ETrue);
-            }
-        else
-            {
-            iResolutionUtil->SetLandscape(EFalse);
-            }
-        	
-     	iResolutionUtil->UpdateScreenMode();
-    	TRect rect;
-    	iResolutionUtil->GetClientRect(rect);
-    	CCoeControl * control = ((CImageEditorUIView *)iEditorView)->GetContainer();
+	{
+
+		LOG(KImageEditorLogFile, "CImageEditorAppUi::HandleScreenDeviceChangedL()");
+	// Work-a-round to avoid softkeys to drawn incorrectly
+	// when a dialog is open when changing to view mode
+	if (iConstructionState == EConstructionStateReady && iSaving == EFalse
+			&& iSending == EFalse)
+		{
+		StopDisplayingMenuBar();
+		}
+
+	CAknViewAppUi::HandleScreenDeviceChangedL();
+
+	//called while screen mode change 
+	if (!iStandby)
+		{
+		if (iPluginName == KDrawPlugin)
+			{
+			InitialHorizontalDrawPlugin();
+			}
+		}
+	iStandby = EFalse;
+
+	TBool visibleFlag = EFalse;
+	if (((CImageEditorUIView *) iEditorView)->GetContainer())
+		{
+		visibleFlag
+				= ((CImageEditorUIView *) iEditorView)->GetContainer()->IsVisible();
+		}
+
+	// If orientation changes during loading - screen bitmap need to be recreated
+	// In the start-up there can be event from system without screen device change
+	if (!iImageLoaded && iConstructionState != EConstructionStateAlloc)
+		{
+		iOrientationChanged = ETrue;
+		// Set landscape parameter
+		if (LandscapeScreenOrientation())
+			{
+			iResolutionUtil->SetLandscape(ETrue);
+			}
+		else
+			{
+			iResolutionUtil->SetLandscape(EFalse);
+			}
+
+		iResolutionUtil->UpdateScreenMode();
+		TRect rect;
+		iResolutionUtil->GetClientRect(rect);
+		CCoeControl * control =
+				((CImageEditorUIView *) iEditorView)->GetContainer();
 		control->SetRect(rect);
-	    }
-    
-    // Update screen rects if we are currently in the foreground.
-    else if ((iForeground && iImageController) || visibleFlag)
-    {
-        UpdateScreenRectL();
-    }
-
-}
+		}
+
+	// Update screen rects if we are currently in the foreground.
+	else if ((iForeground && iImageController) || visibleFlag)
+		{
+		UpdateScreenRectL();
+		}
+
+	}
 
 //=============================================================================
 TBool CImageEditorAppUi::LandscapeScreenOrientation()
-{
-
-	LOG(KImageEditorLogFile, "CImageEditorAppUi::LandscapeScreenOrientation()");
-
-    TBool orientation = EFalse;
+	{
+
+		LOG(KImageEditorLogFile, "CImageEditorAppUi::LandscapeScreenOrientation()");
+
+	TBool orientation = EFalse;
 
 #ifdef LANDSCAPE_SUPPORT
 
-    TRect rect;
-
-    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, rect);
-
-	if ( rect.iBr.iX > rect.iBr.iY )
-        {
-        orientation = ETrue;
-        }
+	TRect rect;
+
+	AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, rect);
+
+	if (rect.iBr.iX > rect.iBr.iY)
+		{
+		orientation = ETrue;
+		}
 	else
-        {
-        orientation = EFalse;
-        }
+		{
+		orientation = EFalse;
+		}
 
 #endif
 
-	LOGFMT(KImageEditorLogFile, "CImageEditorAppUi: Orientation (%d)", (TInt)orientation);
-
-    return orientation;
-}
+		LOGFMT(KImageEditorLogFile, "CImageEditorAppUi: Orientation (%d)", (TInt)orientation);
+
+	return orientation;
+	}
 
 //=============================================================================
-void CImageEditorAppUi::HandleForegroundEventL (TBool aForeground)
-{
-	LOG(KImageEditorLogFile, "CImageEditorAppUi::HandleForegroundEventL()");
+void CImageEditorAppUi::HandleForegroundEventL(TBool aForeground)
+	{
+		LOG(KImageEditorLogFile, "CImageEditorAppUi::HandleForegroundEventL()");
 
 	if (aForeground)
-	{
-		if ( !BaflUtils::FileExists( iEikonEnv->Static()->FsSession() , iSourceFileName  ) )
+		{
+		if (!BaflUtils::FileExists(iEikonEnv->Static()->FsSession(),
+				iSourceFileName))
 			{
 			DeleteTempFiles();
 			RunAppShutter();
 			}
 
-		if ( iProcessPriorityAltered )
-		{
-		// Return to normal priority.
-		RProcess myProcess;
-		TProcessPriority priority = myProcess.Priority();
-		if ( priority < iOriginalProcessPriority )
+		if (iProcessPriorityAltered)
 			{
-			myProcess.SetPriority( iOriginalProcessPriority );
+			// Return to normal priority.
+			RProcess myProcess;
+			TProcessPriority priority = myProcess.Priority();
+			if (priority < iOriginalProcessPriority)
+				{
+				myProcess.SetPriority(iOriginalProcessPriority);
+				}
+			iProcessPriorityAltered = EFalse;
+			iStandby = ETrue;
 			}
-		iProcessPriorityAltered = EFalse;
+
+		// Check that application is in sync with the system 
+		if (!iImageLoaded && iConstructionState != EConstructionStateAlloc)
+			{
+			iOrientationChanged = ETrue;
+			}
+		else if (iResolutionUtil && LandscapeScreenOrientation()
+				!= iResolutionUtil->GetLandscape())
+			{
+			UpdateScreenRectL();
+			}
+
+		iEditorView->HandleCommandL(EImageEditorFocusGained);
 		}
-
-        // Check that application is in sync with the system 
-        if (!iImageLoaded && iConstructionState != EConstructionStateAlloc )
- 	    	{
-        	iOrientationChanged = ETrue;    
-    		}
-        else if (iResolutionUtil && LandscapeScreenOrientation() != iResolutionUtil->GetLandscape())
-            {
-            UpdateScreenRectL();
-            }
-        
-		iEditorView->HandleCommandL (EImageEditorFocusGained);
-	}
 	else
-	{
-		iEditorView->HandleCommandL (EImageEditorFocusLost);
+		{
+		iEditorView->HandleCommandL(EImageEditorFocusLost);
 		// Set the priority to low. This is needed to handle the situations 
 		// where the engine is performing heavy processing while the application 
 		// is in background.
 		RProcess myProcess;
 		iOriginalProcessPriority = myProcess.Priority();
-		myProcess.SetPriority( EPriorityLow );
+		myProcess.SetPriority(EPriorityLow);
 		iProcessPriorityAltered = ETrue;
-
-
+		iStandby = ETrue;
+
+		}
+	CAknViewAppUi::HandleForegroundEventL(aForeground);
 	}
-    CAknViewAppUi::HandleForegroundEventL (aForeground);
-}
-
 
 //=============================================================================
-TBool CImageEditorAppUi::ProcessCommandParametersL (
-	TApaCommand		aCommand,
-	TFileName &		aDocumentName,
-	const TDesC8 &	aTail 
-	)
-{
-	LOG(KImageEditorLogFile, "CImageEditorAppUi::ProcessCommandParametersL");
-
-    /* ------------- : test only ----------
-    if ( this->ContainerAppUi() == NULL ) // launched as standalone
+TBool CImageEditorAppUi::ProcessCommandParametersL(TApaCommand aCommand,
+		TFileName & aDocumentName, const TDesC8 & aTail)
 	{
-	    aDocumentName = _L("C:\\Data\\Images\\test.jpg");
-	};
-    // ---------------- test only ------------- */
-    
+		LOG(KImageEditorLogFile, "CImageEditorAppUi::ProcessCommandParametersL");
+
 	//	Store command parameter document name 
-    iDocumentName.Copy (aDocumentName);
-
-    //  Save original document name
-    iSourceFileName.Copy(aDocumentName);
-
-    //  Set document name for printing
-    ((CImageEditorUIView *)iEditorView)->SetImageFileName(iDocumentName);
-
-    //	Return default action
-	return CAknViewAppUi::ProcessCommandParametersL (aCommand, aDocumentName, aTail);
+	iDocumentName.Copy(aDocumentName);
+
+	//  Save original document name
+	iSourceFileName.Copy(aDocumentName);
+
+	//  Set document name for printing
+	((CImageEditorUIView *) iEditorView)->SetImageFileName(iDocumentName);
+
+	//	Return default action
+	return CAknViewAppUi::ProcessCommandParametersL(aCommand, aDocumentName,
+			aTail);
 	}
 
 //=============================================================================
 void CImageEditorAppUi::OpenFileL(RFile &aFile)
-    {
-    LOG(KImageEditorLogFile, "CImageEditorAppUi::OpenFileL");
+	{
+		LOG(KImageEditorLogFile, "CImageEditorAppUi::OpenFileL");
 
 	// This function should be called only when editor is started
 	// as an embedded application.
 
-    //	Store command parameter document name 
-    aFile.FullName(iDocumentName);
+	//	Store command parameter document name 
+	aFile.FullName(iDocumentName);
 
 	//  Open file for editor 
 	//  File must be opened until editor is closed, otherwise
 	//  shared session is lost -> Error code -14.
-    RFs& fs = iEikonEnv->FsSession();
-    fs.ShareProtected();
+	RFs& fs = iEikonEnv->FsSession();
+	fs.ShareProtected();
 	TInt err = iFile.Open(fs, iDocumentName, EFileRead | EFileShareReadersOnly);
 	if (KErrNone != err)
 		{
-		User::LeaveIfError(iFile.Open(fs, iDocumentName, EFileRead | EFileShareAny));
+		User::LeaveIfError(iFile.Open(fs, iDocumentName, EFileRead
+				| EFileShareAny));
 		}
 
-    //  Save original document name
-    aFile.FullName(iSourceFileName);
-
-    //  Set document name for printing
-    ((CImageEditorUIView *)iEditorView)->SetImageFileName(iDocumentName);
+	//  Save original document name
+	aFile.FullName(iSourceFileName);
+
+	//  Set document name for printing
+	((CImageEditorUIView *) iEditorView)->SetImageFileName(iDocumentName);
 
 	// If OpenFileL was not called when the startup sequence reached 
 	// the point where it needs the document name, the construction was
@@ -1363,763 +1347,746 @@
 		{
 		// Resume construction
 		iConstructionState = EConstructionStateLoadImage;
-		iCallback->DoCallback (KObConstructCallBackID);
+		iCallback->DoCallback(KObConstructCallBackID);
 		}
-    }
+	}
 
 //=============================================================================
 CArrayFix<TCoeHelpContext>* CImageEditorAppUi::HelpContextL() const
-{
-    CArrayFixFlat<TCoeHelpContext>* array = 
-        new(ELeave)CArrayFixFlat<TCoeHelpContext>(1);
-    CleanupStack::PushL(array);
-    
-    TBool zoomedIn = ( ( CImageEditorUIView *)iEditorView )->InZoomingState();                
-    if ( zoomedIn )
-        {
-        array->AppendL(TCoeHelpContext(TUid::Uid(UID_IMAGE_EDITOR), KSIE_HLP_ZOOMING));    		            
-        }
-    else
-        {
-        array->AppendL(TCoeHelpContext(TUid::Uid(UID_IMAGE_EDITOR), KSIE_HLP_MAIN));
-        }
-                    
-    CleanupStack::Pop(array);
-    return array;
-}
+	{
+	CArrayFixFlat<TCoeHelpContext>* array = new (ELeave) CArrayFixFlat<
+			TCoeHelpContext> (1);
+	CleanupStack::PushL(array);
+
+	TBool zoomedIn = ((CImageEditorUIView *) iEditorView)->InZoomingState();
+	if (zoomedIn)
+		{
+		array->AppendL(TCoeHelpContext(TUid::Uid(UID_IMAGE_EDITOR),
+				KSIE_HLP_ZOOMING));
+		}
+	else
+		{
+		array->AppendL(TCoeHelpContext(TUid::Uid(UID_IMAGE_EDITOR),
+				KSIE_HLP_MAIN));
+		}
+
+	CleanupStack::Pop(array);
+	return array;
+	}
 
 //=============================================================================
-void CImageEditorAppUi::InitializePluginL ()
-{
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: Initialising plugin");
-
-    //	Get pointer to the view
-	CImageEditorUIView * view = (CImageEditorUIView *)iEditorView;
-	
+void CImageEditorAppUi::InitializePluginL()
+	{
+		LOG(KImageEditorLogFile, "CImageEditorAppUi: Initialising plugin");
+
+	//	Get pointer to the view
+	CImageEditorUIView * view = (CImageEditorUIView *) iEditorView;
+
 	//	Close the previous plug-in 
 	iEditorManager->ClosePlugin();
+
+	//	Open a new plug-in 
+	CPluginInfo * pgn_info = view->GetSelectedPluginInfoL();
+
+	if (pgn_info)
+		{
+		iEditorManager->OpenPluginL(pgn_info->PluginDll()->Des());
+		iPluginName.Copy(pgn_info->PluginDll()->Des());
 	
-    //	Open a new plug-in 
-    CPluginInfo * pgn_info = view->GetSelectedPluginInfoL();
-
-    if (pgn_info)
-    {
-	    iEditorManager->OpenPluginL ( pgn_info->PluginDll()->Des() );
-
-        LOG(KImageEditorLogFile, "CImageEditorAppUi: Plugin opened");
-
-        // current rect
-        TRect rect;
-        iResolutionUtil->GetClientRect(rect);
-
-	    //	Create a plug-in control
-	    //  Ownership is moved to the plug-in
-	    CCoeControl * control = NULL;
-	    TInt err = iEditorManager->CreatePluginControlL (
-            rect,
-		    view->GetContainer(),
-		    control
-    	    );
-
-        LOG(KImageEditorLogFile, "CImageEditorAppUi: Plugin control created");
-
-        //  The plug-in activation was cancelled
-	    if (err != KErrNone)
-	    {
-            //	Cancel plug-in
-            iCancelling = ETrue;
-		    iCallback->DoCallback (KObCancelCallbackID);
-	    }
-
-        //  Activate plug-in
-	    else
-        {
-
-            //  Register control to UI
-            view->ActivatePluginL (control);
-    
-            LOG(KImageEditorLogFile, "CImageEditorAppUi: Plugin activated");
-
-
-            //  If the filter did not have a control, close plug-in
-            if ( !control )
-            {
-                iEditorManager->ClosePlugin();
-
-            }
-                    
-            //  Set the last opened image to editor view
-            ((CImageEditorUIView *)iEditorView)->SetImageL (
-                iEditorManager->GetPreviewImage()
-                );
-            
-            ResetBusy();
-        }
-    }
+		//judge if it is draw plug-in
+		if (iPluginName != KNull && iPluginName == KDrawPlugin)
+			{
+			((CImageEditorUIContainer *) ((CImageEditorUIView *) iEditorView)->GetContainer())->IsDrawPlugin(ETrue);
+			SetFullScreenL();
+			}
+		else
+			{
+			((CImageEditorUIContainer *) ((CImageEditorUIView *) iEditorView)->GetContainer())->IsDrawPlugin(EFalse);
+			}
+		
+		LOG(KImageEditorLogFile, "CImageEditorAppUi: Plugin opened");
+
+		// current rect
+		TRect rect;
+		iResolutionUtil->GetClientRect(rect);
+
+		//	Create a plug-in control
+		//  Ownership is moved to the plug-in
+		CCoeControl * control = NULL;
+		TInt err = iEditorManager->CreatePluginControlL(rect,view->GetContainer(), control);
+
+		LOG(KImageEditorLogFile, "CImageEditorAppUi: Plugin control created");
+
+		//  The plug-in activation was cancelled
+		if (err != KErrNone)
+			{
+			//	Cancel plug-in
+			iCancelling = ETrue;
+			iCallback->DoCallback(KObCancelCallbackID);
+			}
+		//  Activate plug-in
+		else
+			{
+			//  Register control to UI
+			view->ActivatePluginL(control);
+
+			LOG(KImageEditorLogFile, "CImageEditorAppUi: Plugin activated");
+
+			//  If the filter did not have a control, close plug-in
+			if (!control)
+				{
+				iEditorManager->ClosePlugin();
+				}
+
+			//  Set the last opened image to editor view
+			((CImageEditorUIView *) iEditorView)->SetImageL(iEditorManager->GetPreviewImage());
+
+			ResetBusy();
+			}
+		}
+	
 	else
-	{
+		{
 		ResetBusy();
+		}
 	}
-}
 
 //=============================================================================
-void CImageEditorAppUi::CreatePluginLocatorL ()
-{
-    iLocator = CPluginLocator::NewL();
-}   
-
-//=============================================================================
-void CImageEditorAppUi::CreateEditorManagerL ()
-{
-    iEditorManager = CImageEditorPluginManager::NewL();
-}
+void CImageEditorAppUi::CreatePluginLocatorL()
+	{
+	iLocator = CPluginLocator::NewL();
+	}
 
 //=============================================================================
-void CImageEditorAppUi::CreateImageControllerL ()
-{
-	iImageController = CImageController::NewL (this, iEditorManager);
-}
+void CImageEditorAppUi::CreateEditorManagerL()
+	{
+	iEditorManager = CImageEditorPluginManager::NewL();
+	}
 
 //=============================================================================
-void CImageEditorAppUi::LoadPluginsL ()
-{
-    //  Scan plug-ins
-    iLocator->ScanPluginsL ();
-}
+void CImageEditorAppUi::CreateImageControllerL()
+	{
+	iImageController = CImageController::NewL(this, iEditorManager);
+	}
 
 //=============================================================================
-void CImageEditorAppUi::InitializeUiItemsL ()
-{
-
-    LOG (KImageEditorLogFile, "CImageEditorAppUi: InitializeUiItemsL");
-
-    //  Set UI items
-    if (iEditorReady && iPluginsScanned && iImageLoaded)
-    {
-	    for (TInt i = 0, c = iLocator->CountPlugins(); i < c; ++i)
-        {	
-	        ((CImageEditorUIView *)iEditorView)->AddPluginUiItemL (iLocator->GetPluginInfo(i));
-	    }
-
-		//  Set the last opened image to editor view
-		((CImageEditorUIView *)iEditorView)->SetImageL (
-            iEditorManager->GetPreviewImage()
-            );
-
-        SetFileNameTitlePaneL(iSourceFileName);
-
-       ((CImageEditorUIView *)iEditorView)->SetZoomModeL( iEditorManager->GetZoomMode() );
+void CImageEditorAppUi::LoadPluginsL()
+	{
+	//  Scan plug-ins
+	iLocator->ScanPluginsL();
+	}
+
+//=============================================================================
+void CImageEditorAppUi::InitializeUiItemsL()
+	{
+
+	LOG (KImageEditorLogFile, "CImageEditorAppUi: InitializeUiItemsL");
+
+	//  Set UI items
+	if (iEditorReady && iPluginsScanned && iImageLoaded)
+		{
+		for (TInt i = 0, c = iLocator->CountPlugins(); i < c; ++i)
+			{
+			((CImageEditorUIView *) iEditorView)->AddPluginUiItemL(iLocator->GetPluginInfo(i));
+			}
+
+		SetFileNameTitlePaneL(iSourceFileName);
+
+		((CImageEditorUIView *) iEditorView)->SetZoomModeL(iEditorManager->GetZoomMode());
 
 		LOG (KImageEditorLogFile, "CImageEditorAppUi: Plugins initialized");
-
-    }
-}
+		}
+	}
 
 //=============================================================================
 void CImageEditorAppUi::ApplicationReadyL()
-{
-    LOG (KImageEditorLogFile, "CImageEditorAppUi: ApplicationReadyLL");
-
-    //  Set UI items
-    if (iEditorReady && iPluginsScanned && iImageLoaded)
-    {     
-        if ( iOrientationChanged )
-        {
-        	LOG(KImageEditorLogFile, 
-        	    "CImageEditorAppUi: Orientation changed, updating screen rect");
-            // Check that application is in sync with the system 
-            // This should fix the problem with screen update after image is loading when
-            // screen is folded during loading
-            UpdateScreenRectL();
-            iOrientationChanged = EFalse;
-        }
-        else if ( ( LandscapeScreenOrientation() && 
-                  ( StatusPane()->CurrentLayoutResId() != 
-                  R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT  ) ) )
-            {
-            LOG(KImageEditorLogFile, 
-            "CImageEditorAppUi: Status pane needs to be changed->updating screen rect");
-            // Updating screen rect updates also status pane to correct "flat version"
-            UpdateScreenRectL();
-            }
-            
+	{
+	LOG (KImageEditorLogFile, "CImageEditorAppUi: ApplicationReadyLL");
+
+	//  Set UI items
+	if (iEditorReady && iPluginsScanned && iImageLoaded)
+		{
+		if (iOrientationChanged)
+			{
+			LOG(KImageEditorLogFile, "CImageEditorAppUi: Orientation changed, updating screen rect");
+			// Check that application is in sync with the system 
+			// This should fix the problem with screen update after image is loading when
+			// screen is folded during loading
+			UpdateScreenRectL();
+			iOrientationChanged = EFalse;
+			}
+		else if ((LandscapeScreenOrientation()
+				&& (StatusPane()->CurrentLayoutResId()
+					!= R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT)))
+			{
+			LOG(KImageEditorLogFile,"CImageEditorAppUi: Status pane needs to be changed->updating screen rect");
+			// Updating screen rect updates also status pane to correct "flat version"
+			UpdateScreenRectL();
+			}
+
 		TRect screenRect;
 		CResolutionUtil::Self()->GetClientRect(screenRect);
 		iOldScreenRect = screenRect;
 
 		ResetBusy();
-		
+
 		// Open Plugin selection grid right away when application start is finished
 		//HandleCommandL(EImageEditorMenuCmdApplyEffect);
-		
+
+		}
 	}
-}
-
 
 //=============================================================================
-void CImageEditorAppUi::LoadImageL ()
-{
-    LOGFMT (KImageEditorLogFile, "CImageEditorAppUi: Loading image (%S)", &iSourceFileName);
+void CImageEditorAppUi::LoadImageL()
+	{
+
+	LOGFMT (KImageEditorLogFile, "CImageEditorAppUi: Loading image (%S)", &iSourceFileName);
 
 	//	Load the image to be edited
-	iImageController->LoadImageL (iSourceFileName);
-}
+	iImageController->LoadImageL(iSourceFileName);
+	}
 
 //=============================================================================
-void CImageEditorAppUi::SaveImageL ()
-{
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: Saving image");
-
-    // Check if source image still exists
-    if (!BaflUtils::FileExists(iEikonEnv->FsSession(), iSourceFileName))
-    {
-        if (iExitFromApp)
-        {
-            TInt exit = 
-                ((CImageEditorUIView *)iEditorView)->LaunchExitWithoutSavingQueryL();
-            if (exit)
-            {
-                // Exit
-                User::Leave (KSIEEErrorOkToExit);
-            }
-            else
-            {
-                iExitFromApp = EFalse;
-                User::Leave(KSIEEInternal);
-            }
-        }
-        else
-        {
-            User::Leave(KSIEEInternal);
-        }
-    }
-
-    // Check document name if not saved yet or memory card removed
-    if ( !iImageSaved ||
-         !BaflUtils::PathExists(iEikonEnv->FsSession(), iTempSaveFileName.Left(3)))
-    {
-        //  If not saved yet, check that document name is valid 
-        SetImageNameL(); 
-    }
+void CImageEditorAppUi::SaveImageL()
+	{
+
+	LOG(KImageEditorLogFile, "CImageEditorAppUi: Saving image");
+
+	// Check if source image still exists
+	if (!BaflUtils::FileExists(iEikonEnv->FsSession(), iSourceFileName))
+		{
+		if (iExitFromApp)
+			{
+			TInt exit =	((CImageEditorUIView *) iEditorView)->LaunchExitWithoutSavingQueryL();
+			if (exit)
+				{
+				// Exit
+				User::Leave(KSIEEErrorOkToExit);
+				}
+			else
+				{
+				iExitFromApp = EFalse;
+				User::Leave(KSIEEInternal);
+				}
+			}
+		else
+			{
+			User::Leave(KSIEEInternal);
+			}
+		}
+
+	// Check document name if not saved yet or memory card removed
+	if (!iImageSaved || !BaflUtils::PathExists(iEikonEnv->FsSession(),
+		iTempSaveFileName.Left(3)))
+		{
+		//  If not saved yet, check that document name is valid 
+		SetImageNameL();
+		}
 
 	//	Set temp save image name to engine
-    iEditorManager->SetImageName (iTempSaveFileName);
-    
-    SetLayoutAwareApp(EFalse);
-    //	Launch save wait note
-	LaunchSaveWaitNoteL ();
-
-    iCallback->DoCallback (KObSaveCallbackID);
-
-}
+	iEditorManager->SetImageName(iTempSaveFileName);
+
+	SetLayoutAwareApp(EFalse);
+	//	Launch save wait note
+	LaunchSaveWaitNoteL();
+
+	iCallback->DoCallback(KObSaveCallbackID);
+
+	}
 
 //=============================================================================
 void CImageEditorAppUi::SetImageNameL()
-    {
-    
-    // Create new document name
-    // (note that this also selects the drive where the image is saved)
-    TInt err = ImageEditorUtils::GenerateNewDocumentNameL (
-        iEikonEnv->FsSession(), 
-        iSourceFileName, 
-        iDocumentName,
-        &iSourceImageMgAlbumIdList 
-        );
-    User::LeaveIfError (err); // cannot save the image
-    iEditorManager->SetImageName (iDocumentName);
-
-    // Change title pane text
-    SetFileNameTitlePaneL(iSourceFileName);
+	{
+
+	// Create new document name
+	// (note that this also selects the drive where the image is saved)
+	TInt err = ImageEditorUtils::GenerateNewDocumentNameL(
+			iEikonEnv->FsSession(), iSourceFileName, iDocumentName,
+			&iSourceImageMgAlbumIdList);
+	User::LeaveIfError(err); // cannot save the image
+	iEditorManager->SetImageName(iDocumentName);
+
+	// Change title pane text
+	SetFileNameTitlePaneL(iSourceFileName);
 
 	//	Check that everything is in order with the file
-	CheckFileL (iDocumentName);
-
-    // Generate temporary save file name
-    TParse tempFileParser;
-    tempFileParser.Set (KTempSaveFile, &KTempPath, &iDocumentName); 
-    iTempSaveFileName.Copy (tempFileParser.FullName());
-    BaflUtils::EnsurePathExistsL (iEikonEnv->FsSession(), iTempSaveFileName);
-
-    }
-
+	CheckFileL(iDocumentName);
+
+	// Generate temporary save file name
+	TParse tempFileParser;
+	tempFileParser.Set(KTempSaveFile, &KTempPath, &iDocumentName);
+	iTempSaveFileName.Copy(tempFileParser.FullName());
+	BaflUtils::EnsurePathExistsL(iEikonEnv->FsSession(), iTempSaveFileName);
+
+	}
 
 //=============================================================================
 void CImageEditorAppUi::SaveChangesAndSendL()
-{
-
-    LOG(KImageEditorLogFile, "CImageEditorAppUi::SaveChangesAndSendL()");
-
-    iSending = ETrue;
-
-    // Delete old temp files if exists
-    DeleteTempFiles();
-
-    if (iEditorManager->IsImageChanged())
-    {
-        // Save image
-        SaveImageL();
-
-    }
-    //	Otherwise send last saved image
-    else
-    {
-	    SendImageL ();
-    }
-
-}
+	{
+
+		LOG(KImageEditorLogFile, "CImageEditorAppUi::SaveChangesAndSendL()");
+
+	iSending = ETrue;
+
+	// Delete old temp files if exists
+	DeleteTempFiles();
+
+	if (iEditorManager->IsImageChanged())
+		{
+		// Save image
+		SaveImageL();
+		}
+	//	Otherwise send last saved image
+	else
+		{
+		SendImageL();
+		}
+
+	}
 
 //=============================================================================
-void CImageEditorAppUi::SendImageL ()
-{
-    LOG(KImageEditorLogFile, "CImageEditorAppUi::SendImageL()");
-
-    ResetBusy();
-
-    RFs& fs = iEikonEnv->FsSession();
-    TFileName fileToSend;        
-    
-    // Check if image has been modified and saved
-    if (BaflUtils::FileExists(fs, iDocumentName))
-    {
-        fileToSend.Append(iDocumentName);        
-    }
-    // Use source file if no changes done
-    else
-    {
-        fileToSend.Append(iSourceFileName);     
-    }
-    
-    LOGFMT(KImageEditorLogFile, "CImageEditorAppUi: Sending image: %S", &fileToSend);
-
-    iEikonEnv->SetBusy(ETrue);
-        
+void CImageEditorAppUi::SendImageL()
+	{
+		LOG(KImageEditorLogFile, "CImageEditorAppUi::SendImageL()");
+
+	ResetBusy();
+
+	RFs& fs = iEikonEnv->FsSession();
+	TFileName fileToSend;
+
+	// Check if image has been modified and saved
+	if (BaflUtils::FileExists(fs, iDocumentName))
+		{
+		fileToSend.Append(iDocumentName);
+		}
+	// Use source file if no changes done
+	else
+		{
+		fileToSend.Append(iSourceFileName);
+		}
+
+	LOGFMT(KImageEditorLogFile, "CImageEditorAppUi: Sending image: %S", &fileToSend);
+
+	iEikonEnv->SetBusy(ETrue);
+
 	// Launch send query dialog
-	TSendingCapabilities cap( 0, 0, TSendingCapabilities::ESupportsAttachments );
-	((CImageEditorUIView *)iEditorView)->LaunchSendQueryL(cap, fileToSend);
-
-    iSending = EFalse;
-    iEikonEnv->SetBusy(EFalse);
-}
+	TSendingCapabilities cap(0, 0, TSendingCapabilities::ESupportsAttachments);
+	((CImageEditorUIView *) iEditorView)->LaunchSendQueryL(cap, fileToSend);
+
+	iSending = EFalse;
+	iEikonEnv->SetBusy(EFalse);
+	}
 
 //=============================================================================
-void CImageEditorAppUi::CheckFileL (const TDesC & aFileName) const
-{
+void CImageEditorAppUi::CheckFileL(const TDesC & aFileName) const
+	{
 	RFs & fs = iEikonEnv->FsSession();
 
 	//	Is file name valid
-    if ( !fs.IsValidName (aFileName) )
-	{
-        User::Leave ( KSIEESaveFile );
+	if (!fs.IsValidName(aFileName))
+		{
+		User::Leave(KSIEESaveFile);
+		}
 	}
 
-}
-
 //=============================================================================
-TBool CImageEditorAppUi::CallbackMethodL (TInt aParam)
-{
+TBool CImageEditorAppUi::CallbackMethodL(TInt aParam)
+	{
 	LOGFMT(KImageEditorLogFile, "CImageEditorAppUi::CallbackMethodL (%d)", aParam);
 
-    TBool ret = EFalse;
-
-	switch (aParam) 
-	{
-
-		case KObConstructCallBackID:
+	TBool ret = EFalse;
+
+	switch (aParam)
 		{
-
-	        switch (iConstructionState) 
-	        {
-
-		        case EConstructionStateAlloc:
-		        {
-                    //  Launch wait note
-                    LaunchLoadWaitNoteL();
-                    
-                    // Initialize resolution utility. CResolutionUtil::InitializeL()
-                    // Returns the singleton instance of the class, creating it if
-                    // it does not yet exist.
-                    iResolutionUtil = CResolutionUtil::InitializeL();
+		case KObConstructCallBackID:
+			{
+			switch (iConstructionState)
+				{
+				case EConstructionStateAlloc:
+					{
+					//  Launch wait note
+					LaunchLoadWaitNoteL();
+
+					// Initialize resolution utility. CResolutionUtil::InitializeL()
+					// Returns the singleton instance of the class, creating it if
+					// it does not yet exist.
+					iResolutionUtil = CResolutionUtil::InitializeL();
 					iResolutionUtil->SetFullScreen(EFalse);
 
 #ifdef LANDSCAPE_SUPPORT
-                    // Set landscape parameter
-                    if (LandscapeScreenOrientation())
-                    {
-                        iResolutionUtil->SetLandscape(ETrue);
-                    }
-                    else
-                    {
-                        iResolutionUtil->SetLandscape(EFalse);
-                    }
+					// Set landscape parameter
+					if (LandscapeScreenOrientation())
+						{
+						iResolutionUtil->SetLandscape(ETrue);
+						}
+					else
+						{
+						iResolutionUtil->SetLandscape(EFalse);
+						}
 #else
 #ifdef LANDSCAPE_ONLY
 					iResolutionUtil->SetLandscape(ETrue);
 #else
-                    iResolutionUtil->SetLandscape(EFalse);
+					iResolutionUtil->SetLandscape(EFalse);
 #endif 
 #endif // LANDSCAPE_SUPPORT
-
-                    iResolutionUtil->UpdateScreenMode();
-                    LOG(KImageEditorLogFile, "CImageEditorAppUi: Resolution set");
-
-                    //  Create the Send UI instance
-   	                iSendAppUi = CSendUi::NewL();
-                    ((CImageEditorUIView *)iEditorView)->SetSendAppUi(iSendAppUi);
-
-                    //  Create plug-in locator
-                    CreatePluginLocatorL();
+					iResolutionUtil->UpdateScreenMode();
+						LOG(KImageEditorLogFile, "CImageEditorAppUi: Resolution set");
+
+					//  Create the Send UI instance
+					iSendAppUi = CSendUi::NewL();
+					((CImageEditorUIView *) iEditorView)->SetSendAppUi(iSendAppUi);
+
+					//  Create plug-in locator
+					CreatePluginLocatorL();
 					LOG(KImageEditorLogFile, "Locator created");
-                    //  Create plug-in manager
-                    CreateEditorManagerL();
+					
+					//  Create plug-in manager
+					CreateEditorManagerL();
 					LOG(KImageEditorLogFile, "Manager created");
-                    //  Create image controller
-                    CreateImageControllerL();
+					
+					//  Create image controller
+					CreateImageControllerL();
 					LOG(KImageEditorLogFile, "Image Controller created");
-                    iConstructionState = EConstructionStateLoadImage;
-                    ret = ETrue;
-                    break;
-		        }
-
-		        case EConstructionStateLoadImage:
-		        {
+					iConstructionState = EConstructionStateLoadImage;
+					ret = ETrue;
+					break;
+					}
+
+				case EConstructionStateLoadImage:
+					{
 					LOG(KImageEditorLogFile, "Loading image");
 
 					//	iSourceFileName is available (in embedded mode) only after 
 					//	CImageEditorDocument::OpenFileL has been called by the system.
 					//	If that has not been done 
 					if (!iSourceFileName.Length())
-					{
+						{
 						iConstructionState = EConstructionStateWaitForStartupParameters;
 						ret = EFalse;
-					}
+						}
 					else
-					{
-	                    //  Kill wait note before loading image. 
-	                    //  Some corrupted images loading stacks if wait note is displayd
-	                    //KillWaitNote();
-	                   
-	                    // Relaunch wait note
-	                    //LaunchLoadWaitNoteL();
-
-	                    //  Load image
-				        LoadImageL();
-	                    
-	                    SetFileNameTitlePaneL(iSourceFileName);
-	                    iConstructionState = EConstructionStateScanPlugins;
-	                    ret = ETrue;
+						{
+						//  Kill wait note before loading image. 
+						//  Some corrupted images loading stacks if wait note is displayd
+						//KillWaitNote();
+
+						// Relaunch wait note
+						//LaunchLoadWaitNoteL();
+
+						//  Load image
+						LoadImageL();
+
+						SetFileNameTitlePaneL(iSourceFileName);
+						iConstructionState = EConstructionStateScanPlugins;
+						ret = ETrue;
+						}
+					break;
 					}
-                    break;
-		        }
-
-		        case EConstructionStateScanPlugins:
-		        {
+
+				case EConstructionStateScanPlugins:
+					{
 					LOG(KImageEditorLogFile, "Scanning plugins");
-                    LoadPluginsL();
-                    iConstructionState = EConstructionStateInitUi;
-                    ret = ETrue;
-                    break;
-		        }
-
-                case EConstructionStateInitUi:
-		        {
+					LoadPluginsL();
+					iConstructionState = EConstructionStateInitUi;
+					ret = ETrue;
+					break;
+					}
+
+				case EConstructionStateInitUi:
+					{
 					LOG(KImageEditorLogFile, "Init UI");
-                    //  Initialize UI items
-                    iPluginsScanned = ETrue;
-                    InitializeUiItemsL();
-			        iConstructionState = EConstructionStateReady;
-                    ret = ETrue;
-                    break;
-		        }
-
-                default:
-		        {
+					//  Initialize UI items
+					iPluginsScanned = ETrue;
+					InitializeUiItemsL();
+					iConstructionState = EConstructionStateReady;
+					ret = ETrue;
+					break;
+					}
+
+				default:
+					{
 					LOG(KImageEditorLogFile, "Ready");
 					KillWaitNote();
-                    ApplicationReadyL();
-                    break;
-		        }
-	        }
-            break;
-        }
+					ApplicationReadyL();
+					break;
+					}
+				}
+			break;
+			}
 
 		case KObReturnFromPluginID:
-		{
-            SetUndoFlag();
+			{
+			SetUndoFlag();
 			iEditorManager->ShowPluginPopup();
 			iEditorManager->ClosePlugin();
-
-            __ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
-            ((CImageEditorUIView *)iEditorView)->ActivateMainViewL();
-
-            ((CImageEditorUIView *)iEditorView)->SetImageL (
-                    iEditorManager->GetPreviewImage());
-            
+			__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
+			((CImageEditorUIView *) iEditorView)->ActivateMainViewL();
+
+			//Only for draw plug-in
+			if (iPluginName != KNull && iPluginName == KDrawPlugin)
+				{				
+				iPluginName.Copy(KNull);
+				ResetFullScreenL();
+				}
+			
 			ResetBusy();
 			break;
-		}
+			}
 
 		case KObInitPluginID:
-		{
-			InitializePluginL ();
-            SetUndoFlag();
+			{
+			InitializePluginL();
+			SetUndoFlag();
 			break;
-		}
+			}
 
 		case KObCancelCallbackID:
-		{
+			{
+			TRect rect;
+			CResolutionUtil::Self()->GetClientRect(rect);
+			CCoeControl* control = ((CImageEditorUIView *) iEditorView)->GetContainer();
+			control->SetRect(rect);
+
 			iEditorManager->ClosePlugin();
-            iEditorManager->UndoL();
-
-
-            __ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
-            ((CImageEditorUIView *)iEditorView)->ActivateMainViewL();
-
-            ((CImageEditorUIView *)iEditorView)->SetImageL (
-                iEditorManager->GetPreviewImage());
-
-            SetUndoFlag();
+			iEditorManager->UndoL();
+
+			__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
+			((CImageEditorUIView *) iEditorView)->ActivateMainViewL();
+
+			((CImageEditorUIView *) iEditorView)->SetImageL(iEditorManager->GetPreviewImage());
+
+			SetUndoFlag();
 			ResetBusy();
 			iCancelling = EFalse;
 			break;
-		}
+			}
 
 		case KObUndoDCallbackID:
-		{
-            iEditorManager->UndoL();
-            SetUndoFlag();
-            ((CImageEditorUIView *)iEditorView)->GetContainer()->DrawNow();
+			{
+			iEditorManager->UndoL();
+			SetUndoFlag();
+			((CImageEditorUIView *) iEditorView)->GetContainer()->DrawNow();
 			ResetBusy();
 			break;
-		}
+			}
 
 		case KObSendCallbackID:
-		{
-            SendImageL ();
-            ResetBusy();
+			{
+			SendImageL();
+			ResetBusy();
+			break;
+			}
+
+		case KObPrintCallbackID:
+			{
+			// Reset first otherwise canceling print application
+			// leaves busy state active
+			iPrinting = EFalse;
+			ResetBusy();
+			((CImageEditorUIView *) iEditorView)-> HandleCommandL(EImageEditorDoPrint);
 			break;
+			}
+
+		case KObSaveCallbackID:
+			{
+			//	Start saving 
+			iImageController->SaveImageL(iTempSaveFileName);
+			iSaving = ETrue;
+			break;
+			}
+
+		default:
+			{
+			break;
+			}
 		}
 
-        case KObPrintCallbackID:
-        {
-            // Reset first otherwise canceling print application
-            // leaves busy state active
-            iPrinting = EFalse;
-            ResetBusy();
-            ((CImageEditorUIView *)iEditorView)->
-                HandleCommandL(EImageEditorDoPrint);
-            break;
-        }
-
-        case KObSaveCallbackID:
-        {
-			//	Start saving 
-		    iImageController->SaveImageL (iTempSaveFileName);
-
-    		iSaving = ETrue;
-            break;
-        }
-
-        default:
+	return ret;
+	}
+
+//=============================================================================
+void CImageEditorAppUi::SetBusy()
+	{
+		LOG(KImageEditorLogFile, "CImageEditorAppUi: SetBusy()");
+	if (iEditorView)
 		{
-			break;
+		((CImageEditorUIView *) iEditorView)->SetBusy();
+		}
+	iBusy = ETrue;
+	}
+
+//=============================================================================
+void CImageEditorAppUi::ResetBusy()
+	{
+
+	LOG(KImageEditorLogFile, "CImageEditorAppUi: ResetBusy()");
+	// Keep busy until application is fully constructed
+	if (iConstructionState == EConstructionStateReady)
+		{
+		if (iEditorView)
+			{
+			((CImageEditorUIView *) iEditorView)->ResetBusy();
+			}
+		iBusy = EFalse;
 		}
 	}
 
-    return ret;
-}
-
-//=============================================================================
-void CImageEditorAppUi::SetBusy ()
-{
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: SetBusy()");
-    if (iEditorView)
-    {
-	    ((CImageEditorUIView *)iEditorView)->SetBusy();
-    }
-    iBusy = ETrue;
-}
-
-//=============================================================================
-void CImageEditorAppUi::ResetBusy ()
-{
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: ResetBusy()");
-    // Keep busy until application is fully constructed
-    if (iConstructionState == EConstructionStateReady)
-    {
-        if (iEditorView)
-        {
-            ((CImageEditorUIView *)iEditorView)->ResetBusy();
-        }
-        iBusy = EFalse;
-    }
-}
-
 //=============================================================================
-void CImageEditorAppUi::SetFullScreenL ()
-{
-    __ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
-
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: Setting full screen");
-
-    iFullScreen = ETrue; 
-
-    //  Set to full screen mode
-   ((CImageEditorUIView *)iEditorView)->SetFullScreen();
-
-    // In the startup image controller might not be created yet 
-    if (iImageController)
-    {
-        // Update new screen resolution
-        UpdateScreenRectL();
-    }
-    
- 
-}
+void CImageEditorAppUi::SetFullScreenL()
+	{
+	__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
+
+	LOG(KImageEditorLogFile, "CImageEditorAppUi: Setting full screen");
+
+	iFullScreen = ETrue;
+
+	//  Set to full screen mode
+	((CImageEditorUIView *) iEditorView)->SetFullScreen();
+
+	// In the startup image controller might not be created yet 
+	if (iImageController)
+		{
+		// Update new screen resolution
+		UpdateScreenRectL();
+		}
+
+	}
 
 //=============================================================================
-void CImageEditorAppUi::ResetFullScreenL ()
-{
-    __ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
-
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: Resetting full screen");
-
-    iFullScreen = EFalse;
-
-    //  Set to full screen mode
-    ((CImageEditorUIView *)iEditorView)->ResetFullScreen();
-
-    // In the startup image controller might not be created yet 
-    if (iImageController)
-    {
-        UpdateScreenRectL();
-    }
-   
-}
+void CImageEditorAppUi::ResetFullScreenL()
+	{
+	__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
+
+	LOG(KImageEditorLogFile, "CImageEditorAppUi: Resetting full screen");
+
+	iFullScreen = EFalse;
+
+	//  Set to full screen mode
+	((CImageEditorUIView *) iEditorView)->ResetFullScreen();
+
+	// In the startup image controller might not be created yet 
+	if (iImageController)
+		{
+		UpdateScreenRectL();
+		}
+
+	}
 
 //=============================================================================
-void CImageEditorAppUi::SetUndoFlag ()
-{
-    if (iEditorView)
-    {
-        ((CImageEditorUIView *)iEditorView)->SetUndoFlag( iEditorManager->CanUndo() );
-        ((CImageEditorUIView *)iEditorView)->SetSaveFlag( iEditorManager->IsImageChanged() );
-    }
-}
+void CImageEditorAppUi::SetUndoFlag()
+	{
+	if (iEditorView)
+		{
+		((CImageEditorUIView *) iEditorView)->SetUndoFlag(iEditorManager->CanUndo());
+		((CImageEditorUIView *) iEditorView)->SetSaveFlag(iEditorManager->IsImageChanged());
+		}
+	}
 
 //=============================================================================
-void CImageEditorAppUi::SetTitlePaneTextL (const TDesC & aText)
-{
-    const TInt KMaximumTitleTextLength = 13;
-
-    if (iEditorView)
-    {
-        HBufC * title_text = HBufC::NewLC ( aText.Length() );
-        TPtr title_text_ptr = title_text->Des();
-
-        //  No truncation
-        if ( aText.Length() - 4 < KMaximumTitleTextLength )
-        {
-            //  Copy whole file name 
-            title_text_ptr.Copy (aText);         
-        }
-
-        //  With truncation
-        else
-        {
-
-            //  Copy maximum amount of the file
-            title_text_ptr.Copy ( aText.Left (KMaximumTitleTextLength) );         
-
-            //  Append horizontal ellipsis
-            title_text_ptr.Append ( KBaflCharTruncation );         
-
-            //  Append sequence number
-            _LIT(KSearchWildcard, "*-???");
-            TInt offset = aText.Match (KSearchWildcard);
-            if ( offset != KErrNotFound )
-            {
-                title_text_ptr.Append ( aText.Mid (offset, 4) );         
-            }
-            
-        }
-
-        //  Set title pane text
-	    ((CImageEditorUIView *)iEditorView)->SetTitlePaneTextL (title_text_ptr);
-    
-        CleanupStack::PopAndDestroy(); // title_text
-    }
-}
+void CImageEditorAppUi::SetTitlePaneTextL(const TDesC & aText)
+	{
+	const TInt KMaximumTitleTextLength = 13;
+
+	if (iEditorView)
+		{
+		HBufC * title_text = HBufC::NewLC(aText.Length());
+		TPtr title_text_ptr = title_text->Des();
+
+		//  No truncation
+		if (aText.Length() - 4 < KMaximumTitleTextLength)
+			{
+			//  Copy whole file name 
+			title_text_ptr.Copy(aText);
+			}
+		//  With truncation
+		else
+			{
+			//  Copy maximum amount of the file
+			title_text_ptr.Copy(aText.Left(KMaximumTitleTextLength));
+
+			//  Append horizontal ellipsis
+			title_text_ptr.Append(KBaflCharTruncation);
+			//  Append sequence number
+			_LIT(KSearchWildcard, "*-???");
+			TInt offset = aText.Match(KSearchWildcard);
+			if (offset != KErrNotFound)
+				{
+				title_text_ptr.Append(aText.Mid(offset, 4));
+				}
+			}
+		//  Set title pane text
+		((CImageEditorUIView *) iEditorView)->SetTitlePaneTextL(title_text_ptr);
+
+		CleanupStack::PopAndDestroy(); // title_text
+		}
+	}
 
 //=============================================================================
-void CImageEditorAppUi::ClearTitlePaneTextL ()
-{
-    if (iEditorView)
-    {
-	    ((CImageEditorUIView *)iEditorView)->ClearTitlePaneTextL ();
-    }
-}
-
+void CImageEditorAppUi::ClearTitlePaneTextL()
+	{
+	if (iEditorView)
+		{
+		((CImageEditorUIView *) iEditorView)->ClearTitlePaneTextL();
+		}
+	}
 
 //=============================================================================
-void CImageEditorAppUi::SetFileNameTitlePaneL (const TDesC& aFullFileName)
-{
-	TParsePtrC parser (aFullFileName); 
-    SetTitlePaneTextL ( parser.Name() );
-}
+void CImageEditorAppUi::SetFileNameTitlePaneL(const TDesC& aFullFileName)
+	{
+	TParsePtrC parser(aFullFileName);
+	SetTitlePaneTextL(parser.Name());
+	}
 
 //=============================================================================
 void CImageEditorAppUi::ClearNaviPaneTextL()
-{
-    if (iEditorView)
-    {
-	    ((CImageEditorUIView *)iEditorView)->ClearNaviPaneTextL();
-    }
-}
-
+	{
+	if (iEditorView)
+		{
+		((CImageEditorUIView *) iEditorView)->ClearNaviPaneTextL();
+		}
+	}
 
 //=============================================================================
 void CImageEditorAppUi::UpdateScreenRectL()
-    {
-    LOG(KImageEditorLogFile, "CImageEditorAppUi::UpdateScreenRectL()");
-    
-	if (iEditorView == NULL ||
-		iEditorManager == NULL ||
-		iImageController == NULL)
+	{
+		LOG(KImageEditorLogFile, "CImageEditorAppUi::UpdateScreenRectL()");
+
+	if (iEditorView == NULL || iEditorManager == NULL || iImageController == NULL)
 		{
 		return;
 		}
-	
-	iEditorView->HandleCommandL (EImageEditorPreScreenModeChange);
-
-    // Set Full screen parameter
-    iResolutionUtil->SetFullScreen(iFullScreen);
+
+	iEditorView->HandleCommandL(EImageEditorPreScreenModeChange);
+
+	// Set Full screen parameter
+	iResolutionUtil->SetFullScreen(iFullScreen);
 
 #ifdef LANDSCAPE_SUPPORT
-    // Set landscape parameter
-    if (LandscapeScreenOrientation())
-        {
-        iResolutionUtil->SetLandscape(ETrue);
-        }
-    else
-        {
-        iResolutionUtil->SetLandscape(EFalse);
-        }
+	// Set landscape parameter
+	if (LandscapeScreenOrientation())
+		{
+		iResolutionUtil->SetLandscape(ETrue);
+		}
+	else
+		{
+		iResolutionUtil->SetLandscape(EFalse);
+		}
 #else
 #ifdef LANDSCAPE_ONLY
 	iResolutionUtil->SetLandscape(ETrue);
 #else
-        iResolutionUtil->SetLandscape(EFalse);
+	iResolutionUtil->SetLandscape(EFalse);
 #endif
 #endif
 
-    // Update view layout
-    ((CImageEditorUIView *)iEditorView)->UpdateLayoutL(
-        iEikonEnv->ScreenDevice()->CurrentScreenMode());
+	// Update view layout
+	((CImageEditorUIView *) iEditorView)->UpdateLayoutL(iEikonEnv->ScreenDevice()->CurrentScreenMode());
 
 	LOGFMT(KImageEditorLogFile, "CImageEditorAppUi: CurrentScreenMode() = %d", iEikonEnv->ScreenDevice()->CurrentScreenMode() );
 
-    // Set current screen size to resolution util
-    iResolutionUtil->UpdateScreenMode();
+	// Set current screen size to resolution util
+	iResolutionUtil->UpdateScreenMode();
 
 	// Check if screen size has changed
 	TRect newScreenRect;
@@ -2129,37 +2096,38 @@
 		LOG(KImageEditorLogFile, "CImageEditorAppUi: Not setting new preview image");
 		return;
 		}
-    iOldScreenRect = newScreenRect;
- 
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: Setting new preview image");
-    
-    // Create screen bitmap for new screen size
-    iImageController->CreatePreviewBitmapL();
-    if ((iConstructionState == EConstructionStateReady ||
-        iConstructionState == EConstructionStateInitUi) &&
-        !iSaving && iImageLoaded )
-        {
-        iEditorManager->SetScreenSizeL();
-        }
-   
+	
+	iOldScreenRect = newScreenRect;
+
+	LOG(KImageEditorLogFile, "CImageEditorAppUi: Setting new preview image");
+
+	// Create screen bitmap for new screen size
+	iImageController->CreatePreviewBitmapL();
+	if ((iConstructionState == EConstructionStateReady || iConstructionState
+		== EConstructionStateInitUi) && !iSaving && iImageLoaded)
+		{
+		iEditorManager->SetScreenSizeL();
+		}
+
 	//  Set the new image pointer to editor view
 	if (!iSaving)
 		{
-		((CImageEditorUIView *)iEditorView)->SetImageL (
-	        iEditorManager->GetPreviewImage()
-	        );		
+		((CImageEditorUIView *) iEditorView)->SetImageL(
+				iEditorManager->GetPreviewImage());
 		}
 	else // if saving cannot update new image until saving is completed.
 		{
-		iOrientationChanged = ETrue; 
-		((CImageEditorUIView *)iEditorView)->SetImageL ( NULL );
+		iOrientationChanged = ETrue;
+		((CImageEditorUIView *) iEditorView)->SetImageL(NULL);
 		}
 
 	//  Set container extent to whole screen
-	CCoeControl * control = ((CImageEditorUIView *)iEditorView)->GetContainer();
+	CCoeControl * control =
+			((CImageEditorUIView *) iEditorView)->GetContainer();
 	if (control)
 		{
-		if (iFullScreen)
+		//if it is draw plug-in
+		if (iFullScreen || iPluginName == KDrawPlugin)
 			{
 			control->SetExtentToWholeScreen();
 			}
@@ -2170,748 +2138,777 @@
 			control->SetRect(rect);
 			}
 
-        if (control->IsFocused())
-            {
-            control->DrawNow();
-            }
-        }
-
-	iEditorView->HandleCommandL (EImageEditorPostScreenModeChange);
-
-    }
-
+		if (control->IsFocused())
+			{
+			control->DrawNow();
+			}
+		}
+
+	iEditorView->HandleCommandL(EImageEditorPostScreenModeChange);
+
+	}
 
 //=============================================================================
-void CImageEditorAppUi::ZoomL (const TZoom aZoom)
-    {
-    __ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
-    __ASSERT_ALWAYS( iEditorManager, User::Panic(KComponentName, EImageEditorPanicNoEditorManager) );
-    SetBusy();
-
-    // Zoom
- 	iEditorManager->ZoomL (aZoom);
-
-    RenderL();
+void CImageEditorAppUi::ZoomL(const TZoom aZoom)
+	{
+	__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
+	__ASSERT_ALWAYS( iEditorManager, User::Panic(KComponentName, EImageEditorPanicNoEditorManager) );
+	SetBusy();
+
+	// Zoom
+	iEditorManager->ZoomL(aZoom);
+
+	RenderL();
 	iEditorManager->GetSystemParameters();
 
-    // Inform the view about current zoom mode
-    ((CImageEditorUIView *)iEditorView)->
-                            SetZoomModeL( iEditorManager->GetZoomMode() );
-    }
+	// Inform the view about current zoom mode
+	((CImageEditorUIView *) iEditorView)-> SetZoomModeL(iEditorManager->GetZoomMode());
+	}
 
 //=============================================================================
-void CImageEditorAppUi::PanL (TDirection aDirection)
-{
-    __ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
-    __ASSERT_ALWAYS( iEditorManager, User::Panic(KComponentName, EImageEditorPanicNoEditorManager) );
-
-	iEditorView->HandleCommandL (EImageEditorPreGlobalPanChange);
-
-    SetBusy();
+void CImageEditorAppUi::PanL(TDirection aDirection)
+	{
+	__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
+	__ASSERT_ALWAYS( iEditorManager, User::Panic(KComponentName, EImageEditorPanicNoEditorManager) );
+
+	iEditorView->HandleCommandL(EImageEditorPreGlobalPanChange);
+
+	SetBusy();
 
 	// Pan
-    iEditorManager->PanL (aDirection);
-
-    RenderL();
-    iEditorManager->GetSystemParameters();
-
-    ResetBusy();
-
-    iEditorView->HandleCommandL (EImageEditorGlobalPanChanged);
-}
+	iEditorManager->PanL(aDirection);
+
+	RenderL();
+	iEditorManager->GetSystemParameters();
+
+	ResetBusy();
+
+	iEditorView->HandleCommandL(EImageEditorGlobalPanChanged);
+	}
 
 //=============================================================================
-void CImageEditorAppUi::TouchPanL ()
-{
-    __ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
-    __ASSERT_ALWAYS( iEditorManager, User::Panic(KComponentName, EImageEditorPanicNoEditorManager) );
-
-	iEditorView->HandleCommandL (EImageEditorPreGlobalPanChange);
-
-    SetBusy();
-    
-    // Fetch directions
-    TInt xMovement(0);
-    TInt yMovement(0);
-    
-    ((CImageEditorUIView *)iEditorView)->GetTouchPanDirections( xMovement, yMovement );
-    
+void CImageEditorAppUi::TouchPanL()
+	{
+	__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
+	__ASSERT_ALWAYS( iEditorManager, User::Panic(KComponentName, EImageEditorPanicNoEditorManager) );
+
+	iEditorView->HandleCommandL(EImageEditorPreGlobalPanChange);
+
+	SetBusy();
+
+	// Fetch directions
+	TInt xMovement(0);
+	TInt yMovement(0);
+
+	((CImageEditorUIView *) iEditorView)->GetTouchPanDirections(xMovement,yMovement);
+
 	// Pan
-    iEditorManager->PanL( xMovement, yMovement );
-
-    RenderL();
-    iEditorManager->GetSystemParameters();
-
-    ResetBusy();
-
-    iEditorView->HandleCommandL (EImageEditorGlobalPanChanged);
-}
+	iEditorManager->PanL(xMovement, yMovement);
+
+	RenderL();
+	iEditorManager->GetSystemParameters();
+
+	ResetBusy();
+
+	iEditorView->HandleCommandL(EImageEditorGlobalPanChanged);
+	}
 
 //=============================================================================
-void CImageEditorAppUi::RotateL (const TRotation aRot)
-{
+void CImageEditorAppUi::RotateL(const TRotation aRot)
+	{
 	__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
 	__ASSERT_ALWAYS( iEditorManager, User::Panic(KComponentName, EImageEditorPanicNoEditorManager) );
 
 	if (!iEditorManager->IsPluginLoaded())
-	{
-		iEditorManager->RotateL (aRot);
+		{
+		iEditorManager->RotateL(aRot);
 		RenderL();
 		SetUndoFlag();
-		iEditorView->HandleCommandL (EImageEditorGlobalRotationChanged);
+		iEditorView->HandleCommandL(EImageEditorGlobalRotationChanged);
+		}
 	}
-}
 
 //=============================================================================
-void CImageEditorAppUi::LaunchLoadWaitNoteL ()
-{
-    __ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
-    
-    SetBusy();
-	((CImageEditorUIView *)iEditorView)->LaunchWaitDialog( );
-
-//    if (!iWaitNote)
-//    {
-//        ((CImageEditorUIView *)iEditorView)->LaunchLoadWaitDialogL( &iWaitNote, this );
-//    }
-}
+void CImageEditorAppUi::LaunchLoadWaitNoteL()
+	{
+	__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
+
+	SetBusy();
+	((CImageEditorUIView *) iEditorView)->LaunchWaitDialog();
+
+	//    if (!iWaitNote)
+	//    {
+	//        ((CImageEditorUIView *)iEditorView)->LaunchLoadWaitDialogL( &iWaitNote, this );
+	//    }
+	}
 
 //=============================================================================
-void CImageEditorAppUi::LaunchSaveWaitNoteL ()
-{
-    __ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
-    TAppUiOrientation orientation(EAppUiOrientationPortrait);
-    if(LandscapeScreenOrientation())
-    			{
-    			orientation = EAppUiOrientationLandscape;
-    			}
-    
-    SetOrientationL(orientation);
-    if (!iProgressNote)
-    {
-        ((CImageEditorUIView *)iEditorView)->LaunchSaveWaitDialogL( &iProgressNote, 100, this );
+void CImageEditorAppUi::LaunchSaveWaitNoteL()
+	{
+	__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
+	TAppUiOrientation orientation(EAppUiOrientationPortrait);
+	if (LandscapeScreenOrientation())
+		{
+		orientation = EAppUiOrientationLandscape;
+		}
+
+	SetOrientationL(orientation);
+	if (!iProgressNote)
+		{
+		((CImageEditorUIView *) iEditorView)->LaunchSaveWaitDialogL(&iProgressNote, 100, this);
 		iSaving = ETrue;
-    }
-}
+		}
+	}
 
 //=============================================================================
-void CImageEditorAppUi::KillWaitNote ()
-{
-    
-
-/*    if (iWaitNote)
-    {
-        // If the application is exiting, iWaitNote->ProcessFinishedL()
-        // apparently does not finish in time and does something after the 
-        // application has been deleted, causing USER 0 panic on debug builds.
-        delete iWaitNote;
-        iWaitNote = NULL;
-    } */
-    
-      if (iProgressNote)
-          {
-          delete iProgressNote;
-          iProgressNote = NULL;
-          }
-      else
-          {
-          // This can be hidden in all cases. If dialog is not active, nothing 
-          // special happens
-          ((CImageEditorUIView *)iEditorView)->HideWaitDialog( );
-          // Commented due to multiple ResetBusy() call during initialization:
-          //ResetBusy();
-          }
-}
-
+void CImageEditorAppUi::KillWaitNote()
+	{
+
+	/*    if (iWaitNote)
+	 {
+	 // If the application is exiting, iWaitNote->ProcessFinishedL()
+	 // apparently does not finish in time and does something after the 
+	 // application has been deleted, causing USER 0 panic on debug builds.
+	 delete iWaitNote;
+	 iWaitNote = NULL;
+	 } */
+
+	if (iProgressNote)
+		{
+		delete iProgressNote;
+		iProgressNote = NULL;
+		}
+	else
+		{
+		// This can be hidden in all cases. If dialog is not active, nothing 
+		// special happens
+		((CImageEditorUIView *) iEditorView)->HideWaitDialog();
+		// Commented due to multiple ResetBusy() call during initialization:
+		//ResetBusy();
+		}
+	}
 
 //=============================================================================
 void CImageEditorAppUi::IncrementProgressBarL(const TInt aIncrement)
-{
-    __ASSERT_ALWAYS( iProgressNote, User::Panic(KComponentName, EImageEditorPanicNoProgressDialog) );
-
-    CEikProgressInfo * progi = iProgressNote->GetProgressInfoL();
-    if (progi)
-    {
-        progi->IncrementAndDraw (aIncrement);
-    }
-}
+	{
+	__ASSERT_ALWAYS( iProgressNote, User::Panic(KComponentName, EImageEditorPanicNoProgressDialog) );
+
+	CEikProgressInfo * progi = iProgressNote->GetProgressInfoL();
+	if (progi)
+		{
+		progi->IncrementAndDraw(aIncrement);
+		}
+	}
 
 //=============================================================================
-void CImageEditorAppUi::DialogDismissedL( TInt aButtonId )
-{
-    LOGFMT(KImageEditorLogFile, "CImageEditorAppUi::DialogDismissedL( %d )", aButtonId);
-
-    if( aButtonId == EAknSoftkeyCancel )
-    {
-    
-    	if ( !iSaving )
-    	{
+void CImageEditorAppUi::DialogDismissedL(TInt aButtonId)
+	{
+		LOGFMT(KImageEditorLogFile, "CImageEditorAppUi::DialogDismissedL( %d )", aButtonId);
+
+	if (aButtonId == EAknSoftkeyCancel)
+		{
+		if (!iSaving)
+			{
 			iCallback->Cancel();
-        	iImageController->CancelOperation(ETrue);
-    	}
-    	else
-    	{
-        	iImageController->CancelOperation();
-    	}
+			iImageController->CancelOperation(ETrue);
+			}
+		else
+			{
+			iImageController->CancelOperation();
+			}
 
 		iWaitNote = NULL;
-		
+
 		ResetBusy();
-    }
-}
+		}
+	}
 
 //=============================================================================
-TErrorHandlerResponse CImageEditorAppUi::HandleError (
-	TInt					aError,
-    const SExtendedError &	aExtErr,
-	TDes &					aErrorText,
-	TDes &					aContextText
-	)
-{
-    LOGFMT(KImageEditorLogFile, "CImageEditorAppUi::HandleError: %d", aError);
+TErrorHandlerResponse CImageEditorAppUi::HandleError(TInt aError,const SExtendedError & aExtErr, TDes & aErrorText, TDes & aContextText)
+	{
+	LOGFMT(KImageEditorLogFile, "CImageEditorAppUi::HandleError: %d", aError);
 
 	//	Reset busy flag
-	KillWaitNote ();
+	KillWaitNote();
 	ResetBusy();
 	iCancelling = EFalse;
 	iSaving = EFalse;
 
-    TErrorHandlerResponse ret = ENoDisplay;
-
-    // Handle Image Editor errors
-    if ( (aError < KSIEEErrorBase) && (aError > KSIEEErrorMax) )
-	{
-        TRAPD ( err, HandleErrorL (aError) );
-		if ( err == KErrNoMemory )
+	TErrorHandlerResponse ret = ENoDisplay;
+
+	// Handle Image Editor errors
+	if ((aError < KSIEEErrorBase) && (aError > KSIEEErrorMax))
 		{
-            Exit();
+		TRAPD ( err, HandleErrorL (aError) );
+		if (err == KErrNoMemory)
+			{
+			Exit();
+			}
 		}
-	}
-
-    // Let the framework handle system errors
-    else if ( aError == KErrNoMemory )
-    {
+
+	// Let the framework handle system errors
+	else if (aError == KErrNoMemory)
+		{
 		iImageController->Cancel();
-        ret = CAknViewAppUi::HandleError (aError, aExtErr, aErrorText, aContextText);
-        Exit ();
-    }
-    // KErrCancel is returned when Bluetooth send is cancelled
-    // No need to show error dialog
-    else if ( aError == KErrCancel )
-    {
-        // Nothing to do
-    } 
-    else if ((aError == KErrArgument) || (aError == KErrInUse))
-    {
-    	//	Show error note
-		HandleErrorL (aError);
-    }
-    //end
-    else if ( (aError <= KErrExtended) && (aError >= KLeaveExit) ) 
-    {
-        ret = CAknViewAppUi::HandleError (aError, aExtErr, aErrorText, aContextText);
-        // Close plugin if error occurs, otherwise plugin may crash
-        iEditorManager->ClosePlugin();
-
-        __ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
-        TRAP_IGNORE( ((CImageEditorUIView *)iEditorView)->ActivateMainViewL() );
-
-        TRAP_IGNORE( ((CImageEditorUIView *)iEditorView)->SetImageL (
-            iEditorManager->GetPreviewImage()) );
-    }
-    else 
-    {
-        ret = CAknViewAppUi::HandleError (aError, aExtErr, aErrorText, aContextText);
-        // Close plugin if error occurs, otherwise plugin may crash
-        iEditorManager->ClosePlugin();
-
-        __ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
-
-        TRAPD( err, ((CImageEditorUIView *)iEditorView)->ActivateMainViewL() );
-                    
-        TRAP_IGNORE( ((CImageEditorUIView *)iEditorView)->SetImageL (
-            iEditorManager->GetPreviewImage()) );
-        
-		if ( err == KErrNoMemory )
+		ret = CAknViewAppUi::HandleError(aError, aExtErr, aErrorText,aContextText);
+		Exit();
+		}
+	// KErrCancel is returned when Bluetooth send is cancelled
+	// No need to show error dialog
+	else if (aError == KErrCancel)
+		{
+		// Nothing to do
+		}
+	else if ((aError == KErrArgument) || (aError == KErrInUse))
+		{
+		//	Show error note
+		HandleErrorL(aError);
+		}
+	//end
+	else if ((aError <= KErrExtended) && (aError >= KLeaveExit))
 		{
-            Exit();
+		ret = CAknViewAppUi::HandleError(aError, aExtErr, aErrorText,aContextText);
+		// Close plugin if error occurs, otherwise plugin may crash
+		iEditorManager->ClosePlugin();
+
+		__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
+		TRAP_IGNORE( ((CImageEditorUIView *)iEditorView)->ActivateMainViewL() );
+
+		TRAP_IGNORE( ((CImageEditorUIView *)iEditorView)->SetImageL (iEditorManager->GetPreviewImage()) );
 		}
-    }
-    return ret;
-}
+	else
+		{
+		ret = CAknViewAppUi::HandleError(aError, aExtErr, aErrorText,
+				aContextText);
+		// Close plugin if error occurs, otherwise plugin may crash
+		iEditorManager->ClosePlugin();
+
+		__ASSERT_ALWAYS( iEditorView, User::Panic(KComponentName, EImageEditorPanicNoView) );
+		TRAPD( err, ((CImageEditorUIView *)iEditorView)->ActivateMainViewL() );
+
+		TRAP_IGNORE( ((CImageEditorUIView *)iEditorView)->SetImageL (
+							iEditorManager->GetPreviewImage()) );
+		if (err == KErrNoMemory)
+			{
+			Exit();
+			}
+		}
+	return ret;
+	}
 
 //=============================================================================
-void CImageEditorAppUi::HandleErrorL (const TInt aError)
-{
+void CImageEditorAppUi::HandleErrorL(const TInt aError)
+	{
 
 	//	Show error note
-	ShowErrorNoteL (aError);
+	ShowErrorNoteL(aError);
 
 	//	Handle error
-	switch ( aError ) 
-	{
-
-        case KSIEEErrorOkToExit:
-        case KSIEEOpenFile:
-        case KSIEEExifRead:
-        case KSIEEInternalNonRecoverable:
-        case KSIEEIncompatibleImage:
+	switch (aError)
 		{
+		case KSIEEErrorOkToExit:
+		case KSIEEOpenFile:
+		case KSIEEExifRead:
+		case KSIEEInternalNonRecoverable:
+		case KSIEEIncompatibleImage:
+			{
 			// For some weird reason, in some cases when trying to 
 			// exit from CImageEditorAppUi::OperationReadyL, calling 
 			// Exit() here won't exit the application.
 			RunAppShutter();
 			break;
-		}
+			}
 
 		default:
-		{
-            // Close plugin if error occurs, otherwise plugin may crash
-            if (iEditorManager)
-            {
-                iEditorManager->ClosePlugin();
-
-            }
-            if (iEditorView)
-            {
-                ((CImageEditorUIView *)iEditorView)->ActivateMainViewL();
-                ((CImageEditorUIView *)iEditorView)->SetImageL (
-                iEditorManager->GetPreviewImage());
-            }
+			{
+			// Close plugin if error occurs, otherwise plugin may crash
+			if (iEditorManager)
+				{
+				iEditorManager->ClosePlugin();
+
+				}
+			if (iEditorView)
+				{
+				((CImageEditorUIView *) iEditorView)->ActivateMainViewL();
+				((CImageEditorUIView *) iEditorView)->SetImageL(iEditorManager->GetPreviewImage());
+				}
 
 			break;
+			}
 		}
 	}
-}
 
 //=============================================================================
-void CImageEditorAppUi::ShowErrorNoteL (const TInt aError) const
-{
+void CImageEditorAppUi::ShowErrorNoteL(const TInt aError) const
+	{
 	TInt res_id = -1;
 
 	switch (aError)
-	{
-        case KErrNotFound:
+		{
+		case KErrNotFound:
 		case KSIEEOpenFile:
-        case KSIEEExifRead:
-        case KSIEEIncompatibleImage:
-		{
+		case KSIEEExifRead:
+		case KSIEEIncompatibleImage:
+			{
 			res_id = R_ERROR_LOADING;
 			break;
-		}
+			}
 		case KSIEESaveFile:
-        case KSIEEExifUpdate:
+		case KSIEEExifUpdate:
 		case KErrArgument:
 		case KErrInUse:
-    	
-		{
+
+			{
 			res_id = R_ERROR_SAVING;
 			break;
-		}
+			}
 		case KSIEENotEnoughDiskSpace:
-		{
+			{
 			res_id = R_ERROR_NOT_ENOUGH_DISK_SPACE;
 			break;
-		}
+			}
 		case KSIEEProcessFile:
-		{
+			{
 			res_id = R_ERROR_PROCESSING;
 			break;
-		}
+			}
 		case KSIEEEngine:
-		{
+			{
 			res_id = R_ERROR_ENGINE;
 			break;
-		}
+			}
 		case KSIEEInternal:
-		{
+			{
 			res_id = R_ERROR_INTERNAL;
 			break;
-		}
+			}
 		case KSIEEInternalNonRecoverable:
-		{
+			{
 			res_id = R_ERROR_INTERNAL_NON_RECOVERABLE;
 			break;
+			}
+		case KSIEEProtectedFile:
+			{
+			res_id = R_ERROR_PROTECTED_FILE;
+			break;
+			}
+		default:
+			break;
 		}
-        case KSIEEProtectedFile:
-        {
-            res_id = R_ERROR_PROTECTED_FILE;
-            break;
-        }
-    	default:
-			break;
+
+	if (res_id != -1)
+		{
+		HBufC * textdata = iEikonEnv->AllocReadResourceLC(res_id);
+		TPtrC ptr = textdata->Des();
+
+			LOGFMT(KImageEditorLogFile, "CImageEditorAppUi::ShowErrorNoteL: \"%S\"", &ptr);
+
+		CAknGlobalNote* globalNote = CAknGlobalNote::NewLC();
+		TInt noteId = globalNote->ShowNoteL(EAknGlobalErrorNote, ptr);
+
+		User::After(1500042); // waiting for 1 second
+
+		// discard note
+		globalNote->CancelNoteL(noteId);
+
+		CleanupStack::PopAndDestroy(); //textdata 
+		CleanupStack::PopAndDestroy(); // GlobalNote
+		}
 	}
 
-    if (res_id != - 1)
-    {
-		HBufC * textdata = iEikonEnv->AllocReadResourceLC (res_id);
-	    TPtrC ptr = textdata->Des();
-
-        LOGFMT(KImageEditorLogFile, "CImageEditorAppUi::ShowErrorNoteL: \"%S\"", &ptr);
-        
-      
-        CAknGlobalNote* globalNote = CAknGlobalNote::NewLC();
-        TInt noteId = globalNote->ShowNoteL( EAknGlobalErrorNote, ptr );
-        
-        User::After(1500042);  // waiting for 1 second
-
-        // discard note
-        globalNote->CancelNoteL( noteId );
-
-        
-       CleanupStack::PopAndDestroy(); //textdata 
-       CleanupStack::PopAndDestroy(); // GlobalNote
-    }
-}
-
 //=============================================================================
 void CImageEditorAppUi::DeleteTempFiles() const
-{
-    // Get the used temp directory path.
-    // Take drive letter from iDocumentName
-    TParse parse;
-    parse.Set (KTempPath, &iDocumentName, NULL);
-    TPtrC tempDir = parse.DriveAndPath();
-
-    LOGFMT (KImageEditorLogFile, "CImageEditorAppUi::DeleteTempFiles(): %S", &tempDir);
-    
-    // Delete all files in the temp directory
-    _LIT(KAllFiles, "*.*");
-    TFindFile file_finder (iEikonEnv->FsSession());
-    CDir* file_list; 
-    TInt err = file_finder.FindWildByDir (KAllFiles, tempDir, file_list);
-    while (err==KErrNone)
-    {
-        TInt i;
-        for (i=0; i<file_list->Count(); i++)
-        {
-            const TDesC& name = (*file_list)[i].iName;
-            const TDesC& related = file_finder.File();
-            TParse fullentry;
-            fullentry.Set (name, &related, NULL);
-            BaflUtils::DeleteFile (iEikonEnv->FsSession(), fullentry.FullName());
-        }
-        delete file_list;
-        err=file_finder.FindWild (file_list);
-    }
-    
-}
+	{
+	// Get the used temp directory path.
+	// Take drive letter from iDocumentName
+	TParse parse;
+	parse.Set(KTempPath, &iDocumentName, NULL);
+	TPtrC tempDir = parse.DriveAndPath();
+
+		LOGFMT (KImageEditorLogFile, "CImageEditorAppUi::DeleteTempFiles(): %S", &tempDir);
+	// Delete all files in the temp directory
+	_LIT(KAllFiles, "*.*");
+	TFindFile file_finder(iEikonEnv->FsSession());
+	CDir* file_list;
+	TInt err = file_finder.FindWildByDir(KAllFiles, tempDir, file_list);
+	while (err == KErrNone)
+		{
+		TInt i;
+		for (i = 0; i < file_list->Count(); i++)
+			{
+			const TDesC& name = (*file_list)[i].iName;
+			const TDesC& related = file_finder.File();
+			TParse fullentry;
+			fullentry.Set(name, &related, NULL);
+			BaflUtils::DeleteFile(iEikonEnv->FsSession(), fullentry.FullName());
+			}
+		delete file_list;
+		err = file_finder.FindWild(file_list);
+		}
+
+	}
 
 //=============================================================================
 void CImageEditorAppUi::FinalizeSaveL()
-{
-    LOG(KImageEditorLogFile, "CImageEditorAppUi::FinalizeSaveL");
+	{
+	LOG(KImageEditorLogFile, "CImageEditorAppUi::FinalizeSaveL");
 
 #ifdef FILE_TIME_STAMP_UPDATE    
-    // Set the timestamp of the saved file to original file's timestamp + 2 seconds.
-    // The idea is to make the original and edited images appear next to each other.
-    TEntry original;
-    TInt err = iEikonEnv->FsSession().Entry( iSourceFileName, original );
-    if (KErrNone == err)
-    {
-        TTime newTime = original.iModified + TTimeIntervalSeconds (2);
-        
-        CFileMan* fileMan = CFileMan::NewL( iEikonEnv->FsSession() );
-        CleanupStack::PushL (fileMan);
-        fileMan->Attribs(iDocumentName, 0, 0, newTime); // do not set or clear anything, mofify time 
-        CleanupStack::PopAndDestroy (fileMan);
-    }
+		// Set the timestamp of the saved file to original file's timestamp + 2 seconds.
+		// The idea is to make the original and edited images appear next to each other.
+		TEntry original;
+		TInt err = iEikonEnv->FsSession().Entry( iSourceFileName, original );
+		if (KErrNone == err)
+			{
+			TTime newTime = original.iModified + TTimeIntervalSeconds (2);
+
+			CFileMan* fileMan = CFileMan::NewL( iEikonEnv->FsSession() );
+			CleanupStack::PushL (fileMan);
+			fileMan->Attribs(iDocumentName, 0, 0, newTime); // do not set or clear anything, mofify time 
+			CleanupStack::PopAndDestroy (fileMan);
+			}
 #endif
 
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: Check if source image belongs to an album");
-   
-    iSourceImageMgAlbumIdList.Reset();
-    
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: publish the filename for provider");
-    
-    // Publish & Subscribe API used for delivering document name to AIW provider
-    TInt err2 = RProperty::Define(KImageEditorProperties, EPropertyFilename, RProperty::EText);
-    
-    if (err2 != KErrAlreadyExists)
-    {
-        User::LeaveIfError(err2);   
-    }
-    
-    User::LeaveIfError(RProperty::Set(KImageEditorProperties, EPropertyFilename, iDocumentName));
-    
-    LOG(KImageEditorLogFile, "CImageEditorAppUi::FinalizeSaveL out");
-}
+	LOG(KImageEditorLogFile, "CImageEditorAppUi: Check if source image belongs to an album");
+
+	iSourceImageMgAlbumIdList.Reset();
+
+	LOG(KImageEditorLogFile, "CImageEditorAppUi: publish the filename for provider");
+
+	// Publish & Subscribe API used for delivering document name to AIW provider
+	TInt err2 = RProperty::Define(KImageEditorProperties, EPropertyFilename,
+			RProperty::EText);
+
+	if (err2 != KErrAlreadyExists)
+		{
+		User::LeaveIfError(err2);
+		}
+
+	User::LeaveIfError(RProperty::Set(KImageEditorProperties,
+			EPropertyFilename, iDocumentName));
+
+	LOG(KImageEditorLogFile, "CImageEditorAppUi::FinalizeSaveL out");
+	}
 
 //=============================================================================
 void CImageEditorAppUi::HandleVolumeUpL()
-{
+	{
 	LOG(KImageEditorLogFile, "CImageEditorAppUi::HandleVolumeUpL: in");
 
 	TKeyEvent key;
 	key.iScanCode = EStdKeyIncVolume;
 	key.iCode = EKeyIncVolume;
 
-	if( LandscapeScreenOrientation() )
-	{
+	if (LandscapeScreenOrientation())
+		{
 		key.iScanCode = EStdKeyDecVolume;
 		key.iCode = EKeyDecVolume;
-	}
+		}
 
 	key.iRepeats = 0;
-	iEikonEnv->SimulateKeyEventL( key, EEventKey );
+	iEikonEnv->SimulateKeyEventL(key, EEventKey);
 
 	LOG(KImageEditorLogFile, "CImageEditorAppUi::HandleVolumeUpL: out");
-}
+	}
 
 //=============================================================================
 void CImageEditorAppUi::HandleVolumeDownL()
-{
+	{
 	LOG(KImageEditorLogFile, "CImageEditorAppUi::HandleVolumeDownL: in");
 
 	TKeyEvent key;
 	key.iScanCode = EStdKeyDecVolume;
 	key.iCode = EKeyDecVolume;
 
-	if( LandscapeScreenOrientation() )
-	{
+	if (LandscapeScreenOrientation())
+		{
 		key.iScanCode = EStdKeyIncVolume;
 		key.iCode = EKeyIncVolume;
-	}
+		}
 
 	key.iRepeats = 0;
-	iEikonEnv->SimulateKeyEventL( key, EEventKey );
+	iEikonEnv->SimulateKeyEventL(key, EEventKey);
 
 	LOG(KImageEditorLogFile, "CImageEditorAppUi::HandleVolumeDownL: out");
-}
+	}
 
 //=============================================================================
 void CImageEditorAppUi::SaveImageOverWriteL(TBool aOverWrite)
-{
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: SaveImageOverWriteL: in");
-
-    // Generate temporary save file name
+	{
+		LOG(KImageEditorLogFile, "CImageEditorAppUi: SaveImageOverWriteL: in");
+
+	// Generate temporary save file name
 	TParse tempFileParser;
-	tempFileParser.Set (KTempSaveFile, &KTempPath, &iDocumentName); 
-	iTempSaveFileName.Copy (tempFileParser.FullName());
-    BaflUtils::EnsurePathExistsL (iEikonEnv->FsSession(), iTempSaveFileName);
-
-    if (iExitFromApp)
-    {
-        TInt exit = 
-            ((CImageEditorUIView *)iEditorView)->LaunchExitWithoutSavingQueryL();
-        if (exit)
-        {
-            // Exit
-            User::Leave (KSIEEErrorOkToExit);
-        }
-        else
-        {
-            iExitFromApp = EFalse;
-            User::Leave(KSIEEInternal);
-        }
-    }
+	tempFileParser.Set(KTempSaveFile, &KTempPath, &iDocumentName);
+	iTempSaveFileName.Copy(tempFileParser.FullName());
+	BaflUtils::EnsurePathExistsL(iEikonEnv->FsSession(), iTempSaveFileName);
+
+	if (iExitFromApp)
+		{
+		TInt
+				exit = ((CImageEditorUIView *) iEditorView)->LaunchExitWithoutSavingQueryL();
+		if (exit)
+			{
+			// Exit
+			User::Leave(KSIEEErrorOkToExit);
+			}
+		else
+			{
+			iExitFromApp = EFalse;
+			User::Leave(KSIEEInternal);
+			}
+		}
 
 	// overwrite the existing file
 	if (aOverWrite)
-	{
-		iDocumentName = iSourceFileName; 
-	}
-	
+		{
+		iDocumentName = iSourceFileName;
+		}
+
 	// save with a new file name
 	else
-	{	        		
-   		// Check document name if not saved yet or memory card removed
-    	if ( !iImageSaved ||
-        	 !BaflUtils::PathExists(iEikonEnv->FsSession(), iTempSaveFileName.Left(3)))
-    	{
-        	//  If not saved yet, check that document name is valid 
-			CheckFileL (iDocumentName);
-    	}
+		{
+		// Check document name if not saved yet or memory card removed
+		if (!iImageSaved || !BaflUtils::PathExists(iEikonEnv->FsSession(),
+				iTempSaveFileName.Left(3)))
+			{
+			//  If not saved yet, check that document name is valid 
+			CheckFileL(iDocumentName);
+			}
+		}
+
+	//	Set temp save image name to engine
+	iEditorManager->SetImageName(iTempSaveFileName);
+
+	//	Launch save wait note
+	LaunchSaveWaitNoteL();
+
+	iCallback->DoCallback(KObSaveCallbackID);
+	LOG(KImageEditorLogFile, "CImageEditorAppUi: SaveImageOverWriteL: out");
 	}
-	
-	//	Set temp save image name to engine
-    iEditorManager->SetImageName (iTempSaveFileName);
-    		
-    //	Launch save wait note
-	LaunchSaveWaitNoteL ();
-
-    iCallback->DoCallback (KObSaveCallbackID);
-    LOG(KImageEditorLogFile, "CImageEditorAppUi: SaveImageOverWriteL: out");    
-}
 
 //=============================================================================
 TInt CImageEditorAppUi::QueryAndSaveL()
-    {
-
-    TInt isSaved = 0;
-    TInt userSelection = 0;
-    TBool isFileOpen = EFalse;
-    RFs& fs = iEikonEnv->FsSession();
-    TInt err = fs.IsFileOpen( iSourceFileName, isFileOpen );
-            
-    // Check if .jpg or .jpeg file
-    TBool isJpgExtension = EFalse;
-	TParsePtrC fileParse ( iSourceFileName );
+	{
+
+	TInt isSaved = 0;
+	TInt userSelection = 0;
+	TBool isFileOpen = EFalse;
+	RFs& fs = iEikonEnv->FsSession();
+	TInt err = fs.IsFileOpen(iSourceFileName, isFileOpen);
+
+	// Check if .jpg or .jpeg file
+	TBool isJpgExtension = EFalse;
+	TParsePtrC fileParse(iSourceFileName);
 	_LIT( KJpgExtension, ".jpg" );
 	_LIT( KJpegExtension, ".jpeg" );
-	TPtrC extension( fileParse.Ext() );
-	if ( ( extension.MatchF( KJpgExtension ) == KErrNone ) || 
-	     ( extension.MatchF( KJpegExtension ) == KErrNone ) )
-	    {
-	    isJpgExtension = ETrue;
-	    }
-		
-    // If source file is open (e.g. in ImageViewer application) don't give
-    // user an option to replace original but launch directly "Save with a
-    // new name query. Don't give other that jpg originals.
-    if ( !isFileOpen && isJpgExtension )
-        {
-        // the user selects to save with a new file name
-        // launch query with choices "Replace original" and 
-        // "Save with a new file name" 
-        userSelection = ( ( CImageEditorUIView *)iEditorView )->LaunchSaveImageQueryL();
-        } 
-    SetOrientationL(Orientation()); 
-    SetLayoutAwareApp(EFalse);
-    // If user has selected "Save with a new file name"
-    if( userSelection == 0 ) 
-        {
-        
-        // Multiple drive support enabled
+	TPtrC extension(fileParse.Ext());
+	if ((extension.MatchF(KJpgExtension) == KErrNone) || (extension.MatchF(
+			KJpegExtension) == KErrNone))
+		{
+		isJpgExtension = ETrue;
+		}
+
+	// If source file is open (e.g. in ImageViewer application) don't give
+	// user an option to replace original but launch directly "Save with a
+	// new name query. Don't give other that jpg originals.
+	if (!isFileOpen && isJpgExtension)
+		{
+		// the user selects to save with a new file name
+		// launch query with choices "Replace original" and 
+		// "Save with a new file name" 
+		userSelection = ((CImageEditorUIView *) iEditorView)->LaunchSaveImageQueryL();
+		}
+	SetOrientationL(Orientation());
+	SetLayoutAwareApp(EFalse);
+	// If user has selected "Save with a new file name"
+	if (userSelection == 0)
+		{
+
+		// Multiple drive support enabled
 #ifdef RD_MULTIPLE_DRIVE
-        
-        TDriveNumber driveNumber;
-        TFileName driveAndPath;
-        // new multi drive dialog
-        CAknMemorySelectionDialogMultiDrive* multiDriveDlg = 
-            CAknMemorySelectionDialogMultiDrive::NewL( ECFDDialogTypeSave, 
-                                                       EFalse );
-        CleanupStack::PushL( multiDriveDlg );
-
-        // launch "Select memory" query (mds)
-        if ( multiDriveDlg->ExecuteL( driveNumber, &driveAndPath, NULL ) )
-            {        
-            // Generate a default name for the new file
-            TInt err = ImageEditorUtils::GenerateNewFileNameL(
-                                                iEikonEnv->FsSession(),
-                                                iSourceFileName, 
-                                                iDocumentName,
-                                                driveAndPath,
-                                                NULL );
-                                    
-            driveAndPath.Append( PathInfo::ImagesPath() );
-                                   
-            // launch file name prompt dialog
-            // the generated name is shown as a default name in dialog
-            TBuf<160> tmp( iDocumentName.Left(160) );
-            iSavingQuery = ETrue;
-            if ( CAknFileNamePromptDialog::RunDlgLD( tmp, /* iDocumentName, */
-                                                     driveAndPath, 
-                                                     KNullDesC ) )
-                {
-                iDocumentName.Copy( tmp );
-                iSavingQuery = EFalse;
-                // add just queried filename to the path
-                driveAndPath.Append( iDocumentName );
-    
-                iDocumentName = driveAndPath;
-                                               
-                SaveImageOverWriteL( EFalse );   
-                isSaved = 1;
-                }
-            iSavingQuery = EFalse;
-            }
-        CleanupStack::PopAndDestroy( multiDriveDlg );
-        
+
+		TDriveNumber driveNumber;
+		TFileName driveAndPath;
+		// new multi drive dialog
+		CAknMemorySelectionDialogMultiDrive* multiDriveDlg = CAknMemorySelectionDialogMultiDrive::NewL(ECFDDialogTypeSave,
+						EFalse);
+		CleanupStack::PushL(multiDriveDlg);
+
+		// launch "Select memory" query (mds)
+		if (multiDriveDlg->ExecuteL(driveNumber, &driveAndPath, NULL ))
+			{
+			// Generate a default name for the new file
+			TInt err = ImageEditorUtils::GenerateNewFileNameL(
+					iEikonEnv->FsSession(), iSourceFileName, iDocumentName,
+					driveAndPath, NULL );
+
+			driveAndPath.Append(PathInfo::ImagesPath());
+
+			//Save as the original  file format.
+			iDocumentName.Delete(iDocumentName.Length() - 5, 4);
+			iDocumentName.Append(fileParse.Ext());
+
+			// launch file name prompt dialog
+			// the generated name is shown as a default name in dialog
+
+			TBuf<160> tmp(iDocumentName.Left(160));
+			iSavingQuery = ETrue;
+			if (CAknFileNamePromptDialog::RunDlgLD(tmp, /* iDocumentName, */
+			driveAndPath, KNullDesC))
+				{
+				iDocumentName.Copy(tmp);
+				iSavingQuery = EFalse;
+				// add just queried filename to the path
+				driveAndPath.Append(iDocumentName);
+
+				iDocumentName = driveAndPath;
+
+				SaveImageOverWriteL(EFalse);
+				isSaved = 1;
+				}
+			iSavingQuery = EFalse;
+			}
+		CleanupStack::PopAndDestroy(multiDriveDlg);
+
 #else // No multiple drive support
-        CAknMemorySelectionDialog::TMemory selectedMemory(
-                            CAknMemorySelectionDialog::EPhoneMemory );
-    
-        // launch "Select memory" query
-        if ( CAknMemorySelectionDialog::RunDlgLD( selectedMemory ) )
-            {    
-            // create path for the image
-            TFileName driveAndPath;         
-            ImageEditorUtils::TMemorySelection memorySelection = 
-                                            ImageEditorUtils::ESelectPhone;
-            if( selectedMemory == CAknMemorySelectionDialog::EPhoneMemory )
-                {
-                memorySelection = ImageEditorUtils::ESelectPhone;
-                driveAndPath.Copy( PathInfo::PhoneMemoryRootPath() );
-                driveAndPath.Append( PathInfo::ImagesPath() );
-                }
-            else if ( selectedMemory == 
-                      CAknMemorySelectionDialog::EMemoryCard )
-                {
-                memorySelection = ImageEditorUtils::ESelectMmc;
-                driveAndPath.Copy( PathInfo::MemoryCardRootPath() );
-                driveAndPath.Append( PathInfo::ImagesPath() );
-                }         
-
-            TInt err = ImageEditorUtils::GenerateNewDocumentNameL(
-                                                iEikonEnv->FsSession(), 
-                                                iSourceFileName, 
-                                                iDocumentName,
-                                                &iSourceImageMgAlbumIdList,
-                                                NULL,
-                                                memorySelection );     
-            
-            
-            // launch file name prompt dialog
-            // the generated name is shown as a default name
-            iSavingQuery = ETrue;
-            if ( CAknFileNamePromptDialog::RunDlgLD( iDocumentName,
-                                                     driveAndPath, 
-                                                     KNullDesC ) )
-                {
-                iSavingQuery = EFalse;
-                TInt err = ImageEditorUtils::GenerateFilePathL(
-                                                iEikonEnv->FsSession(),
-                                                iSourceFileName, 
-                                                iDocumentName,
-                                                memorySelection
-                                                );
-                                                    
-                SaveImageOverWriteL( EFalse );   
-                isSaved = 1;
-                }
-            iSavingQuery = EFalse;
-            }
+		CAknMemorySelectionDialog::TMemory selectedMemory(
+				CAknMemorySelectionDialog::EPhoneMemory );
+
+		// launch "Select memory" query
+		if ( CAknMemorySelectionDialog::RunDlgLD( selectedMemory ) )
+			{
+			// create path for the image
+			TFileName driveAndPath;
+			ImageEditorUtils::TMemorySelection memorySelection =
+			ImageEditorUtils::ESelectPhone;
+			if( selectedMemory == CAknMemorySelectionDialog::EPhoneMemory )
+				{
+				memorySelection = ImageEditorUtils::ESelectPhone;
+				driveAndPath.Copy( PathInfo::PhoneMemoryRootPath() );
+				driveAndPath.Append( PathInfo::ImagesPath() );
+				}
+			else if ( selectedMemory ==
+					CAknMemorySelectionDialog::EMemoryCard )
+				{
+				memorySelection = ImageEditorUtils::ESelectMmc;
+				driveAndPath.Copy( PathInfo::MemoryCardRootPath() );
+				driveAndPath.Append( PathInfo::ImagesPath() );
+				}
+
+			TInt err = ImageEditorUtils::GenerateNewDocumentNameL(
+					iEikonEnv->FsSession(),
+					iSourceFileName,
+					iDocumentName,
+					&iSourceImageMgAlbumIdList,
+					NULL,
+					memorySelection );
+
+			// launch file name prompt dialog
+			// the generated name is shown as a default name
+			iSavingQuery = ETrue;
+			if ( CAknFileNamePromptDialog::RunDlgLD( iDocumentName,
+							driveAndPath,
+							KNullDesC ) )
+				{
+				iSavingQuery = EFalse;
+				TInt err = ImageEditorUtils::GenerateFilePathL(
+						iEikonEnv->FsSession(),
+						iSourceFileName,
+						iDocumentName,
+						memorySelection
+				);
+
+				SaveImageOverWriteL( EFalse );
+				isSaved = 1;
+				}
+			iSavingQuery = EFalse;
+			}
 #endif
-        }
-    // the user selects to overwrite the original image
-    else if ( userSelection == 1 )
-        {
-        SaveImageOverWriteL( ETrue );
-        isSaved = 1;
-        }
-    return isSaved;
-    }
+		}
+	// the user selects to overwrite the original image
+	else if (userSelection == 1)
+		{
+		SaveImageOverWriteL(ETrue);
+		isSaved = 1;
+		}
+	return isSaved;
+	}
 
 // ----------------------------------------------------------------------------
 // CImageEditorAppUi::HandleVolumeKeyEvent
 // ----------------------------------------------------------------------------
 //
-void CImageEditorAppUi::HandleVolumeKeyEvent( TRemConCoreApiOperationId aOperationId,
-        							 		  TRemConCoreApiButtonAction /* aButtonAct */ )
-    {
-    if (((CImageEditorUIView *)iEditorView)->GetContainer())
-    {
-        if(! ((CImageEditorUIView *)iEditorView)->GetContainer()->IsFocused() )
-     	   {
-     	   return;
-     	   }
-    }
-    
-    if( iForeground )
-    	{
-    	TKeyEvent keyEvent;
-    	if( aOperationId == ERemConCoreApiVolumeUp )
-    		{
-    		keyEvent.iScanCode = EStdKeyIncVolume;
-    		TRAP_IGNORE( HandleKeyEventL( keyEvent, EEventKey ) );
-    		}
-    	else if( aOperationId == ERemConCoreApiVolumeDown )
-    		{
-    		keyEvent.iScanCode = EStdKeyDecVolume;
-    		TRAP_IGNORE( HandleKeyEventL( keyEvent, EEventKey ) );
-    		}
-    	}
-    }
-
+void CImageEditorAppUi::HandleVolumeKeyEvent(
+		TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction /* aButtonAct */)
+	{
+	if (((CImageEditorUIView *) iEditorView)->GetContainer())
+		{
+		if (!((CImageEditorUIView *) iEditorView)->GetContainer()->IsFocused())
+			{
+			return;
+			}
+		}
+
+	if (iForeground)
+		{
+		TKeyEvent keyEvent;
+		if (aOperationId == ERemConCoreApiVolumeUp)
+			{
+			keyEvent.iScanCode = EStdKeyIncVolume;
+				TRAP_IGNORE( HandleKeyEventL( keyEvent, EEventKey ) );
+			}
+		else if (aOperationId == ERemConCoreApiVolumeDown)
+			{
+			keyEvent.iScanCode = EStdKeyDecVolume;
+				TRAP_IGNORE( HandleKeyEventL( keyEvent, EEventKey ) );
+			}
+		}
+	}
+
+void CImageEditorAppUi::InitialHorizontalDrawPlugin()
+	{
+	//    //	Get pointer to the view
+	CImageEditorUIView * view = (CImageEditorUIView *) iEditorView;
+	
+	TRect rect;
+	iResolutionUtil->GetClientRect(rect);
+	SetFullScreenL();
+	//	Create a plug-in control
+	//  Ownership is moved to the plug-in
+	CCoeControl * control = NULL;
+	TInt err = iEditorManager->CreatePluginControlL(rect, view->GetContainer(),
+			control);
+
+	LOG(KImageEditorLogFile, "CImageEditorAppUi: Plugin control created");
+
+	//  The plug-in activation was cancelled
+	if (err != KErrNone)
+		{
+		//	Cancel plug-in
+		iCancelling = ETrue;
+		iCallback->DoCallback(KObCancelCallbackID);
+		}
+
+	//  Activate plug-in
+	else
+		{
+		//  Register control to UI
+		view->ActivatePluginL(control);
+
+		LOG(KImageEditorLogFile, "CImageEditorAppUi: Plugin activated");
+
+		//  If the filter did not have a control, close plug-in
+		if (!control)
+			{
+			iEditorManager->ClosePlugin();
+
+			}
+
+		//  Set the last opened image to editor view
+		((CImageEditorUIView *) iEditorView)->SetImageL(iEditorManager->GetPreviewImage());
+
+		ResetBusy();
+		}
+	}
 // End of File
--- a/imageeditor/inc/ImageEditorControlBase.h	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/inc/ImageEditorControlBase.h	Thu Jun 03 18:57:10 2010 +0800
@@ -116,6 +116,7 @@
 	*	@return -
 	*/
     IMPORT_C virtual void PrepareL ();
+    
 
     /*	OfferKeyEventL
     *
@@ -232,6 +233,7 @@
 	*/
 	IMPORT_C virtual TBitField GetDimmedMenuItems ();
 
+	
 //@}
 
 protected:
--- a/imageeditor/inc/ImageEditorUI.hrh	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/inc/ImageEditorUI.hrh	Thu Jun 03 18:57:10 2010 +0800
@@ -55,6 +55,7 @@
 	//	MISC COMMANDS
 	EImageEditorCmdSelectPlugin		=	15000,
 	EImageEditorCmdRender,
+	EImageEditorResetFullScreen,
 	EImageEditorCmdViewReady,
 	EImageEditorApplyPlugin,
 	EImageEditorApplyPluginNoStorage,
--- a/imageeditor/inc/ImageEditorUIView.h	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/inc/ImageEditorUIView.h	Thu Jun 03 18:57:10 2010 +0800
@@ -522,6 +522,9 @@
     */
     IMPORT_C TBool InZoomingState();
     IMPORT_C TBool IsMemoryInCriticalLevel();
+    
+   
+    
 //@}
 
 protected:
@@ -546,7 +549,6 @@
 
 /** @name Methods:*/
 //@{
-
 	/*	DoActivateL
 	*
 	*	Called when view is activated.
@@ -718,6 +720,8 @@
     // Popup controller
 	CAknInfoPopupNoteController*        iPopupController;
 	
+
+	
 #ifdef AIW_SUPPORT
     /// AIW Service Handler
     CAiwServiceHandler*                 iServiceHandler;
--- a/imageeditor/inc/PreviewControlBase.h	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/inc/PreviewControlBase.h	Thu Jun 03 18:57:10 2010 +0800
@@ -115,6 +115,7 @@
 //@{
     /// Preview image
 	const CFbsBitmap *		        iPreview;
+	TInt                            iStatuspaneHeight;
 //@}
 
 private:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/data/PenSize.svg	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="text/ecmascript" zoomAndPan="magnify" baseProfile="tiny" contentStyleType="text/css" version="1.1" width="16px" preserveAspectRatio="xMidYMid meet" viewBox="-0.5 -0.5 16 16" height="16px" x="0px" y="0px">
+    <g>
+        <g stroke-opacity="0.5" fill-opacity="0.5">
+            <g>
+                <polygon points="4.375,8.271 3.378,9.009 0.877,13.945 6.329,12.982 7.323,12.245    "/>
+                <polygon points="0.877,13.945 4.115,13.377 2.364,11.014    "/>
+                <polygon points="6.584,11.251 4.854,10.996 5.108,9.267 13.009,3.403 14.481,5.391    "/>
+                <polygon points="6.329,12.982 15.221,6.388 14.481,5.391 6.584,11.251    "/>
+                <polygon points="12.271,2.413 3.378,9.009 5.108,9.267 13.009,3.403    "/>
+            </g>
+        </g>
+        <g>
+            <polygon fill="#ffdf97" points="4.208,7.825 3.211,8.563 0.71,13.499 6.162,12.535 7.155,11.798   "/>
+            <polygon fill="#464cff" points="0.71,13.499 3.948,12.93 2.197,10.566   "/>
+            <linearGradient x1="1123.2207" gradientTransform="matrix(1 0 0 1 -1118.5 -1429.5)" y1="1432.209" x2="1131.8673" gradientUnits="userSpaceOnUse" y2="1440.8555" xlink:type="simple" xlink:actuate="onLoad" id="SVGID_1_" xlink:show="other">
+                <stop stop-color="#60a5da" offset="0"/>
+                <stop stop-color="#464cff" offset="1"/>
+            </linearGradient>
+            <polygon fill="url(#SVGID_1_)" points="6.418,10.804 4.687,10.549 4.941,8.818 12.843,2.957 14.314,4.944   "/>
+            <linearGradient x1="1125.4199" gradientTransform="matrix(1 0 0 1 -1118.5 -1429.5)" y1="1434.9209" x2="1126.6041" gradientUnits="userSpaceOnUse" y2="1436.1051" xlink:type="simple" xlink:actuate="onLoad" id="SVGID_2_" xlink:show="other">
+                <stop stop-color="#60a5da" offset="0"/>
+                <stop stop-color="#263be0" offset="1"/>
+            </linearGradient>
+            <polygon fill="url(#SVGID_2_)" points="6.162,12.535 15.054,5.94 14.314,4.944 6.418,10.804   "/>
+            <polygon fill="#4aa8ed" points="12.104,1.965 3.211,8.563 4.941,8.818 12.843,2.957   "/>
+        </g>
+    </g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/data/menu.svg	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Decoded by SVGB to SVG converter version 0.9.3 -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" baseProfile="tiny" version="1.1" width="54" viewBox="0 0 54 54" height="54" x="0" y="0">
+  <g>
+    <rect width="54" fill="none" height="54"/>
+    <path d="M49.059,25.115C49.008,24.009,48.567,22.933,47.733,22.111L32.983,7.36C32.194,6.507,31.059,6.079,29.928,6.081C28.756,6.07,27.642,6.524,26.821,7.36L26.531,7.652L26.531,7.692C25.829,8.469,25.53,9.481,25.545,10.463C25.538,11.256,25.743,12.028,26.147,12.691L15.67,21.841C14.918,21.349,14.031,21.104,13.109,21.112C11.829,21.099,10.641,21.548,9.769,22.441C8.831,23.364,8.386,24.57,8.396,25.778C8.386,27.018,8.819,28.224,9.723,29.115L15.99,35.385L5.822,45.555C5.383,45.984,5.053,46.647,5.061,47.39L5.061,47.452L5.066,47.503C5.127,48.073,5.344,48.677,5.771,49.167L6.069,49.516L6.186,49.516C6.619,49.836,7.154,49.988,7.643,49.988C7.664,49.988,7.683,49.988,7.704,49.987C8.349,50,9.05,49.731,9.542,49.224L19.684,39.079L25.976,45.374C26.851,46.261,28.036,46.713,29.315,46.698C30.561,46.711,31.727,46.257,32.629,45.394L32.945,45.098L32.945,45.006C33.646,44.173,34.033,43.111,34.025,41.985C34.029,41.052,33.75,40.16,33.246,39.391L42.426,28.959C43.078,29.342,43.815,29.558,44.576,29.597L44.621,29.597L44.684,29.597C45.83,29.547,46.854,29.097,47.682,28.364L48.026,28.066L48.026,27.953C48.672,27.177,49.016,26.218,49.059,25.218L49.061,25.165L49.059,25.115z" opacity="0.2" stroke-opacity="0.2"/>
+    <path d="M47.028,22.819L32.276,8.068C31.665,7.409,30.819,7.082,29.928,7.082C28.989,7.082,28.188,7.409,27.531,8.068L27.531,8.115C26.826,8.725,26.545,9.523,26.545,10.464C26.545,11.403,26.873,12.201,27.531,12.814L15.693,23.148C14.988,22.443,14.142,22.114,13.108,22.114C12.027,22.114,11.182,22.443,10.478,23.148C9.725,23.9,9.396,24.792,9.396,25.778C9.396,26.812,9.725,27.705,10.43,28.409L17.407,35.387L6.531,46.262C6.25,46.543,6.061,46.919,6.061,47.391C6.109,47.813,6.249,48.189,6.531,48.516L6.578,48.516C6.859,48.846,7.236,48.987,7.705,48.987C8.129,48.987,8.504,48.846,8.834,48.516L19.686,37.664L26.686,44.665C27.391,45.368,28.237,45.699,29.315,45.699C30.35,45.699,31.196,45.368,31.948,44.665L31.948,44.617C32.653,43.913,33.028,43.019,33.028,41.985C33.028,41.001,32.653,40.107,31.948,39.355L42.282,27.61C42.94,28.222,43.739,28.549,44.632,28.598C45.573,28.549,46.323,28.222,47.028,27.61L47.028,27.564C47.686,26.907,48.014,26.107,48.061,25.168C48.014,24.275,47.686,23.477,47.028,22.819z" opacity="0.5" stroke-opacity="0.5"/>
+    <linearGradient x1="13.4478" y1="38.6709" x2="15.3632" gradientUnits="userSpaceOnUse" y2="40.5878" id="SVGID_1_">
+      <stop stop-color="#FFFFFF" offset="0"/>
+      <stop stop-color="#CCCCCC" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_1_)" d="M6.531,45.262C6.25,45.543,6.061,45.919,6.061,46.391C6.109,46.813,6.249,47.189,6.531,47.516L6.578,47.516C6.859,47.846,7.236,47.987,7.705,47.987C8.129,47.987,8.504,47.846,8.834,47.516L22.269,34.081C22.598,33.798,22.741,33.422,22.741,32.954C22.787,32.483,22.598,32.106,22.317,31.779L22.269,31.779C21.988,31.449,21.612,31.308,21.142,31.308C20.672,31.308,20.296,31.496,20.015,31.779L6.531,45.262z"/>
+    <linearGradient x1="56.5337" y1="-0.5005" x2="11.1311" gradientUnits="userSpaceOnUse" y2="40.3802" id="SVGID_2_">
+      <stop stop-color="#FF7833" offset="0"/>
+      <stop stop-color="#B52B2B" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_2_)" d="M27.531,7.068C28.188,6.409,28.989,6.082,29.928,6.082C30.819,6.082,31.664,6.409,32.276,7.068L47.028,21.819C47.686,22.476,48.014,23.275,48.061,24.168C48.014,25.107,47.686,25.907,47.028,26.564L47.028,26.61C46.323,27.222,45.573,27.549,44.632,27.598C43.739,27.549,42.941,27.222,42.282,26.61L27.532,11.813C26.874,11.201,26.546,10.403,26.546,9.463C26.546,8.523,26.827,7.725,27.532,7.114L27.532,7.068z"/>
+    <linearGradient x1="59.9644" y1="-1.9878" x2="14.6338" gradientUnits="userSpaceOnUse" y2="38.828" id="SVGID_3_">
+      <stop stop-color="#FF7833" offset="0"/>
+      <stop stop-color="#B52B2B" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_3_)" d="M10.479,22.148C11.183,21.443,12.028,21.114,13.109,21.114C14.143,21.114,14.989,21.443,15.694,22.148L31.948,38.355C32.653,39.107,33.028,40.001,33.028,40.985C33.028,42.019,32.653,42.913,31.948,43.617L31.948,43.665C31.196,44.368,30.35,44.699,29.315,44.699C28.237,44.699,27.391,44.368,26.686,43.665L10.431,27.409C9.726,26.705,9.397,25.812,9.397,24.778C9.396,23.792,9.726,22.9,10.479,22.148L10.479,22.148z"/>
+    <linearGradient x1="10.0381" y1="5.4067" x2="39.7084" gradientUnits="userSpaceOnUse" y2="35.077" id="SVGID_4_">
+      <stop stop-color="#FF7833" offset="0"/>
+      <stop stop-color="#B52B2B" offset="1"/>
+    </linearGradient>
+    <polygon fill="url(#SVGID_4_)" points="15.693,22.148 27.531,11.813 42.282,26.61 31.948,38.355"/>
+    <linearGradient x1="37.4048" y1="14.4644" x2="35.0782" gradientUnits="userSpaceOnUse" y2="16.5592" id="SVGID_5_">
+      <stop stop-color="#FF7833" offset="0"/>
+      <stop stop-color="#B52B2B" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_5_)" d="M28.096,7.632C28.612,7.115,29.27,6.88,30.116,6.926C30.915,7.021,31.62,7.35,32.229,7.96L46.086,21.867L31.711,8.523C31.055,7.96,30.397,7.537,29.691,7.349C29.034,7.161,28.469,7.302,28.096,7.632z"/>
+    <linearGradient x1="22.4233" y1="17.8149" x2="29.736" gradientUnits="userSpaceOnUse" y2="25.1276" id="SVGID_6_">
+      <stop stop-color="#FF7833" offset="0"/>
+      <stop stop-color="#B52B2B" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_6_)" d="M18.183,22.289C19.31,23.699,20.156,25.06,20.72,26.282L16.821,22.336L27.673,12.893C24.665,16.37,21.518,19.471,18.183,22.289z"/>
+    <linearGradient x1="21.9092" y1="28.3584" x2="18.2108" gradientUnits="userSpaceOnUse" y2="31.6885" id="SVGID_7_">
+      <stop stop-color="#FF7833" offset="0"/>
+      <stop stop-color="#B52B2B" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_7_)" d="M10.619,22.759C11.228,22.101,12.027,21.82,13.108,21.867C14.142,21.96,15.035,22.384,15.834,23.181L29.739,37.087L15.129,23.885C14.376,23.086,13.532,22.616,12.639,22.383C11.746,22.148,11.088,22.289,10.619,22.759z"/>
+  </g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/data/palette.svg	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="text/ecmascript" zoomAndPan="magnify" baseProfile="tiny" contentStyleType="text/css" version="1.1" width="65px" preserveAspectRatio="xMidYMid meet" viewBox="0 0 65 65" height="65px" x="0px" y="0px">
+    <g>
+        <path d="M 31.61 5.667 C 18.09 5.667 2.5500011 12.625999 2.5500011 22.208 C 2.5500011 26.382 3.9940012 30.218 15.150002 30.93 C 18.313002 31.132 21.711002 33.603 18.550001 36.761 C 16.136002 39.177002 15.884001 41.324 15.884001 42.942 C 15.884001 53.502003 35.324 53.68 36.667 53.68 C 44.664 53.68 62.225 49.411 62.225 30.388 C 62.225 14.192 45.762 5.667 31.61 5.667 z M 30.873 37.313 C 29.313 37.313 28.519 35.891 28.519 34.959 C 28.519 34.025 29.355 32.605 30.873 32.605 C 32.394 32.605 33.226997 33.968 33.226997 34.959 C 33.227 35.953 32.438 37.313 30.873 37.313 z " fill-opacity="0.2"/>
+        <path d="M 4.865 21.539 C 3.4299998 25.188 6.1309996 28.394 15.271999 28.977 C 20.032999 29.281 22.462 32.615997 22.462 35.406 C 22.462 37.540997 21.053 38.972 19.933 40.093998 C 12.848001 47.177998 26.07 51.723 36.667 51.723 C 48.473 51.723 60.275 43.992 60.271 31.494 C 60.266 19.502 7.023 16.054 4.865 21.539 z M 35.23 34.988 C 35.23 37.383 33.288 39.324997 30.894 39.324997 C 28.498999 39.324997 26.557999 37.382996 26.557999 34.988 C 26.557999 32.592 28.499998 30.651999 30.894 30.651999 C 33.288 30.653 35.23 32.596 35.23 34.988 z " fill-opacity="0.5"/>
+        <linearGradient x1="1126.3867" gradientTransform="matrix(1 0 0 1 -1094 -1454)" y1="1468.3223" x2="1126.3867" gradientUnits="userSpaceOnUse" y2="1509.5771" xlink:type="simple" xlink:actuate="onLoad" id="SVGID_1_" xlink:show="other">
+            <stop stop-color="#ffffff" offset="0"/>
+            <stop stop-color="#b2b2b2" offset="1"/>
+        </linearGradient>
+        <path fill="url(#SVGID_1_)" d="M 31.61 7.625 C 9.874001 7.625 -7.625 25.569 15.271 27.026 C 20.032 27.328 22.462 30.664 22.462 33.454998 C 22.462 35.588997 21.052 37.020996 19.933 38.142998 C 12.847 45.226997 26.07 49.774 36.668 49.774 C 48.471 49.774 60.273 42.041 60.272 29.540998 C 60.266 17.55 47.541 7.625 31.61 7.625 z M 30.878 38.18 C 28.493 38.18 25.436 35.257 25.436 32.876 C 25.436 30.498999 28.493 27.556 30.878 27.556 C 33.253 27.556 36.546 30.501 36.546 32.876 C 36.546 35.258 33.255 38.18 30.878 38.18 z "/>
+        <linearGradient x1="1124.8965" gradientTransform="matrix(1 0 0 1 -1094 -1454)" y1="1493.4043" x2="1124.8965" gradientUnits="userSpaceOnUse" y2="1480.6709" xlink:type="simple" xlink:actuate="onLoad" id="SVGID_2_" xlink:show="other">
+            <stop stop-color="#ffffff" offset="0"/>
+            <stop stop-color="#b2b2b2" offset="1"/>
+        </linearGradient>
+        <path fill="url(#SVGID_2_)" d="M 30.895 26.671 C 27.380001 26.671 24.529 29.521 24.529 33.037 C 24.529 36.551 27.38 39.404 30.895 39.404 C 34.411 39.404 37.264 36.55 37.264 33.037 C 37.264 29.521 34.41 26.671 30.895 26.671 z M 30.895 37.372 C 28.5 37.372 26.559 35.43 26.559 33.034 C 26.559 30.638 28.501 28.698 30.895 28.698 C 33.289 28.698 35.23 30.639 35.23 33.034 C 35.23 35.43 33.288 37.372 30.895 37.372 z "/>
+        <linearGradient x1="1122.2373" gradientTransform="matrix(1 0 0 1 -1094 -1454)" y1="1475.3789" x2="1122.2373" gradientUnits="userSpaceOnUse" y2="1464.7236" xlink:type="simple" xlink:actuate="onLoad" id="SVGID_3_" xlink:show="other">
+            <stop stop-color="#ffffff" offset="0"/>
+            <stop stop-color="#b2b2b2" offset="1"/>
+        </linearGradient>
+        <path fill="url(#SVGID_3_)" d="M 33.563 16.054 C 33.563 13.115001 31.171 10.7230015 28.236 10.7230015 C 25.304 10.7230015 22.912 13.116001 22.912 16.054 C 22.912 18.988 25.305 21.379002 28.236 21.379002 C 31.17 21.379 33.563 18.989 33.563 16.054 z "/>
+        <circle fill="#79cd19" r="3.373" cx="28.237" cy="16.053"/>
+        <linearGradient x1="1110.4375" gradientTransform="matrix(1 0 0 1 -1094 -1454)" y1="1478.748" x2="1110.4375" gradientUnits="userSpaceOnUse" y2="1468.0986" xlink:type="simple" xlink:actuate="onLoad" id="SVGID_4_" xlink:show="other">
+            <stop stop-color="#ffffff" offset="0"/>
+            <stop stop-color="#b2b2b2" offset="1"/>
+        </linearGradient>
+        <path fill="url(#SVGID_4_)" d="M 16.438 14.098 C 13.500999 14.098 11.113 16.487999 11.113 19.425999 C 11.113 22.363998 13.500999 24.748 16.438 24.748 C 19.372 24.748 21.764 22.363998 21.764 19.425999 C 21.765 16.488 19.371 14.098 16.438 14.098 z "/>
+        <circle fill="#ea2227" r="3.371" cx="16.438" cy="19.424"/>
+        <linearGradient x1="1134.0439" gradientTransform="matrix(1 0 0 1 -1094 -1454)" y1="1477.0645" x2="1134.0439" gradientUnits="userSpaceOnUse" y2="1466.4111" xlink:type="simple" xlink:actuate="onLoad" id="SVGID_5_" xlink:show="other">
+            <stop stop-color="#ffffff" offset="0"/>
+            <stop stop-color="#b2b2b2" offset="1"/>
+        </linearGradient>
+        <path fill="url(#SVGID_5_)" d="M 40.044 23.064 C 42.976997 23.064 45.369 20.675999 45.369 17.737 C 45.369 14.8029995 42.975998 12.410999 40.044 12.410999 C 37.107 12.410999 34.718998 14.8029995 34.718998 17.737 C 34.717 20.675 37.107 23.064 40.044 23.064 z "/>
+        <path fill="#3687ff" d="M 40.042 21.109 C 41.906 21.109 43.416 19.601 43.416 17.736 C 43.416 15.876 41.908 14.3619995 40.042 14.3619995 C 38.182 14.3619995 36.667 15.875 36.667 17.736 C 36.67 19.602 38.182 21.109 40.042 21.109 z "/>
+    </g>
+    <g>
+        <polygon points="26.911,40.732 26.937,40.739 39.047,45.066 43.381,57.189 47.711,45.066 59.844,40.732    59.832,40.732 56.073,39.393 30.581,39.421  " fill-opacity="0.5"/>
+        <linearGradient x1="-1072.4731" gradientTransform="matrix(-1 0 0 1 -1029.0957 -2181)" y1="2207.3447" x2="-1072.4731" gradientUnits="userSpaceOnUse" y2="2257.1973" xlink:type="simple" xlink:actuate="onLoad" id="SVGID_6_" xlink:show="other">
+            <stop stop-color="#ffe23d" offset="0"/>
+            <stop stop-color="#e48717" offset="1"/>
+        </linearGradient>
+        <polygon fill="url(#SVGID_6_)" points="26.911,39.421 26.937,39.43 39.047,43.755 43.381,55.881 47.711,43.755 59.844,39.421    59.832,39.421 47.702,35.09 43.369,22.96 39.039,35.09  "/>
+        <polygon points="26.911,39.421 26.937,39.43 39.047,43.755 43.381,55.881 47.711,43.755 59.844,39.421    59.832,39.421 55.936,39.426 46.684,42.729 43.381,51.98 40.076,42.729 30.814,39.419  " fill-opacity="0.2"/>
+        <polygon fill="#ffffff" fill-opacity="0.35" points="55.936,39.426 59.832,39.421 47.702,35.09 43.369,22.96 39.039,35.09    26.911,39.421 30.814,39.419 40.066,36.12 43.369,26.862 46.676,36.12  "/>
+    </g>
+    <g>
+        <path d="M 19.123 61.898 L 22.223999 52.585 L 31.532999 49.482 L 27.481998 48.133 L 10.76 48.133 L 6.709 49.482 C 6.709 49.482 14.851 52.202 16.022 52.585 C 16.409 53.757 19.123 61.898 19.123 61.898 z " fill-opacity="0.5"/>
+        <linearGradient x1="-1048.2168" gradientTransform="matrix(-1 0 0 1 -1029.0957 -2181)" y1="2216.7393" x2="-1048.2168" gradientUnits="userSpaceOnUse" y2="2270.1416" xlink:type="simple" xlink:actuate="onLoad" id="SVGID_7_" xlink:show="other">
+            <stop stop-color="#ffe23d" offset="0"/>
+            <stop stop-color="#e48717" offset="1"/>
+        </linearGradient>
+        <path fill="url(#SVGID_7_)" d="M 19.123 60.587 L 22.223999 51.277 L 31.532999 48.174 C 31.532999 48.174 23.387999 45.463 22.223999 45.072 C 21.832998 43.907997 19.123 35.766 19.123 35.766 C 19.123 35.766 16.41 43.907997 16.022 45.072 C 14.855 45.467 6.7089996 48.174 6.7089996 48.174 C 6.7089996 48.174 14.851 50.892 16.022 51.277 C 16.409 52.445 19.123 60.587 19.123 60.587 z "/>
+        <path d="M 6.708 48.175 C 6.708 48.175 14.851 50.895 16.021 51.279 C 16.406 52.447 19.121 60.591 19.121 60.591 C 19.121 60.591 21.831001 52.45 22.221 51.279 C 23.167 50.966 31.532001 48.175 31.532001 48.175 L 27.388 48.176 L 21.187 50.241997 L 19.122 56.436996 L 17.060999 50.237995 L 10.860999 48.174995 L 6.708 48.175 z " fill-opacity="0.2"/>
+        <path fill="#ffffff" d="M 6.709 48.174 L 10.859 48.175 C 13.1710005 47.403 17.059 46.106 17.059 46.106 L 19.12 39.918 C 19.888 42.228 21.186 46.107998 21.186 46.107998 C 21.186 46.107998 25.075 47.405 27.386002 48.175 L 31.530003 48.174 C 31.530003 48.174 23.385002 45.461 22.218002 45.07 C 21.829002 43.904 19.119003 35.765 19.119003 35.765 C 19.119003 35.765 16.406004 43.904 16.019003 45.07 C 14.855 45.465 6.709 48.175 6.709 48.174 z " fill-opacity="0.35"/>
+    </g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/data/save.svg	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Decoded by SVGB to SVG converter version 0.9.3 -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" baseProfile="tiny" version="1.1" width="54" viewBox="0 0 54 54" height="54" x="0" y="0">
+  <g>
+    <rect width="54" fill="none" height="54"/>
+    <path d="M47.58,7.417L46.86,8.109L47.565,7.401C46.651,6.474,45.445,5.99,44.19,5.999L42.18,5.999L11.669,5.999L9.72,5.999C8.444,5.989,7.221,6.473,6.328,7.417C5.411,8.28,4.928,9.509,4.94,10.809L4.94,45.249C4.928,46.508,5.426,47.689,6.328,48.612C7.236,49.491,8.42,50.005,9.72,49.998L44.19,49.998C44.198,49.998,44.205,49.998,44.212,49.998C45.483,49.998,46.642,49.485,47.534,48.655L47.568,48.622L47.605,48.581C48.431,47.663,48.916,46.508,48.908,45.249L48.908,10.81C48.917,9.51,48.448,8.31,47.58,7.417z" opacity="0.2" stroke-opacity="0.2"/>
+    <path d="M46.859,8.11C46.109,7.36,45.21,7,44.189,7L42.179,7L11.67,7L9.72,7C8.67,7,7.77,7.36,7.05,8.11C6.3,8.83,5.94,9.73,5.94,10.81L5.94,45.25C5.94,46.27,6.3,47.141,7.05,47.92C7.77,48.609,8.67,49,9.72,49L44.19,49C45.211,49,46.11,48.609,46.86,47.92C47.55,47.141,47.91,46.27,47.91,45.25L47.91,10.81C47.909,9.73,47.55,8.83,46.859,8.11z" opacity="0.5" stroke-opacity="0.5"/>
+    <linearGradient x1="26.9243" y1="-17.313" x2="26.9243" gradientUnits="userSpaceOnUse" y2="47.7651" id="SVGID_1_">
+      <stop stop-color="#808080" offset="0"/>
+      <stop stop-color="#666666" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_1_)" d="M46.859,7.11C46.109,6.36,45.21,6,44.189,6L9.72,6C8.67,6,7.77,6.36,7.05,7.11C6.3,7.83,5.94,8.73,5.94,9.81L5.94,44.25C5.94,45.27,6.3,46.141,7.05,46.92C7.77,47.609,8.67,48,9.72,48L44.19,48C45.211,48,46.11,47.609,46.86,46.92C47.55,46.141,47.91,45.27,47.91,44.25L47.91,9.81C47.909,8.73,47.55,7.83,46.859,7.11z"/>
+    <linearGradient x1="26.9097" y1="26.0903" x2="26.9097" gradientUnits="userSpaceOnUse" y2="14.6583" id="SVGID_2_">
+      <stop stop-color="#808080" offset="0"/>
+      <stop stop-color="#666666" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_2_)" d="M15.33,22.17C14.159,22.17,13.17,21.75,12.359,20.91C11.819,20.43,11.46,19.83,11.309,19.17L11.459,20.43C12.059,22.14,13.379,22.98,15.329,22.95L38.549,22.95C40.439,22.98,41.729,22.14,42.329,20.46L42.509,19.38C42.329,19.98,41.999,20.46,41.488,20.91C40.709,21.75,39.718,22.17,38.549,22.17L15.33,22.17z"/>
+    <linearGradient x1="26.9399" y1="61.6094" x2="26.9399" gradientUnits="userSpaceOnUse" y2="34.7718" id="SVGID_3_">
+      <stop stop-color="#808080" offset="0"/>
+      <stop stop-color="#666666" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_3_)" d="M43.8,47.28C44.699,47.28,45.48,46.95,46.11,46.29C46.77,45.631,47.1,44.881,47.1,43.95L47.1,38.58L46.68,43.92C46.68,44.609,46.35,45.24,45.75,45.78C45.18,46.29,44.489,46.53,43.8,46.53L10.08,46.53C9.359,46.53,8.76,46.29,8.189,45.78C7.649,45.24,7.29,44.609,7.229,43.92C7.109,43.29,7.019,42.09,6.929,40.35L6.779,40.35L6.779,43.951C6.779,44.882,7.109,45.632,7.739,46.291C8.399,46.951,9.179,47.281,10.08,47.281L43.8,47.281z"/>
+    <linearGradient x1="4.1445" y1="39.1201" x2="6.7735" gradientUnits="userSpaceOnUse" y2="39.1201" id="SVGID_4_">
+      <stop stop-color="#808080" offset="0"/>
+      <stop stop-color="#666666" offset="1"/>
+    </linearGradient>
+    <polygon fill="url(#SVGID_4_)" points="6.779,40.35 6.93,40.35 6.779,37.891"/>
+    <linearGradient x1="44.9092" y1="10.9932" x2="44.9092" gradientUnits="userSpaceOnUse" y2="24.5599" id="SVGID_5_">
+      <stop stop-color="#808080" offset="0"/>
+      <stop stop-color="#666666" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_5_)" d="M46.17,7.65C45.51,6.99,44.76,6.66,43.83,6.66L42.659,6.66L44.489,7.08C45.75,7.65,46.38,8.61,46.409,10.02L47.159,35.58L47.159,10.02C47.159,9.09,46.83,8.28,46.17,7.65z"/>
+    <linearGradient x1="8.9395" y1="10.9805" x2="8.9395" gradientUnits="userSpaceOnUse" y2="24.546" id="SVGID_6_">
+      <stop stop-color="#808080" offset="0"/>
+      <stop stop-color="#666666" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_6_)" d="M7.71,7.68C7.05,8.31,6.689,9.09,6.689,10.02L6.689,34.561L7.409,10.02C7.409,8.73,8.099,7.74,9.42,7.05L11.19,6.66L10.05,6.66C9.12,6.66,8.34,6.99,7.71,7.68z"/>
+    <linearGradient x1="26.9243" y1="-6.8662" x2="26.9243" gradientUnits="userSpaceOnUse" y2="25.9672" id="SVGID_7_">
+      <stop stop-color="#FFFFFF" offset="0"/>
+      <stop stop-color="#CCCCCC" offset="1"/>
+    </linearGradient>
+    <path fill="url(#SVGID_7_)" d="M42.18,6L11.67,6L11.64,6.18L11.64,17.88C11.64,18.93,12.03,19.83,12.75,20.58C13.5,21.33,14.399,21.69,15.449,21.69L38.429,21.69C39.479,21.69,40.379,21.33,41.099,20.58C41.849,19.83,42.209,18.93,42.209,17.88L42.209,6.18L42.18,6zM19.05,16.86C19.05,17.28,18.93,17.58,18.659,17.881C18.359,18.181,18.029,18.36,17.609,18.36C17.159,18.36,16.71,18.18,16.229,17.881C15.659,17.581,15.389,17.251,15.389,16.86L15.389,9.99C15.389,9.63,15.659,9.3,16.229,8.97C16.709,8.7,17.159,8.55,17.609,8.55C18.059,8.55,18.389,8.7,18.659,8.97C18.93,9.24,19.05,9.6,19.05,9.99L19.05,16.86z"/>
+    <linearGradient x1="26.939" y1="5.0107" x2="26.939" gradientUnits="userSpaceOnUse" y2="24.0344" id="SVGID_8_">
+      <stop stop-color="#FFFFFF" offset="0"/>
+      <stop stop-color="#CCCCCC" offset="1"/>
+    </linearGradient>
+    <polygon fill="url(#SVGID_8_)" points="41.069,7.11 41.85,11.73 41.85,6.36 12.029,6.36 12.029,12.24 12.81,7.11"/>
+    <path fill="#A6A6A6" d="M42.09,29.43C41.88,28.44,41.43,27.631,40.739,27.031C40.05,26.371,39.239,26.041,38.37,26.041L15.51,26.041C14.61,26.041,13.83,26.371,13.14,27.031C12.45,27.631,12,28.44,11.76,29.43C11.67,29.76,11.64,30.151,11.67,30.54L11.67,39.061C11.64,39.481,11.699,39.93,11.85,40.381C12.06,41.28,12.51,42.061,13.2,42.66C13.86,43.26,14.64,43.56,15.511,43.56L38.371,43.56C39.211,43.56,39.99,43.259,40.681,42.66C41.311,42.06,41.761,41.28,42.031,40.381C42.151,39.93,42.212,39.481,42.241,39.061L42.241,30.54C42.239,30.15,42.21,29.76,42.09,29.43z"/>
+  </g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/data/undo.svg	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="text/ecmascript" zoomAndPan="magnify" baseProfile="tiny" contentStyleType="text/css" version="1.1" width="57px" preserveAspectRatio="xMidYMid meet" viewBox="0 0 57 49" height="49px" x="0px" y="0px">
+    <path d="M 36.642 42.702 C 36.642 42.702 36.958 46.047 32.48 46.047 L 22.581 46.047 C 18.106998 46.047 18.412998 42.702 18.412998 42.702 L 18.426998 25.809 L 8.207 25.809 L 27.351 3.9 L 46.849 25.813 L 36.634 25.813 L 36.642 42.702 z " fill-opacity="0.2"/>
+    <path d="M 35.424 41.203 C 35.424 41.203 35.714 44.313 31.626999 44.313 L 22.591 44.313 C 18.51 44.313 18.786999 41.203 18.786999 41.203 L 18.8 25.496 L 9.474 25.496 L 26.945 5.12 L 44.739 25.495998 L 35.419 25.495998 L 35.424 41.203 z " fill-opacity="0.5"/>
+    <g>
+        <linearGradient x1="2267.2646" gradientTransform="matrix(-1 0 0 -1 2294.793 2999.7793)" y1="2987.833" x2="2267.2646" gradientUnits="userSpaceOnUse" y2="2917.8977" xlink:type="simple" xlink:actuate="onLoad" id="SVGID_1_" xlink:show="other">
+            <stop stop-color="#3687ff" offset="0"/>
+            <stop stop-color="#051f7d" offset="1"/>
+        </linearGradient>
+        <path fill="url(#SVGID_1_)" d="M 36.003 42.15 C 36.003 42.15 36.299 45.260002 32.133 45.260002 L 22.926998 45.260002 C 18.769999 45.260002 19.051998 42.15 19.051998 42.15 L 19.063997 26.441002 L 9.562 26.441002 L 27.362 6.066002 L 45.496002 26.441002 L 35.997 26.441002 L 36.003 42.15 z "/>
+        <path fill="#ffffff" d="M 27.367 8.685 L 13.234 24.878 L 20.923 24.878 L 20.913 42.251 C 20.909 42.262 20.879 42.908 21.313 43.294 L 20.021 44.389 C 18.955 43.469 19.043 42.154 19.043 42.154 L 19.056 26.444 L 9.553 26.444 L 27.361 6.067 L 27.367 8.685 z " fill-opacity="0.3"/>
+        <path d="M 27.361 6.064 L 45.495003 26.441002 L 35.995003 26.441002 L 36.009003 42.15 C 36.009003 42.15 36.299004 45.260002 32.132004 45.260002 L 22.93 45.260002 C 21.482 45.260002 20.6 44.875004 20.027 44.392002 L 21.328001 43.291 C 21.635 43.562 22.165 43.697 22.93 43.697 L 32.132 43.697 C 33.557 43.697 34.153 43.234997 34.153 42.152 L 34.134 24.877 L 41.781998 24.877 L 27.38 8.688 L 27.361 6.064 z " fill-opacity="0.2"/>
+    </g>
+</svg>
Binary file imageeditor/plugins/DrawPlugin/gfx/15A.bmp has changed
Binary file imageeditor/plugins/DrawPlugin/gfx/Left.bmp has changed
Binary file imageeditor/plugins/DrawPlugin/gfx/Leftmask.bmp has changed
Binary file imageeditor/plugins/DrawPlugin/gfx/Right.bmp has changed
Binary file imageeditor/plugins/DrawPlugin/gfx/bottom.bmp has changed
Binary file imageeditor/plugins/DrawPlugin/gfx/bottommask.bmp has changed
Binary file imageeditor/plugins/DrawPlugin/gfx/menumask.bmp has changed
Binary file imageeditor/plugins/DrawPlugin/gfx/rightmask.bmp has changed
Binary file imageeditor/plugins/DrawPlugin/gfx/top.bmp has changed
Binary file imageeditor/plugins/DrawPlugin/gfx/topmask.bmp has changed
--- a/imageeditor/plugins/DrawPlugin/group/bld.inf	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/plugins/DrawPlugin/group/bld.inf	Thu Jun 03 18:57:10 2010 +0800
@@ -32,6 +32,7 @@
 //	mmp files
 PRJ_MMPFILES
 drawplugin.mmp
+gnumakefile icons_doodle.mk
 
 PRJ_EXTENSIONS
 START EXTENSION s60/mifconv
--- a/imageeditor/plugins/DrawPlugin/group/drawplugin.mmp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/plugins/DrawPlugin/group/drawplugin.mmp	Thu Jun 03 18:57:10 2010 +0800
@@ -60,9 +60,8 @@
 
 SOURCEPATH      ../src
 SOURCE          imageeditordrawplugin.cpp
-SOURCE          imageeditordrawcontrol.cpp
 SOURCE          drawpath.cpp
-SOURCE          selectionpopup.cpp
+SOURCE          selectionpopup.cpp imageeditordrawcontrol.cpp AnimationAO.cpp CImageLabel.cpp TimeAO.cpp CustomerComponet.cpp RollAO.cpp
 
 
 USERINCLUDE     .
@@ -101,10 +100,24 @@
 LIBRARY         pb.lib
 LIBRARY         systemparameters.lib
 LIBRARY         CommonEngine.lib
+LIBRARY        hlplch.lib eikcoctl.lib eikctl.lib bafl.lib fbscli.lib aknicon.lib egul.lib
+LIBRARY        imageconversion.lib  bitgdi.lib CommonDialogs.lib
+//LIBRARY        ImageEditorUI.LIB
 
 //#if defined (__EXPORT_UNFROZEN_PLUGINS__)
-//EXPORTUNFROZEN
+EXPORTUNFROZEN
 //#endif
 NOSTRICTDEF
 
 // End of File
+START BITMAP imageditorfilterdraw.mbm
+	TARGETPATH resource/apps
+	HEADER
+	SOURCEPATH ../gfx
+	SOURCE c24 top.bmp bottom.bmp
+	SOURCE c4 menumask.bmp
+	SOURCE c24 Right.bmp 15A.bmp
+	SOURCE 1 Leftmask.bmp rightmask.bmp
+	SOURCE c24 Left.bmp
+	SOURCE 1 topmask.bmp bottommask.bmp
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/group/icons_doodle.mk	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,39 @@
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=$(EPOCROOT)epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\RESOURCE\APPS
+HEADERDIR=$(EPOCROOT)epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\Icons_doodle.mif
+HEADERFILENAME=$(HEADERDIR)\Icons_doodle.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIN : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c32,8  ..\data\pensize.svg\
+	/c32,8  ..\data\palette.svg\
+	/c32,8  ..\data\undo.svg\
+	/c32,8  ..\data\save.svg\
+	/c32,8  ..\data\menu.svg
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME) && \
+	@echo $(ICONTARGETFILENAME)
+FINAL : do_nothing
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/inc/AnimationAO.h	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,74 @@
+/*
+ ============================================================================
+ Name		: AnimationAO.h
+ Author	  : 
+ Version	 : 1.0
+ Copyright   : Your copyright notice
+ Description : CAnimationAO declaration
+ ============================================================================
+ */
+
+#ifndef ANIMATIONAO_H
+#define ANIMATIONAO_H
+
+#include <e32base.h>	// For CActive, link against: euser.lib
+#include <e32std.h>		// For RTimer, link against: euser.lib
+
+class MAnimationObserver
+	{
+public:
+	virtual void Notify() = 0;
+	~MAnimationObserver() {}
+protected:
+	MAnimationObserver() {}
+	};
+
+
+
+
+
+class CAnimationAO : public CActive
+	{
+public:
+	// Cancel and destroy
+	~CAnimationAO();
+
+	// Two-phased constructor.
+	static CAnimationAO* NewL();
+
+	// Two-phased constructor.
+	static CAnimationAO* NewLC();
+
+public:
+	// New functions
+	// Function for making the initial request
+	void StartL(TTimeIntervalMicroSeconds32 aDelay);
+	void SetObserver(MAnimationObserver *aObserver);
+	
+private:
+	// C++ constructor
+	CAnimationAO();
+
+	// Second-phase constructor
+	void ConstructL();
+	
+	
+
+private:
+	// From CActive
+	// Handle completion
+	void RunL();
+
+	// How to cancel me
+	void DoCancel();
+
+	// Override to handle leaves from RunL(). Default implementation causes
+	// the active scheduler to panic.
+	TInt RunError(TInt aError);
+
+private:
+	RTimer iTimer; // Provides async timing service
+	MAnimationObserver *iObserver;
+	};
+
+#endif // ANIMATIONAO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/inc/CImageLabel.h	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,140 @@
+/*
+ ============================================================================
+ Name		: CImageLabel.h
+ Author	  : 
+ Version	 : 1.0
+ Copyright   : Your copyright notice
+ Description : CImageLabel declaration
+ ============================================================================
+ */
+
+#ifndef IMAGELABEL_H
+#define IMAGELABEL_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <COECNTRL.H>
+#include "MCountTime.h"
+
+class CFbsBitmap;
+class CTimeAO;
+
+
+class MHandlePointerObserver
+	{
+public:
+	virtual void HandlePointerNotify(CCoeControl* aComponent) = 0;
+	virtual ~MHandlePointerObserver() {}
+protected:
+	MHandlePointerObserver(){}
+	};
+
+
+
+// CLASS DECLARATION
+
+/**
+ *  CCImageLabel
+ * 
+ */
+class CImageLabel : public CCoeControl, MCountTime
+	{
+public:
+	enum LABEL_STATE
+		{
+		ENone, ESelected, ESelectedWithTooltip,EMoving
+		};
+	enum TOOLTIP_LAYOUT
+		{
+		ELabelHorizontal, ELabelVertical
+		};
+public:
+	// Constructors and destructor
+
+	/**
+	 * Destructor.
+	 */
+	~CImageLabel();
+
+	/**
+	 * Two-phased constructor.
+	 */
+	static CImageLabel* NewL(CCoeControl *aParent, const TRect& aRect, TOOLTIP_LAYOUT aLabelLayout);
+
+	/**
+	 * Two-phased constructor.
+	 */
+	static CImageLabel* NewLC(CCoeControl *aParent, const TRect& aRect, TOOLTIP_LAYOUT aLabelLayout);
+
+public:
+	/**
+	 * From CCoeControl
+	 */
+	virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+
+	/**
+	 * From CCoeControl
+	 */
+	virtual void SizeChanged();
+
+	/**
+	 * From CCoeControl
+	 */
+	virtual void Draw(const TRect& aRect) const;
+	
+	virtual void Notify();
+
+	/**
+	 * Self-define 
+	 */
+	void SetImage(const TDesC& aMbmPackage, TInt aIndex);
+
+	/**
+	 * Self-define 
+	 */
+	void SetTooltip(const TDesC& aTooltip);
+	
+	void ResetControl();
+	
+	void LabelIsMoving();
+	
+	void SetHandlePointerObserver(MHandlePointerObserver* aHandlePointerObserver);
+	
+private:
+	/**
+	 * Constructor for performing 1st stage construction
+	 */
+	CImageLabel();
+
+	/**
+	 * EPOC default constructor for performing 2nd stage construction
+	 */
+	void ConstructL(CCoeControl *aParent, const TRect& aRect, TOOLTIP_LAYOUT aLabelLayout);
+	
+	void CalculateImagePoint();
+	void CalculateBoundingRectStartPoint();
+	void CalculateTooltipPoint();
+	void CalculateZones();
+
+private:
+	LABEL_STATE iState;
+	TOOLTIP_LAYOUT iLabelLayout;
+	
+	TBuf<20> iTooltip;
+	TPoint iTooltipStartPoint;
+	TPoint iImageStartPoint;
+	TPoint iBoundingRectStartPoint;
+	
+	TSize iImageSize;
+	TSize iBoundingSize;
+	
+	CFbsBitmap* iBitmap;
+	CFbsBitmap* iBitmapMask;
+	
+	CTimeAO* iTimeAO;
+	MHandlePointerObserver* iHandlePointerObserver;
+	TBool iIsHandlePointerNotifyProcessing;
+	};
+
+#endif // CIMAGELABEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/inc/CustomerComponet.h	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,101 @@
+/*
+ ============================================================================
+ Name		: CustomerComponet.h
+ Author	  : henry
+ Version	 : 1.0
+ Copyright   : Your copyright notice
+ Description : CCustomerComponet declaration
+ ============================================================================
+ */
+
+#ifndef CUSTOMERCOMPONET_H
+#define CUSTOMERCOMPONET_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <coecntrl.h>
+#include "CImageLabel.h"
+#include <COECOBS.H> 
+// CLASS DECLARATION
+
+/**
+ *  CCustomerComponet
+ * 
+ */
+
+class CCustomerComponet : public CCoeControl
+	{
+public:
+	// Constructors and destructor
+
+	/**
+	 * Destructor.
+	 */
+	~CCustomerComponet();
+
+	/**
+	 * Two-phased constructor.
+	 */
+	static CCustomerComponet* NewL(TRect & aRect, CCoeControl* aParent);
+
+	/**
+	 * Two-phased constructor.
+	 */
+	static CCustomerComponet* NewLC(TRect & aRect, CCoeControl* aParent);
+
+	/**
+	 * Draw() 
+	 */
+	void Draw(const TRect& aRect) const;
+
+	/**
+	 * Handling pointer Event.
+	 */
+	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+
+	/**
+	 * Set Rect for the componet.
+	 */
+	void SetRect(TRect& aRect);
+
+protected:
+
+	void SizeChanged();
+
+private:
+
+	/**
+	 * Constructor for performing 1st stage construction
+	 */
+	CCustomerComponet();
+
+	/**
+	 * EPOC default constructor for performing 2nd stage construction
+	 */
+	void ConstructL(TRect & aRect, CCoeControl* aParent);
+public:
+	/**
+	 * SetHandlePointerObserver
+	 */
+	void SetHandlePointerObserver(
+			MHandlePointerObserver* aHandlePointerObserver);
+
+	TBool GetButtonType();
+private:
+	TInt iDrawDirection;
+	CFbsBitmap* iMenu;
+	CFbsBitmap* iMenuMask;
+	CFbsBitmap* iRight;
+	CFbsBitmap* iRightMask;
+	CFbsBitmap* iLeft;
+	CFbsBitmap* iTop;
+	CFbsBitmap* iBottom;
+	CFbsBitmap* iLeftMask;
+	CFbsBitmap* iTopMask;
+	CFbsBitmap* iBottomMask;
+	MHandlePointerObserver* iPointerObserver;
+	TBool iButtonFlag;
+	};
+
+#endif // CUSTOMERCOMPONET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/inc/MCountTime.h	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,13 @@
+#ifndef MCOUNTTIME_H_
+#define MCOUNTTIME_H_
+
+class MCountTime
+	{
+public:
+	virtual void Notify() = 0;
+	virtual ~MCountTime() {}
+protected:
+	MCountTime() {}
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/inc/RollAO.h	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,74 @@
+/*
+ ============================================================================
+ Name		: AnimationAO.h
+ Author	  : 
+ Version	 : 1.0
+ Copyright   : Your copyright notice
+ Description : CAnimationAO declaration
+ ============================================================================
+ */
+
+#ifndef ROLLAO_H
+#define ROLLAO_H
+
+#include <e32base.h>	// For CActive, link against: euser.lib
+#include <e32std.h>		// For RTimer, link against: euser.lib
+
+class MRollObserver
+	{
+public:
+	virtual void Roll() = 0;
+	~MRollObserver() {}
+protected:
+	MRollObserver() {}
+	};
+
+
+
+
+
+class CRollAO : public CActive
+	{
+public:
+	// Cancel and destroy
+	~CRollAO();
+
+	// Two-phased constructor.
+	static CRollAO* NewL();
+
+	// Two-phased constructor.
+	static CRollAO* NewLC();
+
+public:
+	// New functions
+	// Function for making the initial request
+	void StartL(TTimeIntervalMicroSeconds32 aDelay);
+	void SetObserver(MRollObserver *aObserver);
+	
+private:
+	// C++ constructor
+	CRollAO();
+
+	// Second-phase constructor
+	void ConstructL();
+	
+	
+
+protected:
+	// From CActive
+	// Handle completion
+	void RunL();
+
+	// How to cancel me
+	void DoCancel();
+
+	// Override to handle leaves from RunL(). Default implementation causes
+	// the active scheduler to panic.
+	TInt RunError(TInt aError);
+
+private:
+	RTimer iTimer; // Provides async timing service
+	MRollObserver *iObserver;
+	};
+
+#endif // ANIMATIONAO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/inc/TimeAO.h	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,64 @@
+/*
+ ============================================================================
+ Name		: TimeAO.h
+ Author	  : 
+ Version	 : 1.0
+ Copyright   : Your copyright notice
+ Description : CTimeAO declaration
+ ============================================================================
+ */
+
+#ifndef TIMEAO_H
+#define TIMEAO_H
+
+#include <e32base.h>	// For CActive, link against: euser.lib
+#include <e32std.h>		// For RTimer, link against: euser.lib
+
+class MCountTime;
+
+class CTimeAO : public CActive
+	{
+public:
+	// Cancel and destroy
+	~CTimeAO();
+
+	// Two-phased constructor.
+	static CTimeAO* NewL();
+
+	// Two-phased constructor.
+	static CTimeAO* NewLC();
+
+public:
+	// New functions
+	// Function for making the initial request
+	void StartL();
+	
+	void SetObserver(MCountTime* aObserver);
+
+private:
+	// C++ constructor
+	CTimeAO();
+
+	// Second-phase constructor
+	void ConstructL();
+
+private:
+	// From CActive
+	// Handle completion
+	void RunL();
+
+	// How to cancel me
+	void DoCancel();
+
+	// Override to handle leaves from RunL(). Default implementation causes
+	// the active scheduler to panic.
+	TInt RunError(TInt aError);
+
+private:
+
+private:
+	RTimer iTimer; // Provides async timing service
+	MCountTime* iObserver;
+	};
+
+#endif // TIMEAO_H
--- a/imageeditor/plugins/DrawPlugin/inc/draw.hrh	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/plugins/DrawPlugin/inc/draw.hrh	Thu Jun 03 18:57:10 2010 +0800
@@ -24,7 +24,7 @@
 
 enum TDrawPgnCommandId
 {
-	EDrawPgnMenuCmdMin 		= EPgnMenuCmdIdBase,
+	EDrawPgnMenuCmdMin 		= EPgnMenuCmdIdBase, //200000
 	EDrawPgnMenuCmdDone,
 	EDrawPgnMenuCmdResize,
 	EDrawPgnMenuCmdColor,
--- a/imageeditor/plugins/DrawPlugin/inc/imageeditordrawcontrol.h	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/plugins/DrawPlugin/inc/imageeditordrawcontrol.h	Thu Jun 03 18:57:10 2010 +0800
@@ -1,21 +1,21 @@
 /*
-* Copyright (c) 2010 Ixonos Plc.
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - Initial contribution
-*
-* Contributors:
-* Ixonos Plc
-*
-* Description: 
-* Draw plugin control class header.
-*
-*/
+ * Copyright (c) 2010 Ixonos Plc.
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - Initial contribution
+ *
+ * Contributors:
+ * Ixonos Plc
+ *
+ * Description: 
+ * Draw plugin control class header.
+ *
+ */
 
 #ifndef IMAGEEDITORDRAWCONTROL_H
 #define IMAGEEDITORDRAWCONTROL_H
@@ -26,6 +26,10 @@
 
 #include <coecntrl.h>
 #include <ConeResLoader.h>
+#include "AnimationAO.h"
+#include "CImageLabel.h"
+#include "CustomerComponet.h"
+#include "RollAO.h"
 
 //  FORWARD DECLARATIONS
 class CAknView;
@@ -33,268 +37,401 @@
 class CPluginInfo;
 class CSystemParameters;
 class CJPTimer;
-class CAknInfoPopupNoteController; 
+class CAknInfoPopupNoteController;
 class CDrawPath;
+class CImageLabel;
+class CAnimationAO;
 
 /*	CLASS: CImageEditorDrawControl
-*
-*   CImageEditorDrawControl is a control for text insertion plug-in.
-*
-*/
-class CImageEditorDrawControl :	public CPreviewControlBase,
-                                public MTimerCallBack
-{
+ *
+ *   CImageEditorDrawControl is a control for text insertion plug-in.
+ *
+ */
+class CImageEditorDrawControl : public CPreviewControlBase,
+		public MTimerCallBack,
+		public MAnimationObserver,
+		public MHandlePointerObserver,
+		public MRollObserver
+	{
+	static const int DRAG_LENGTH = 5;
+	enum TMainMenuLayout
+		{
+		EMainMenuHorizontal, EMainMenuVertical
+		};
 public:
 
-/** @name Methods:*/
-//@{
+	/** @name Methods:*/
+	//@{
 
 	/** NewL factory method
-	*
-	*	@param aRect - control rectangle
-	*	@param aParent - pointer to window owning control
-	*	@return pointer to created CImageEditorDrawControl object
-	*/
-	static CImageEditorDrawControl* NewL(
-		const TRect& aRect,
-		CCoeControl* aParent
-		);
+	 *
+	 *	@param aRect - control rectangle
+	 *	@param aParent - pointer to window owning control
+	 *	@return pointer to created CImageEditorDrawControl object
+	 */
+	static CImageEditorDrawControl* NewL(const TRect& aRect,
+			CCoeControl* aParent, RPointerArray<CDrawPath>& aPaths,TRgb& aRgb, TSize& aSize,TBool &aDisplayTool);
 
 	/** Destructor */
 	~CImageEditorDrawControl();
 
-protected: // From CImageEditorControlBase
+protected:
+	// From CImageEditorControlBase
 	/** Second phase constructor
-	*
-	*	@see CImageEditorControlBase
-    */
-	void ConstructL(
-		const TRect& aRect,
-		CCoeControl* aParent
-		);
+	 *
+	 *	@see CImageEditorControlBase
+	 */
+	void ConstructL(const TRect& aRect, CCoeControl* aParent);
 
 	/*	Setter for view reference
-	*
-	*	@see CImageEditorControlBase
-    */
-    void SetView(CAknView* aView);
+	 *
+	 *	@see CImageEditorControlBase
+	 */
+	void SetView(CAknView* aView);
 
-    /*	SetSelectedUiItemL
-	*
-	*	@see CImageEditorControlBase
-    */
-    void SetSelectedUiItemL(CPluginInfo* aItem);
+	/*	SetSelectedUiItemL
+	 *
+	 *	@see CImageEditorControlBase
+	 */
+	void SetSelectedUiItemL(CPluginInfo* aItem);
 
 	/** PrepareL
-	*
-	*	@see CImageEditorControlBase
-    */
+	 *
+	 *	@see CImageEditorControlBase
+	 */
 	void PrepareL();
 
-    /*	OfferKeyEventL
-	*
-	*	@see CImageEditorControlBase
-    */
-    TKeyResponse OfferKeyEventL(
-        const TKeyEvent& aKeyEvent,
-        TEventCode aType
-        );   
-    
-    /*	HandlePointerEventL
-    *
-    *	@see CImageEditorControlBase
-    */
-	void HandlePointerEventL( const TPointerEvent &aPointerEvent );
-	
+	/*	OfferKeyEventL
+	 *
+	 *	@see CImageEditorControlBase
+	 */
+	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+
+	/*	HandlePointerEventL
+	 *
+	 *	@see CImageEditorControlBase
+	 */
+	void HandlePointerEventL(const TPointerEvent &aPointerEvent);
+
 	/*	HandlePluginCommandL
-	*
-	*	@see CImageEditorControlBase
-    */
-    void HandlePluginCommandL(const TInt aCommand);
+	 *
+	 *	@see CImageEditorControlBase
+	 */
+	void HandlePluginCommandL(const TInt aCommand);
 
 	/*	GetSoftkeyIndexL
-	*
-	*	@see CImageEditorControlBase
-    */
-    TInt GetSoftkeyIndexL();
+	 *
+	 *	@see CImageEditorControlBase
+	 */
+	TInt GetSoftkeyIndexL();
 
-    /*	GetContextMenuResourceId
-	*
-	*	@see CImageEditorControlBase
-	*/
-    TInt GetContextMenuResourceId();
-    
+	/*	GetContextMenuResourceId
+	 *
+	 *	@see CImageEditorControlBase
+	 */
+	TInt GetContextMenuResourceId();
+
 	/*	GetDimmedMenuItems
-	*
-	*	@see CImageEditorControlBase
-	*/
+	 *
+	 *	@see CImageEditorControlBase
+	 */
 	TBitField GetDimmedMenuItems();
 
 	/*	GetNaviPaneTextL
-	*
-	*	@see CImageEditorControlBase
-	*/
-	TPtrC GetNaviPaneTextL(
-		TBool& aLeftNaviPaneScrollButtonVisibile, 
-		TBool& aRightNaviPaneScrollButtonVisible);
-public: 
+	 *
+	 *	@see CImageEditorControlBase
+	 */
+	TPtrC GetNaviPaneTextL(TBool& aLeftNaviPaneScrollButtonVisibile,
+			TBool& aRightNaviPaneScrollButtonVisible);
+
+public:
 	/*	GetParam
-	*
-	*	Gets pointer to the parameter struct.
-	*	@return - pointer to MIA parameter struct
-	*/
-    TDesC& GetParam();
+	 *
+	 *	Gets pointer to the parameter struct.
+	 *	@return - pointer to MIA parameter struct
+	 */
+	TDesC& GetParam();
 
 	/*	SetSysteParameters
-	*
-	*	Sets reference to system parameters to plug-in.
-	*	@param aSysPars - System parameters instance
-	*/
-    void SetSystemParameters(const CSystemParameters* aSysPars);
-    
-    /*  IsReadyToRender
-    *
-    *   @return - ETrue when control is ready render
-    */
-    TBool IsReadyToRender() const;    
+	 *
+	 *	Sets reference to system parameters to plug-in.
+	 *	@param aSysPars - System parameters instance
+	 */
+	void SetSystemParameters(const CSystemParameters* aSysPars);
+
+	/*  IsReadyToRender
+	 *
+	 *   @return - ETrue when control is ready render
+	 */
+	TBool IsReadyToRender() const;
 
 protected:
 
-    /*	GetHelpContext
-	*
-	*	@see CCoeControl
-    */
+	/*	GetHelpContext
+	 *
+	 *	@see CCoeControl
+	 */
 	virtual void GetHelpContext(TCoeHelpContext& aContext) const;
 
-    /*	TimerCallBack
-	*
-	*	@see MTimerCallBack
-    */
+	/*	TimerCallBack
+	 *
+	 *	@see MTimerCallBack
+	 */
 	void TimerCallBack();
 
-//@}
-
+	/*MakeVisibleLable
+	 * 
+	 * make the controller visible
+	 * @param aFlag - ETrue,make the tool bar visible,otherwise.
+	 */
+	void MakeVisibleLable(TBool aFlag);
+    
+	/**StartTheAnimation
+	 * 
+	 * start the auto-moving active object for tool bar. 
+	 */
+	void StartTheAnimation();
 
 protected:
 
-/** @name Methods:*/
-//@{
+	/** @name Methods:*/
+	//@{
 	/*	SizeChanged
-	*
-	*	@see CImageEditorControlBase
-    */
+	 *
+	 *	@see CImageEditorControlBase
+	 */
 	void SizeChanged();
 
-//@}
+	//@}
 
-/** @name Members:*/
-//@{
+	/** @name Members:*/
+	//@{
 
-//@}
+	//@}
 
 private:
-
-	CImageEditorDrawControl ();
+	/** Default constructor */
+	CImageEditorDrawControl(RPointerArray<CDrawPath>& aPaths,TRgb& aRgb, TSize& aSize,TBool &aDisplayTool);
 
 	/**	Draw
-	*
-	*	@see CImageEditorControlBase
-	*
-    */
-	virtual void Draw (const TRect & aRect) const;
+	 *
+	 *	@see CImageEditorControlBase
+	 *
+	 */
+	virtual void Draw(const TRect & aRect) const;
 
-private: // Implementation	
-    void NaviDown();
-    void NaviUp();
-    void NaviRight();
-    void NaviLeft();
-    void SelectSizeL();
-    void StoreTempParams();
-    void RestoreTempParams();
-    void RenderTextImageL();
-    void LoadIndicatorL ( TInt aBitmapInd, TInt aMaskInd ); 
-    TPoint ComputeIndicatorPosition() const;
+protected:
+	/**CountComponentControls
+	 * 
+	 * @see CImageEditorControlBase
+	 */
+	TInt CountComponentControls() const;
+	
+	/**ComponentControl
+	 * 
+	 * 
+	 * @see CImageEditorControlBase
+	 */
+	CCoeControl* ComponentControl(TInt aIndex) const;
+
+private:
+	// Implementation	
+	void NaviDown();
+	void NaviUp();
+	void NaviRight();
+	void NaviLeft();
+	void SelectSizeL();
+	void StoreTempParams();
+	void RestoreTempParams();
+	void RenderTextImageL();
+	void LoadIndicatorL(TInt aBitmapInd, TInt aMaskInd);
+	TPoint ComputeIndicatorPosition() const;
 	void StoreParameters(TBool aLastItem, TBool aDone);
 	void StorePosAndScaleRelScreen();
 	void RestorePosAndScaleRelScreen();
 	void StorePosAndScaleRelImage();
 	void RestorePosAndScaleRelImage();
 	void ClipPosition();
-    void SetPositionOnImage( TPoint aPointedPosition );
-    TPoint GetPositionOnView();
-    void ShowTooltip();
-    TSize ScaledLineSize( TSize aOriginalSize ) const;
+	void SetPositionOnImage(TPoint aPointedPosition);
+	TPoint GetPositionOnView();
+	void ShowTooltip();
+	TSize ScaledLineSize(TSize aOriginalSize) const;
+	
+public:
+	/**Notify
+	 * 
+	 * handle the event by Active object 
+	 */
+	virtual void Notify();
+	
+	/**HandlePointerNotify
+	 * 
+	 * handle the press icon event 
+	 * @param aComponent - the icon control of tool bar
+	 */
+	virtual void HandlePointerNotify(CCoeControl* aComponent);
+	
+	/**Roll
+	 * 
+	 * the fuction for AO to move the tool bar
+	 */
+	virtual void Roll();
 
-//@}
-
-/** @name Members:*/
-//@{
-
-    /// Ref: to Editor view
-    CAknView* iEditorView;
+private:
+	/**InitializeMainMenu
+	 * 
+	 * initialize the tool bar 
+	 * @param aMainMenuLayout - horizon or veritical layout of the tool bar 
+	 */
+	void InitializeMainMenu(TMainMenuLayout aMainMenuLayout);
+	
+	/**CalculateEffectiveOffset
+	 * 
+	 * calculate vaild offset for tool bar
+	 */
+	void CalculateEffectiveOffset();
 
-    /// Source image size
-    const CSystemParameters* iSysPars;
-
-    /// Ref: to Plug-in info
-    CPluginInfo* iItem;
-
-    /// Own: Navigation pane text
-    HBufC* iNaviPaneText;
+	/**HandleMainMenuButtonUp
+	 * 
+	 * handle the up event on tool bar 
+	 * @param aPoint - the position on screen 
+	 */
+	void HandleMainMenuButtonUp(TPoint aPoint);
+	
+	/**HandleMainMenuButtonDrag
+	 * 
+	 * handle the drag event on tool bar
+	 * @param aPoint - the position on screen 
+	 */
+	void HandleMainMenuButtonDrag(TPoint aPoint);
+	
+private:
+	/**UndoDrawPath
+	 * 
+	 * undo the drawed lines on screen 
+	 */
+	void UndoDrawPath();
+	
+	/**RedoDrawPath
+	 * 
+	 * redo the undo lines on screen 
+	 */
+	void RedoDrawPath();
+	
+private:
+	
+	//@}
 
-    /// X position
-    TInt iX;
-    /// Y position
-    TInt iY;
-    /// Color
-    TRgb iRgb;
+	/** @name Members:*/
+	//@{
+
+	/// Ref: to Editor view
+	CAknView* iEditorView;
+
+	/// Source image size
+	const CSystemParameters* iSysPars;
 
-    /// Timer for fast key events
+	/// Ref: to Plug-in info
+	CPluginInfo* iItem;
+
+	/// Own: Navigation pane text
+	HBufC* iNaviPaneText;
+
+	/// X position
+	TInt iX;
+	/// Y position
+	TInt iY;
+
+	/// Timer for fast key events
 	CJPTimer* iTimer;
 	TUint32 iKeyCode;
 
 	/// Pressed key event code
 	TInt iPressedKeyScanCode;
 
-    /// Number of ticks since timer start
-    TInt iTickCount;
+	/// Number of ticks since timer start
+	TInt iTickCount;
 
-    /// Multiplier to control the navigation movement speed
-    TInt iNaviStepMultiplier;
+	/// Multiplier to control the navigation movement speed
+	TInt iNaviStepMultiplier;
 
-    /// Showing Ok options menu, where some items are dimmed
-    TBool iDisplayingOkOptionsMenu;
+	/// Showing Ok options menu, where some items are dimmed
+	TBool iDisplayingOkOptionsMenu;
 
-    /// Own: State indicator glyph
-    CFbsBitmap* iIndicator;
-    CFbsBitmap* iIndicatorMask;
+	/// Own: State indicator glyph
+	CFbsBitmap* iIndicator;
+	CFbsBitmap* iIndicatorMask;
 
-    /// Ready to render
-    TBool iReadyToRender;
-    
-    /// Parameter
-    TBuf<256> iParam;
+	/// Ready to render
+	TBool iReadyToRender;
+
+	/// Parameter
+	TBuf<256> iParam;
 
 	// Popup controller
 	CAknInfoPopupNoteController* iPopupController;
 	// Tooltip texts
 	HBufC* iTooltipResize;
-	
+
 	// Previous pen position. Make touch rotating and resizing possible
 	TPoint iPointerPosition;
 	// Multiplier to control the rotating speed by touch
 	TInt iTouchAngleMultiplier;
-    
-    /// Resource reader
+
+	/// Resource reader
 	RConeResourceLoader iResLoader;
 	/// Line size
-	TSize iSize;
+	TSize& iSize;
+	/// Color
+	TRgb& iRgb;
 	/// Own: drawn paths
-	RPointerArray<CDrawPath> iPaths;
-       
-//@}
+	RPointerArray<CDrawPath> &iPaths;
+	//bitmap device
+	CFbsBitmapDevice* iBitmapDev;
+	CGraphicsContext* iGc;
+	//@}
+
+private:
+	
+    void SetToolBarStatus();
+	RPointerArray<CImageLabel> iLabels;
+
+	TRect iLoopMenuRect;
+	TPoint iButtonDownPoint;
+	TPoint iDragStartPoint;
+	TPoint iDragPrePoint;
+	TPoint iDragUpPoint;
+
+	TInt iTotalComponent;
+	TInt iDragOffset;
+	TInt iStartSpeed;
+
+	CAnimationAO* iAnimationAO;
+	CRollAO* iRollAo;
 
-};
+	TBool iPointStartInLoopRect;
+	TBool iDragIsStart;
+	TBool iEnableAnimationEffect;
+	TMainMenuLayout iMainMenuLayout;
+	///implement undo and redo functions.
 
+private:
+	
+	RPointerArray<CDrawPath> iUndoPaths;
+	TBool iUndo;
+	TBool iRedo;
+	TBool iCanRedo;
+	//ETrue: roll in
+	//EFalse:roll out
+	TBool iRollDirection;
+private:
+	
+	CCustomerComponet *iCustomComponet;
+	TBool iCustomComponetClick;
+	TBool iLastPointEventType;
+	TBool iRollflag;
+	TBool &iDisplayTool;
+	TBool iSizeChangeFlag;
+	};
 
 #endif
--- a/imageeditor/plugins/DrawPlugin/inc/imageeditordrawplugin.h	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/plugins/DrawPlugin/inc/imageeditordrawplugin.h	Thu Jun 03 18:57:10 2010 +0800
@@ -28,7 +28,7 @@
 class CEditorImage;
 class CCoeControl;
 class CSystemParameters;
-
+class CDrawPath;
 
 /*	CLASS:	CImageEditorDrawPlugin
 *
@@ -90,7 +90,12 @@
 	*	@see CImageEditorPluginBase
     */
 	virtual void ReleasePlugin ();    
-
+	
+	/**CalculatePositionOnView
+	 * 
+	 *  calculate the point on view when changing the screen mode 
+	 */
+	void CalculatePositionOnView();
 //@}
 
 private: // Data
@@ -98,12 +103,24 @@
 //@{
     /// Plug-in UI control
     CCoeControl* iControl;
-    /// System parameters
+    TBool iDiplayToolPluginParam;
+  /// System parameters
     const CSystemParameters* iSysPars;
     /// Is landscape enabled, Must be EFalse until text is set
     TBool iLandscapeEnabled;
 //@}
 
+private: // Data 
+	//for drawcontrol
+	//drawed lines in drawcontrol
+	RPointerArray<CDrawPath> iPaths;
+	//selected pencolor 
+	TRgb       iRgb;
+	//selected pensize
+	TSize      iSize;
+	//first image rect on preview
+	TRect      iVisibleImageRectPrevFirst;
+  
 };
 
 #endif // IMAGEEDITORDRAWPLUGIN_H
--- a/imageeditor/plugins/DrawPlugin/inc/selectionpopup.h	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/plugins/DrawPlugin/inc/selectionpopup.h	Thu Jun 03 18:57:10 2010 +0800
@@ -1,22 +1,21 @@
 /*
-* Copyright (c) 2010 Ixonos Plc.
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - Initial contribution
-*
-* Contributors:
-* Ixonos Plc
-*
-* Description: 
-* Selection popup dialog header file.
-*
-*/
-
+ * Copyright (c) 2010 Ixonos Plc.
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - Initial contribution
+ *
+ * Contributors:
+ * Ixonos Plc
+ *
+ * Description: 
+ * Selection popup dialog header file.
+ *
+ */
 
 #ifndef _SELECTIONPOPUP_H
 #define _SELECTIONPOPUP_H
@@ -30,263 +29,263 @@
 
 class CFbsBitmap;
 //class TAknLayoutText;
-   
-NONSHARABLE_CLASS( CSelectionPopup ):public CPreviewControlBase
-{
+
+NONSHARABLE_CLASS( CSelectionPopup ) : public CPreviewControlBase
+	{
 
 public:
 
-    /** Default constructor, cannot leave.
-	*
-	*   @since S60 5.0
-	*   @param -
-	*	@return -
-	*/
-	CSelectionPopup();
+	/** Default constructor, cannot leave.
+	 *
+	 *   @since S60 5.0
+	 *   @param -
+	 *	@return -
+	 */
+	CSelectionPopup(TRgb& aCurrentColor, const TRect& aImageRect);
 
-    /** Destructor
-	*
-	*   @since S60 5.0
-	*	@param -
-	*	@return -
-	*/
-	~CSelectionPopup ();
+	/** Destructor
+	 *
+	 *   @since S60 5.0
+	 *	@param -
+	 *	@return -
+	 */
+	~CSelectionPopup();
 
-    /** Second phase constructor
-	*
-	*   @since S60 5.0
-	*	@param aParent - Parent control
-	*	@return -
-	*/
-	void ConstructL ( CCoeControl* aParent );
-	
+	/** Second phase constructor
+	 *
+	 *   @since S60 5.0
+	 *	@param aParent - Parent control
+	 *	@return -
+	 */
+	void ConstructL(CCoeControl* aParent);
+
 	/**	OfferKeyEventL	
-	*
-	*	@see CCoeControl
-	*/
-    TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
-                                               TEventCode aType );
-                                               
-    /**	HandlePointerEventL	
-	*
-	*	@see CCoeControl
-	*/
-    void HandlePointerEventL( const TPointerEvent &aPointerEvent );
+	 *
+	 *	@see CCoeControl
+	 */
+	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+
+	/**	HandlePointerEventL	
+	 *
+	 *	@see CCoeControl
+	 */
+	void HandlePointerEventL(const TPointerEvent &aPointerEvent);
+
+public:
+	//new methods
 
-public: //new methods
-      
-    /** GridRect
-    *
-    * Returns popup component's rectangle area
-    *
-    * @since S60 5.0
-    * @param -
-    * @return TRect The area of the popup
-    */
-    TRect GridRect() const;
-    
-    /** HighlightedItemPressed
-    *
-    *   This function can be used to check whether user has pressed (by stylus)
-    *   currently highlighted color item. 
-    *
-    *   @since S60 5.0
-    *   @param aPosition position value to be checked.
-    *   @return ETrue if aPosition is in the rect area of currently highlighted
-    *          plugin item, EFalse otherwise.
-    */
-    TBool HighlightedItemPressed( TPoint aPosition ) const;
-    
-    /** SetSelectedValue
-    *
-    * Set currently highlighted item
-    *
-    * @param aSelected selected item index.    
-    * @since S60 5.0
-    */
-    void SetSelectedValue( TInt aSelected );
-    
-    /** GetSelectedValue
-    *
-    * Returns current highlighted item value
-    *
-    * @since S60 5.0
-    * @return TInt Currently selected value
-    */
-    TInt GetSelectedValue() const;
-    
-private:                                                   
-    
-    /** CreateColorBitmapsL
-    *
-    * Creates a bitmap array
-    *
-    * @since S60 5.0
-    * @param aSize Size that color bitmaps should be created to
-    * @return -
-    */
-    void CreateColorBitmapsL( TSize aSize ); 
-    
+	/** GridRect
+	 *
+	 * Returns popup component's rectangle area
+	 *
+	 * @since S60 5.0
+	 * @param -
+	 * @return TRect The area of the popup
+	 */
+	TRect GridRect() const;
+
+	/** HighlightedItemPressed
+	 *
+	 *   This function can be used to check whether user has pressed (by stylus)
+	 *   currently highlighted color item. 
+	 *
+	 *   @since S60 5.0
+	 *   @param aPosition position value to be checked.
+	 *   @return ETrue if aPosition is in the rect area of currently highlighted
+	 *          plugin item, EFalse otherwise.
+	 */
+	TBool HighlightedItemPressed(TPoint aPosition) const;
+
+	/** SetSelectedValue
+	 *
+	 * Set currently highlighted item
+	 *
+	 * @param aSelected selected item index.    
+	 * @since S60 5.0
+	 */
+	void SetSelectedValue(TInt aSelected);
+
+	/** GetSelectedValue
+	 *
+	 * Returns current highlighted item value
+	 *
+	 * @since S60 5.0
+	 * @return TInt Currently selected value
+	 */
+	TInt GetSelectedValue() const;
+
+private:
+
+	/** CreateColorBitmapsL
+	 *
+	 * Creates a bitmap array
+	 *
+	 * @since S60 5.0
+	 * @param aSize Size that color bitmaps should be created to
+	 * @return -
+	 */
+	void CreateColorBitmapsL(TSize aSize);
+
 protected:
 
-   	/**	SizeChanged	
-	*
-	*	@see CCoeControl
-	*/
-    virtual void SizeChanged();
+	/**	SizeChanged	
+	 *
+	 *	@see CCoeControl
+	 */
+	virtual void SizeChanged();
 
 	/**	Draw	
-	*
-	*	@see CCoeControl
-	*/
-    virtual void Draw( const TRect& aRect ) const;
-    
+	 *
+	 *	@see CCoeControl
+	 */
+	virtual void Draw(const TRect& aRect) const;
 
 private:
-        
-    // Popup graphic bitmaps
-    CFbsBitmap*     iPopupCenter;
-    CFbsBitmap*     iPopupCenterMask;
-    CFbsBitmap*     iPopupCornerTL;
-    CFbsBitmap*     iPopupCornerTLMask;
-    CFbsBitmap*     iPopupCornerTR;
-    CFbsBitmap*     iPopupCornerTRMask;
-    CFbsBitmap*     iPopupCornerBL;
-    CFbsBitmap*     iPopupCornerBLMask;
-    CFbsBitmap*     iPopupCornerBR;
-    CFbsBitmap*     iPopupCornerBRMask;
-    CFbsBitmap*     iPopupSideL;
-    CFbsBitmap*     iPopupSideLMask;
-    CFbsBitmap*     iPopupSideR;
-    CFbsBitmap*     iPopupSideRMask;
-    CFbsBitmap*     iPopupSideT;
-    CFbsBitmap*     iPopupSideTMask;
-    CFbsBitmap*     iPopupSideB;
-    CFbsBitmap*     iPopupSideBMask;
-         
-    // Popup rects
-    TRect           iPopupCenterRect;
-    TRect           iPopupCornerTLRect;
-    TRect           iPopupCornerTRRect;
-    TRect           iPopupCornerBLRect;
-    TRect           iPopupCornerBRRect;
-    TRect           iPopupSideLRect;
-    TRect           iPopupSideRRect;
-    TRect           iPopupSideTRect;
-    TRect           iPopupSideBRect;    
-    TRect           iHeadingRect;    
-    
-    // Format and layout information of the heading text
-    TAknLayoutText  iLayoutTextHeading;
-    
-    // Contains rectangles of all grid highlight items
-    RArray< TRect > iHighlightRectsArray;
-    
-    // Contains rectangles of all grid color items
-    RArray< TRect > iGridRectsArray;
-    
-    // Color bitmaps
-    RPointerArray < CFbsBitmap > iColorBitmapsArray;
-    
-    // Used values
-    RArray< TInt > iItemArray;
-    
-    TInt iCurrentItem;
+
+	// Popup graphic bitmaps
+	CFbsBitmap* iPopupCenter;
+	CFbsBitmap* iPopupCenterMask;
+	CFbsBitmap* iPopupCornerTL;
+	CFbsBitmap* iPopupCornerTLMask;
+	CFbsBitmap* iPopupCornerTR;
+	CFbsBitmap* iPopupCornerTRMask;
+	CFbsBitmap* iPopupCornerBL;
+	CFbsBitmap* iPopupCornerBLMask;
+	CFbsBitmap* iPopupCornerBR;
+	CFbsBitmap* iPopupCornerBRMask;
+	CFbsBitmap* iPopupSideL;
+	CFbsBitmap* iPopupSideLMask;
+	CFbsBitmap* iPopupSideR;
+	CFbsBitmap* iPopupSideRMask;
+	CFbsBitmap* iPopupSideT;
+	CFbsBitmap* iPopupSideTMask;
+	CFbsBitmap* iPopupSideB;
+	CFbsBitmap* iPopupSideBMask;
 
-        
-};
+	// Popup rects
+	TRect iPopupCenterRect;
+	TRect iPopupCornerTLRect;
+	TRect iPopupCornerTRRect;
+	TRect iPopupCornerBLRect;
+	TRect iPopupCornerBRRect;
+	TRect iPopupSideLRect;
+	TRect iPopupSideRRect;
+	TRect iPopupSideTRect;
+	TRect iPopupSideBRect;
+	TRect iHeadingRect;
+
+	// Format and layout information of the heading text
+	TAknLayoutText iLayoutTextHeading;
+
+	// Contains rectangles of all grid highlight items
+	RArray<TRect> iHighlightRectsArray;
 
+	// Contains rectangles of all grid color items
+	RArray<TRect> iGridRectsArray;
 
-NONSHARABLE_CLASS( CSelectionDialog ): public CAknDialog
-    {
+	// Color bitmaps
+	RPointerArray<CFbsBitmap> iColorBitmapsArray;
+
+	// Used values
+	RArray<TInt> iItemArray;
+
+	TInt iCurrentItem;
+
+	TRgb iCurrentColor;
+
+	TRect iImageRect;
+	};
+
+NONSHARABLE_CLASS( CSelectionDialog ) : public CAknDialog
+	{
 public:
-    
-    /** RunDlgLD
-	*
-	*	@param aBitmap - background bitmap
-	*	@param aRect - Rect for the dialog
-    *	@param aSelection - Selected value to be returned
-	*	@return - ExecuteLD() return value
-	*/
-	static TInt RunDlgLD( const CFbsBitmap* aBitmap, 
-	                      const TRect& aRect, 
-	                      TInt& aSelection );
 
+	/** RunDlgLD
+	 *
+	 *	@param aBitmap - background bitmap
+	 *	@param aRect - Rect for the dialog
+	 *	@param aSelection - Selected value to be returned
+	 *	@return - ExecuteLD() return value
+	 */
+	static TInt RunDlgLD(const CFbsBitmap* aBitmap, const TRect& aRect,
+			TInt& aSelection, TRgb& aCurrentColor, const TRect& aImageRect);
 
-    virtual ~CSelectionDialog();
+	virtual ~CSelectionDialog();
 
-    /** OkToExitL
-    * 
-    *   From CAknDialog update member variables .
-    *   @param aButtonId The ID of the button that was activated.
-    *   @return Should return ETrue if the dialog should exit,
-    *           and EFalse if it should not
-    */
-    TBool OkToExitL( TInt aButtonId );
+	/** OkToExitL
+	 * 
+	 *   From CAknDialog update member variables .
+	 *   @param aButtonId The ID of the button that was activated.
+	 *   @return Should return ETrue if the dialog should exit,
+	 *           and EFalse if it should not
+	 */
+	TBool OkToExitL(TInt aButtonId);
 
-    /** Draw
-    * 
-    * 
-    * @see CAknDialog
-    *
-    */
-    void Draw(const TRect& aRect) const;
+	/** Draw
+	 * 
+	 * 
+	 * @see CAknDialog
+	 *
+	 */
+	void Draw(const TRect& aRect) const;
 
-    /** SizeChanged
-    * 
-    * 
-    * @see CCoeControl
-    *
-    */
-    virtual void SizeChanged();
+	/** SizeChanged
+	 * 
+	 * 
+	 * @see CCoeControl
+	 *
+	 */
+	virtual void SizeChanged();
+
+	/** OfferKeyEventL
+	 *  
+	 * @see CCoeControl
+	 *
+	 */
+	virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
+			TEventCode aType);
 
-    /** OfferKeyEventL
-    *  
-    * @see CCoeControl
-    *
-    */
-    virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
-    
-    /**	HandlePointerEventL	
-	*
-	*	@see CCoeControl
-	*/
-    virtual void HandlePointerEventL( const TPointerEvent &aPointerEvent );
-    
-    /** PreLayoutDynInitL
-    *  
-    * @see CEikDialog
-    *
-    */
-    virtual void PreLayoutDynInitL();
+	/**	HandlePointerEventL	
+	 *
+	 *	@see CCoeControl
+	 */
+	virtual void HandlePointerEventL(const TPointerEvent &aPointerEvent);
+
+	/** PreLayoutDynInitL
+	 *  
+	 * @see CEikDialog
+	 *
+	 */
+	virtual void PreLayoutDynInitL();
 
-    /** CountComponentControls
-    *  
-    * @see CCoeControl
-    *
-    */
-    TInt CountComponentControls() const;
+	/** CountComponentControls
+	 *  
+	 * @see CCoeControl
+	 *
+	 */
+	TInt CountComponentControls() const;
 
-    /** ComponentControl
-    *  
-    * @see CCoeControl
-    *
-    */
-    virtual CCoeControl* ComponentControl(TInt aIndex) const;
-    
-private: // implementation
-
-    CSelectionDialog( TInt& aSelectino );
-    void ConstructL( const CFbsBitmap* aBitmap, const TRect& aRect);
+	/** ComponentControl
+	 *  
+	 * @see CCoeControl
+	 *
+	 */
+	virtual CCoeControl* ComponentControl(TInt aIndex) const;
 
 private:
-    
-    // Own: popup component
-    CSelectionPopup* iPopup;
-    
-    // Ref: Selected color   
-    TInt& iCurrentValue;
-    
-    };
+	// implementation
+
+	CSelectionDialog(TInt& aSelectino);
+	void ConstructL(const CFbsBitmap* aBitmap, const TRect& aRect,
+			TRgb& aCurrentColor, const TRect& aImageRect);
+
+private:
+
+	// Own: popup component
+	CSelectionPopup* iPopup;
+
+	// Ref: Selected color   
+	TInt& iCurrentValue;
+	};
 
 #endif // _SELECTIONPOPUP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/src/AnimationAO.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,102 @@
+/*
+ ============================================================================
+ Name		: AnimationAO.cpp
+ Author	  : 
+ Version	 : 1.0
+ Copyright   : Your copyright notice
+ Description : CAnimationAO implementation
+ ============================================================================
+ */
+
+#include "AnimationAO.h"
+// ---------------------------------------------------------------------------
+// CAnimationAO()
+// ---------------------------------------------------------------------------
+//
+CAnimationAO::CAnimationAO() :
+	CActive(EPriorityStandard) // Standard priority
+	{
+	}
+// ---------------------------------------------------------------------------
+// NewLC()
+// ---------------------------------------------------------------------------
+//
+CAnimationAO* CAnimationAO::NewLC()
+	{
+	CAnimationAO* self = new (ELeave) CAnimationAO();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+// ---------------------------------------------------------------------------
+// NewL()
+// ---------------------------------------------------------------------------
+//
+CAnimationAO* CAnimationAO::NewL()
+	{
+	CAnimationAO* self = CAnimationAO::NewLC();
+	CleanupStack::Pop(); // self;
+	return self;
+	}
+// ---------------------------------------------------------------------------
+// ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CAnimationAO::ConstructL()
+	{
+	User::LeaveIfError(iTimer.CreateLocal()); // Initialize timer
+	CActiveScheduler::Add(this); // Add to scheduler
+	}
+// ---------------------------------------------------------------------------
+// CAnimationAO()
+// ---------------------------------------------------------------------------
+//
+CAnimationAO::~CAnimationAO()
+	{
+	Cancel(); // Cancel any request, if outstanding
+	iTimer.Close(); // Destroy the RTimer object
+	}
+// ---------------------------------------------------------------------------
+// DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CAnimationAO::DoCancel()
+	{
+	iTimer.Cancel();
+	}
+// ---------------------------------------------------------------------------
+// StartL()
+// ---------------------------------------------------------------------------
+//
+void CAnimationAO::StartL(TTimeIntervalMicroSeconds32 aDelay)
+	{
+	Cancel(); // Cancel any request, just to be sure
+	iTimer.After(iStatus, aDelay); // Set for later
+	SetActive(); // Tell scheduler a request is active
+	}
+// ---------------------------------------------------------------------------
+// RunL()
+// ---------------------------------------------------------------------------
+//
+void CAnimationAO::RunL()
+	{
+	iTimer.After(iStatus, 33333); // Set for 1 sec later
+	SetActive(); 
+	iObserver->Notify();
+	}
+// ---------------------------------------------------------------------------
+// RunError()
+// ---------------------------------------------------------------------------
+//
+TInt CAnimationAO::RunError(TInt aError)
+	{
+	return aError;
+	}
+// ---------------------------------------------------------------------------
+// SetObserver()
+// ---------------------------------------------------------------------------
+//
+void CAnimationAO::SetObserver(MAnimationObserver *aObserver)
+	{
+	iObserver = aObserver;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/src/CImageLabel.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,395 @@
+/*
+ ============================================================================
+ Name		: CImageLabel.cpp
+ Author	  : 
+ Version	 : 1.0
+ Copyright   : Your copyright notice
+ Description : CCImageLabel implementation
+ ============================================================================
+ */
+#include "TimeAO.h"
+#include "CImageLabel.h"
+#include <W32STD.H>
+#include <akniconutils.h> 
+#include <EIKENV.H> //For iEikonEnv
+#include <GDI.H>
+// ---------------------------------------------------------------------------
+// CImageLabel()
+// ---------------------------------------------------------------------------
+//
+CImageLabel::CImageLabel()
+	{
+	// No implementation required
+	}
+// ---------------------------------------------------------------------------
+// ~CImageLabel()
+// ---------------------------------------------------------------------------
+//
+CImageLabel::~CImageLabel()
+	{
+	if (iBitmap != NULL)
+		{
+		delete iBitmap;
+		iBitmap = NULL;
+		}
+	if (iBitmapMask != NULL)
+		{
+		delete iBitmapMask;
+		iBitmap = NULL;
+		}
+	if (iTimeAO != NULL)
+		{
+		delete iTimeAO;
+		iTimeAO = NULL;
+		}
+	}
+// ---------------------------------------------------------------------------
+// NewLC()
+// ---------------------------------------------------------------------------
+//
+CImageLabel* CImageLabel::NewLC(CCoeControl *aParent, const TRect& aRect,
+		TOOLTIP_LAYOUT aLabelLayout)
+	{
+	CImageLabel* self = new (ELeave) CImageLabel();
+	CleanupStack::PushL(self);
+	self->ConstructL(aParent, aRect, aLabelLayout);
+	return self;
+	}
+// ---------------------------------------------------------------------------
+// NewL()
+// ---------------------------------------------------------------------------
+//
+CImageLabel* CImageLabel::NewL(CCoeControl *aParent, const TRect& aRect,
+		TOOLTIP_LAYOUT aLabelLayout)
+	{
+	CImageLabel* self = CImageLabel::NewLC(aParent, aRect, aLabelLayout);
+	CleanupStack::Pop(); // self;
+	return self;
+	}
+// ---------------------------------------------------------------------------
+// ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::ConstructL(CCoeControl *aParent, const TRect& aRect,
+		TOOLTIP_LAYOUT aLabelLayout)
+	{
+	SetContainerWindowL(*aParent);
+	SetRect(aRect);
+
+	iState = ENone;
+	iLabelLayout = aLabelLayout;
+	iBitmap = NULL;
+	iBitmapMask = NULL;
+
+	iTooltipStartPoint = TPoint(0, 0);
+	CalculateImagePoint();
+	CalculateBoundingRectStartPoint();
+	CalculateZones();
+
+	iTimeAO = CTimeAO::NewL();
+	iTimeAO->SetObserver(this);
+	
+	iIsHandlePointerNotifyProcessing = EFalse;
+	}
+// ---------------------------------------------------------------------------
+// HandlePointerEventL()
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::HandlePointerEventL(const TPointerEvent& aPointerEvent)
+	{
+	switch (aPointerEvent.iType)
+		{
+		case TPointerEvent::EButton1Down:
+			{
+			if(iIsHandlePointerNotifyProcessing)
+				{
+				//Ignore button down event when HandlePointerNotify is processing.
+				break;
+				}
+			iState = ESelected;
+			DrawNow();
+			iTimeAO->StartL();
+			
+			break;
+			}
+		case TPointerEvent::EButton1Up:
+			{
+			iTimeAO->Cancel();
+			//If the statte is moveing or selected.change the state to ENone 
+			
+			if (iState == EMoving || iState == ESelectedWithTooltip)
+				{
+				iState = ENone;
+				DrawNow();
+				}
+			else
+				{
+				iState = ENone;
+				DrawNow();
+				//If not on process start it
+				if(!iIsHandlePointerNotifyProcessing)
+					{
+					iIsHandlePointerNotifyProcessing = ETrue;
+					//To avoid pop up dialog two times by quick double chick
+					iHandlePointerObserver->HandlePointerNotify(this);
+					iIsHandlePointerNotifyProcessing = EFalse;
+					}
+				}
+			break;
+			}
+		default:
+			break;
+		}
+	}
+// ---------------------------------------------------------------------------
+// SizeChanged()
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::SizeChanged()
+	{
+	DrawNow();
+	}
+// ---------------------------------------------------------------------------
+// Draw()
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::Draw(const TRect& aRect) const
+	{
+	// Get the standard graphics context
+	CWindowGc& gc = SystemGc();
+
+	TRgb Rgb(KRgbGray);
+	Rgb.SetAlpha(180);
+	gc.SetBrushColor(Rgb);
+	gc.SetBrushStyle(CWindowGc::ESolidBrush);
+	gc.SetPenStyle(CGraphicsContext::ESolidPen);
+	gc.SetPenColor(KRgbDarkGray);
+	gc.SetPenSize(TSize(2,2));
+
+	switch (iState)
+		{
+		case ENone:
+			{
+		//do nothing	
+			}
+			break;
+		case EMoving:
+			{
+			//Draw the bounding rect
+			TSize cornorSize(8, 8);
+			gc.DrawRoundRect(TRect(iBoundingRectStartPoint, iBoundingSize),
+					cornorSize);
+			break;
+			}
+		case ESelected:
+			{
+			//Draw the bouding rect
+			TSize cornorSize(8, 8);
+			gc.DrawRoundRect(TRect(iBoundingRectStartPoint, iBoundingSize),
+					cornorSize);
+			break;
+			}
+		case ESelectedWithTooltip:
+			{
+			//Draw the bounding rect
+			TSize cornorSize(8, 8);
+			gc.DrawRoundRect(TRect(iBoundingRectStartPoint, iBoundingSize),
+					cornorSize);
+
+			CFont* pFont = NULL;
+			TFontSpec fontSpec = iEikonEnv->TitleFont()->FontSpecInTwips();
+			fontSpec.iHeight *= 0.535;
+			iCoeEnv->ScreenDevice()->GetNearestFontInTwips(pFont, fontSpec);
+
+			//Draw the tooltips
+			gc.UseFont(pFont);
+			gc.SetPenStyle(CGraphicsContext::ESolidPen);
+			gc.SetPenColor(KRgbGreen);
+			gc.DrawText(iTooltip, iTooltipStartPoint);
+			iCoeEnv->ScreenDevice()->ReleaseFont(pFont);
+			gc.DiscardFont();
+			break;
+			}
+		default:
+			break;
+		}
+
+	//Draw svg picture
+	if (iBitmap != NULL)
+		{
+		gc.BitBltMasked(iImageStartPoint, iBitmap, TRect(TPoint(0, 0), TSize(
+				iBoundingSize)), iBitmapMask, ETrue);
+		}
+
+	}
+// ---------------------------------------------------------------------------
+// Notify()
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::Notify()
+	{
+	//if the state is not moving set selected with tooltips
+	if (iState != EMoving)
+		iState = ESelectedWithTooltip;
+	DrawNow();
+	}
+// ---------------------------------------------------------------------------
+// SetImage()
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::SetImage(const TDesC& aMbmPackage, TInt aIndex)
+	{
+	//Load pictures
+	AknIconUtils::CreateIconL(iBitmap, iBitmapMask, aMbmPackage, aIndex, aIndex
+			+ 1);
+	AknIconUtils::SetSize(iBitmap, iImageSize);
+	AknIconUtils::SetSize(iBitmapMask, iImageSize);
+
+	ActivateL();
+	}
+// ---------------------------------------------------------------------------
+// SetTooltip()
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::SetTooltip(const TDesC& aTooltip)
+	{
+	iTooltip.Copy(aTooltip);
+	CalculateTooltipPoint();
+	}
+// ---------------------------------------------------------------------------
+// ResetControl()
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::ResetControl()
+	{
+	CalculateImagePoint();
+	CalculateBoundingRectStartPoint();
+	CalculateTooltipPoint();
+	CalculateZones();
+	}
+// ---------------------------------------------------------------------------
+// CalculateImagePoint()
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::CalculateImagePoint()
+	{
+	// landscape 
+	if (iLabelLayout == ELabelHorizontal)
+		{
+		iImageStartPoint.iX = Rect().iTl.iX + 2;
+		iImageStartPoint.iY = Rect().iBr.iY - (Rect().iBr.iX - Rect().iTl.iX)
+				+ 2;
+		}
+	//portrait
+	else if (iLabelLayout == ELabelVertical)
+		{
+		iImageStartPoint.iX = Rect().iBr.iX - (Rect().iBr.iY - Rect().iTl.iY)
+				+ 2;
+		iImageStartPoint.iY = Rect().iTl.iY + 2;
+		}
+	}
+// ---------------------------------------------------------------------------
+// CalculateBoundingRectStartPoint()
+// calcuate related start point
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::CalculateBoundingRectStartPoint()
+	{
+	// landscape 
+	if (iLabelLayout == ELabelHorizontal)
+		{
+		iBoundingRectStartPoint.iX = Rect().iTl.iX + 1;
+		iBoundingRectStartPoint.iY = Rect().iBr.iY - (Rect().iBr.iX
+				- Rect().iTl.iX) + 1;
+		}
+	//portrait
+	else if (iLabelLayout == ELabelVertical)
+		{
+		iBoundingRectStartPoint.iX = Rect().iBr.iX - (Rect().iBr.iY
+				- Rect().iTl.iY) + 1;
+		iBoundingRectStartPoint.iY = Rect().iTl.iY + 1;
+		}
+
+	}
+// ---------------------------------------------------------------------------
+// CalculateTooltipPoint()
+// Where show the tooltips.
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::CalculateTooltipPoint()
+	{
+	// landscape 
+	if (iLabelLayout == ELabelHorizontal)
+		{
+		CFont* pFont = NULL;
+		TFontSpec fontSpec = iEikonEnv->TitleFont()->FontSpecInTwips();
+		fontSpec.iHeight *= 0.535;
+		iCoeEnv->ScreenDevice()->GetNearestFontInTwips(pFont, fontSpec);
+		int tooltipLength = pFont->TextWidthInPixels(iTooltip);
+		iCoeEnv->ScreenDevice()->ReleaseFont(pFont);
+
+		iTooltipStartPoint.iX = Rect().iTl.iX
+				+ (Rect().Width() - tooltipLength) / 2;
+		iTooltipStartPoint.iY = Rect().iBr.iY - (Rect().iBr.iX - Rect().iTl.iX);
+		}
+	//portrait
+	else if (iLabelLayout == ELabelVertical)
+		{
+		CFont* pFont = NULL;
+		TFontSpec fontSpec = iEikonEnv->TitleFont()->FontSpecInTwips();
+		fontSpec.iHeight *= 0.535;
+		iCoeEnv->ScreenDevice()->GetNearestFontInTwips(pFont, fontSpec);
+		int tooltipLength = pFont->TextWidthInPixels(iTooltip);
+		int tooltipHeight = pFont->HeightInPixels();
+		iCoeEnv->ScreenDevice()->ReleaseFont(pFont);
+
+		iTooltipStartPoint.iX = Rect().iTl.iX + (iBoundingRectStartPoint.iX
+				- Rect().iTl.iX - tooltipLength) / 2;
+		iTooltipStartPoint.iY = Rect().iBr.iY - (Rect().Height()
+				- tooltipHeight) / 2;
+		}
+	}
+// ---------------------------------------------------------------------------
+// CalculateZones()
+// ---------------------------------------------------------------------------
+//
+
+void CImageLabel::CalculateZones()
+	{
+	// landscape 
+	if (iLabelLayout == ELabelHorizontal)
+		{
+		iBoundingSize.iHeight = Rect().iBr.iX - Rect().iTl.iX - 2;
+		iBoundingSize.iWidth = iBoundingSize.iHeight - 2;
+
+		iImageSize.iHeight = iBoundingSize.iHeight - 4;
+		iImageSize.iWidth = iBoundingSize.iWidth - 4;
+		}
+	//portrait
+	else if (iLabelLayout == ELabelVertical)
+		{
+		iBoundingSize.iHeight = Rect().iBr.iY - Rect().iTl.iY - 2;
+		iBoundingSize.iWidth = iBoundingSize.iHeight - 2;
+
+		iImageSize.iHeight = iBoundingSize.iHeight - 4;
+		iImageSize.iWidth = iBoundingSize.iWidth - 4;
+		}
+	}
+// ---------------------------------------------------------------------------
+// LabelIsMoving()
+// ---------------------------------------------------------------------------
+//
+
+void CImageLabel::LabelIsMoving()
+	{
+	iState = EMoving;
+	}
+// ---------------------------------------------------------------------------
+// SetHandlePointerObserver()
+// ---------------------------------------------------------------------------
+//
+void CImageLabel::SetHandlePointerObserver(
+		MHandlePointerObserver* aHandlePointerObserver)
+	{
+	iHandlePointerObserver = aHandlePointerObserver;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/src/CustomerComponet.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,271 @@
+/*
+ ============================================================================
+ Name		: CustomerComponet.cpp
+ Author	  : henry
+ Version	 : 1.0
+ Copyright   : Your copyright notice
+ Description : CCustomerComponet implementation
+ ============================================================================
+ */
+
+#include "CustomerComponet.h"
+#include "gdi.h"
+#include <eikdef.h>
+#include "imageditorfilterdraw.mbg"
+#include <eikenv.h>
+#include <akniconutils.h>
+#include <aknnotewrappers.h>
+
+// ---------------------------------------------------------------------------
+// Default constructer
+// ---------------------------------------------------------------------------
+//
+CCustomerComponet::CCustomerComponet()
+	{
+	// No implementation required
+	}
+
+CCustomerComponet::~CCustomerComponet()
+	{
+	if (iMenu)
+		{
+		delete iMenu;
+		iMenu = NULL;
+		}
+	if (iRight)
+		{
+		delete iRight;
+		iRight = NULL;
+		}
+	if (iLeft)
+		{
+		delete iLeft;
+		iLeft = NULL;
+		}
+	if (iTop)
+		{
+		delete iTop;
+		iTop = NULL;
+		}
+	if (iBottom)
+		{
+		delete iBottom;
+		iBottom = NULL;
+		}
+	if (iMenuMask)
+		{
+		delete iMenuMask;
+		iMenuMask = NULL;
+		}
+	if (iRightMask)
+		{
+		delete iRightMask;
+		iRightMask = NULL;
+		}
+	if (iLeftMask)
+		{
+		delete iLeftMask;
+		iLeftMask = NULL;
+		}
+	if (iTopMask)
+		{
+		delete iTopMask;
+		iTopMask = NULL;
+		}
+	if (iBottomMask)
+		{
+		delete iBottomMask;
+		iBottomMask = NULL;
+		}
+	}
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CCustomerComponet* CCustomerComponet::NewLC(TRect & aRect, CCoeControl* aParent)
+	{
+	CCustomerComponet* self = new (ELeave) CCustomerComponet();
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect, aParent);
+	return self;
+	}
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CCustomerComponet* CCustomerComponet::NewL(TRect & aRect, CCoeControl* aParent)
+	{
+	CCustomerComponet* self = CCustomerComponet::NewLC(aRect, aParent);
+	CleanupStack::Pop(); // self;
+	return self;
+	}
+// ---------------------------------------------------------------------------
+// ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CCustomerComponet::ConstructL(TRect & aRect, CCoeControl* aParent)
+	{
+	SetContainerWindowL(*aParent);
+	EnableDragEvents();
+	SetRect(aRect);
+	TRgb color = KRgbBlue;
+	//Set transparent effect
+	if (KErrNone == Window().SetTransparencyAlphaChannel())
+		{
+		color.SetAlpha(0);
+		}
+	Window().SetBackgroundColor(color);
+
+	iDrawDirection = EFalse;
+	
+	//Load pictures and mask
+	_LIT(iconFileName, "\\resource\\apps\\imageditorfilterdraw.mbm");
+	TFileName iconFile(iconFileName);
+	//Menu
+	AknIconUtils::CreateIconL(iMenu, iMenuMask, iconFileName,
+			EMbmImageditorfilterdraw15a, EMbmImageditorfilterdrawMenumask);
+	//Right
+	AknIconUtils::CreateIconL(iRight, iRightMask, iconFileName,
+			EMbmImageditorfilterdrawRight, EMbmImageditorfilterdrawRightmask);
+	//Left
+	AknIconUtils::CreateIconL(iLeft, iLeftMask, iconFileName,
+			EMbmImageditorfilterdrawLeft, EMbmImageditorfilterdrawLeftmask);
+	//Top
+	AknIconUtils::CreateIconL(iTop, iTopMask, iconFileName,
+			EMbmImageditorfilterdrawTop, EMbmImageditorfilterdrawTopmask);
+	//Bottom
+	AknIconUtils::CreateIconL(iBottom, iBottomMask, iconFileName,
+			EMbmImageditorfilterdrawBottom, EMbmImageditorfilterdrawBottommask);
+	
+	ActivateL();
+	}
+// ---------------------------------------------------------------------------
+// Draw
+// ---------------------------------------------------------------------------
+//
+void CCustomerComponet::Draw(const TRect& aRect) const
+	{
+	CWindowGc& gc = SystemGc();
+	gc.Clear(aRect);
+	//Create rect for showing pictures.
+	TRect menuRect, topRect, bottomRect, rightRect, leftRect;
+
+	menuRect = aRect;
+	//get the width of the rect
+	TInt wx = aRect.iBr.iX - aRect.iTl.iX;
+	// get the height of the screen
+	TInt hy = aRect.iBr.iY - aRect.iTl.iY;
+	//Set top rect.
+	topRect.SetRect(TPoint(wx / 3 + aRect.iTl.iX, aRect.iTl.iY), TPoint(
+			(wx / 3) * 2 + aRect.iTl.iX, hy / 3 + aRect.iTl.iY));
+	//Set bottom rect
+	bottomRect.SetRect(TPoint((wx/3)+aRect.iTl.iX,(hy/3)*2+aRect.iTl.iY),
+			TPoint((wx/3)*2+aRect.iTl.iX,aRect.iBr.iY));
+	//set right rect.
+	rightRect.SetRect(TPoint(aRect.iTl.iX,hy/3+aRect.iTl.iY), TPoint(wx/3+aRect.iTl.iX,(hy/3)*2+aRect.iTl.iY));
+
+	//set left  rect.
+	leftRect.SetRect(TPoint((wx/3)*2+aRect.iTl.iX,hy/3+aRect.iTl.iY),
+			TPoint(aRect.iBr.iX,(hy/3)*2+aRect.iTl.iY));
+	//Set set size for pictures
+	
+	AknIconUtils::SetSize(iMenu, aRect.Size(), EAspectRatioPreserved);
+	AknIconUtils::SetSize(iMenuMask, aRect.Size(), EAspectRatioPreserved);
+
+	AknIconUtils::SetSize(iTop, topRect.Size(), EAspectRatioPreserved);
+	AknIconUtils::SetSize(iTopMask, topRect.Size(), EAspectRatioPreserved);
+
+	AknIconUtils::SetSize(iBottom, bottomRect.Size(), EAspectRatioPreserved);
+	AknIconUtils::SetSize(iBottomMask, bottomRect.Size(), EAspectRatioPreserved);
+
+	AknIconUtils::SetSize(iRight, rightRect.Size(), EAspectRatioPreserved);
+	AknIconUtils::SetSize(iRightMask, rightRect.Size(), EAspectRatioPreserved);
+
+	AknIconUtils::SetSize(iLeft, leftRect.Size(), EAspectRatioPreserved);
+	AknIconUtils::SetSize(iLeftMask, leftRect.Size(), EAspectRatioPreserved);
+	
+	//Draw menu
+	gc.DrawBitmapMasked(menuRect, iMenu, TRect(TPoint(0, 0),
+			iMenu->SizeInPixels()), iMenuMask, ETrue);
+	//if the user press the menu bottom show direction rect.
+	if (iDrawDirection)
+		{
+		gc.DrawBitmapMasked(topRect, iTop, TRect(TPoint(0, 0),
+				iTop->SizeInPixels()), iTopMask, ETrue);
+
+		gc.DrawBitmapMasked(bottomRect, iBottom, TRect(TPoint(0, 0),
+				iBottom->SizeInPixels()), iBottomMask, ETrue);
+		gc.DrawBitmapMasked(leftRect, iRight, TRect(TPoint(0, 0),
+				iRight->SizeInPixels()), iRightMask, ETrue);
+		gc .DrawBitmapMasked(rightRect, iLeft, TRect(TPoint(0, 0),
+				iLeft->SizeInPixels()), iLeftMask, ETrue);
+		}
+	}
+// ---------------------------------------------------------------------------
+// SetRect
+// ---------------------------------------------------------------------------
+//
+void CCustomerComponet::SetRect(TRect& aRect)
+	{
+	DrawNow(aRect);
+	}
+// ---------------------------------------------------------------------------
+// SizeChanged()
+// ---------------------------------------------------------------------------
+//
+void CCustomerComponet::SizeChanged()
+	{
+//Nothing done here.
+	}
+// ---------------------------------------------------------------------------
+// HandlePointerEventL()
+// ---------------------------------------------------------------------------
+//
+void CCustomerComponet::HandlePointerEventL(const TPointerEvent& aPointerEvent)
+	{
+	switch (aPointerEvent.iType)
+		{
+		
+		case TPointerEvent::EButton1Down:
+			{
+			iDrawDirection = ETrue;
+			iButtonFlag = ETrue;
+			iPointerObserver->HandlePointerNotify(this);
+			DrawNow();
+			}
+			break;
+		case TPointerEvent::EButton1Up:
+			{
+			iDrawDirection = EFalse;
+			iButtonFlag = EFalse;
+			iPointerObserver->HandlePointerNotify(this);
+			DrawNow();
+			}
+			break;
+		case TPointerEvent::EDrag:
+			{
+			DrawNow();
+			}
+			break;
+		default:
+			break;
+		}
+	}
+// ---------------------------------------------------------------------------
+// SetHandlePointerObserver()
+// ---------------------------------------------------------------------------
+//
+void CCustomerComponet::SetHandlePointerObserver(
+		MHandlePointerObserver* aHandlePointerObserver)
+	{
+	iPointerObserver = aHandlePointerObserver;
+
+	}
+// ---------------------------------------------------------------------------
+// GetButtonType()
+// ---------------------------------------------------------------------------
+//
+TBool CCustomerComponet::GetButtonType()
+	{
+	return iButtonFlag;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/src/RollAO.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,103 @@
+/*
+ ============================================================================
+ Name		: AnimationAO.cpp
+ Author	  : 
+ Version	 : 1.0
+ Copyright   : Your copyright notice
+ Description : CAnimationAO implementation
+ ============================================================================
+ */
+
+#include "RollAO.h"
+// ---------------------------------------------------------------------------
+// CRollAO()
+// ---------------------------------------------------------------------------
+//
+CRollAO::CRollAO() :
+	CActive(EPriorityStandard) // Standard priority
+	{
+	}
+// ---------------------------------------------------------------------------
+// NewLC()
+// ---------------------------------------------------------------------------
+//
+CRollAO* CRollAO::NewLC()
+	{
+	CRollAO* self = new (ELeave) CRollAO();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+// ---------------------------------------------------------------------------
+// NewL()
+// ---------------------------------------------------------------------------
+//
+CRollAO* CRollAO::NewL()
+	{
+	CRollAO* self = CRollAO::NewLC();
+	CleanupStack::Pop(); // self;
+	return self;
+	}
+// ---------------------------------------------------------------------------
+// ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CRollAO::ConstructL()
+	{
+	User::LeaveIfError(iTimer.CreateLocal()); // Initialize timer
+	CActiveScheduler::Add(this); // Add to scheduler
+	}
+// ---------------------------------------------------------------------------
+// ~CRollAO()
+// ---------------------------------------------------------------------------
+//
+CRollAO::~CRollAO()
+	{
+	Cancel(); // Cancel any request, if outstanding
+	iTimer.Close(); // Destroy the RTimer object
+	// Delete instance variables if any
+	}
+// ---------------------------------------------------------------------------
+// DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CRollAO::DoCancel()
+	{
+	iTimer.Cancel();
+	}
+// ---------------------------------------------------------------------------
+// StartL()
+// ---------------------------------------------------------------------------
+//
+void CRollAO::StartL(TTimeIntervalMicroSeconds32 aDelay)
+	{
+	Cancel(); // Cancel any request, just to be sure
+	iTimer.After(iStatus, aDelay); // Set for later
+	SetActive(); // Tell scheduler a request is active
+	}
+// ---------------------------------------------------------------------------
+// RunL()
+// ---------------------------------------------------------------------------
+//
+void CRollAO::RunL()
+	{
+	iTimer.After(iStatus, 300); // Set for 1 sec later
+	SetActive(); 
+	iObserver->Roll();
+	}
+// ---------------------------------------------------------------------------
+// RunError()
+// ---------------------------------------------------------------------------
+//
+TInt CRollAO::RunError(TInt aError)
+	{
+	return aError;
+	}
+// ---------------------------------------------------------------------------
+// SetObserver()
+// ---------------------------------------------------------------------------
+//
+void CRollAO::SetObserver(MRollObserver *aObserver)
+	{
+	iObserver = aObserver;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imageeditor/plugins/DrawPlugin/src/TimeAO.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -0,0 +1,106 @@
+/*
+ ============================================================================
+ Name		: TimeAO.cpp
+ Author	  : 
+ Version	 : 1.0
+ Copyright   : Your copyright notice
+ Description : CTimeAO implementation
+ ============================================================================
+ */
+
+#include "TimeAO.h"
+#include "MCountTime.h"
+// ---------------------------------------------------------------------------
+// CTimeAO()
+// ---------------------------------------------------------------------------
+//
+CTimeAO::CTimeAO() :
+	CActive(EPriorityStandard) // Standard priority
+	{
+	}
+// ---------------------------------------------------------------------------
+// NewLC()
+// ---------------------------------------------------------------------------
+//
+CTimeAO* CTimeAO::NewLC()
+	{
+	CTimeAO* self = new (ELeave) CTimeAO();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+// ---------------------------------------------------------------------------
+// NewL()
+// ---------------------------------------------------------------------------
+//
+CTimeAO* CTimeAO::NewL()
+	{
+	CTimeAO* self = CTimeAO::NewLC();
+	CleanupStack::Pop(); // self;
+	return self;
+	}
+// ---------------------------------------------------------------------------
+// ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CTimeAO::ConstructL()
+	{
+	User::LeaveIfError(iTimer.CreateLocal());
+	CActiveScheduler::Add(this); // Add to scheduler
+	}
+// ---------------------------------------------------------------------------
+// ~CTimeAO()
+// ---------------------------------------------------------------------------
+//
+CTimeAO::~CTimeAO()
+	{
+	Cancel(); // Cancel any request, if outstanding
+	iTimer.Close(); // Destroy the RTimer object
+	// Delete instance variables if any
+	}
+// ---------------------------------------------------------------------------
+// DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CTimeAO::DoCancel()
+	{
+	iTimer.Cancel();
+	}
+// ---------------------------------------------------------------------------
+// StartL()
+// ---------------------------------------------------------------------------
+//
+void CTimeAO::StartL()
+	{
+	Cancel(); // Cancel any request, just to be sure
+	iTimer.After(iStatus, 1000000); // Set for later
+	SetActive(); // Tell scheduler a request is active
+	}
+// ---------------------------------------------------------------------------
+// SetObserver()
+// ---------------------------------------------------------------------------
+//
+void CTimeAO::SetObserver(MCountTime* aObserver)
+	{
+	iObserver = aObserver;
+	}
+// ---------------------------------------------------------------------------
+// RunL()
+// ---------------------------------------------------------------------------
+//
+void CTimeAO::RunL()
+	{
+	
+	if (iObserver != NULL)
+		{
+		iObserver->Notify();
+		}
+	}
+// ---------------------------------------------------------------------------
+// RunError()
+// ---------------------------------------------------------------------------
+//
+TInt CTimeAO::RunError(TInt aError)
+	{
+	return aError;
+	}
--- a/imageeditor/plugins/DrawPlugin/src/imageeditordrawcontrol.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/plugins/DrawPlugin/src/imageeditordrawcontrol.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -1,30 +1,26 @@
 /*
-* Copyright (c) 2010 Ixonos Plc.
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - Initial contribution
-*
-* Contributors:
-* Ixonos Plc
-*
-* Description: 
-* Image Editor plugin control class.
-*
-*/
-
-
+ * Copyright (c) 2010 Ixonos Plc.
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - Initial contribution
+ *
+ * Contributors:
+ * Ixonos Plc
+ *
+ * Description: 
+ * Image Editor plugin control class.
+ *
+ */
 //  INCLUDES
 #include "imageeditordrawcontrol.h"
 #include "draw.hrh"
-
 #include "ImageEditorUI.hrh"
 #include "ImageEditorPluginBase.hrh"
-
 #include "PluginInfo.h"
 #include "JpTimer.h"
 #include "ImageEditorUids.hrh"
@@ -32,20 +28,16 @@
 #include "SystemParameters.h"
 #include "drawpath.h"
 #include "selectionpopup.h"
-
 #include "iepb.h" 
 // debug log
 #include "imageeditordebugutils.h"
-
 #include <fbs.h>
 #include <badesca.h>
 #include <gdi.h>
 #include <eikenv.h>
 #include <bitdev.h>
-
 #include <aknview.h>
 #include <aknutils.h>
-
 #include <ImageEditorUI.mbg>
 #include <AknInfoPopupNoteController.h> 
 #include <draw.rsg> 
@@ -53,622 +45,809 @@
 #include <ConeResLoader.h> 
 #include <gulalign.h>
 #include <csxhelp/sie.hlp.hrh>
-
+#include <Icons_doodle.mbg>
+#include "CImageLabel.h"
+#include <aknnotewrappers.h>
 // Log file
 _LIT(KDrawPluginLogFile,"drawplugin.log");
 
 //  CONSTANTS
-const TInt KWait			    	= 1;
-const TInt KMainTextIndex           = 0;
-
+const TInt KWait = 1;
+const TInt KMainTextIndex = 0;
+//#define HORIZ TPoint(0,72),TPoint(502,360)
+//#define VERTICAL TPoint(0,92),TPoint(360,579)
 // ---------------------------------------------------------------------------
 // NewL
 // ---------------------------------------------------------------------------
 //
-CImageEditorDrawControl* CImageEditorDrawControl::NewL(
-	const TRect& aRect,
-	CCoeControl* aParent )
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::NewL()");
+CImageEditorDrawControl* CImageEditorDrawControl::NewL(const TRect& aRect,
+		CCoeControl* aParent, RPointerArray<CDrawPath>& aPaths, TRgb& aRgb,
+		TSize& aSize, TBool &aDisplayTool)
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::NewL()");
 
-    CImageEditorDrawControl * self = new (ELeave) CImageEditorDrawControl;
-    CleanupStack::PushL (self);
-    self->ConstructL (aRect, aParent);
-    CleanupStack::Pop ();   // self
-    return self;
-    }
+	CImageEditorDrawControl * self = new (ELeave) CImageEditorDrawControl(
+			aPaths, aRgb, aSize, aDisplayTool);
+	CleanupStack::PushL(self);
+	self->ConstructL(aRect, aParent);
+	CleanupStack::Pop(); // self
+	return self;
+	}
 
 // ---------------------------------------------------------------------------
 // CImageEditorDrawControl
 // ---------------------------------------------------------------------------
 //
-CImageEditorDrawControl::CImageEditorDrawControl() : 
-iTickCount(0),
-iNaviStepMultiplier(KDefaultSmallNavigationStepMultiplier),
-iDisplayingOkOptionsMenu(EFalse),
-iReadyToRender(EFalse),
-iResLoader( *ControlEnv() )
-{}
+CImageEditorDrawControl::CImageEditorDrawControl(
+		RPointerArray<CDrawPath>& aPaths, TRgb& aRgb, TSize& aSize,
+		TBool& aDisplayTool) :
+	iTickCount(0), iX(0), iY(0), iNaviStepMultiplier(
+			KDefaultSmallNavigationStepMultiplier), iDisplayingOkOptionsMenu(
+			EFalse), iReadyToRender(EFalse), iResLoader(*ControlEnv()), iPaths(
+			aPaths), iRgb(aRgb), iSize(aSize), iDisplayTool(aDisplayTool)
+
+	{
+	}
 
 // ---------------------------------------------------------------------------
 // ~CImageEditorDrawControl()
 // ---------------------------------------------------------------------------
 //
 CImageEditorDrawControl::~CImageEditorDrawControl()
-    {
-    LOG(KDrawPluginLogFile, 
-            "CImageEditorDrawControl::~CImageEditorDrawControl()");    
-    delete iTimer;
-    delete iIndicator;
-    delete iIndicatorMask;
+	{
+	LOG(KDrawPluginLogFile,
+			"CImageEditorDrawControl::~CImageEditorDrawControl()");
+	delete iCustomComponet;
+	delete iTimer;
+	delete iIndicator;
+	delete iIndicatorMask;
 	delete iPopupController;
 	delete iTooltipResize;
-	iPaths.ResetAndDestroy();
-    delete iNaviPaneText;	
+	delete iRollAo;
+	delete iNaviPaneText;
+	delete iGc;
+	delete iBitmapDev;
+	delete iAnimationAO;
+	
+	iUndoPaths.ResetAndDestroy();
 	iResLoader.Close();
-    }
+	
+	for (int i = 0; i < iTotalComponent; i++)
+		{
+		CImageLabel* &temp = iLabels[i];
+		if (temp != NULL)
+			{
+			delete temp;
+			temp = NULL;
+			}
+		}
+	iLabels.ResetAndDestroy();
+
+
+	}
 
 // ---------------------------------------------------------------------------
 // ConstructL
 // ---------------------------------------------------------------------------
 //
-void CImageEditorDrawControl::ConstructL(
-	const TRect& /*aRect*/, CCoeControl* aParent )
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::ConstructL()");
-	//	Set parent window
-	SetContainerWindowL(*aParent);
-    
-    //  Create resource utility
+void CImageEditorDrawControl::ConstructL(const TRect& aRect,
+		CCoeControl* aParent)
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::ConstructL()");
+
+	CreateWindowL();
+	EnableDragEvents();
+	//iRollDirection = EFalse;
+	iStatuspaneHeight = aRect.iTl.iY;
+	iUndo = EFalse;
+	iRedo = EFalse;
+	iCanRedo = EFalse;
+	//iRollDirection = ETrue;
+	//  Create resource utility
 	TFileName resFile;
 	// resource file name
-	_LIT (KResourceFile, "draw.rsc");	
+	_LIT(KResourceFile, "draw.rsc");
 	resFile.Append(KPgnResourcePath);
 	resFile.Append(KResourceFile);
 
-    User::LeaveIfError( CompleteWithAppPath( resFile ) );
-    // Implementation of RConeResourceLoader uses BaflUtils::NearestLanguageFile 
-    // to search for a localised resource in proper search order
-    iResLoader.OpenL( resFile );
-    
+	User::LeaveIfError(CompleteWithAppPath(resFile));
+	// Implementation of RConeResourceLoader uses BaflUtils::NearestLanguageFile 
+	// to search for a localised resource in proper search order
+	iResLoader.OpenL(resFile);
+
 	//	Create timer for fast key repeat
-	iTimer = CJPTimer::NewL( this );
+	iTimer = CJPTimer::NewL(this);
+
+	iPopupController = CAknInfoPopupNoteController::NewL();
+	iTooltipResize = ControlEnv()->AllocReadResourceL(R_TOOLTIP_TEXT_RESIZE);
+
+	SetExtentToWholeScreen();
+	//	TRect a(HORIZ);
+	//	iClientRectH = a;
+	//	TRect b(VERTICAL);
+	//	iClientRectV = b;
+	iCustomComponetClick = EFalse;
+	TRect rect = Rect();
+	//iDisplayTool=ETrue;
+	if (rect.Width() < rect.Height())
+		{
+		InitializeMainMenu(EMainMenuHorizontal);
+		}
+	else if (rect.Width() > rect.Height())
+		{
+		InitializeMainMenu(EMainMenuVertical);
+		}
+
+	TRect Trect(TPoint(0, 0), TPoint(50, 50));
+	iCustomComponet = CCustomerComponet::NewL(Trect, this);
+	iCustomComponet->SetExtent(TPoint(40, 100), TSize(50, 50));
+	iCustomComponet->SetHandlePointerObserver(this);
+	iLastPointEventType = EFalse;
+	//	Activate control
+	ActivateL();
+
+	}
+
+void CImageEditorDrawControl::InitializeMainMenu(
+		TMainMenuLayout aMainMenuLayout)
+	{
+	iMainMenuLayout = aMainMenuLayout;
+	_LIT(KSvgPath, "\\resource\\apps\\icons_doodle.mif");
+	TFileName svgFile(KSvgPath);
+	User::LeaveIfError(CompleteWithAppPath(svgFile));
+	iTotalComponent = 7;
+	TRect clipRect;
+	if (iMainMenuLayout == EMainMenuHorizontal)
+		{
+		iLoopMenuRect = TRect(TPoint(0, Rect().iBr.iY - 87), TSize(360, 87));
+
+		for (int i = 0; i < iTotalComponent; i++)
+			{
+			if (iDisplayTool)
+				{
+				TRect
+						Rect1(TPoint(i * 72, iLoopMenuRect.iTl.iY), TSize(72,
+								87));
+				clipRect = Rect1;
+				}
+
+			else
+				{
+				TRect Rect2(TPoint(i * 72 - iLoopMenuRect.Width() - 72 * 2,
+						iLoopMenuRect.iTl.iY), TSize(72, 87));
+				clipRect = Rect2;
+				}
 
-	iPopupController = CAknInfoPopupNoteController::NewL();    
-	iTooltipResize = ControlEnv()->AllocReadResourceL(R_TOOLTIP_TEXT_RESIZE);           
-	    
-    EnableDragEvents();
-        
-	//	Activate control
-    ActivateL();
-    }
+			CImageLabel* label = CImageLabel::NewL(this, clipRect,
+					CImageLabel::ELabelHorizontal);
+			label->SetHandlePointerObserver(this);
+			iLabels.Append(label);
+			}
+		}
+	else if (iMainMenuLayout == EMainMenuVertical)
+		{
+		iLoopMenuRect = TRect(TPoint(Rect().iBr.iX - 87, 0), TSize(87, 360));
+
+		for (int i = 0; i < iTotalComponent; i++)
+			{
+			if (iDisplayTool)
+				{
+				TRect
+						Rect1(TPoint(iLoopMenuRect.iTl.iX, i * 72), TSize(87,
+								72));
+				clipRect = Rect1;
+				}
+			else
+				{
+				TRect Rect2(TPoint(iLoopMenuRect.iTl.iX, i * 72
+						- iLoopMenuRect.Height() - 72 * 2), TSize(87, 72));
+				clipRect = Rect2;
+				}
+
+			CImageLabel* label = CImageLabel::NewL(this, clipRect,
+					CImageLabel::ELabelVertical);
+			label->SetHandlePointerObserver(this);
+			iLabels.Append(label);
+			}
+		}
+
+	iLabels[0]->SetImage(svgFile, EMbmIcons_doodlePensize);
+	iLabels[0]->SetTooltip(_L("Pensize"));
+
+	iLabels[1]->SetImage(svgFile, EMbmIcons_doodlePalette);
+	iLabels[1]->SetTooltip(_L("Palette"));
+
+	iLabels[2]->SetImage(svgFile, EMbmIcons_doodleUndo);
+	iLabels[2]->SetTooltip(_L("Undo"));
+
+	iLabels[3]->SetImage(svgFile, EMbmIcons_doodleSave);
+	iLabels[3]->SetTooltip(_L("Save"));
+
+	iLabels[4]->SetImage(svgFile, EMbmIcons_doodleMenu);
+	iLabels[4]->SetTooltip(_L("About"));
+
+	iLabels[5]->SetImage(svgFile, EMbmIcons_doodlePalette);
+	iLabels[5]->SetTooltip(_L("Redo"));
+
+	iLabels[6]->SetImage(svgFile, EMbmIcons_doodlePensize);
+	iLabels[6]->SetTooltip(_L("Null"));
+
+	iAnimationAO = CAnimationAO::NewL();
+	iAnimationAO->SetObserver(this);
+	iRollAo = CRollAO::NewL();
+	iRollAo->SetObserver(this);
+
+	iButtonDownPoint = TPoint(0, 0);
+	iDragStartPoint = TPoint(0, 0);
+	iDragPrePoint = TPoint(0, 0);
+	iDragUpPoint = TPoint(0, 0);
+
+	iPointStartInLoopRect = EFalse;
+	iDragIsStart = EFalse;
+	iEnableAnimationEffect = EFalse;
+	iDragOffset = 0;
+
+	}
 
 // ---------------------------------------------------------------------------
 // SetView
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::SetView(CAknView* aView)
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::SetView()");
-    ASSERT( aView );
-    iEditorView = aView;
-    }
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::SetView()");
+	ASSERT(aView);
+	iEditorView = aView;
+	}
 
 // ---------------------------------------------------------------------------
 // SetSelectedUiItemL
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::SetSelectedUiItemL(CPluginInfo* aItem)
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::SetSelectedUiItemL()");
-    ASSERT( aItem );
-    iItem = aItem;
-    delete iNaviPaneText;
-    iNaviPaneText = NULL;
-    iNaviPaneText = (iItem->Parameters()[KMainTextIndex]).AllocL();
-    iEditorView->HandleCommandL(EImageEditorCmdRender);
-    }
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::SetSelectedUiItemL()");
+	ASSERT(aItem);
+	iItem = aItem;
+	delete iNaviPaneText;
+	iNaviPaneText = NULL;
+	iNaviPaneText = (iItem->Parameters()[KMainTextIndex]).AllocL();
+	iEditorView->HandleCommandL(EImageEditorCmdRender);
+	}
 
 // ---------------------------------------------------------------------------
 // OfferKeyEventL
 // ---------------------------------------------------------------------------
 //
 TKeyResponse CImageEditorDrawControl::OfferKeyEventL(
-    const TKeyEvent& aKeyEvent,
-    TEventCode aType)
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::OfferKeyEventL()");
+		const TKeyEvent& aKeyEvent, TEventCode aType)
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::OfferKeyEventL()");
+
+	TKeyResponse response = EKeyWasNotConsumed;
 
-    TKeyResponse response = EKeyWasNotConsumed;
+	//  If busy, do not handle anything
+	if (Busy())
+		{
+		response = EKeyWasConsumed;
+		}
 
-    //  If busy, do not handle anything
-    if ( Busy() )
-    {
-        response = EKeyWasConsumed;
-    }
+	// In main state handle the OK Options menu
+	else if (aKeyEvent.iCode == EKeyOK)
+		{
+		iDisplayingOkOptionsMenu = ETrue;
+		iEditorView->HandleCommandL(EImageEditorTryDisplayMenuBar);
+		response = EKeyWasConsumed;
+		}
 
-    // In main state handle the OK Options menu
-    else if ( aKeyEvent.iCode == EKeyOK )
-        {
-        iDisplayingOkOptionsMenu = ETrue;
-        iEditorView->HandleCommandL (EImageEditorTryDisplayMenuBar);
-        response = EKeyWasConsumed;
-        }
-
-    //  We handle only event keys
-    else if (EEventKey == aType)
-    {
+	//  We handle only event keys
+	else if (EEventKey == aType)
+		{
 
 		switch (aKeyEvent.iCode)
-		{
-		
+			{
+
 			case EKeyDownArrow:
 			case EKeyUpArrow:
 			case EKeyRightArrow:
-            case EKeyLeftArrow:
-			{		
-			    SetPositionOnImage( ComputeIndicatorPosition() );
-		    	StoreParameters( EFalse, EFalse );			    
+			case EKeyLeftArrow:
+				{
+				SetPositionOnImage(ComputeIndicatorPosition());
+				StoreParameters(EFalse, EFalse);
 				response = EKeyWasConsumed;
-                break;
-			}
-		
-            case EKeyOK:
-                {           
-                break;
-                }
+				break;
+				}
 
-		    case 0x30: // 0		    		    
-		    case 0x32: // 2
-		    case 0x34: // 4
-		    case 0x35: // 5
-		    case 0x36: // 6
-		    case 0x38: // 8
+			case EKeyOK:
+				{
+				break;
+				}
+
+			case 0x30: // 0		    		    
+			case 0x32: // 2
+			case 0x34: // 4
+			case 0x35: // 5
+			case 0x36: // 6
+			case 0x38: // 8
 			case EStdKeyIncVolume: // zoom in key
 			case EStdKeyDecVolume: // zoom out key
-		    {
-		    	StorePosAndScaleRelScreen();
-		    	break;
-		    }
+				{
+				StorePosAndScaleRelScreen();
+				break;
+				}
 
 			default:
-			{
+				{
 				break;
+				}
 			}
 		}
-	}
 
 	//	Key pressed down, mark pressed key
 	else if (aType == EEventKeyDown)
-	{
+		{
 		switch (aKeyEvent.iScanCode)
-		{
+			{
 			case EStdKeyUpArrow:
-			{
+				{
 				iKeyCode = 1;
-			    response = EKeyWasConsumed;
+				response = EKeyWasConsumed;
 				break;
-			}
+				}
 			case EStdKeyDownArrow:
-			{
+				{
 				iKeyCode = 2;
-			    response = EKeyWasConsumed;
+				response = EKeyWasConsumed;
 				break;
-			}
+				}
 			case EStdKeyLeftArrow:
-			{
+				{
 				iKeyCode = 3;
-			    response = EKeyWasConsumed;
+				response = EKeyWasConsumed;
 				break;
-			}
+				}
 			case EStdKeyRightArrow:
-			{
+				{
 				iKeyCode = 4;
-			    response = EKeyWasConsumed;
+				response = EKeyWasConsumed;
 				break;
+				}
+			}
+
+		if (iKeyCode != 0)
+			{
+			iNaviStepMultiplier = KDefaultSmallNavigationStepMultiplier;
+			iTickCount = 0;
+			iTimer->Call(KWait);
 			}
 		}
 
-		if ( iKeyCode != 0 )
-		{
-		    iNaviStepMultiplier = KDefaultSmallNavigationStepMultiplier;
-		    iTickCount = 0;
-			iTimer->Call( KWait );
-		}
-	}
-	
 	//	Key released, mark all keys to zero
 	else if (aType == EEventKeyUp)
-	{
+		{
 		switch (aKeyEvent.iScanCode)
-		{
+			{
 			case EStdKeyUpArrow:
 			case EStdKeyDownArrow:
 			case EStdKeyLeftArrow:
 			case EStdKeyRightArrow:
-			{
+				{
 				iKeyCode = 0;
-			    response = EKeyWasConsumed;
-			    ShowTooltip();
+				response = EKeyWasConsumed;
+				ShowTooltip();
 				break;
+				}
 			}
 		}
+
+	return response;
 	}
 
-    return response;
-    }
-
 // ---------------------------------------------------------------------------
 // SizeChanged
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::SizeChanged()
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::SizeChanged()");
-    }
+	{
+	if (iSizeChangeFlag)
+		{
+		SetToolBarStatus();
+		}
+	else
+		{
+		iSizeChangeFlag = ETrue;
+		}
+	if (iDragIsStart)
+		{
+		if (iMainMenuLayout == EMainMenuHorizontal)
+			{
+			for (TInt i = 0; i < iTotalComponent; i++)
+				{
+				if (iLabels[0]->Rect().iTl.iX <= 0)
+					{
+					TInt x = iLabels[i]->Rect().iTl.iX;
+					iLabels[i]->SetPosition(TPoint(x + iDragOffset,
+							iLoopMenuRect.iTl.iY));
+					iLabels[i]->ResetControl();
+					}
+				}
+			}
+		else if (iMainMenuLayout == EMainMenuVertical)
+			{
+			for (TInt i = 0; i < iTotalComponent; i++)
+				{
+				if (iLabels[0]->Rect().iTl.iY <= 0)
+					{
+					TInt y = iLabels[i]->Rect().iTl.iY;
+					iLabels[i]->SetPosition(TPoint(iLoopMenuRect.iTl.iX, y
+							+ iDragOffset));
+					iLabels[i]->ResetControl();
+					}
+				}
+			}
+		DrawNow();
+		}
+	}
 
+void CImageEditorDrawControl::SetToolBarStatus()
+	{
+
+	if (iMainMenuLayout == EMainMenuHorizontal)
+		{
+		TInt leftX = iLabels[0]->Rect().iTl.iX;
+		TInt rightX = iLabels[iTotalComponent - 1]->Rect().iBr.iX;
+		if (leftX == 0)
+			iDisplayTool = ETrue;
+		else if (rightX == 0)
+			iDisplayTool = EFalse;
+		}
+	else if (iMainMenuLayout == EMainMenuVertical)
+		{
+		TInt topY = iLabels[0]->Rect().iTl.iY;
+		TInt bottomY = iLabels[iTotalComponent - 1]->Rect().iBr.iY;
+		if (topY == 0)
+			iDisplayTool = ETrue;
+		else if (bottomY == 0)
+			iDisplayTool = EFalse;
+
+		}
+
+	}
 // ---------------------------------------------------------------------------
 // GetParam
 // ---------------------------------------------------------------------------
 //
 TDesC& CImageEditorDrawControl::GetParam()
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::GetParam()");
-    LOGDES(KDrawPluginLogFile, iParam);
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::GetParam()");
+	LOGDES(KDrawPluginLogFile, iParam);
 	return iParam;
-    }
+	}
 
 // ---------------------------------------------------------------------------
 // SetSystemParameters
 // ---------------------------------------------------------------------------
 //
-void CImageEditorDrawControl::SetSystemParameters(const CSystemParameters* aPars) 
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::SetSystemParameters()");
-    ASSERT( aPars );
-    iSysPars = aPars;
-    }
+void CImageEditorDrawControl::SetSystemParameters(
+		const CSystemParameters* aPars)
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::SetSystemParameters()");
+	ASSERT(aPars);
+	iSysPars = aPars;
+	}
 
 // ---------------------------------------------------------------------------
 // HandlePluginCommandL
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::HandlePluginCommandL(const TInt aCommand)
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::HandlePluginCommandL()");
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::HandlePluginCommandL()");
 
-    switch (aCommand) 
-        {
-        case EImageEditorFocusLost:
-            {
-            if (iTimer)
-                {
-                iTimer->Cancel();
-                }
-            break;
-            }
-        case EPgnSoftkeyIdOk:
-            {
-            iPopupController->HideInfoPopupNote();
-            break;
-            }
-        case EPgnSoftkeyIdCancel:
-            {
-            iPopupController->HideInfoPopupNote();
-            iEditorView->HandleCommandL (EImageEditorCancelPlugin);
-            break;
-            }
-        case EPgnSoftkeyIdDone:
-            // FALLTROUHG
-        case EDrawPgnMenuCmdDone:
-            {   
-            iPopupController->HideInfoPopupNote();
-            StoreParameters(EFalse, ETrue);
-            iEditorView->HandleCommandL( EImageEditorCmdRender );//results Draw call
-            iEditorView->HandleCommandL(EImageEditorApplyPlugin);
-            break;
-            }
-        case EDrawPgnMenuCmdResize:
-            {
-            StoreParameters(ETrue, ETrue);
-            iEditorView->HandleCommandL( EImageEditorCmdRender );//results Draw call
-            SelectSizeL();         
-            break;
-            }
-        case EDrawPgnMenuCmdColor:
-            {
-            StoreParameters(ETrue, ETrue);
-            iEditorView->HandleCommandL( EImageEditorCmdRender );//results Draw call            
-            SDrawUtils::LaunchColorSelectionPopupL(iPreview, Rect(), iRgb);
-            break;
-            }
-        case EDrawPgnMenuCmdCancel:
-            {
+	switch (aCommand)
+		{
+		case EImageEditorFocusLost:
+			{
+			if (iTimer)
+				{
+				iTimer->Cancel();
+				}
+			break;
+			}
+		case EPgnSoftkeyIdOk:
+			{
+			iPopupController->HideInfoPopupNote();
+			break;
+			}
+		case EPgnSoftkeyIdCancel:
+			{
+			iPopupController->HideInfoPopupNote();
+			iEditorView->HandleCommandL(EImageEditorCancelPlugin);
+			break;
+			}
+		case EPgnSoftkeyIdDone:
+			// FALLTROUHG
+		case EDrawPgnMenuCmdDone:
+			{
+			iPopupController->HideInfoPopupNote();
+			StoreParameters(EFalse, ETrue);
+			iEditorView->HandleCommandL(EImageEditorCmdRender);//results Draw call
+			iEditorView->HandleCommandL(EImageEditorApplyPlugin);
+			break;
+			}
+		case EDrawPgnMenuCmdResize:
+			{
+			StoreParameters(ETrue, ETrue);
+			iEditorView->HandleCommandL(EImageEditorCmdRender);//results Draw call
+			SelectSizeL();
+			break;
+			}
+		case EDrawPgnMenuCmdColor:
+			{
+			StoreParameters(ETrue, ETrue);
+			iEditorView->HandleCommandL(EImageEditorCmdRender);//results Draw call            
+			SDrawUtils::LaunchColorSelectionPopupL(iPreview, Rect(), iRgb);
+			break;
+			}
+		case EDrawPgnMenuCmdCancel:
+			{
 			iReadyToRender = EFalse;
-            iEditorView->HandleCommandL(EImageEditorCancelPlugin);
-            break;
-            }
-        
-        case EImageEditorGlobalZoomChanged:
-            // FALLTROUGHT
-        case EImageEditorGlobalPanChanged:
-            {
-			RestorePosAndScaleRelScreen();
-			//StoreParameters();
-            StoreTempParams();
-	    	iEditorView->HandleCommandL (EImageEditorCmdRender);
+			iEditorView->HandleCommandL(EImageEditorCancelPlugin);
+			break;
+			}
 
-			//DrawNow();
-	        break;
-            }
-        
-        case EImageEditorPreScreenModeChange:
-            {
+		case EImageEditorGlobalZoomChanged:
+			// FALLTROUGHT
+		case EImageEditorGlobalPanChanged:
+			{
+			RestorePosAndScaleRelScreen();
+			StoreTempParams();
+			iEditorView->HandleCommandL(EImageEditorCmdRender);
+			break;
+			}
+
+		case EImageEditorPreScreenModeChange:
+			{
 			StorePosAndScaleRelImage();
-        	break;
-            }
-        
-        case EImageEditorPostScreenModeChange:
-            {
+			break;
+			}
+
+		case EImageEditorPostScreenModeChange:
+			{
 			RestorePosAndScaleRelImage();
 			ClipPosition();
-			//StoreParameters();
-            StoreTempParams();
-	    	iEditorView->HandleCommandL (EImageEditorCmdRender);
-			//DrawNow();
-        	break;
-            }
-
-        default:
-            {
-            break;
-            }
-        }
-    }
+			StoreTempParams();
+			iEditorView->HandleCommandL(EImageEditorCmdRender);
+			break;
+			}
+		default:
+			{
+			break;
+			}
+		}
+	}
 
 // ---------------------------------------------------------------------------
 // GetSoftkeyIndexL
 // ---------------------------------------------------------------------------
 //
 TInt CImageEditorDrawControl::GetSoftkeyIndexL()
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::GetSoftkeyIndexL()");
-    // : Check needed states
-    TInt state(2);
-    return state;
-    }
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::GetSoftkeyIndexL()");
+	// : Check needed states
+	TInt state(2);
+	return state;
+	}
 
 // ---------------------------------------------------------------------------
 // GetContextMenuResourceId
 // ---------------------------------------------------------------------------
 //
 TInt CImageEditorDrawControl::GetContextMenuResourceId()
-    {
-    return R_TEXT_CONTEXT_MENUBAR;    
-    }
+	{
+	return R_TEXT_CONTEXT_MENUBAR;
+	}
 
 // ---------------------------------------------------------------------------
 // GetDimmedMenuItems
 // ---------------------------------------------------------------------------
 //
 TBitField CImageEditorDrawControl::GetDimmedMenuItems()
-{
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::GetDimmedMenuItems()");
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::GetDimmedMenuItems()");
 
-    TBitField dimmedMenuItems;
-    TInt count = iItem->MenuItems().Count();
+	TBitField dimmedMenuItems;
+	TInt count = iItem->MenuItems().Count();
 
-    if ( iDisplayingOkOptionsMenu )
-    {
-        // Dim the command EImageEditorCancelPlugin
-        for ( TInt i = 0; i < count; i++)
-        {
-            // get the menu item id
-            TInt menuItem = iItem->MenuItems().At(i).iCommandId;
-            if ( menuItem == EDrawPgnMenuCmdCancel ) 
-            {
-                dimmedMenuItems.SetBit( i );
-            }
-        }
-        iDisplayingOkOptionsMenu = EFalse;
-    }
-    
-    for ( TInt i = 0; i < count; i++)
-    {
-        // get the menu item id
-        TInt menuItem = iItem->MenuItems().At(i).iCommandId;
-        if ( menuItem == EDrawPgnMenuCmdMax )
-        	{
-        	dimmedMenuItems.SetBit( i );
-        	}    
-    }
-    return dimmedMenuItems;
-}
+	if (iDisplayingOkOptionsMenu)
+		{
+		// Dim the command EImageEditorCancelPlugin
+		for (TInt i = 0; i < count; i++)
+			{
+			// get the menu item id
+			TInt menuItem = iItem->MenuItems().At(i).iCommandId;
+			if (menuItem == EDrawPgnMenuCmdCancel)
+				{
+				dimmedMenuItems.SetBit(i);
+				}
+			}
+		iDisplayingOkOptionsMenu = EFalse;
+		}
+
+	for (TInt i = 0; i < count; i++)
+		{
+		// get the menu item id
+		TInt menuItem = iItem->MenuItems().At(i).iCommandId;
+		if (menuItem == EDrawPgnMenuCmdMax)
+			{
+			dimmedMenuItems.SetBit(i);
+			}
+		}
+	return dimmedMenuItems;
+	}
 
 // ---------------------------------------------------------------------------
 // GetNaviPaneTextL
 // ---------------------------------------------------------------------------
 //
 TPtrC CImageEditorDrawControl::GetNaviPaneTextL(
-    TBool& aLeftNaviPaneScrollButtonVisibile, 
-    TBool& aRightNaviPaneScrollButtonVisible )
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::GetNaviPaneTextL()");
+		TBool& aLeftNaviPaneScrollButtonVisibile,
+		TBool& aRightNaviPaneScrollButtonVisible)
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::GetNaviPaneTextL()");
 
-    aLeftNaviPaneScrollButtonVisibile = EFalse;
-    aRightNaviPaneScrollButtonVisible = EFalse;
-    return *iNaviPaneText;
-    }
+	aLeftNaviPaneScrollButtonVisibile = EFalse;
+	aRightNaviPaneScrollButtonVisible = EFalse;
+	return *iNaviPaneText;
+	}
 
 // ---------------------------------------------------------------------------
 // Draw
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::Draw(const TRect& aRect) const
-    {
-    CWindowGc & gc = SystemGc();
-    if( IsReadyToRender() )
-        {
-        CPreviewControlBase::DrawPreviewImage(aRect);
-        }
+	{
+	CWindowGc & gc = SystemGc();
+	gc.SetBrushColor(KRgbBlack);
+	gc.Clear(aRect);
+
+	TRect ImageRect(iSysPars->VisibleImageRectPrev());
+	CPreviewControlBase::DrawPreviewImage(aRect);
+	gc.SetClippingRect(TRect(TPoint(ImageRect.iTl.iX, ImageRect.iTl.iY
+			+ iStatuspaneHeight), ImageRect.Size()));
 
-    if( iPaths.Count() )
-        {
-        ASSERT( iSysPars ); 
-        for( TInt i(0); i<iPaths.Count(); ++i)
-            {
-            CDrawPath* path = iPaths[i];
-            CArrayFix<TPoint>* pathPoints = path->ItemArray();
-            gc.SetPenStyle( CGraphicsContext::ESolidPen );
-            gc.SetPenColor( path->Color() );
-            gc.SetPenSize( ScaledLineSize( path->Size() ) );
-            gc.DrawPolyLine( pathPoints );
-            }
-        }
-    
-  /*  
-   * : Too slow cause we need to redraw preview image everytime
-   * if( iIndicator && iIndicator->Handle() && 
-         iIndicatorMask && iIndicatorMask->Handle() )
-        {                
-        gc.BitBltMasked ( 
-            ComputeIndicatorPosition(),
-            iIndicator, 
-            TRect (iIndicator->SizeInPixels()), 
-            iIndicatorMask, 
-            EFalse
-            );
-        }*/       	
-    }
+	if (iPaths.Count() > 0)
+		{
+		//        ASSERT( iSysPars ); 
+		TInt count = iPaths.Count();
+		for (TInt i(0); i < iPaths.Count(); ++i)
+			{
+			CDrawPath* path = iPaths[i];
+			CArrayFix<TPoint>* pathPoints = path->ItemArray();
+			gc.SetPenStyle(CGraphicsContext::ESolidPen);
+			gc.SetPenColor(path->Color());
+			gc.SetPenSize(ScaledLineSize(path->Size()));
+			gc.DrawPolyLine(pathPoints);
+			}
+		}
+	}
 
 // ---------------------------------------------------------------------------
 // NaviDown
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::NaviDown()
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::NaviDown()");
-    }
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::NaviDown()");
+	}
 
 // ---------------------------------------------------------------------------
 // NaviUp
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::NaviUp()
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::NaviUp()");
-    }
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::NaviUp()");
+	}
 
 // ---------------------------------------------------------------------------
 // NaviRight
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::NaviRight()
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::NaviRight()");
-    }
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::NaviRight()");
+	}
 
 // ---------------------------------------------------------------------------
 // NaviLeft
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::NaviLeft()
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::NaviLeft()");
-    }
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::NaviLeft()");
+	}
 
 // ---------------------------------------------------------------------------
 // SelectSizeL
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::SelectSizeL()
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::SelectSizeL()");
-    // Symmetric line width / height
-    TInt size(iSize.iWidth);
-    CSelectionDialog::RunDlgLD( iPreview, Rect(), size );
-    iSize = TSize(size,size);
-    }
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::SelectSizeL()");
+	// Symmetric line width / height
+	TInt size(iSize.iWidth);
+	CSelectionDialog::RunDlgLD(iPreview, Rect(), size, iRgb,
+			iSysPars->VisibleImageRectPrev());
+	iSize = TSize(size, size);
+	}
 
 // ---------------------------------------------------------------------------
 // StoreTempParams
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::StoreTempParams()
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::StoreTempParams()");
-    }
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::StoreTempParams("
+			""
+			")");
+	}
 
 // ---------------------------------------------------------------------------
 // RestoreTempParams
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::RestoreTempParams()
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::RestoreTempParams()");
-    }
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::RestoreTempParams()");
+	}
 
 // ---------------------------------------------------------------------------
 // GetHelpContext
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::GetHelpContext(TCoeHelpContext& aContext) const
-{
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::GetHelpContext()");
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::GetHelpContext()");
 
-    aContext.iMajor = TUid::Uid(UID_IMAGE_EDITOR);
-    aContext.iContext = KSIE_HLP_EDIT_TEXT;
-}
+	aContext.iMajor = TUid::Uid(UID_IMAGE_EDITOR);
+	aContext.iContext = KSIE_HLP_EDIT_TEXT;
+	}
 
 // ---------------------------------------------------------------------------
 // PrepareL
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::PrepareL()
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::PrepareL()");
-    
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::PrepareL()");
+
 	//	Get current view port
 	TRect rect = iSysPars->VisibleImageRectPrev();
-	
-	//	Set default position
-	iX = (rect.iTl.iX + rect.iBr.iX) / 2;
-	iY = (rect.iTl.iY + rect.iBr.iY) / 2;
-	
-	//	Set default color to white
-	iRgb = KRgbWhite;
+
+	iReadyToRender = ETrue;
 
-	// Set default size
-	TInt defaultSize(8);
-	iSize = TSize(defaultSize, defaultSize);
-    iReadyToRender = ETrue;
-
-    iEditorView->HandleCommandL( EImageEditorCmdRender );        
-    }
+	iEditorView->HandleCommandL(EImageEditorCmdRender);
+	}
 
 // ---------------------------------------------------------------------------
 // LoadIndicatorL
 // ---------------------------------------------------------------------------
 //
-void CImageEditorDrawControl::LoadIndicatorL(
-    TInt aBitmapInd, TInt aMaskInd ) 
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::LoadIndicatorL()");
+void CImageEditorDrawControl::LoadIndicatorL(TInt aBitmapInd, TInt aMaskInd)
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::LoadIndicatorL()");
 
-    //  Delete old indicator
-    delete iIndicator;
-    iIndicator = 0;
-    delete iIndicatorMask;
-    iIndicatorMask = 0;
+	//  Delete old indicator
+	delete iIndicator;
+	iIndicator = 0;
+	delete iIndicatorMask;
+	iIndicatorMask = 0;
 
-    //  Load new indicator
-	SDrawUtils::GetIndicatorBitmapL (
-		iIndicator,
-		iIndicatorMask,
-		aBitmapInd,
-		aMaskInd
-		);
-    }
+	//  Load new indicator
+	SDrawUtils::GetIndicatorBitmapL(iIndicator, iIndicatorMask, aBitmapInd,
+			aMaskInd);
+	}
 
 // ---------------------------------------------------------------------------
 // ComputeIndicatorPosition
@@ -678,24 +857,22 @@
 	{
 	TRect vprect = iSysPars->VisibleImageRect();
 	TRect vpprect = iSysPars->VisibleImageRectPrev();
-    
-    TInt x( 0 );
-	TInt y( 0 );
+
+	TInt x(0);
+	TInt y(0);
 	// check if there is no indicator
-	if ( !iIndicator )
-	    {
-	    return TPoint ( x, y );
-	    }
-	    
+	if (!iIndicator)
+		{
+		return TPoint(x, y);
+		}
+
 	y = ((iY - vprect.iTl.iY) * vpprect.Height()) / vprect.Height();
 	y += vpprect.iTl.iY;
-	//y -= iIndicator->SizeInPixels().iHeight; /// 4;
 
-	x = ((iX  - vprect.iTl.iX) * vpprect.Width()) / vprect.Width();
+	x = ((iX - vprect.iTl.iX) * vpprect.Width()) / vprect.Width();
 	x += vpprect.iTl.iX;
-	//x -= iIndicator->SizeInPixels().iWidth / 2;
 
-    return TPoint (x,y);
+	return TPoint(x, y);
 	}
 
 // ---------------------------------------------------------------------------
@@ -703,363 +880,839 @@
 // ---------------------------------------------------------------------------
 //
 TBool CImageEditorDrawControl::IsReadyToRender() const
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::IsReadyToRender()");
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::IsReadyToRender()");
 	return iReadyToRender;
-    }
+	}
 
 // ---------------------------------------------------------------------------
 // StoreParameters
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::StoreParameters(TBool aLastItem, TBool aDone)
-    {
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::StoreParameters()");
-    RDebug::Print(_L("CImageEditorDrawControl::StoreParameters color[%d]"), 
-    	iRgb.Internal());    
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::StoreParameters()");
+	RDebug::Print(_L("CImageEditorDrawControl::StoreParameters color[%d]"),
+			iRgb.Internal());
 
 	iParam.Copy(_L("x "));
-	iParam.AppendNum (iX);
+	iParam.AppendNum(iX);
 	iParam.Append(_L(" y "));
-	iParam.AppendNum (iY);
-	
-	if( aLastItem )
-		{	
-	    iParam.Append(_L(" size "));
-	    iParam.AppendNum (iSize.iHeight);
-	    iParam.Append(_L(" color "));
-	    iParam.AppendNum ( iRgb.Value() );  		
+	iParam.AppendNum(iY);
+	if (aLastItem)
+		{
+		iParam.Append(_L(" size "));
+		iParam.AppendNum(iSize.iHeight);
+		iParam.Append(_L(" color "));
+		iParam.AppendNum(iRgb.Value());
 		iParam.Append(_L(" lastItem "));
-		}	
-    if( aDone )
-        {   
-        iParam.Append(_L("done"));
-        }
-    }
+		}
+
+	if (aDone)
+		{
+		iParam.Zero();
+		iParam.Append(_L("done"));
+		}
+	if (iUndo)
+		{
+		iParam.Zero();
+		iParam.Append(_L("Undo"));
+		}
+	if (iRedo)
+		{
+		iParam.Zero();
+		iParam.Append(_L("redone"));
+		}
+	}
 
 // ---------------------------------------------------------------------------
 // TimerCallBack
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::TimerCallBack()
-{
-    LOG(KDrawPluginLogFile, "CImageEditorDrawControl::TimerCallBack()");
+	{
+	LOG(KDrawPluginLogFile, "CImageEditorDrawControl::TimerCallBack()");
 
-    if (iTickCount > KDefaultFastKeyTimerMultiplyThresholdInTicks)
-    {
-        iNaviStepMultiplier = KDefaultBigNavigationStepMultiplier;
-    }
-    else
-    {
-        iTickCount++;
-    }
+	if (iTickCount > KDefaultFastKeyTimerMultiplyThresholdInTicks)
+		{
+		iNaviStepMultiplier = KDefaultBigNavigationStepMultiplier;
+		}
+	else
+		{
+		iTickCount++;
+		}
 
 	if (iKeyCode)
-	{
+		{
 
 		switch (iKeyCode)
-		{
+			{
 			case 1:
-			{
-	            NaviUp();
+				{
+				NaviUp();
+				break;
+				}
+			case 2:
+				{
+				NaviDown();
+				break;
+				}
+			case 3:
+				{
+				NaviLeft();
+				break;
+				}
+			case 4:
+				{
+				NaviRight();
+				break;
+				}
+			default:
 				break;
 			}
-			case 2:
-			{
-	            NaviDown();
-				break;
-			}
-			case 3:
-			{
-				NaviLeft();
-				break;
-			}
-			case 4:
-			{
-	            NaviRight();
-				break;
-			}
-	        default:
-	            break;
+		//StoreParameters();
+		TRAP_IGNORE(iEditorView->HandleCommandL(EImageEditorCmdRender));
+		iTimer->Call(KWait);
 		}
-	    //StoreParameters();
-	    TRAP_IGNORE( iEditorView->HandleCommandL(EImageEditorCmdRender) );
-		iTimer->Call (KWait);			
 	}
-}
 
 // ---------------------------------------------------------------------------
 // StorePosAndScaleRelScreen
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::StorePosAndScaleRelScreen()
-    {
-    LOG(KDrawPluginLogFile, 
-            "CImageEditorClipartControl::StorePosAndScaleRelScreen()");
-	iParam.Copy(_L("nop"));	
-    }
+	{
+	LOG(KDrawPluginLogFile,
+			"CImageEditorClipartControl::StorePosAndScaleRelScreen()");
+	iParam.Copy(_L("nop"));
+	}
 
 // ---------------------------------------------------------------------------
 // ?description_if_needed
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::RestorePosAndScaleRelScreen()
-    {
-	LOG(KDrawPluginLogFile, 
-	        "CImageEditorClipartControl::RestorePosAndScaleRelScreen()");
-    }
-
+	{
+	LOG(KDrawPluginLogFile,
+			"CImageEditorClipartControl::RestorePosAndScaleRelScreen()");
+	}
 
 // ---------------------------------------------------------------------------
 // StorePosAndScaleRelImage
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::StorePosAndScaleRelImage()
-    {
-    TReal relscale = iSysPars->RelScale();    
-    LOGFMT(KDrawPluginLogFile,
-            "CImageEditorClipartControl::StorePosAndScaleRelImage():%g",
-            relscale);
-    }
+	{
+	TReal relscale = iSysPars->RelScale();
+	LOGFMT(KDrawPluginLogFile,
+			"CImageEditorClipartControl::StorePosAndScaleRelImage():%g",
+			relscale);
+	}
 
 // ---------------------------------------------------------------------------
 // RestorePosAndScaleRelImage
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::RestorePosAndScaleRelImage()
-    {
-    TReal relscale = iSysPars->RelScale();
-    LOGFMT(KDrawPluginLogFile,
-            "CImageEditorClipartControl::RestorePosAndScaleRelImage():%g",
-            relscale);
-    }
+	{
+	TReal relscale = iSysPars->RelScale();
+	LOGFMT(KDrawPluginLogFile,
+			"CImageEditorClipartControl::RestorePosAndScaleRelImage():%g",
+			relscale);
+	}
 
 // ---------------------------------------------------------------------------
 // ClipPosition
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::ClipPosition()
-{
-    if ( iX < iSysPars->VisibleImageRect().iTl.iX )
-    {
-    	iX = iSysPars->VisibleImageRect().iTl.iX;
-    }
-    else if ( iX > iSysPars->VisibleImageRect().iBr.iX )
-    {
-    	iX = iSysPars->VisibleImageRect().iBr.iX;
-    }
-    
-    if ( iY < iSysPars->VisibleImageRect().iTl.iY )
-    {
-    	iY = iSysPars->VisibleImageRect().iTl.iY;
-    }
-    else if ( iY > iSysPars->VisibleImageRect().iBr.iY )
-    {
-    	iY = iSysPars->VisibleImageRect().iBr.iY;
-    }
-}
+	{
+	if (iX < iSysPars->VisibleImageRect().iTl.iX)
+		{
+		iX = iSysPars->VisibleImageRect().iTl.iX;
+		}
+	else if (iX > iSysPars->VisibleImageRect().iBr.iX)
+		{
+		iX = iSysPars->VisibleImageRect().iBr.iX;
+		}
+
+	if (iY < iSysPars->VisibleImageRect().iTl.iY)
+		{
+		iY = iSysPars->VisibleImageRect().iTl.iY;
+		}
+	else if (iY > iSysPars->VisibleImageRect().iBr.iY)
+		{
+		iY = iSysPars->VisibleImageRect().iBr.iY;
+		}
+	}
 
 // ---------------------------------------------------------------------------
 // HandlePointerEventL
 // ---------------------------------------------------------------------------
 //
 void CImageEditorDrawControl::HandlePointerEventL(
-    const TPointerEvent &aPointerEvent)
-    {
-    RDebug::Print(_L("CImageEditorDrawControl::HandlePointerEventL pen[%d]"), 
-    	AknLayoutUtils::PenEnabled());        
-    if( AknLayoutUtils::PenEnabled() && !Busy())
+		const TPointerEvent &aPointerEvent)
+	{
+	SetToolBarStatus();
+	RDebug::Print(_L("CImageEditorDrawControl::HandlePointerEventL pen[%d]"),
+			AknLayoutUtils::PenEnabled());
+	if (iRollflag)
+		return;
+	if (AknLayoutUtils::PenEnabled() && !Busy())
 		{
-		RDebug::Print(_L("CImageEditorDrawControl::iType [%d]"), 
-			aPointerEvent.iType);
-		TBool lastItem( EFalse );
-		switch( aPointerEvent.iType )
+		RDebug::Print(_L("CImageEditorDrawControl::iType [%d]"),
+				aPointerEvent.iType);
+		TBool lastItem(EFalse);
+		TPoint point = aPointerEvent.iPosition;
+
+		switch (aPointerEvent.iType)
 			{
 			case TPointerEvent::EButton1Down:
 				{
-				iReadyToRender = EFalse;
+
+				iButtonDownPoint = point;
+				iLastPointEventType = EFalse;
+				CCoeControl::HandlePointerEventL(aPointerEvent);
+
+				if (iLoopMenuRect.Contains(point) && !iCustomComponetClick
+						&& iDisplayTool)
+
+					{
+					iPointStartInLoopRect = ETrue;
+					if (iDragIsStart)
+						{
+						iAnimationAO->Cancel();
+						iDragIsStart = EFalse;
+						}
 
-				CDrawPath* lastPath = CDrawPath::NewL();
-				CleanupStack::PushL( lastPath );
-				lastPath->SetColor( iRgb );
-				lastPath->SetSize( iSize );								
-                SetPositionOnImage( aPointerEvent.iPosition );
-                lastPath->AddItemL( aPointerEvent.iPosition );
-                iPaths.AppendL( lastPath );
-                CleanupStack::Pop( lastPath );
-                break;
+					}
+				else if ((!iLoopMenuRect.Contains(point)
+						&& !iCustomComponetClick && iDisplayTool)
+						|| (!iDisplayTool && !iCustomComponetClick))
+					{
+					iPointStartInLoopRect = EFalse;
+					//System dispose
+					iReadyToRender = EFalse;					
+					CDrawPath* lastPath = CDrawPath::NewL();
+					CleanupStack::PushL(lastPath);
+					lastPath->SetColor(iRgb);
+					lastPath->SetSize(iSize);
+					SetPositionOnImage(aPointerEvent.iPosition);
+					lastPath->AddItemL(aPointerEvent.iPosition);
+					iPaths.AppendL(lastPath);
+					CleanupStack::Pop(lastPath);
+					iCanRedo = EFalse;
+					iUndoPaths.ResetAndDestroy();
+					}
 				}
-			case TPointerEvent::EDrag:
-				{  
-				if( iPaths.Count() )
-    				{
-    				CDrawPath* path = iPaths[iPaths.Count()-1];
-    				// store current position for next round
-                    iPointerPosition = aPointerEvent.iPosition;    
-    			    SetPositionOnImage( aPointerEvent.iPosition );
-    			    path->AddItemL( aPointerEvent.iPosition );
-    				}
-				break;		
-				}
+				break;
 			case TPointerEvent::EButton1Up:
 				{
+				//		System dispose
 				iReadyToRender = ETrue;
-				ShowTooltip();
+				iCustomComponetClick = EFalse;
 				lastItem = ETrue;
+				HandleMainMenuButtonUp(point);
+				CCoeControl::HandlePointerEventL(aPointerEvent);
+				DrawNow();
+		
+				}
+				break;
+			case TPointerEvent::EDrag:
+				{
+				CCoeControl::HandlePointerEventL(aPointerEvent);
+				//System dispose		
+				iLastPointEventType = ETrue;
+
+				if ((iDisplayTool && iPaths.Count() && !iCustomComponetClick
+						&& !iPointStartInLoopRect) || (!iDisplayTool
+						&& iPaths.Count() && !iCustomComponetClick))
+					{
+					iCanRedo = EFalse;
+					iUndoPaths.ResetAndDestroy();
+					CDrawPath* path = iPaths[iPaths.Count() - 1];
+					// store current position for next round
+					iPointerPosition = aPointerEvent.iPosition;
+					SetPositionOnImage(aPointerEvent.iPosition);
+					path->AddItemL(aPointerEvent.iPosition);
+					}
+				//Self dispose
+				if (iCustomComponetClick)
+					{
+					TPoint con(aPointerEvent.iPosition.iX - 25,
+							aPointerEvent.iPosition.iY - 25);
+					iCustomComponet->SetExtent(con, TSize(50, 50));
+					DrawNow();
+					}
+
+				if (iDisplayTool && iPointStartInLoopRect)
+
+					{
+					HandleMainMenuButtonDrag(point);
+					}
+				}
+				break;
+			default:
+
 				break;
+
+			}
+
+		//System dispose
+		if ((!iPointStartInLoopRect && iDisplayTool) || !iDisplayTool)
+			{
+			if (!(iCustomComponet->Rect().Contains(aPointerEvent.iPosition)))
+				{
+				StoreParameters(lastItem, EFalse);
+				iEditorView->HandleCommandL(EImageEditorCmdRender);//results Draw call
 				}
-						
-			default:
+			}
+		}
+
+	}
+
+// ---------------------------------------------------------------------------
+// HandleMainMenuButtonUp
+// ---------------------------------------------------------------------------
+//
+void CImageEditorDrawControl::HandleMainMenuButtonUp(TPoint aPoint)
+	{
+	if (iMainMenuLayout == EMainMenuHorizontal)
+		{
+		if (iDragIsStart)
+			{
+			//Drag event is end (Except activating animation effect).
+			iDragIsStart = EFalse;
+
+			if (Abs(iDragPrePoint.iX - aPoint.iX) > 1)
+				{
+				//Animation effect is activated
+				iDragIsStart = ETrue;
+				iStartSpeed = aPoint.iX - iDragPrePoint.iX;
+				iAnimationAO->StartL(0);
+				}
+			}
+		}
+	else if (iMainMenuLayout == EMainMenuVertical)
+		{
+		if (iDragIsStart)
+			{
+			//Drag event is end (Except activating animation effect).
+			iDragIsStart = EFalse;
+
+			if (Abs(iDragPrePoint.iY - aPoint.iY) > 1)
+				{
+				//Animation effect is activated
+				iDragIsStart = ETrue;
+				iStartSpeed = aPoint.iY - iDragPrePoint.iY;
+				iAnimationAO->StartL(0);
+				}
+			}
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// HandleMainMenuButtonDrag
+// ---------------------------------------------------------------------------
+//
+void CImageEditorDrawControl::HandleMainMenuButtonDrag(TPoint aPoint)
+	{
+	if (iMainMenuLayout == EMainMenuHorizontal)
+		{
+		if (iPointStartInLoopRect && !iDragIsStart && Abs(aPoint.iX
+				- iButtonDownPoint.iX) >= DRAG_LENGTH)
+			{
+			iDragIsStart = ETrue;
+			iDragStartPoint = aPoint;
+	
+			for (TInt i = 0; i < iTotalComponent; i++)
 				{
-				break;	
-				}	
+				if (iLabels[i]->Rect().Contains(iButtonDownPoint))
+					{
+					iLabels[i]->LabelIsMoving();
+					}
+				}
+			}
+
+		if (iDragIsStart)
+			{
+			iDragPrePoint = iDragUpPoint;
+			iDragUpPoint = aPoint;
+			iDragOffset = aPoint.iX - iDragStartPoint.iX;
+			iDragStartPoint = aPoint;
+			
+			CalculateEffectiveOffset();
+			SizeChanged();
 			}
+		}
+	else if (iMainMenuLayout == EMainMenuVertical)
+		{
+		if (iPointStartInLoopRect && !iDragIsStart && Abs(aPoint.iY
+				- iButtonDownPoint.iY) >= DRAG_LENGTH)
+			{
+			iDragIsStart = ETrue;
+			iDragStartPoint = aPoint;
+		
+			for (TInt i = 0; i < iTotalComponent; i++)
+				{
+				if (iLabels[i]->Rect().Contains(iButtonDownPoint))
+					{
+					iLabels[i]->LabelIsMoving();
+					}
+				}
+			}
+
+		if (iDragIsStart)
+			{
+			iDragPrePoint = iDragUpPoint;
+			iDragUpPoint = aPoint;
+			iDragOffset = aPoint.iY - iDragStartPoint.iY;
+			iDragStartPoint = aPoint;
 			
-    	StoreParameters( lastItem, EFalse ); 
-	    iEditorView->HandleCommandL( EImageEditorCmdRender );//results Draw call
-		CCoeControl::HandlePointerEventL( aPointerEvent );
+			CalculateEffectiveOffset();
+			SizeChanged();
+			}
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// UndoDrawPath
+// ---------------------------------------------------------------------------
+//   
+void CImageEditorDrawControl::UndoDrawPath()
+	{
+	if (iPaths.Count())
+		{
+		iUndoPaths.Append(iPaths[iPaths.Count() - 1]);
+		iPaths.Remove(iPaths.Count() - 1);
+		iCanRedo = ETrue;
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// RedoDrawPath
+// ---------------------------------------------------------------------------
+//
+void CImageEditorDrawControl::RedoDrawPath()
+	{
+	if (iUndoPaths.Count())
+		{
+		iPaths.Append(iUndoPaths[iUndoPaths.Count() - 1]);
+		iUndoPaths.Remove(iUndoPaths.Count() - 1);
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// HandlePointerNotify
+// ---------------------------------------------------------------------------
+//
+void CImageEditorDrawControl::HandlePointerNotify(CCoeControl* aComponent)
+	{
+	//pen size
+	if (iLabels[0] == dynamic_cast<CImageLabel*> (aComponent))
+		{
+		MakeVisibleLable(EFalse);
+		SelectSizeL();
+		MakeVisibleLable(ETrue);
 		}
-    }
+	//pen color
+	else if (iLabels[1] == dynamic_cast<CImageLabel*> (aComponent))
+		{
+		MakeVisibleLable(EFalse);
+		SDrawUtils::LaunchColorSelectionPopupL(iPreview, Rect(), iRgb);
+		MakeVisibleLable(ETrue);
+		}
+	//undo
+	else if (iLabels[2] == dynamic_cast<CImageLabel*> (aComponent))
+		{
+		UndoDrawPath();
+		iUndo = ETrue;
+		StoreParameters(EFalse, EFalse);
+		iEditorView->HandleCommandL(EImageEditorCmdRender);
+		iUndo = EFalse;
+		}
+	//save and quit
+	else if (iLabels[3] == dynamic_cast<CImageLabel*> (aComponent))
+		{
+		iPopupController->HideInfoPopupNote();
+		StoreParameters(EFalse, ETrue);
+		iEditorView->HandleCommandL(EImageEditorApplyPlugin);
+		}
+	else if (iLabels[4] == dynamic_cast<CImageLabel*> (aComponent))
+		{
+		
+		}
+	else if (iLabels[5] == dynamic_cast<CImageLabel*> (aComponent))
+		{
+		iRedo = ETrue;
+		RedoDrawPath();
+		StoreParameters(EFalse, EFalse);
+		iEditorView->HandleCommandL(EImageEditorCmdRender);
+		iRedo = EFalse;
+		}
+	else if (iLabels[6] == dynamic_cast<CImageLabel*> (aComponent))
+		{
+
+		}
+	else if (iCustomComponet == dynamic_cast<CCustomerComponet*> (aComponent))
+		{
+		if (iCustomComponet->GetButtonType())
+			{
+			iCustomComponetClick = ETrue;
+			}
+		
+		if ((!iCustomComponet->GetButtonType()) && (!iLastPointEventType))
+			{
+			StartTheAnimation();
+
+			}
+		}
+
+	}
 
 // ---------------------------------------------------------------------------
 // SetPositionOnImage
 // ---------------------------------------------------------------------------
 //    
-void CImageEditorDrawControl::SetPositionOnImage( TPoint aPointedPosition )
-    {    
-    ASSERT( iSysPars );
-    // Get system parameters
-   	TRect visibleImageRect( iSysPars->VisibleImageRect() );
-   	TRect visibleImageRectPrev( iSysPars->VisibleImageRectPrev() );
+void CImageEditorDrawControl::SetPositionOnImage(TPoint aPointedPosition)
+	{
+	ASSERT(iSysPars);
+	// Get system parameters
+	TRect visibleImageRect(iSysPars->VisibleImageRect());
+	TRect visibleImageRectPrev(iSysPars->VisibleImageRectPrev());
+
+	TInt xPosFactorDivider(visibleImageRectPrev.Width());
+	TInt yPosFactorDivider(visibleImageRectPrev.Height());
+
+	LOGFMT2(KDrawPluginLogFile, "CImageEditorDrawControl::vir w:%d h:%d",
+			visibleImageRect.Width(), visibleImageRect.Height());
+	LOGFMT2(KDrawPluginLogFile, "CImageEditorDrawControl::virp w:%d h:%d",
+			visibleImageRectPrev.Width(), visibleImageRectPrev.Height());
 
-   	TInt xPosFactorDivider( visibleImageRectPrev.Width() );
-   	TInt yPosFactorDivider( visibleImageRectPrev.Height() );
-    
-   	LOGFMT2(KDrawPluginLogFile, "CImageEditorDrawControl::vir w:%d h:%d", 
-   	        visibleImageRect.Width(), visibleImageRect.Height());
-    LOGFMT2(KDrawPluginLogFile, "CImageEditorDrawControl::virp w:%d h:%d", 
-            visibleImageRectPrev.Width(), visibleImageRectPrev.Height());
-   	   	
-   	// Dividing by zero will cause panic -> check
-   	if ( xPosFactorDivider == 0 || yPosFactorDivider == 0 )
-   	    {
-   	    //	Set default position
-    	iX = (visibleImageRect.iTl.iX + visibleImageRect.iBr.iX) / 2;
-    	iY = (visibleImageRect.iTl.iY + visibleImageRect.iBr.iY) / 2;
-   	    }
-   	else
-   	    {
-   	    // Calculate relative position on the screen
-   	    TReal xPositionFactor 
-   	             ( TReal( aPointedPosition.iX - visibleImageRectPrev.iTl.iX ) /
-	             xPosFactorDivider );
-	                        
-    	TReal yPositionFactor 
-    	         ( TReal( aPointedPosition.iY - visibleImageRectPrev.iTl.iY ) /
-		         yPosFactorDivider );
-        LOGFMT2(KDrawPluginLogFile, "CImageEditorDrawControl::pfx:%g pfy:%g", 
-                xPositionFactor, yPositionFactor);		
+	// Dividing by zero will cause panic -> check
+	if (xPosFactorDivider == 0 || yPosFactorDivider == 0)
+		{
+		//	Set default position
+		iX = (visibleImageRect.iTl.iX + visibleImageRect.iBr.iX) / 2;
+		iY = (visibleImageRect.iTl.iY + visibleImageRect.iBr.iY) / 2;
+		}
+	else
+		{
+		// Calculate relative position on the screen
+		TReal xPositionFactor(TReal(aPointedPosition.iX
+				- visibleImageRectPrev.iTl.iX) / xPosFactorDivider);
+		//
+		//		TReal yPositionFactor(TReal(aPointedPosition.iY - iStatuspaneHeight
+		//				- visibleImageRectPrev.iTl.iY) / yPosFactorDivider);
+		TReal yPositionFactor(TReal(aPointedPosition.iY
+				- visibleImageRectPrev.iTl.iY) / yPosFactorDivider);
+		LOGFMT2(KDrawPluginLogFile, "CImageEditorDrawControl::pfx:%g pfy:%g",
+				xPositionFactor, yPositionFactor);
 		// Calculate position on visible image		
 
-   	    iX = visibleImageRect.iTl.iX + 
-   	        visibleImageRect.Width() * xPositionFactor + 0.5;	    
-    	
-    	iY = visibleImageRect.iTl.iY + 
-    	    visibleImageRect.Height() * yPositionFactor + 0.5;    	
-   	    }    
+		iX = visibleImageRect.iTl.iX + visibleImageRect.Width()
+				* xPositionFactor + 0.5;
+
+		iY = visibleImageRect.iTl.iY + visibleImageRect.Height()
+				* yPositionFactor + 0.5;
+		}
 
-    LOGFMT4(KDrawPluginLogFile, "CImageEditorDrawControl::Draw x:%d iX:%d y:%d iY:%d", 
-            aPointedPosition.iX, iX, aPointedPosition.iY, iY);
+	LOGFMT4(KDrawPluginLogFile,
+			"CImageEditorDrawControl::Draw x:%d iX:%d y:%d iY:%d",
+			aPointedPosition.iX, iX, aPointedPosition.iY, iY);
 	// Check that not out of bounds    
-    //ClipPosition();          
-    }
-    
+	//ClipPosition();          
+	}
+
 // ---------------------------------------------------------------------------
 // GetPositionOnView
 // ---------------------------------------------------------------------------
 // 
 TPoint CImageEditorDrawControl::GetPositionOnView()
-    {
-    ASSERT( iSysPars );
-    // Get system parameters 
-    TRect visibleImageRect( iSysPars->VisibleImageRect() );
-    TRect visibleImageRectPrev( iSysPars->VisibleImageRectPrev() );
+	{
+	ASSERT(iSysPars);
+	// Get system parameters 
+	TRect visibleImageRect(iSysPars->VisibleImageRect());
+	TRect visibleImageRectPrev(iSysPars->VisibleImageRectPrev());
 
-    TInt xPosFactorDivider( visibleImageRectPrev.Width() );
-    TInt yPosFactorDivider( visibleImageRectPrev.Height() );
-    
-    // Calculate relative position on the screen
-    TReal xPositionFactor( TReal( iX + visibleImageRectPrev.iTl.iX ) /
-             xPosFactorDivider );
-                        
-    TReal yPositionFactor( TReal( iY + visibleImageRectPrev.iTl.iY ) /
-             yPosFactorDivider );    
+	TInt xPosFactorDivider(visibleImageRectPrev.Width());
+	TInt yPosFactorDivider(visibleImageRectPrev.Height());
+
+	// Calculate relative position on the screen
+	TReal xPositionFactor(TReal(iX + visibleImageRectPrev.iTl.iX)
+			/ xPosFactorDivider);
+
+	TReal yPositionFactor(TReal(iY + visibleImageRectPrev.iTl.iY)
+			/ yPosFactorDivider);
 
-    LOGFMT2(KDrawPluginLogFile, 
-            "CImageEditorDrawControl::GetPositionOnView xf:%g yf:%g", 
-            xPositionFactor , yPositionFactor );    
-    
-    LOGFMT2(KDrawPluginLogFile, 
-            "CImageEditorDrawControl::GetPositionOnView xf:%d yf:%d", 
-            xPosFactorDivider , yPosFactorDivider );     
-    
-    LOGFMT2(KDrawPluginLogFile, 
-            "CImageEditorDrawControl::GetPositionOnView w:%d h:%d", 
-            iX , iY );  
-    
-    TInt xPosition(iX + visibleImageRectPrev.iTl.iX);
-    TInt yPosition(iY + visibleImageRectPrev.iTl.iY);  
-    
-    LOGFMT3(KDrawPluginLogFile, 
-            "CImageEditorDrawControl::GetPositionOnView w:%d h:%d S:%g", 
-            xPosition, yPosition, iSysPars->RelScale());  
-    
-    return TPoint(xPosition, yPosition);
-    }
+	LOGFMT2(KDrawPluginLogFile,
+			"CImageEditorDrawControl::GetPositionOnView xf:%g yf:%g",
+			xPositionFactor, yPositionFactor);
+
+	LOGFMT2(KDrawPluginLogFile,
+			"CImageEditorDrawControl::GetPositionOnView xf:%d yf:%d",
+			xPosFactorDivider, yPosFactorDivider);
+
+	LOGFMT2(KDrawPluginLogFile,
+			"CImageEditorDrawControl::GetPositionOnView w:%d h:%d", iX, iY);
+
+	TInt xPosition(iX + visibleImageRectPrev.iTl.iX);
+	TInt yPosition(iY + visibleImageRectPrev.iTl.iY);
+
+	LOGFMT3(KDrawPluginLogFile,
+			"CImageEditorDrawControl::GetPositionOnView w:%d h:%d S:%g",
+			xPosition, yPosition, iSysPars->RelScale());
+
+	return TPoint(xPosition, yPosition);
+	}
 
 // ---------------------------------------------------------------------------
 // ShowTooltip
 // ---------------------------------------------------------------------------
 //    
 void CImageEditorDrawControl::ShowTooltip()
-    {   
-    iPopupController->HideInfoPopupNote();
+	{
+	iPopupController->HideInfoPopupNote();
 
-    TPoint iconPosition = ComputeIndicatorPosition();
-    TRect iconRect( iconPosition.iX, iconPosition.iY, 
-                    iconPosition.iX, iconPosition.iY );
+	TPoint iconPosition = ComputeIndicatorPosition();
+	TRect iconRect(iconPosition.iX, iconPosition.iY, iconPosition.iX,
+			iconPosition.iY);
 
-                              
-    /*SDrawUtils::ShowToolTip( iPopupController,
-                             this,
-                             iconPosition,
-                             EHRightVTop, 
-                             *iTooltipResize );                                 
-    */
-    
-    }
+	/*SDrawUtils::ShowToolTip( iPopupController,
+	 this,
+	 iconPosition,
+	 EHRightVTop, 
+	 *iTooltipResize );                                 
+	 */
+
+	}
 
 // ---------------------------------------------------------------------------
 // ScaledLineSize
 // ---------------------------------------------------------------------------
 //    
-TSize CImageEditorDrawControl::ScaledLineSize( TSize aOriginalSize ) const 
-    {
-    TInt sizew(aOriginalSize.iWidth * iSysPars->RelScale() + 0.5);
-    TInt sizeh(aOriginalSize.iHeight * iSysPars->RelScale() + 0.5);
-    if( sizew < 1 )
-        {
-        sizew++;
-        }
-    if( sizeh < 1 )
-        {
-        sizeh++;
-        }
+TSize CImageEditorDrawControl::ScaledLineSize(TSize aOriginalSize) const
+	{
+	TInt sizew(aOriginalSize.iWidth * iSysPars->RelScale() + 0.5);
+	TInt sizeh(aOriginalSize.iHeight * iSysPars->RelScale() + 0.5);
+	if (sizew < 1)
+		{
+		sizew++;
+		}
+	if (sizeh < 1)
+		{
+		sizeh++;
+		}
+
+	LOGFMT3(KDrawPluginLogFile,
+			"CImageEditorDrawControl::ScaledLineSize w:%d h:%d S:%g", sizew,
+			sizeh, iSysPars->RelScale());
+	return TSize(sizew, sizeh);
+	}
+
+// ---------------------------------------------------------------------------
+// CountComponentControls
+// ---------------------------------------------------------------------------
+//  
+TInt CImageEditorDrawControl::CountComponentControls() const
+	{
+	return iTotalComponent + 1;
+	}
+
+// ---------------------------------------------------------------------------
+// ComponentControl
+// ---------------------------------------------------------------------------
+//  
+CCoeControl* CImageEditorDrawControl::ComponentControl(TInt aIndex) const
+	{
+	switch (aIndex)
+		{
+		case 7:
+			return iCustomComponet;
+		case 0:
+			return iLabels[0];
+		case 1:
+			return iLabels[1];
+		case 2:
+			return iLabels[2];
+		case 3:
+			return iLabels[3];
+		case 4:
+			return iLabels[4];
+		case 5:
+			return iLabels[5];
+		case 6:
+			return iLabels[6];
+		default:
+			return NULL;
+		}
+	return NULL;
+	}
+
+// ---------------------------------------------------------------------------
+// Notify
+// ---------------------------------------------------------------------------
+//  
+void CImageEditorDrawControl::Notify()
+	{
+	if (iStartSpeed > 0)
+		{
+		iStartSpeed -= 2;
+		if (iStartSpeed <= 0)
+			{
+			iStartSpeed = 0;
+			iDragIsStart = EFalse;
+			iAnimationAO->Cancel();
+			}
+		}
+	else if (iStartSpeed < 0)
+		{
+		iStartSpeed += 2;
+		if (iStartSpeed >= 0)
+			{
+			iStartSpeed = 0;
+			iDragIsStart = EFalse;
+			iAnimationAO->Cancel();
+			}
+		}
+	else
+		{
+		iDragIsStart = EFalse;
+		iAnimationAO->Cancel();
+		}
+
+	iDragOffset += iStartSpeed;
+	CalculateEffectiveOffset();
+	SizeChanged();
+	}
+
+// ---------------------------------------------------------------------------
+// Roll 
+// ---------------------------------------------------------------------------
+//  
+void CImageEditorDrawControl::Roll()
+	{
+	SetToolBarStatus();
+	//TInt leftX = iLabels[0]->Rect().iTl.iX;
+	//TInt rightX = iLabels[iTotalComponent - 1]->Rect().iBr.iX;
+	TInt offset = 0;
+	iRollflag = ETrue;
+	if (iDisplayTool)
+		iRollDirection = EFalse;
+	else
+		iRollDirection = ETrue;
+
 
-    LOGFMT3(KDrawPluginLogFile, 
-            "CImageEditorDrawControl::ScaledLineSize w:%d h:%d S:%g", 
-            sizew, sizeh, iSysPars->RelScale());    
-    return TSize(sizew , sizeh);
-    }
-        
+	if (iRollDirection)
+		{
+		offset = 4;
+		}
+	else
+		{
+		offset = -4;
+		}
+	
+	if (iMainMenuLayout == EMainMenuHorizontal)
+		{
+		for (TInt i = 0; i < iLabels.Count(); i++)
+			{
+			TInt x = iLabels[i]->Rect().iTl.iX;
+			iLabels[i]->SetPosition(TPoint(x + offset, iLoopMenuRect.iTl.iY));
+			iLabels[i]->ResetControl();
+			}
+		if (iLabels[0]->Rect().iTl.iX == 0
+				|| iLabels[iLabels.Count() - 1]->Rect().iBr.iX == 0)
+			iRollflag = EFalse;
+		}
+	else if (iMainMenuLayout == EMainMenuVertical)
+		{
+		for (TInt i = 0; i < iLabels.Count(); i++)
+			{
+			TInt y = iLabels[i]->Rect().iTl.iY;
+			iLabels[i]->SetPosition(TPoint(iLoopMenuRect.iTl.iX, y + offset));
+			iLabels[i]->ResetControl();
+			}
+		if (iLabels[0]->Rect().iTl.iY == 0
+				|| iLabels[iLabels.Count() - 1]->Rect().iBr.iY == 0)
+			iRollflag = EFalse;
+		}
+	
+	DrawNow();
+	
+	if (!iRollflag)
+		{
+		//iRollDirection = !iRollDirection;
+		iRollAo->Cancel();
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// CalculateEffectiveOffset
+// ---------------------------------------------------------------------------
+//  
+void CImageEditorDrawControl::CalculateEffectiveOffset()
+	{
+	if (iMainMenuLayout == EMainMenuHorizontal)
+		{
+		TInt leftX = iLabels[0]->Rect().iTl.iX;
+		TInt rightX = iLabels[iTotalComponent - 1]->Rect().iBr.iX;
+		TInt offset = iDragOffset;
+		if (leftX + offset > 0)
+			{
+			iDragOffset = Abs(leftX);
+			}
+
+		if (rightX + offset < 360)
+			{
+			iDragOffset = -(rightX - 360);
+			}
+		}
+	else if (iMainMenuLayout == EMainMenuVertical)
+		{
+		TInt topY = iLabels[0]->Rect().iTl.iY;
+		TInt bottomY = iLabels[iTotalComponent - 1]->Rect().iBr.iY;
+		TInt offset = iDragOffset;
+		if (topY + offset > 0)
+			{
+			iDragOffset = Abs(topY);
+			}
+
+		if (bottomY + offset < 360)
+			{
+			iDragOffset = -(bottomY - 360);
+			}
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// MakeVisibleLable
+// ---------------------------------------------------------------------------
+//  
+void CImageEditorDrawControl::MakeVisibleLable(TBool aFlag)
+	{
+	if (aFlag)
+		{
+		for (int i = 0; i < iTotalComponent; i++)
+			{
+			iLabels[i]->MakeVisible(ETrue);
+			}
+		}
+	else
+		{
+		for (int i = 0; i < iTotalComponent; i++)
+			{
+			iLabels[i]->MakeVisible(EFalse);
+			}
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// StartTheAnimation
+// ---------------------------------------------------------------------------
+//  
+void CImageEditorDrawControl::StartTheAnimation()
+	{
+	iRollAo->StartL(0);
+	}
+
 // End of File
--- a/imageeditor/plugins/DrawPlugin/src/imageeditordrawplugin.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/plugins/DrawPlugin/src/imageeditordrawplugin.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -1,39 +1,35 @@
 /*
-* Copyright (c) 2010 Ixonos Plc.
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - Initial contribution
-*
-* Contributors:
-* Ixonos Plc
-*
-* Description: 
-* Freehand draw UI plugin that sends UI commands to 
-* corresponding filter plugin. (filterdraw.dll).
-*
-*/
-
-
+ * Copyright (c) 2010 Ixonos Plc.
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - Initial contribution
+ *
+ * Contributors:
+ * Ixonos Plc
+ *
+ * Description: 
+ * Freehand draw UI plugin that sends UI commands to 
+ * corresponding filter plugin. (filterdraw.dll).
+ *
+ */
 #include "ImageEditordrawPlugin.h"
 #include "ImageEditordrawControl.h"
 #include "ImageEditorPluginBaseDefs.h"
 #include "DrawUtils.h"
 #include "SystemParameters.h"
-
+#include "drawpath.h"
 #ifdef TEXT_INSERTION_IN_PORTRAIT_ONLY
 #include <aknappui.h>
 #endif
 #include <aknquerydialog.h> 
-
 //	CONSTANTS
 _LIT (KPgnResourceFile, "draw.rsc");
 
-
 // ---------------------------------------------------------------------------
 // CreateImageEditorPlugin
 // ---------------------------------------------------------------------------
@@ -44,15 +40,17 @@
 	CleanupStack::PushL(plugin);
 	plugin->ConstructL();
 	CleanupStack::Pop(); // plugin
-    return plugin;
+	return plugin;
 	}
 
 // ---------------------------------------------------------------------------
 // CImageEditorDrawPlugin
 // ---------------------------------------------------------------------------
 //
-CImageEditorDrawPlugin::CImageEditorDrawPlugin() : iLandscapeEnabled(EFalse)
-	{}
+CImageEditorDrawPlugin::CImageEditorDrawPlugin() :
+	iLandscapeEnabled(EFalse)
+	{
+	}
 
 // ---------------------------------------------------------------------------
 // ConstructL
@@ -60,7 +58,9 @@
 //
 inline void CImageEditorDrawPlugin::ConstructL()
 	{
-    CImageEditorPluginBase::ConstructL(KPgnResourcePath, KPgnResourceFile);
+	CImageEditorPluginBase::ConstructL(KPgnResourcePath, KPgnResourceFile);
+	iRgb = KRgbWhite;
+	iSize = TSize(8, 8);
 	}
 
 // ---------------------------------------------------------------------------
@@ -69,62 +69,62 @@
 //
 CImageEditorDrawPlugin::~CImageEditorDrawPlugin()
 	{
-    ReleasePlugin();
-    iSysPars = NULL;
+	ReleasePlugin();
+	iSysPars = NULL;
+	iPaths.ResetAndDestroy();
 	}
 
 // ---------------------------------------------------------------------------
 // SetProperty
 // ---------------------------------------------------------------------------
 //
-TInt CImageEditorDrawPlugin::SetProperty(
-	TInt aPropertyId, TDesC& aPropertyValue)
+TInt CImageEditorDrawPlugin::SetProperty(TInt aPropertyId,
+		TDesC& aPropertyValue)
 	{
-    TInt err(KErrNone);
-    TLex parser;
+	TInt err(KErrNone);
+	TLex parser;
 
 	//	Copy data
-	switch (aPropertyId) 
+	switch (aPropertyId)
 		{
 		case KCapSystemParameters:
 			{
-			parser.Assign (aPropertyValue);
-            TInt tempval = 0;
-            parser.Val (tempval);
-            iSysPars = (const CSystemParameters *)tempval;
+			parser.Assign(aPropertyValue);
+			TInt tempval = 0;
+			parser.Val(tempval);
+			iSysPars = (const CSystemParameters *) tempval;
 			err = KErrNone;
-            break;
+			break;
 			}
 		default:
 			{
-			err = CImageEditorPluginBase::SetProperty(
-				aPropertyId, aPropertyValue);
-            break;
+			err = CImageEditorPluginBase::SetProperty(aPropertyId,
+					aPropertyValue);
+			break;
 			}
 		}
-    return err;
+	return err;
 	}
 
 // ---------------------------------------------------------------------------
 // GetProperty
 // ---------------------------------------------------------------------------
 //
-TInt CImageEditorDrawPlugin::GetProperty(
-	TInt aPropertyId, TDes& aPropertyValue)
+TInt CImageEditorDrawPlugin::GetProperty(TInt aPropertyId, TDes& aPropertyValue)
 	{
 	//	Clean buffer
 	aPropertyValue.Zero();
 
 	//	Copy data
-	switch (aPropertyId) 
+	switch (aPropertyId)
 		{
 		case KCapParamStruct:
 			{
 			// Control found
 			if (iControl)
 				{
-				aPropertyValue.Copy( 
-					((CImageEditorDrawControl *)iControl)->GetParam() );
+				aPropertyValue.Copy(
+						((CImageEditorDrawControl *) iControl)->GetParam());
 				return KErrNone;
 				}
 
@@ -134,31 +134,31 @@
 				return KErrNotReady;
 				}
 			}
-        case KCapReadyToRender:
+		case KCapReadyToRender:
 			{
-            TBool readytorender = ETrue;
-            if (iControl)
-                {
-                readytorender = 
-                	((CImageEditorDrawControl *)iControl)->IsReadyToRender();
-                }
-			aPropertyValue.AppendNum ((TInt)readytorender);
+			TBool readytorender = ETrue;
+			if (iControl)
+				{
+				readytorender
+						= ((CImageEditorDrawControl *) iControl)->IsReadyToRender();
+				}
+			aPropertyValue.AppendNum((TInt) readytorender);
 			return KErrNone;
 			}
-        case KCapIsLandscapeEnabled:
+		case KCapIsLandscapeEnabled:
 			{
-			aPropertyValue.AppendNum ((TInt)iLandscapeEnabled);
+			aPropertyValue.AppendNum((TInt) iLandscapeEnabled);
 			return KErrNone;
 			}
-        case KCapIsSlowPlugin:
+		case KCapIsSlowPlugin:
 			{
-			aPropertyValue.AppendNum ((TInt)ETrue);
+			aPropertyValue.AppendNum((TInt) ETrue);
 			return KErrNone;
 			}
 		default:
 			{
-			return CImageEditorPluginBase::GetProperty(
-				aPropertyId, aPropertyValue);
+			return CImageEditorPluginBase::GetProperty(aPropertyId,
+					aPropertyValue);
 			}
 		}
 	}
@@ -167,45 +167,46 @@
 // InitPluginL
 // ---------------------------------------------------------------------------
 //
-TInt CImageEditorDrawPlugin::InitPluginL(
-	const TRect& aRect,
-	CCoeControl* aParent,
-	CCoeControl*& aPluginControl)
+TInt CImageEditorDrawPlugin::InitPluginL(const TRect& aRect,
+		CCoeControl* aParent, CCoeControl*& aPluginControl)
 	{
-    //  Delete previous control
+	//  Delete previous control
 	ReleasePlugin();
 
 	//	Get pointer to the parameter descriptor array
-	TBuf<256>  readbuf;  
-	TLex       parser;
-	User::LeaveIfError( CImageEditorPluginBase::GetProperty(
-		KCapPluginParamNames, readbuf) );
-	parser.Assign (readbuf);
+	TBuf<256> readbuf;
+	TLex parser;
+	User::LeaveIfError(CImageEditorPluginBase::GetProperty(
+			KCapPluginParamNames, readbuf));
+	parser.Assign(readbuf);
 	TInt tempval = 0;
-	parser.Val( tempval );
+	parser.Val(tempval);
 	//CDesCArray * pars = (CDesCArray *)tempval;
 
 #ifdef TEXT_INSERTION_IN_PORTRAIT_ONLY
-    // Text input is always insterted in portrait mode.
+	// Text input is always insterted in portrait mode.
 	// Store the original orientation before forcing to portrait.
-    CAknAppUiBase* appUi = static_cast<CAknAppUiBase *>( 
-    	CEikonEnv::Static()->EikAppUi() );
-	CAknAppUiBase::TAppUiOrientation originalOrientation = 
-		appUi->Orientation();
-    appUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationPortrait);
+	CAknAppUiBase* appUi = static_cast<CAknAppUiBase *>(
+			CEikonEnv::Static()->EikAppUi() );
+	CAknAppUiBase::TAppUiOrientation originalOrientation =
+	appUi->Orientation();
+	appUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationPortrait);
 #endif
 
-    iControl = CImageEditorDrawControl::NewL (aRect, aParent);
-    aPluginControl = iControl;
-    
-    //  Set system parameters
-    ((CImageEditorDrawControl*)iControl)->SetSystemParameters (iSysPars);
+	CalculatePositionOnView();
+
+	iControl = CImageEditorDrawControl::NewL(aRect, aParent, iPaths, iRgb, iSize,iDiplayToolPluginParam);
+	aPluginControl = iControl;
 
-    iLandscapeEnabled = ETrue;
-    
+	//  Set system parameters
+	((CImageEditorDrawControl*) iControl)->SetSystemParameters(iSysPars);
+
+	iVisibleImageRectPrevFirst = iSysPars->VisibleImageRectPrev();
+
+	iLandscapeEnabled = ETrue;
 
 #ifdef TEXT_INSERTION_IN_PORTRAIT_ONLY
-    // Set always back to original orientation, even if leaves
+	// Set always back to original orientation, even if leaves
 	CAknAppUiBase::TAppUiOrientation orientation = appUi->Orientation();
 
 	if (orientation != originalOrientation)
@@ -217,8 +218,8 @@
 
 		RWsSession& rws = CEikonEnv::Static()->WsSession();
 		event.SetType( EEventScreenDeviceChanged );
-		event.SetTimeNow(); 
-		event.SetHandle( rws.WsHandle() ); 
+		event.SetTimeNow();
+		event.SetHandle( rws.WsHandle() );
 
 		User::LeaveIfError( rws.SendEventToAllWindowGroups(event) );
 		}
@@ -232,22 +233,22 @@
 
 	RWsSession& rws = CEikonEnv::Static()->WsSession();
 	event.SetType( EEventScreenDeviceChanged );
-	event.SetTimeNow(); 
-	event.SetHandle( rws.WsHandle() ); 
+	event.SetTimeNow();
+	event.SetHandle( rws.WsHandle() );
 
 	User::LeaveIfError( rws.SendEventToAllWindowGroups(event) );
-	
+
 #endif
 #endif
 
-    return KErrNone;
+	return KErrNone;
 	}
 
 // ---------------------------------------------------------------------------
 // ProcessImageL
 // ---------------------------------------------------------------------------
 //
-void CImageEditorDrawPlugin::ProcessImageL(CEditorImage * /*aImage*/ )
+void CImageEditorDrawPlugin::ProcessImageL(CEditorImage * /*aImage*/)
 	{
 	}
 
@@ -260,5 +261,55 @@
 	delete iControl;
 	iControl = NULL;
 	}
+// ---------------------------------------------------------------------------
+// CalculatePositionOnView
+// ---------------------------------------------------------------------------
+//
+void CImageEditorDrawPlugin::CalculatePositionOnView()
+	{
+	if (iPaths.Count() > 0)
+		{
+		// new image rect on preview
+		TRect rectPrevLast = iSysPars->VisibleImageRectPrev(); 
+		//real image rect
+		TRect rectReal = iSysPars->VisibleImageRect();  
+		//the old position of old image rect
+		TInt xPositionPrevFirst = iVisibleImageRectPrevFirst.iTl.iX; 
+		TInt yPositionPrevFirst = iVisibleImageRectPrevFirst.iTl.iY;
+		//the old width and height of old image rect
+		TInt xPosFactorDivider = iVisibleImageRectPrevFirst.Width();
+		TInt yPosFactorDivider = iVisibleImageRectPrevFirst.Height();
+
+		for (TInt i(0); i < iPaths.Count(); ++i)
+			{
+			CDrawPath* path = iPaths[i];
+			CArrayFix<TPoint>* pathPoints = path->ItemArray();
+			if (pathPoints && (pathPoints->Count() > 0))
+				{
+				for (TInt i(0); i < pathPoints->Count(); ++i)
+					{
+					//the old absolute point on screen 
+					TPoint & point = (*pathPoints)[i];
+					//the relative position on old image rect
+					TInt xPositionCompareFirst = point.iX - xPositionPrevFirst;
+					TInt yPositionCompareFirst = point.iY - yPositionPrevFirst;
+					//the relative position on new image rect
+					TReal xPositionCompareLast = TReal(rectPrevLast.Width()
+							* xPositionCompareFirst)
+							/ iVisibleImageRectPrevFirst.Width();
+					TReal yPositionCompareLast = TReal(rectPrevLast.Height()
+							* yPositionCompareFirst)
+							/ iVisibleImageRectPrevFirst.Height();
+					//the new absolute position on screen
+					TInt xPositionOnView = rectPrevLast.iTl.iX
+							+ xPositionCompareLast;
+					TInt yPositionOnView = rectPrevLast.iTl.iY
+							+ yPositionCompareLast;
+					point.SetXY(xPositionOnView, yPositionOnView);
+					}
+				}
+			}
+		}
+	}
 
 // End of File
--- a/imageeditor/plugins/DrawPlugin/src/selectionpopup.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/plugins/DrawPlugin/src/selectionpopup.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -1,792 +1,799 @@
-/*
-* Copyright (c) 2010 Ixonos Plc.
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - Initial contribution
-*
-* Contributors:
-* Ixonos Plc
-*
-* Description: 
-* Selection popup dialog.
-*
-*/
-
-
-// INCLUDES
-
-#include <avkon.hrh>
-#include <AknLayoutScalable_Avkon.cdl.h>
-#include <AknLayoutScalable_Apps.cdl.h>
-#include <fbs.h>
-#include <AknIconUtils.h> 
-#include <AknUtils.h> 
-
-#include <AknBidiTextUtils.h>
-#include <BidiText.h> 
-
-#include <ImageEditorUi.mbg>
-#include <ImageEditorUI.rsg>
-#include <draw.rsg>
-
-#include "ResolutionUtil.h"
-#include "selectionpopup.h"
-#include "ImageEditorUiDefs.h"
-
-// CONSTANTS
-const TInt KGridColumnCount = 5;
-const TInt KGridRowCount = 1;
-
-
-//=============================================================================
-CSelectionPopup::CSelectionPopup()
-    {    
-    // Set values into an array
-    iItemArray.Append( 4 );
-    iItemArray.Append( 8 );
-    iItemArray.Append( 16 );
-    iItemArray.Append( 32 );
-    iItemArray.Append( 64 );
-    }
-
-//=============================================================================
-CSelectionPopup::~CSelectionPopup()
-    {
-    delete iPopupCenter;
-    delete iPopupCenterMask;
-    delete iPopupCornerTL;
-    delete iPopupCornerTLMask;
-    delete iPopupCornerTR;
-    delete iPopupCornerTRMask;
-    delete iPopupCornerBL;
-    delete iPopupCornerBLMask;
-    delete iPopupCornerBR;
-    delete iPopupCornerBRMask;
-    delete iPopupSideL;
-    delete iPopupSideLMask;
-    delete iPopupSideR;
-    delete iPopupSideRMask;
-    delete iPopupSideT;
-    delete iPopupSideTMask;
-    delete iPopupSideB;
-    delete iPopupSideBMask;     
-           
-    iHighlightRectsArray.Close();
-    iGridRectsArray.Close();
-    iColorBitmapsArray.ResetAndDestroy();
-    iItemArray.Close();
-    }
-
-//=============================================================================
-void CSelectionPopup::ConstructL (	CCoeControl* aParent )
-    {
-	// Set parent
-	SetContainerWindowL( *aParent );  
-    TFileName iconFile( KImageEditorUiMifFile );
-    
-    // Create trans popup window graphics
-    // Center
-    AknIconUtils::CreateIconL( iPopupCenter, iPopupCenterMask, iconFile, 
-            EMbmImageeditoruiQgn_graf_popup_trans_center, 
-			EMbmImageeditoruiQgn_graf_popup_trans_center_mask );
-	
-	// Top-left corner
-    AknIconUtils::CreateIconL( iPopupCornerTL, iPopupCornerTLMask, iconFile, 
-            EMbmImageeditoruiQgn_graf_popup_trans_corner_tl, 
-			EMbmImageeditoruiQgn_graf_popup_trans_corner_tl_mask );		
-    
-    // Top-right corner
-    AknIconUtils::CreateIconL( iPopupCornerTR, iPopupCornerTRMask, iconFile, 
-            EMbmImageeditoruiQgn_graf_popup_trans_corner_tr, 
-			EMbmImageeditoruiQgn_graf_popup_trans_corner_tr_mask );
-    
-    // Bottom-left corner
-    AknIconUtils::CreateIconL( iPopupCornerBL, iPopupCornerBLMask, iconFile, 
-            EMbmImageeditoruiQgn_graf_popup_trans_corner_bl, 
-			EMbmImageeditoruiQgn_graf_popup_trans_corner_bl_mask );
-			
-	// Bottom-right corner
-    AknIconUtils::CreateIconL( iPopupCornerBR, iPopupCornerBRMask, iconFile, 
-            EMbmImageeditoruiQgn_graf_popup_trans_corner_br, 
-			EMbmImageeditoruiQgn_graf_popup_trans_corner_br_mask );
-    
-    // left side
-    AknIconUtils::CreateIconL( iPopupSideL, iPopupSideLMask, iconFile, 
-            EMbmImageeditoruiQgn_graf_popup_trans_side_l, 
-			EMbmImageeditoruiQgn_graf_popup_trans_side_l_mask );
-			
-	// left side
-    AknIconUtils::CreateIconL( iPopupSideR, iPopupSideRMask, iconFile, 
-            EMbmImageeditoruiQgn_graf_popup_trans_side_r, 
-			EMbmImageeditoruiQgn_graf_popup_trans_side_r_mask );
-	
-	// top side
-    AknIconUtils::CreateIconL( iPopupSideT, iPopupSideTMask, iconFile, 
-            EMbmImageeditoruiQgn_graf_popup_trans_side_t, 
-			EMbmImageeditoruiQgn_graf_popup_trans_side_t_mask );
-	
-	// bottom side
-    AknIconUtils::CreateIconL( iPopupSideB, iPopupSideBMask, iconFile, 
-            EMbmImageeditoruiQgn_graf_popup_trans_side_b, 
-			EMbmImageeditoruiQgn_graf_popup_trans_side_b_mask );						                                   
-                        					
-	//	Activate control
-    ActivateL();
-    
-    }
-
-//=============================================================================
-void CSelectionPopup::CreateColorBitmapsL( TSize aSize )
-    {    
-    // Generate color bitmaps    
-    iColorBitmapsArray.Reset();    
-    for( TInt i = 0; i < iItemArray.Count(); i++ )
-        {
-        CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap;
-        CleanupStack::PushL( bitmap );
-        User::LeaveIfError ( bitmap->Create ( aSize, EColor64K ) );
-
-        //  Compute color for bitmap
-        TRgb color( KRgbBlack );//iRGBArray[i] );		
-         
-    	//	Fill the bitmap with the correct color
-    	TUint16 color_64k = ( TUint16 )
-    		(0 | 
-    		((( TUint8 )color.Red() >> 3) << 11) | 
-    		((( TUint8 )color.Green() >> 2) << 5) | 
-    		(( TUint8 )color.Blue() >> 3));
-
-        bitmap->LockHeapLC();
-    	TUint16 * pd = (TUint16 *)bitmap->DataAddress();
-    	TSize size = bitmap->SizeInPixels();
-    	TInt w = (bitmap->ScanLineLength(size.iWidth, EColor64K) >> 1) 
-    	                                                * size.iHeight;
-    	for( TInt k = w; k != 0; --k)
-    	    {
-    		*pd++ = color_64k;
-    	    }
-    	
-    	iColorBitmapsArray.Append( bitmap );
-    	
-        CleanupStack::PopAndDestroy(); // LockHeapLC()
-        CleanupStack::Pop(); // bitmap
-                
-        }    
-    
-    }
-    
-//=============================================================================
-void CSelectionPopup::Draw( const TRect& /*aRect*/ ) const
-    {
-    const TRgb KHighlightCenterColor (229, 229, 229);
-    
-    CWindowGc& gc = SystemGc();
-    
-    CPreviewControlBase::DrawPreviewImage (Rect());
-    
-    // Change brush to null to enable transparent drawing
-    gc.SetBrushStyle (CGraphicsContext::ENullBrush);
-                
-    // draw center of the borders
-    gc.BitBltMasked( iPopupCenterRect.iTl, iPopupCenter, 
-                     iPopupCenterRect.Size(), iPopupCenterMask, EFalse );    
-    // draw Top left corner
-	gc.BitBltMasked( iPopupCornerTLRect.iTl, iPopupCornerTL, 
-	                 iPopupCornerTLRect.Size(), iPopupCornerTLMask, EFalse );
-	// draw Top right corner		
-	gc.BitBltMasked( iPopupCornerTRRect.iTl, iPopupCornerTR, 
-	                 iPopupCornerTRRect.Size(), iPopupCornerTRMask, EFalse );			
-    // draw Bottom left corner
-	gc.BitBltMasked( iPopupCornerBLRect.iTl, iPopupCornerBL, 
-	                 iPopupCornerBLRect.Size(), iPopupCornerBLMask, EFalse );
-	// draw Bottom right corner		
-	gc.BitBltMasked( iPopupCornerBRRect.iTl, iPopupCornerBR, 
-	                 iPopupCornerBRRect.Size(), iPopupCornerBRMask, EFalse );
-    // draw Left side
-	gc.BitBltMasked( iPopupSideLRect.iTl, iPopupSideL, 
-	                 iPopupSideLRect.Size(), iPopupSideLMask, EFalse );
-	// draw Right side		
-    gc.BitBltMasked( iPopupSideRRect.iTl, iPopupSideR, 
-                     iPopupSideRRect.Size(), iPopupSideRMask, EFalse );			
-    // draw Top side
-    gc.BitBltMasked( iPopupSideTRect.iTl, iPopupSideT, 
-                     iPopupSideTRect.Size(), iPopupSideTMask, EFalse );			
-    // draw Bottom side
-    gc.BitBltMasked( iPopupSideBRect.iTl, iPopupSideB, 
-                     iPopupSideBRect.Size(), iPopupSideBMask, EFalse );			
-    
-    // Draw color items and selection indicator
-    for( TInt index = 0; index < iGridRectsArray.Count(); index++ )
-        {
-        // Draw selection indicator for current item
-        if( index == iCurrentItem )
-            {
-            gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
-            gc.SetBrushColor( KHighlightCenterColor );
-            gc.SetPenColor( KRgbBlack );
-            gc.SetPenSize( TSize(2,2) );     
-            gc.DrawRect( iHighlightRectsArray[ iCurrentItem ] );
-
-            gc.SetBrushStyle (CGraphicsContext::ENullBrush);            
-            }
-            
-        // draw color bitmap    
-        TRect currentRect = iGridRectsArray[index];
-        gc.BitBlt(currentRect.iTl, iColorBitmapsArray[index]);
-        }
-                  
-     // Draw heading  
-     // Convert the plug-in name to visual representation
-     // (in case would be right-to-left)
-     const CFont* font = NULL;
-     font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont );
-     TBuf<256> visual;            
-     // Text to be converted
-     HBufC * heading = ControlEnv()->AllocReadResourceLC ( R_TITLE_LINE_WEIGHT );
-     
-     AknBidiTextUtils::ConvertToVisualAndClip( 
-         heading->Des(), 
-         visual,
-         *font,
-         iHeadingRect.Width(),
-         iHeadingRect.Width()
-         );
-            
-     CleanupStack::PopAndDestroy( heading );
-        
-     gc.UseFont( font );
-     gc.SetBrushStyle ( CGraphicsContext::ENullBrush );
-
-     TInt baseline = iHeadingRect.Height() / 2 + font->AscentInPixels() / 2; 
-
-     // Check the directionality of the current language and set the alignment
-     // according the directionality
-     TBidiText::TDirectionality dir = TBidiText::ScriptDirectionality(User::Language());
-     CGraphicsContext::TTextAlign align = CGraphicsContext::ELeft;
-
-     if( dir == TBidiText::ERightToLeft )
-        {
-        align = CGraphicsContext::ERight;
-        }
-        gc.SetPenColor(KRgbWhite);
-        gc.DrawText(
-            visual,
-            iHeadingRect,
-            baseline,
-            align,
-            0);
-    }
-    
-//=============================================================================    
-void CSelectionPopup::SizeChanged()
-    {
-    
-    TAknLayoutRect layoutRect;
-    layoutRect.LayoutRect( Rect(), AknLayoutScalable_Apps::popup_imed_trans_window(0) );
-    TRect parentRect = layoutRect.Rect();
-            
-	TAknLayoutRect iconLayout;
-	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g1());
-	iPopupCenterRect = iconLayout.Rect();
-	
-	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g2());
-	iPopupCornerTLRect = iconLayout.Rect();
-	
-	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g3());
-	iPopupCornerTRRect = iconLayout.Rect();
-	
-	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g4());
-	iPopupCornerBLRect = iconLayout.Rect();
-	
-	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g5());
-	iPopupCornerBRRect = iconLayout.Rect();
-	
-	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g6());
-	iPopupSideLRect = iconLayout.Rect();
-	
-	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g7());
-	iPopupSideRRect = iconLayout.Rect();
-	
-	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g8());
-	iPopupSideTRect = iconLayout.Rect();
-	
-	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g9());
-	iPopupSideBRect = iconLayout.Rect();
-		
-	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Apps::listscroll_imed_pane());
-	TRect listscrollPaneRect = iconLayout.Rect();
-	
-	iconLayout.LayoutRect( listscrollPaneRect, AknLayoutScalable_Apps::grid_imed_colour_35_pane( 1 ));
-	TRect gridPaneRect = iconLayout.Rect();
-	
-	// Calculate grid's cell rects
-	iHighlightRectsArray.Reset();
-	iGridRectsArray.Reset();
-	for( TInt row = 0; row < KGridRowCount; row++ )
-	    {
-	    for( TInt column = 0; column < KGridColumnCount; column++ )
-	        {
-	        iconLayout.LayoutRect( gridPaneRect, 
-	                               AknLayoutScalable_Apps::cell_imed_colour_pane(0 , column, row ));
-	        TRect highlightRect = iconLayout.Rect();
-	        iHighlightRectsArray.Append( highlightRect );
-	        
-	        iconLayout.LayoutRect( highlightRect, 
-	                               AknLayoutScalable_Apps::cell_imed_colour_pane_g1(0) );	       
-	        
-	        iGridRectsArray.Append( iconLayout.Rect() );
-	        
-	        }
-	    }	
-
-    CreateColorBitmapsL( iconLayout.Rect().Size() );
-    
-    //Heading rect
-	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Apps::heading_imed_pane());
-	TRect heading = iconLayout.Rect();
-	
-    TAknLayoutText layoutText;
-    layoutText.LayoutText( heading, AknLayoutScalable_Apps::heading_imed_pane_t1() );
-    iHeadingRect = layoutText.TextRect();
-    iLayoutTextHeading = layoutText;            		
-    
-    // Resize graphics to correct size
-	AknIconUtils::SetSize( iPopupCenter, iPopupCenterRect.Size(), EAspectRatioNotPreserved);
-	AknIconUtils::SetSize( iPopupCornerTL, iPopupCornerTLRect.Size(), EAspectRatioNotPreserved);
-	AknIconUtils::SetSize( iPopupCornerTR, iPopupCornerTRRect.Size(), EAspectRatioNotPreserved);
-	AknIconUtils::SetSize( iPopupCornerBL, iPopupCornerBLRect.Size(), EAspectRatioNotPreserved);
-	AknIconUtils::SetSize( iPopupCornerBR, iPopupCornerBRRect.Size(), EAspectRatioNotPreserved);
-	AknIconUtils::SetSize( iPopupSideL, iPopupSideLRect.Size(), EAspectRatioNotPreserved);
-	AknIconUtils::SetSize( iPopupSideR, iPopupSideRRect.Size(), EAspectRatioNotPreserved);
-    AknIconUtils::SetSize( iPopupSideT, iPopupSideTRect.Size(), EAspectRatioNotPreserved);
-    AknIconUtils::SetSize( iPopupSideB, iPopupSideBRect.Size(), EAspectRatioNotPreserved);
-	
-    }
-
-//=============================================================================      
-TKeyResponse CSelectionPopup::OfferKeyEventL( const TKeyEvent& aKeyEvent,
-                                                   TEventCode aType )
-    {
-    TKeyResponse res = EKeyWasNotConsumed;
-
-    if (aType == EEventKey) 
-        {
-        // If in landscape mode, do different mapping for the number keys.
-        TUint keyCode = aKeyEvent.iCode;
-        TBool landscape = CResolutionUtil::Self()->GetLandscape();
-        if (landscape)
-        	{
-            switch (keyCode)
-                {
-                case 49: // numeric keypad '1'
-                    keyCode = 55;
-                    break;
-                case 50: // numeric keypad '2'
-                    keyCode = 52;
-                    break;
-                case 51: // numeric keypad '3'
-                    keyCode = 49;
-                    break;
-                case 52: // numeric keypad '4'
-                    keyCode = 56;
-                    break;
-                case 54: // numeric keypad '6'
-                    keyCode = 50;
-                    break;
-                case 55: // numeric keypad '7'
-                    keyCode = 57;
-                    break;
-                case 56: // numeric keypad '8'
-                    keyCode = 54;
-                    break;
-                case 57: // numeric keypad '9'
-                    keyCode = 51;
-                    break;
-                default:
-                    break;
-                }
-        	}
-
-        switch (keyCode)
-            {
-            case EKeyLeftArrow:
-            case 52: // numeric keypad '4'
-                {
-                if (iCurrentItem == 0)
-                    {
-                    iCurrentItem = iGridRectsArray.Count() - 1; 
-                    }
-                else
-                    {
-                    iCurrentItem--;
-                    }
-
-                res = EKeyWasConsumed;
-                break;
-                }
-
-            case EKeyRightArrow:
-            case 54: // numeric keypad '6'
-                {
-                iCurrentItem++;
-                if (iCurrentItem >= iGridRectsArray.Count())
-                    {
-                    iCurrentItem = 0; 
-                    }
-
-                res = EKeyWasConsumed;
-                break;
-                }
-
-            case EKeyDownArrow:
-            case 56: // numeric keypad '8'
-                {
-                iCurrentItem += KGridColumnCount;
-                if (iCurrentItem >= iGridRectsArray.Count())
-                    {
-                    iCurrentItem = iCurrentItem - iGridRectsArray.Count();
-                    }
-
-                res = EKeyWasConsumed;
-                break;
-                }
-
-            case EKeyUpArrow:
-            case 50: // numeric keypad '2'
-                {
-                iCurrentItem -= KGridColumnCount;
-                if (iCurrentItem < 0)
-                    {
-                    iCurrentItem = iGridRectsArray.Count() + iCurrentItem;
-                    }
-
-                res = EKeyWasConsumed;
-                break;
-                }
-
-            case 49: // numeric keypad '1'
-                {
-                // Move up and left
-                iCurrentItem -= KGridColumnCount;
-                iCurrentItem --;
-                if (iCurrentItem < 0)
-                    {
-                    iCurrentItem = iGridRectsArray.Count() + iCurrentItem;
-                    }
-                res = EKeyWasConsumed;
-                break;
-                }
-
-            case 51: // numeric keypad '3'
-                {
-                // Move up and right
-                iCurrentItem -= KGridColumnCount;
-                iCurrentItem ++;
-                if (iCurrentItem < 0)
-                    {
-                    iCurrentItem = iGridRectsArray.Count() + iCurrentItem;
-                    }
-                res = EKeyWasConsumed;
-                break;
-                }
-
-            case 55: // numeric keypad '7'
-                {
-                // Move down and left
-                iCurrentItem += KGridColumnCount;
-                iCurrentItem--;
-                if (iCurrentItem >= iGridRectsArray.Count())
-                    {
-                    iCurrentItem = iCurrentItem - iGridRectsArray.Count();
-                    }
-                res = EKeyWasConsumed;
-                break;
-                }
-
-            case 57: // numeric keypad '9'
-                {
-                // Move down and left
-                iCurrentItem += KGridColumnCount;
-                iCurrentItem++;
-                if (iCurrentItem >= iGridRectsArray.Count())
-                    {
-                    iCurrentItem = iCurrentItem - iGridRectsArray.Count();
-                    }
-                res = EKeyWasConsumed;
-                break;
-                }
-
-             default:
-                {
-                break;
-                }
-            }
-        }
-
-    return res;
-    
-    }
-
-//=============================================================================
-void CSelectionPopup::HandlePointerEventL( const TPointerEvent &aPointerEvent )
-    {
-    if( AknLayoutUtils::PenEnabled() )
-		{
-		switch( aPointerEvent.iType )
-			{
-			case TPointerEvent::EButton1Down:
-			case TPointerEvent::EDrag:
-				{	
-				// calculate which one of the grid items was pressed by
-				// by comparing item rects and pressed position						
-				for (TInt i = 0; i < iHighlightRectsArray.Count(); ++i)
-                    {
-                    TRect iconRect( iHighlightRectsArray[i] );
-                    
-                    if( iconRect.Contains( aPointerEvent.iPosition ) )
-                        {
-                        // set new highlighted item
-                        iCurrentItem = i;
-                        break;
-                        }                        
-                    }        
-				break;
-				}
-			case TPointerEvent::EButton1Up:
-				{
-				break;
-				}
-			default:
-				{
-				break;	
-				}	
-			}
-		}
-    }
-
-//=============================================================================    
-TRect CSelectionPopup::GridRect() const
-    {    
-    return iPopupCenterRect;
-    }
-
-//=============================================================================    
-TBool CSelectionPopup::HighlightedItemPressed( TPoint aPosition ) const
-    {	    
-	TRect iconRect = iHighlightRectsArray[ iCurrentItem ];		
-	                   
-    if (iconRect.Contains( aPosition ))  
-        {
-        return ETrue;
-        }
-    else 
-        {
-        return EFalse;
-        }       
-    }
-
-//=============================================================================    
-void CSelectionPopup::SetSelectedValue( TInt aSelected )
-    {
-    ASSERT( aSelected >= 0 );
-    iCurrentItem = iItemArray.Find( aSelected );
-    }
-
-//=============================================================================    
-TInt CSelectionPopup::GetSelectedValue() const
-    {
-    ASSERT( iCurrentItem >= 0 && iCurrentItem < iItemArray.Count() );
-    return iItemArray[iCurrentItem];
-    }
-
-
-//=============================================================================
-// DIALOG
-//=============================================================================
-TInt CSelectionDialog::RunDlgLD( const CFbsBitmap* aBitmap, 
-                                      const TRect& aRect, 
-                                      TInt& aSelection )
-    {
-    CSelectionDialog* dialog = 
-        new (ELeave) CSelectionDialog ( aSelection );
-    dialog->ConstructL( aBitmap, aRect);
-    return dialog->ExecuteLD( R_IMAGE_EDITOR_COLOR_DIALOG );
-    }
-
-//=============================================================================
-CSelectionDialog::CSelectionDialog( TInt& aSelection )
-: iCurrentValue( aSelection )
-    {
-    }
-    
-//=============================================================================
-CSelectionDialog::~CSelectionDialog()
-    {
-    delete iPopup;
-    }
-
-//=============================================================================
-
-void CSelectionDialog::ConstructL( const CFbsBitmap* aBitmap,
-                                        const TRect& aRect )
-    {    
-    iPopup = new ( ELeave ) CSelectionPopup();
-    iPopup->SetSelectedValue( iCurrentValue);
-    iPopup->ConstructL( this );
-    
-    SetRect(aRect);   
-    
-    // Not drawn correctly if calling SetRect()
-    iPopup->SetSize(aRect.Size());
-    iPopup->SetPosition(TPoint(0,0));
-    iPopup->SetImageL( aBitmap );
-    }
-
-//=============================================================================
-TBool CSelectionDialog::OkToExitL( TInt aButtonId )
-    {
-    if ( aButtonId == EAknSoftkeyOk || aButtonId == EAknSoftkeySelect)
-        {
-        iCurrentValue = iPopup->GetSelectedValue();
-        return ETrue;
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
-
-//=============================================================================    
-void CSelectionDialog::Draw(const TRect& /*aRect*/) const
-    {
-    }
-
-//=============================================================================    
-void CSelectionDialog::SizeChanged()
-    {  
-    }
-
-//=============================================================================    
-void CSelectionDialog::PreLayoutDynInitL() 
-    { 
-    }
-
-
-//=============================================================================    
-TInt CSelectionDialog::CountComponentControls() const
-    {
-    return 1;
-    }
-
-//=============================================================================    
-CCoeControl* CSelectionDialog::ComponentControl(TInt /*aIndex*/) const
-    {
-    return iPopup;
-    }
-
-//=============================================================================    
-TKeyResponse CSelectionDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
-    {
-    // Selection key or numeric keypad '5' close the dialog
-    TKeyResponse res = EKeyWasNotConsumed;
-    if (aType == EEventKey && 
-        (aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == 53 || aKeyEvent.iScanCode == EStdKeyEnter) )
-        {
-        TryExitL (EAknSoftkeyOk);
-        res = EKeyWasConsumed;
-        }
-    else if (aType == EEventKey && aKeyEvent.iCode == EKeyNo || aKeyEvent.iCode == EKeyEscape) // Do not exit if dialog active
-		{
-		TryExitL (EAknSoftkeyCancel);
-		res = EKeyWasNotConsumed;
-        }
-#ifdef FULLSCREEN_AVAILABLE        
-    else if (aType == EEventKey && aKeyEvent.iCode == 48 ) // 0             
-      {
-      // Switch normal screen / full screen
-      if (CResolutionUtil::Self()->GetFullScreen())
-          {
-          iEikonEnv->EikAppUi()->HandleCommandL(EImageEditorMenuCmdNormalScreen);
-	      SetRect(iEikonEnv->EikAppUi()->ClientRect());
-	      SizeChanged();
-	      DrawNow();
-          }
-      else
-	      {      
-	      iEikonEnv->EikAppUi()->HandleCommandL(EImageEditorMenuCmdFullScreen);			  
-	      SetExtentToWholeScreen();
-	      SizeChanged();
-	      DrawNow();
-	      }              
-      res = EKeyWasConsumed;              
-      }
-#endif // FULLSCREEN_AVAILABLE      						 
-    else 
-        {
-        res = iPopup->OfferKeyEventL(aKeyEvent, aType);
-        if (res == EKeyWasConsumed)
-            {
-            DrawDeferred();
-            }
-        }
-         
-    return res;
-    }
-
-//=============================================================================
-void CSelectionDialog::HandlePointerEventL( 
-                                           const TPointerEvent &aPointerEvent )
-    {    
-    if( AknLayoutUtils::PenEnabled() )
-	    {
-        TBool draw( EFalse );
-        switch( aPointerEvent.iType )
-			{
-			case TPointerEvent::EButton1Down:
-				{				
-			    // forward event only if grid area was pressed    
-			    if ( iPopup->GridRect().Contains( aPointerEvent.iPosition ) )
-			        {			        
-			        iPopup->HandlePointerEventL( aPointerEvent );			        
-			        draw = ETrue;
-			        }    		        
-				break;
-				}
-			case TPointerEvent::EDrag:
-				{
-			    if ( iPopup->GridRect().Contains( aPointerEvent.iPosition ) )
-			        {
-			        iPopup->HandlePointerEventL( aPointerEvent );
-			        draw = ETrue;
-			        }
-				break;		
-				}
-			case TPointerEvent::EButton1Up:
-				{
-				// already highlighted item is pressed
-			    if ( iPopup->HighlightedItemPressed( aPointerEvent.iPosition ) )
-			        {
-			        TryExitL (EAknSoftkeyOk);
-			        }
-				break;
-				}
-			default:
-				{
-				break;	
-				}	
-			}
-			
-	    if ( draw )
-	        {
-		    DrawDeferred();    
-	        }	
-        }
-    }
-    
-// End of file 
-
+/*
+* Copyright (c) 2010 Ixonos Plc.
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - Initial contribution
+*
+* Contributors:
+* Ixonos Plc
+*
+* Description: 
+* Selection popup dialog.
+*
+*/
+
+
+// INCLUDES
+
+#include <avkon.hrh>
+#include <AknLayoutScalable_Avkon.cdl.h>
+#include <AknLayoutScalable_Apps.cdl.h>
+#include <fbs.h>
+#include <AknIconUtils.h> 
+#include <AknUtils.h> 
+
+#include <AknBidiTextUtils.h>
+#include <BidiText.h> 
+
+#include <ImageEditorUi.mbg>
+#include <ImageEditorUI.rsg>
+#include <draw.rsg>
+#include <drawpath.h>
+
+#include "ResolutionUtil.h"
+#include "selectionpopup.h"
+#include "ImageEditorUiDefs.h"
+
+// CONSTANTS
+const TInt KGridColumnCount = 5;
+const TInt KGridRowCount = 1;
+const TInt KPenSizeOffset = 153;
+
+
+//=============================================================================
+CSelectionPopup::CSelectionPopup(TRgb& aCurrentColor, const TRect& aImageRect)
+    {    
+    // Set values into an array
+    iItemArray.Append( 2 ); //default: 4
+    iItemArray.Append( 4 );
+    iItemArray.Append( 8 );
+    iItemArray.Append( 16 );
+    iItemArray.Append( 32 );
+    
+    //set defalut color
+    iCurrentColor = aCurrentColor;
+    
+    iImageRect = aImageRect;
+    }
+
+//=============================================================================
+CSelectionPopup::~CSelectionPopup()
+    {
+    delete iPopupCenter;
+    delete iPopupCenterMask;
+    delete iPopupCornerTL;
+    delete iPopupCornerTLMask;
+    delete iPopupCornerTR;
+    delete iPopupCornerTRMask;
+    delete iPopupCornerBL;
+    delete iPopupCornerBLMask;
+    delete iPopupCornerBR;
+    delete iPopupCornerBRMask;
+    delete iPopupSideL;
+    delete iPopupSideLMask;
+    delete iPopupSideR;
+    delete iPopupSideRMask;
+    delete iPopupSideT;
+    delete iPopupSideTMask;
+    delete iPopupSideB;
+    delete iPopupSideBMask;     
+           
+    iHighlightRectsArray.Close();
+    iGridRectsArray.Close();
+    iColorBitmapsArray.ResetAndDestroy();
+    iItemArray.Close();
+    }
+
+//=============================================================================
+void CSelectionPopup::ConstructL (	CCoeControl* aParent )
+    {
+	// Set parent
+	SetContainerWindowL( *aParent );  
+
+    TFileName iconFile( KImageEditorUiMifFile );
+    
+    // Create trans popup window graphics
+    // Center
+    AknIconUtils::CreateIconL( iPopupCenter, iPopupCenterMask, iconFile, 
+            EMbmImageeditoruiQgn_graf_popup_trans_center, 
+			EMbmImageeditoruiQgn_graf_popup_trans_center_mask );
+	
+	// Top-left corner
+    AknIconUtils::CreateIconL( iPopupCornerTL, iPopupCornerTLMask, iconFile, 
+            EMbmImageeditoruiQgn_graf_popup_trans_corner_tl, 
+			EMbmImageeditoruiQgn_graf_popup_trans_corner_tl_mask );		
+    
+    // Top-right corner
+    AknIconUtils::CreateIconL( iPopupCornerTR, iPopupCornerTRMask, iconFile, 
+            EMbmImageeditoruiQgn_graf_popup_trans_corner_tr, 
+			EMbmImageeditoruiQgn_graf_popup_trans_corner_tr_mask );
+    
+    // Bottom-left corner
+    AknIconUtils::CreateIconL( iPopupCornerBL, iPopupCornerBLMask, iconFile, 
+            EMbmImageeditoruiQgn_graf_popup_trans_corner_bl, 
+			EMbmImageeditoruiQgn_graf_popup_trans_corner_bl_mask );
+			
+	// Bottom-right corner
+    AknIconUtils::CreateIconL( iPopupCornerBR, iPopupCornerBRMask, iconFile, 
+            EMbmImageeditoruiQgn_graf_popup_trans_corner_br, 
+			EMbmImageeditoruiQgn_graf_popup_trans_corner_br_mask );
+    
+    // left side
+    AknIconUtils::CreateIconL( iPopupSideL, iPopupSideLMask, iconFile, 
+            EMbmImageeditoruiQgn_graf_popup_trans_side_l, 
+			EMbmImageeditoruiQgn_graf_popup_trans_side_l_mask );
+			
+	// left side
+    AknIconUtils::CreateIconL( iPopupSideR, iPopupSideRMask, iconFile, 
+            EMbmImageeditoruiQgn_graf_popup_trans_side_r, 
+			EMbmImageeditoruiQgn_graf_popup_trans_side_r_mask );
+	
+	// top side
+    AknIconUtils::CreateIconL( iPopupSideT, iPopupSideTMask, iconFile, 
+            EMbmImageeditoruiQgn_graf_popup_trans_side_t, 
+			EMbmImageeditoruiQgn_graf_popup_trans_side_t_mask );
+	
+	// bottom side
+    AknIconUtils::CreateIconL( iPopupSideB, iPopupSideBMask, iconFile, 
+            EMbmImageeditoruiQgn_graf_popup_trans_side_b, 
+			EMbmImageeditoruiQgn_graf_popup_trans_side_b_mask );						                                   
+                   					
+	//	Activate control
+    ActivateL();
+    
+    }
+
+//=============================================================================
+void CSelectionPopup::CreateColorBitmapsL( TSize /* aSize */ )
+    {    
+    //TODO: to set icon here
+    // Generate color bitmaps    
+    iColorBitmapsArray.Reset(); 
+    
+    TSize size(2,2);
+    for( TInt i = iItemArray.Count(); i > 0 ; i-- )
+        {
+        CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap;
+        CleanupStack::PushL( bitmap );
+        User::LeaveIfError ( bitmap->Create ( size, EColor64K ) );
+        size.iHeight*=2;
+        size.iWidth*=2;
+        //  Compute color for bitmap
+        TRgb color( iCurrentColor );//iRGBArray[i] );		
+         
+    	//	Fill the bitmap with the correct color
+    	TUint16 color_64k = ( TUint16 )
+    		(0 | 
+    		((( TUint8 )color.Red() >> 3) << 11) | 
+    		((( TUint8 )color.Green() >> 2) << 5) | 
+    		(( TUint8 )color.Blue() >> 3));
+
+        bitmap->LockHeapLC();
+    	TUint16 * pd = (TUint16 *)bitmap->DataAddress();
+    	TSize size = bitmap->SizeInPixels();
+    	TInt w = (bitmap->ScanLineLength(size.iWidth, EColor64K) >> 1) 
+    	                                                * size.iHeight;
+    	for( TInt k = w; k != 0; --k)
+    	    {
+    		*pd++ = color_64k;
+    	    }
+    	
+    	iColorBitmapsArray.Append( bitmap );
+    	
+        CleanupStack::PopAndDestroy(); // LockHeapLC()
+        CleanupStack::Pop(); // bitmap
+                
+        }    
+    
+    }
+    
+//=============================================================================
+void CSelectionPopup::Draw( const TRect& aRect ) const
+    {
+    const TRgb KHighlightCenterColor (229, 229, 229);
+    
+    CWindowGc& gc = SystemGc();
+     
+    // Change brush to null to enable transparent drawing
+    gc.SetBrushStyle (CGraphicsContext::ENullBrush);
+                
+    // draw center of the borders
+    gc.BitBltMasked( iPopupCenterRect.iTl, iPopupCenter, 
+                     iPopupCenterRect.Size(), iPopupCenterMask, EFalse );    
+    // draw Top left corner
+	gc.BitBltMasked( iPopupCornerTLRect.iTl, iPopupCornerTL, 
+	                 iPopupCornerTLRect.Size(), iPopupCornerTLMask, EFalse );
+	// draw Top right corner		
+	gc.BitBltMasked( iPopupCornerTRRect.iTl, iPopupCornerTR, 
+	                 iPopupCornerTRRect.Size(), iPopupCornerTRMask, EFalse );			
+    // draw Bottom left corner
+	gc.BitBltMasked( iPopupCornerBLRect.iTl, iPopupCornerBL, 
+	                 iPopupCornerBLRect.Size(), iPopupCornerBLMask, EFalse );
+	// draw Bottom right corner		
+	gc.BitBltMasked( iPopupCornerBRRect.iTl, iPopupCornerBR, 
+	                 iPopupCornerBRRect.Size(), iPopupCornerBRMask, EFalse );
+    // draw Left side
+	gc.BitBltMasked( iPopupSideLRect.iTl, iPopupSideL, 
+	                 iPopupSideLRect.Size(), iPopupSideLMask, EFalse );
+	// draw Right side		
+    gc.BitBltMasked( iPopupSideRRect.iTl, iPopupSideR, 
+                     iPopupSideRRect.Size(), iPopupSideRMask, EFalse );			
+    // draw Top side
+    gc.BitBltMasked( iPopupSideTRect.iTl, iPopupSideT, 
+                     iPopupSideTRect.Size(), iPopupSideTMask, EFalse );			
+    // draw Bottom side
+    gc.BitBltMasked( iPopupSideBRect.iTl, iPopupSideB, 
+                     iPopupSideBRect.Size(), iPopupSideBMask, EFalse );			
+    
+    // Draw color items and selection indicator
+    for( TInt index = 0; index < iGridRectsArray.Count(); index++ )
+        {
+        // Draw selection indicator for current item
+        if( index == iCurrentItem )
+            {
+            gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+            gc.SetBrushColor( KHighlightCenterColor );
+            gc.SetPenColor( KRgbBlack );
+            gc.SetPenSize( TSize(2,2) );     
+            gc.DrawRect( iHighlightRectsArray[ iCurrentItem ] );
+
+            gc.SetBrushStyle (CGraphicsContext::ENullBrush);            
+            }
+            
+        // draw color bitmap    
+        TRect currentRect = iGridRectsArray[index];
+        currentRect.iTl.iX = currentRect.iTl.iX + (currentRect.iBr.iX - currentRect.iTl.iX)/2 - iItemArray[index]/2;
+        currentRect.iTl.iY = currentRect.iTl.iY + (currentRect.iBr.iY - currentRect.iTl.iY)/2 - iItemArray[index]/2;
+        gc.BitBlt(currentRect.iTl, iColorBitmapsArray[index]);
+        }
+                  
+     // Draw heading  
+     // Convert the plug-in name to visual representation
+     // (in case would be right-to-left)
+     const CFont* font = NULL;
+     font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont );
+     TBuf<256> visual;            
+     // Text to be converted
+     HBufC * heading = ControlEnv()->AllocReadResourceLC ( R_TITLE_LINE_WEIGHT );
+     
+     AknBidiTextUtils::ConvertToVisualAndClip( 
+         heading->Des(), 
+         visual,
+         *font,
+         iHeadingRect.Width(),
+         iHeadingRect.Width()
+         );
+        
+     CleanupStack::PopAndDestroy( heading );
+        
+     gc.UseFont( font );
+     gc.SetBrushStyle ( CGraphicsContext::ENullBrush );
+
+     TInt baseline = iHeadingRect.Height() / 2 + font->AscentInPixels() / 2; 
+
+     // Check the directionality of the current language and set the alignment
+     // according the directionality
+     TBidiText::TDirectionality dir = TBidiText::ScriptDirectionality(User::Language());
+     CGraphicsContext::TTextAlign align = CGraphicsContext::ELeft;
+
+     if (dir == TBidiText::ERightToLeft)
+		{
+		align = CGraphicsContext::ERight;
+		}
+	gc.SetPenColor(KRgbWhite);
+	gc.DrawText(visual, iHeadingRect, baseline, align, 0);
+
+    }
+    
+//=============================================================================    
+void CSelectionPopup::SizeChanged()
+    {
+    
+    TAknLayoutRect layoutRect;
+    layoutRect.LayoutRect( Rect(), AknLayoutScalable_Apps::popup_imed_trans_window(0) );
+    TRect parentRect = layoutRect.Rect();
+    
+    if(parentRect.iTl.iX > parentRect.iTl.iY)
+    	{
+    	 parentRect.SetRect(parentRect.iTl.iX-KPenSizeOffset,parentRect.iTl.iY,parentRect.iBr.iX-KPenSizeOffset,parentRect.iBr.iY);      
+    	}
+   
+	TAknLayoutRect iconLayout;
+	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g1());
+	iPopupCenterRect = iconLayout.Rect();
+	
+	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g2());
+	iPopupCornerTLRect = iconLayout.Rect();
+	
+	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g3());
+	iPopupCornerTRRect = iconLayout.Rect();
+	
+	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g4());
+	iPopupCornerBLRect = iconLayout.Rect();
+	
+	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g5());
+	iPopupCornerBRRect = iconLayout.Rect();
+	
+	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g6());
+	iPopupSideLRect = iconLayout.Rect();
+	
+	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g7());
+	iPopupSideRRect = iconLayout.Rect();
+	
+	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g8());
+	iPopupSideTRect = iconLayout.Rect();
+	
+	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Avkon::bg_tb_trans_pane_g9());
+	iPopupSideBRect = iconLayout.Rect();
+		
+	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Apps::listscroll_imed_pane());
+	TRect listscrollPaneRect = iconLayout.Rect();
+	
+	iconLayout.LayoutRect( listscrollPaneRect, AknLayoutScalable_Apps::grid_imed_colour_35_pane( 1 ));
+	TRect gridPaneRect = iconLayout.Rect();
+	
+	iHighlightRectsArray.Reset();
+	iGridRectsArray.Reset();
+	for( TInt row = 0; row < KGridRowCount; row++ )
+	    {
+	    for( TInt column = 0; column < KGridColumnCount; column++ )
+	        {
+	        iconLayout.LayoutRect( gridPaneRect, 
+	                               AknLayoutScalable_Apps::cell_imed_colour_pane(0 , column, row ));
+	        TRect highlightRect = iconLayout.Rect();
+	        iHighlightRectsArray.Append( highlightRect );
+	        
+	        iconLayout.LayoutRect( highlightRect, 
+	                               AknLayoutScalable_Apps::cell_imed_colour_pane_g1(0) );	       
+	        
+	        iGridRectsArray.Append(iconLayout.Rect());
+	        }
+	    }	
+
+    CreateColorBitmapsL( iconLayout.Rect().Size() );
+    
+    //Heading rect
+	iconLayout.LayoutRect( parentRect, AknLayoutScalable_Apps::heading_imed_pane());
+	TRect heading = iconLayout.Rect();
+	
+    TAknLayoutText layoutText;
+    layoutText.LayoutText( heading, AknLayoutScalable_Apps::heading_imed_pane_t1() );
+    iHeadingRect = layoutText.TextRect();
+    iLayoutTextHeading = layoutText;            		
+    
+    // Resize graphics to correct size
+	AknIconUtils::SetSize( iPopupCenter, iPopupCenterRect.Size(), EAspectRatioNotPreserved);
+	AknIconUtils::SetSize( iPopupCornerTL, iPopupCornerTLRect.Size(), EAspectRatioNotPreserved);
+	AknIconUtils::SetSize( iPopupCornerTR, iPopupCornerTRRect.Size(), EAspectRatioNotPreserved);
+	AknIconUtils::SetSize( iPopupCornerBL, iPopupCornerBLRect.Size(), EAspectRatioNotPreserved);
+	AknIconUtils::SetSize( iPopupCornerBR, iPopupCornerBRRect.Size(), EAspectRatioNotPreserved);
+	AknIconUtils::SetSize( iPopupSideL, iPopupSideLRect.Size(), EAspectRatioNotPreserved);
+	AknIconUtils::SetSize( iPopupSideR, iPopupSideRRect.Size(), EAspectRatioNotPreserved);
+    AknIconUtils::SetSize( iPopupSideT, iPopupSideTRect.Size(), EAspectRatioNotPreserved);
+    AknIconUtils::SetSize( iPopupSideB, iPopupSideBRect.Size(), EAspectRatioNotPreserved);
+	
+    }
+
+//=============================================================================      
+TKeyResponse CSelectionPopup::OfferKeyEventL( const TKeyEvent& aKeyEvent,
+                                                   TEventCode aType )
+    {
+    TKeyResponse res = EKeyWasNotConsumed;
+
+    if (aType == EEventKey) 
+        {
+        // If in landscape mode, do different mapping for the number keys.
+        TUint keyCode = aKeyEvent.iCode;
+        TBool landscape = CResolutionUtil::Self()->GetLandscape();
+        if (landscape)
+        	{
+            switch (keyCode)
+                {
+                case 49: // numeric keypad '1'
+                    keyCode = 55;
+                    break;
+                case 50: // numeric keypad '2'
+                    keyCode = 52;
+                    break;
+                case 51: // numeric keypad '3'
+                    keyCode = 49;
+                    break;
+                case 52: // numeric keypad '4'
+                    keyCode = 56;
+                    break;
+                case 54: // numeric keypad '6'
+                    keyCode = 50;
+                    break;
+                case 55: // numeric keypad '7'
+                    keyCode = 57;
+                    break;
+                case 56: // numeric keypad '8'
+                    keyCode = 54;
+                    break;
+                case 57: // numeric keypad '9'
+                    keyCode = 51;
+                    break;
+                default:
+                    break;
+                }
+        	}
+
+        switch (keyCode)
+            {
+            case EKeyLeftArrow:
+            case 52: // numeric keypad '4'
+                {
+                if (iCurrentItem == 0)
+                    {
+                    iCurrentItem = iGridRectsArray.Count() - 1; 
+                    }
+                else
+                    {
+                    iCurrentItem--;
+                    }
+
+                res = EKeyWasConsumed;
+                break;
+                }
+
+            case EKeyRightArrow:
+            case 54: // numeric keypad '6'
+                {
+                iCurrentItem++;
+                if (iCurrentItem >= iGridRectsArray.Count())
+                    {
+                    iCurrentItem = 0; 
+                    }
+
+                res = EKeyWasConsumed;
+                break;
+                }
+
+            case EKeyDownArrow:
+            case 56: // numeric keypad '8'
+                {
+                iCurrentItem += KGridColumnCount;
+                if (iCurrentItem >= iGridRectsArray.Count())
+                    {
+                    iCurrentItem = iCurrentItem - iGridRectsArray.Count();
+                    }
+
+                res = EKeyWasConsumed;
+                break;
+                }
+
+            case EKeyUpArrow:
+            case 50: // numeric keypad '2'
+                {
+                iCurrentItem -= KGridColumnCount;
+                if (iCurrentItem < 0)
+                    {
+                    iCurrentItem = iGridRectsArray.Count() + iCurrentItem;
+                    }
+
+                res = EKeyWasConsumed;
+                break;
+                }
+
+            case 49: // numeric keypad '1'
+                {
+                // Move up and left
+                iCurrentItem -= KGridColumnCount;
+                iCurrentItem --;
+                if (iCurrentItem < 0)
+                    {
+                    iCurrentItem = iGridRectsArray.Count() + iCurrentItem;
+                    }
+                res = EKeyWasConsumed;
+                break;
+                }
+
+            case 51: // numeric keypad '3'
+                {
+                // Move up and right
+                iCurrentItem -= KGridColumnCount;
+                iCurrentItem ++;
+                if (iCurrentItem < 0)
+                    {
+                    iCurrentItem = iGridRectsArray.Count() + iCurrentItem;
+                    }
+                res = EKeyWasConsumed;
+                break;
+                }
+
+            case 55: // numeric keypad '7'
+                {
+                // Move down and left
+                iCurrentItem += KGridColumnCount;
+                iCurrentItem--;
+                if (iCurrentItem >= iGridRectsArray.Count())
+                    {
+                    iCurrentItem = iCurrentItem - iGridRectsArray.Count();
+                    }
+                res = EKeyWasConsumed;
+                break;
+                }
+
+            case 57: // numeric keypad '9'
+                {
+                // Move down and left
+                iCurrentItem += KGridColumnCount;
+                iCurrentItem++;
+                if (iCurrentItem >= iGridRectsArray.Count())
+                    {
+                    iCurrentItem = iCurrentItem - iGridRectsArray.Count();
+                    }
+                res = EKeyWasConsumed;
+                break;
+                }
+
+             default:
+                {
+                break;
+                }
+            }
+        }
+
+    return res;
+    
+    }
+
+//=============================================================================
+void CSelectionPopup::HandlePointerEventL( const TPointerEvent &aPointerEvent )
+    {
+    if( AknLayoutUtils::PenEnabled() )
+		{
+		switch( aPointerEvent.iType )
+			{
+			case TPointerEvent::EButton1Down:
+			case TPointerEvent::EDrag:
+				{	
+				// calculate which one of the grid items was pressed by
+				// by comparing item rects and pressed position						
+				for (TInt i = 0; i < iHighlightRectsArray.Count(); ++i)
+                    {
+                    TRect iconRect( iHighlightRectsArray[i] );
+                    
+                    if( iconRect.Contains( aPointerEvent.iPosition ) )
+                        {
+                        // set new highlighted item
+                        iCurrentItem = i;
+                        break;
+                        }                        
+                    }        
+				break;
+				}
+			case TPointerEvent::EButton1Up:
+				{
+				break;
+				}
+			default:
+				{
+				break;	
+				}	
+			}
+		}
+    }
+
+//=============================================================================    
+TRect CSelectionPopup::GridRect() const
+    {    
+    return iPopupCenterRect;
+    }
+
+//=============================================================================    
+TBool CSelectionPopup::HighlightedItemPressed( TPoint aPosition ) const
+    {	    
+	TRect iconRect = iHighlightRectsArray[ iCurrentItem ];		
+	                   
+    if (iconRect.Contains( aPosition ))  
+        {
+        return ETrue;
+        }
+    else 
+        {
+        return EFalse;
+        }       
+    }
+
+//=============================================================================    
+void CSelectionPopup::SetSelectedValue( TInt aSelected )
+    {
+    ASSERT( aSelected >= 0 );
+    iCurrentItem = iItemArray.Find( aSelected );
+    }
+
+//=============================================================================    
+TInt CSelectionPopup::GetSelectedValue() const
+    {
+    ASSERT( iCurrentItem >= 0 && iCurrentItem < iItemArray.Count() );
+    return iItemArray[iCurrentItem];
+    }
+
+
+//=============================================================================
+// DIALOG
+//=============================================================================
+TInt CSelectionDialog::RunDlgLD( const CFbsBitmap* aBitmap,
+                                      const TRect& aRect, 
+                                      TInt& aSelection,
+                                      TRgb& aCurrentColor,
+                                      const TRect& aImageRect)
+    {
+    CSelectionDialog* dialog = 
+        new (ELeave) CSelectionDialog ( aSelection);
+    dialog->ConstructL( aBitmap, aRect, aCurrentColor, aImageRect);
+    return dialog->ExecuteLD( R_IMAGE_EDITOR_COLOR_DIALOG );
+    }
+
+//=============================================================================
+CSelectionDialog::CSelectionDialog( TInt& aSelection)
+: iCurrentValue( aSelection )
+    {
+    }
+    
+//=============================================================================
+CSelectionDialog::~CSelectionDialog()
+    {
+    delete iPopup;
+    }
+
+//=============================================================================
+
+void CSelectionDialog::ConstructL( const CFbsBitmap* aBitmap,	
+                                        const TRect& aRect,
+                                        TRgb& aCurrentColor,
+                                        const TRect& aImageRect)
+    {    
+    iPopup = new ( ELeave ) CSelectionPopup(aCurrentColor, aImageRect);
+    iPopup->SetSelectedValue(iCurrentValue);
+    iPopup->ConstructL(this);
+    
+    SetRect(aRect);   
+    
+    // Not drawn correctly if calling SetRect()
+    iPopup->SetSize(aRect.Size());
+    iPopup->SetPosition(TPoint(0,0));
+    iPopup->SetImageL( aBitmap ); // set the image which we are editing
+    }
+
+//=============================================================================
+TBool CSelectionDialog::OkToExitL( TInt aButtonId )
+    {
+    if ( aButtonId == EAknSoftkeyOk || aButtonId == EAknSoftkeySelect)
+        {
+        iCurrentValue = iPopup->GetSelectedValue();
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+//=============================================================================    
+void CSelectionDialog::Draw(const TRect& /*aRect*/) const
+    {
+    }
+
+//=============================================================================    
+void CSelectionDialog::SizeChanged()
+    {  
+    }
+
+//=============================================================================    
+void CSelectionDialog::PreLayoutDynInitL() 
+    { 
+    }
+
+
+//=============================================================================    
+TInt CSelectionDialog::CountComponentControls() const
+    {
+    return 1;
+    }
+
+//=============================================================================    
+CCoeControl* CSelectionDialog::ComponentControl(TInt /*aIndex*/) const
+    {
+    return iPopup;
+    }
+
+//=============================================================================    
+TKeyResponse CSelectionDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+    {
+    // Selection key or numeric keypad '5' close the dialog
+    TKeyResponse res = EKeyWasNotConsumed;
+    if (aType == EEventKey && 
+        (aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == 53 || aKeyEvent.iScanCode == EStdKeyEnter) )
+        {
+        TryExitL (EAknSoftkeyOk);
+        res = EKeyWasConsumed;
+        }
+    else if (aType == EEventKey && aKeyEvent.iCode == EKeyNo || aKeyEvent.iCode == EKeyEscape) // Do not exit if dialog active
+		{
+		TryExitL (EAknSoftkeyCancel);
+		res = EKeyWasNotConsumed;
+        }
+#ifdef FULLSCREEN_AVAILABLE        
+    else if (aType == EEventKey && aKeyEvent.iCode == 48 ) // 0             
+      {
+      // Switch normal screen / full screen
+      if (CResolutionUtil::Self()->GetFullScreen())
+          {
+          iEikonEnv->EikAppUi()->HandleCommandL(EImageEditorMenuCmdNormalScreen);
+	      SetRect(iEikonEnv->EikAppUi()->ClientRect());
+	      SizeChanged();
+	      DrawNow();
+          }
+      else
+	      {      
+	      iEikonEnv->EikAppUi()->HandleCommandL(EImageEditorMenuCmdFullScreen);			  
+	      SetExtentToWholeScreen();
+	      SizeChanged();
+	      DrawNow();
+	      }              
+      res = EKeyWasConsumed;              
+      }
+#endif // FULLSCREEN_AVAILABLE      						 
+    else 
+        {
+        res = iPopup->OfferKeyEventL(aKeyEvent, aType);
+        if (res == EKeyWasConsumed)
+            {
+            DrawDeferred();
+            }
+        }
+         
+    return res;
+    }
+
+//=============================================================================
+void CSelectionDialog::HandlePointerEventL( 
+                                           const TPointerEvent &aPointerEvent )
+    {    
+    if( AknLayoutUtils::PenEnabled() )
+	    {
+        switch( aPointerEvent.iType )
+			{
+			case TPointerEvent::EButton1Down:
+				{				
+			    // forward event only if grid area was pressed    
+			    if ( iPopup->GridRect().Contains( aPointerEvent.iPosition ) )
+			        {			        
+			        iPopup->HandlePointerEventL( aPointerEvent );
+			        }    		        
+				break;
+				}
+			case TPointerEvent::EDrag:
+				{
+			    if ( iPopup->GridRect().Contains( aPointerEvent.iPosition ) )
+			        {
+			        iPopup->HandlePointerEventL( aPointerEvent );
+			        }
+				break;		
+				}
+			case TPointerEvent::EButton1Up:
+				{
+				// already highlighted item is pressed
+			    if ( iPopup->HighlightedItemPressed( aPointerEvent.iPosition ) )
+			        {
+			        TryExitL (EAknSoftkeyOk);
+			        }
+				break;
+				}
+			default:
+				{
+				break;	
+				}	
+			}
+        }
+    }
+    
+// End of file 
+
--- a/imageeditorengine/EngineWrapper/src/ImageEditorEngineWrapper.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditorengine/EngineWrapper/src/ImageEditorEngineWrapper.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -1359,7 +1359,7 @@
 {
     LOG( KEngineWrapperLogFile, "CEngineWrapper::CopyBufferL" );
     
-	iScreenBitmap->LockHeapLC();
+//	iScreenBitmap->LockHeapLC();
 
 	TSize size = iScreenBitmap->SizeInPixels();
 	TDisplayMode dmode = iScreenBitmap->DisplayMode();
@@ -1385,7 +1385,7 @@
 		}
 	}
 
-	CleanupStack::PopAndDestroy(); // iScreenBitmap->LockHeapLC	
+//	CleanupStack::PopAndDestroy(); // iScreenBitmap->LockHeapLC	
 }
 
 //=============================================================================
--- a/imageeditorengine/filters/FilterDraw/Inc/cfilterdraw.h	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditorengine/filters/FilterDraw/Inc/cfilterdraw.h	Thu Jun 03 18:57:10 2010 +0800
@@ -58,14 +58,20 @@
 	    void RealToViewedFactories(TReal& aWidth, TReal& aHeight);
 	
 	private: // Data
-	    /// Data is ready to be rendered
+	    // Data is ready to be rendered
 	    TBool iReadyToRender;
+	    //If it can redo
+	    TBool iCanRedo;
 		/// Data buffer
-		TUint32* iData;
-		/// Drawed lines
+	    static	TUint32* iData;
+		// Drawed lines
 		RArray<RDrawPath> iPaths;	
-		/// Bitmap size 
-		TSize iBitmapSize;				
+		// Bitmap size 
+		TSize iBitmapSize;	
+		//Undo Path
+		RArray<RDrawPath> iUndoPaths;
+		CFbsBitmap* iBitmap;
+		CFbsBitmap* iMask;
     };
 
 #endif // __CFILTER_DRAW_H_
--- a/imageeditorengine/filters/FilterDraw/Inc/drawpath.h	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditorengine/filters/FilterDraw/Inc/drawpath.h	Thu Jun 03 18:57:10 2010 +0800
@@ -37,7 +37,8 @@
 public:
 
     RDrawPath();
-
+	TBuf<20> iBuf;
+    
 public:
     /**
      * Color.
@@ -76,6 +77,7 @@
     /**
      * Path color 
      */
+
     TRgb iColor;
 	TSize iSize;
     };
--- a/imageeditorengine/filters/FilterDraw/Src/cfilterdraw.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditorengine/filters/FilterDraw/Src/cfilterdraw.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -1,30 +1,30 @@
 /*
-* Copyright (c) 2010 Ixonos Plc.
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - Initial contribution
-*
-* Contributors:
-* Ixonos Plc
-*
-* Description:  
-* Draw filter for Draw UI plugin.
-*
-*/
-
+ * Copyright (c) 2010 Ixonos Plc.
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - Initial contribution
+ *
+ * Contributors:
+ * Ixonos Plc
+ *
+ * Description:  
+ * Draw filter for Draw UI plugin.
+ *
+ */
 
 #include <fbs.h>
 #include <bitdev.h>
 #include <e32math.h>
 #include "cfilterdraw.h"
 
-const TInt KDrawBitmapWidth(640);
-const TInt KDrawBitmapHeight(480);
+const TInt KDrawBitmapWidth(480);
+const TInt KDrawBitmapHeight(640);
+TUint32* CFilterDraw::iData = NULL;
 // ---------------------------------------------------------------------------
 // Create
 // ---------------------------------------------------------------------------
@@ -33,7 +33,7 @@
 	{
 	CFilterDraw* ptr = NULL;
 	TRAP_IGNORE( ptr = NewL() );
-	return (TInt)((MImageFilter*)ptr);
+	return (TInt) ((MImageFilter*) ptr);
 	}
 
 // ---------------------------------------------------------------------------
@@ -42,7 +42,7 @@
 //
 CFilterDraw* CFilterDraw::NewL()
 	{
-	return new( ELeave )CFilterDraw();
+	return new (ELeave) CFilterDraw();
 	}
 
 // ---------------------------------------------------------------------------
@@ -51,22 +51,44 @@
 //
 CFilterDraw::~CFilterDraw()
 	{
+	if(iData)
+	{
 	delete[] iData;
+	iData = NULL;
+	}
 	iReadyToRender = EFalse;
 	// Close all paths
-	for( TInt i(0); i<iPaths.Count(); i++ )
+	for (TInt i(0); i < iPaths.Count(); i++)
 		{
 		iPaths[i].Close();
 		}
-	iPaths.Close();	
+	iPaths.Close();
+	
+	for (TInt j(0); j < iUndoPaths.Count(); j++)
+		{
+		iUndoPaths[j].Close();
+		}
+	iUndoPaths.Close();
+	
+	if(iMask)
+		{
+		delete iMask;
+		iMask =NULL;
+		}
+	if(iBitmap)
+		{
+		delete iBitmap;
+		iBitmap =NULL;
+		}
 	}
 
 // ---------------------------------------------------------------------------
 // CFilterDraw
 // ---------------------------------------------------------------------------
 //
-CFilterDraw::CFilterDraw():iData(NULL), 
-    iBitmapSize(KDrawBitmapWidth, KDrawBitmapHeight)
+CFilterDraw::CFilterDraw() :
+	 iBitmapSize(KDrawBitmapWidth, KDrawBitmapHeight), iCanRedo(
+			EFalse)
 	{
 	}
 
@@ -97,55 +119,63 @@
 TSize CFilterDraw::ViewPortSize()
 	{
 	ASSERT(iChild);
-    return iChild->ViewPortSize();
+	return iChild->ViewPortSize();
 	}
 
 // ---------------------------------------------------------------------------
 // GetBlockL
 // ---------------------------------------------------------------------------
 //
-TBlock* CFilterDraw::GetBlockL( const TRect& aRect )
+TBlock* CFilterDraw::GetBlockL(const TRect& aRect)
 	{
-	ASSERT(iChild);	
-    TBlock* pB = iChild->GetBlockL( aRect );
-    if( !pB ) return NULL;
-    TUint32* pD = pB->iData;
-       
-    if( iData && iReadyToRender )
-           {
-           // Factor between real and viewed image
-           TReal realToViewedFactorWidth;
-           TReal realToViewedFactorHeight;
-           RealToViewedFactories(realToViewedFactorWidth, realToViewedFactorHeight);           
-           const TInt width( iBitmapSize.iWidth ); // Data bitmap width
+	ASSERT(iChild);
+	TBlock* pB = iChild->GetBlockL(aRect);
+	if (!pB)
+		return NULL;
+	TUint32* pD = pB->iData;
+
+	if (iData && iReadyToRender)
+		{
+		// Factor between real and viewed image
+		TReal realToViewedFactorWidth;
+		TReal realToViewedFactorHeight;
+		RealToViewedFactories(realToViewedFactorWidth, realToViewedFactorHeight);
+		const TInt width(iBitmapSize.iWidth); // Data bitmap width
 
-           for( TInt y(pB->iRect.iTl.iY); y<pB->iRect.iBr.iY; ++y )
-               {
-               TInt realY(y / Scale() + 0.5);
-               TInt viewY(realY / realToViewedFactorHeight + 0.5);               
-               for( TInt x(pB->iRect.iTl.iX); x<pB->iRect.iBr.iX; ++x )
-                   {
-                   TInt realX(x / Scale() + 0.5);
-                   TInt viewX(realX / realToViewedFactorWidth + 0.5);
+		for (TInt y(pB->iRect.iTl.iY); y < pB->iRect.iBr.iY; ++y)
+			{
+			TInt realY(y / Scale() + 0.5);
+			TInt viewY(realY / realToViewedFactorHeight + 0.5);
+			for (TInt x(pB->iRect.iTl.iX); x < pB->iRect.iBr.iX; ++x)
+				{
+				TInt realX(x / Scale() + 0.5);
+				TInt viewX(realX / realToViewedFactorWidth + 0.5);
 
-                   TUint32 color = iData[ width*viewY + viewX ];
-                   if( (color & 0xff000000) )
-                       {                           
-                       *pD = color;
-                       }
-                       
-                   *pD++;
-                   }                 
-               }    
-           }   
-    return pB;
+				if( viewY >= KDrawBitmapHeight)
+					{
+					viewY--;
+					}
+				if(iData[width * viewY + viewX])
+					{
+					TUint32 color = iData[width * viewY + viewX];
+					if ((color & 0xff000000))
+						{
+						*pD = color;
+						}
+					}
+				*pD++;
+				}
+			}
+		}
+	
+	return pB;
 	}
 
 // ---------------------------------------------------------------------------
 // SetParent
 // ---------------------------------------------------------------------------
 //
-void CFilterDraw::SetParent( MImageFilter* aParent )
+void CFilterDraw::SetParent(MImageFilter* aParent)
 	{
 	ASSERT(aParent);
 	iParent = aParent;
@@ -155,7 +185,7 @@
 // SetChild
 // ---------------------------------------------------------------------------
 //
-void CFilterDraw::SetChild( MImageFilter* aChild )
+void CFilterDraw::SetChild(MImageFilter* aChild)
 	{
 	ASSERT(aChild);
 	iChild = aChild;
@@ -165,120 +195,163 @@
 // CmdL
 // ---------------------------------------------------------------------------
 //
-TInt CFilterDraw::CmdL( const TDesC16& aCmd )
+TInt CFilterDraw::CmdL(const TDesC16& aCmd)
 	{
+	TInt bbb(0);
+	bbb = iPaths.Count();
 	ASSERT(iChild);
-	TLex lex (aCmd);
-	TPoint position(0,0);	
-    // Factor between real and viewed image
-    TReal realToViewedFactorWidth;
-    TReal realToViewedFactorHeight;
-    RealToViewedFactories(realToViewedFactorWidth, realToViewedFactorHeight);
-    
+	TLex lex(aCmd);
+	TPoint position(0, 0);
+	// Factor between real and viewed image
+	TReal realToViewedFactorWidth;
+	TReal realToViewedFactorHeight;
+	RealToViewedFactories(realToViewedFactorWidth, realToViewedFactorHeight);
+
 	//	Handle parameters
-    while( !lex.Eos() )
+	while (!lex.Eos())
 		{
+		RDebug::RawPrint(aCmd);
 		TPtrC token = lex.NextToken();
-		if( token.Compare( _L("x") ) == 0 )
+		TInt pathCount(0);
+		pathCount = iPaths.Count();
+
+		if (token.Compare(_L("x")) == 0)
 			{
+			iCanRedo = EFalse;
+			for (TInt j(0); j < iUndoPaths.Count(); j++)
+				{
+				iUndoPaths[j].Close();
+				}
+			iUndoPaths.Close();
 			iReadyToRender = EFalse;
-            TReal relscale = Scale();
-            TInt param = 0;
-			lex.Inc ();
-			lex.Val (param);
+			TReal relscale = Scale();
+			TInt param = 0;
+			lex.Inc();
+			lex.Val(param);
 			// Coordinates on data bitmap
-            position.iX = (TReal(param) / relscale) / realToViewedFactorWidth + 0.5;
+			position.iX = (TReal(param) / relscale) / realToViewedFactorWidth + 0.5;
 			}
-		else if( token.Compare( _L("y") ) == 0 )
+		else if (token.Compare(_L("y")) == 0)
 			{
-            TReal relscale = Scale();
-            TInt param = 0;
-			lex.Inc ();
-			lex.Val (param);
-            position.iY = (TReal(param) / relscale) / realToViewedFactorHeight + 0.5;	    			
-            RDebug::Print(_L("CFilterDraw::CmdL x:%d y:%d Scale:%g Rw:%d Rh:%d Vpw:%d Vph:%d Rtvw:%g Rtvh:%g"), 
-                   position.iX,
-                   position.iY,
-                   relscale,
-                   Rect().Size().iWidth,
-                   Rect().Size().iHeight,
-                   ViewPortSize().iWidth,
-                   ViewPortSize().iHeight,
-                   realToViewedFactorWidth,
-                   realToViewedFactorHeight);   			
-		    
-			if(!iPaths.Count())
+			TReal relscale = Scale();
+			TInt param = 0;
+			lex.Inc();
+			lex.Val(param);
+			position.iY = (TReal(param) / relscale) / realToViewedFactorHeight + 0.5;
+			RDebug::Print(
+					_L("CFilterDraw::CmdL x:%d y:%d Scale:%g Rw:%d Rh:%d Vpw:%d Vph:%d Rtvw:%g Rtvh:%g"),
+					position.iX, position.iY, relscale, Rect().Size().iWidth,
+					Rect().Size().iHeight, ViewPortSize().iWidth,
+					ViewPortSize().iHeight, realToViewedFactorWidth,
+					realToViewedFactorHeight);
+
+			if (!iPaths.Count())
 				{
 				RDrawPath newPath;
-				User::LeaveIfError( newPath.Append(position) );
-				User::LeaveIfError( iPaths.Append( newPath ) );
+				User::LeaveIfError(newPath.Append(position));
+				User::LeaveIfError(iPaths.Append(newPath));
 				}
 			else
-				{	
-				ASSERT(iPaths.Count());	
-				RDrawPath& lastPath = iPaths[iPaths.Count()-1];
-				User::LeaveIfError( lastPath.Append(position) );				
+				{
+				ASSERT(iPaths.Count());
+				RDrawPath& lastPath = iPaths[iPaths.Count() - 1];
+				User::LeaveIfError(lastPath.Append(position));
 				}
 			}
-		else if( token.Compare( _L("color") ) == 0 )
+		else if (token.Compare(_L("color")) == 0)
 			{
 			TUint32 color(0);
 			lex.Inc();
-			lex.Val( color, EDecimal );
+			lex.Val(color, EDecimal);
 			TRgb rgb(color);
-			TUint32 colorValue = 
-			    ( rgb.Red() << 16 ) + ( rgb.Green() << 8 ) + rgb.Blue();
-            ASSERT( iPaths.Count() );
-			RDrawPath& lastPath = iPaths[iPaths.Count()-1];            
-            lastPath.SetColor( TRgb(colorValue) );			
-			}			
-		else if( token.Compare( _L("size") ) == 0 )
+			TUint32 colorValue = (rgb.Red() << 16) + (rgb.Green() << 8)	+ rgb.Blue();
+			ASSERT( iPaths.Count() );
+			RDrawPath& lastPath = iPaths[iPaths.Count() - 1];
+			lastPath.SetColor(TRgb(colorValue));
+			}
+		else if (token.Compare(_L("size")) == 0)
 			{
 			TInt size(0);
-			lex.Inc ();
+			lex.Inc();
 			lex.Val(size);
 			// Scale line size to match bitmap scale
 			TInt sizew( (TReal(size) / realToViewedFactorWidth) + 0.5 );
 			TInt sizeh( (TReal(size) / realToViewedFactorHeight) + 0.5 );
-			
-			if( !sizew )
-			    {
-			    sizew++;
-			    }
-            if( !sizeh )
-                {
-                sizeh++;
-                }			
-						
-			if(iPaths.Count())	
+
+			if (!sizew)
+				{
+				sizew++;
+				}
+			if (!sizeh)
 				{
-				RDrawPath& lastPath = iPaths[iPaths.Count()-1];
-				lastPath.SetSize( TSize(sizew, sizeh) );			
+				sizeh++;
+				}
+
+			if (iPaths.Count())
+				{
+				RDrawPath& lastPath = iPaths[iPaths.Count() - 1];
+				lastPath.SetSize(TSize(sizew, sizeh));
 				}
 			}
-        else if( token.Compare( _L("lastItem") ) == 0 )
-            {
-            ASSERT(iPaths.Count()); 
-            
-            RDrawPath& lastPath = iPaths[iPaths.Count()-1];
-            RDebug::Print(_L("CFilterDraw::CmdL lastItem count:%d size:%d r:%d g:%d b:%d"), 
-                    iPaths.Count(), lastPath.Size().iHeight,
-                    lastPath.Color().Red(),
-                    lastPath.Color().Green(),
-                    lastPath.Color().Blue()
-                    );
+		else if (token.Compare(_L("lastItem")) == 0)
+			{
+			ASSERT(iPaths.Count());
+
+			RDrawPath& lastPath = iPaths[iPaths.Count() - 1];
+			RDebug::Print(
+					_L("CFilterDraw::CmdL lastItem count:%d size:%d r:%d g:%d b:%d"),
+					iPaths.Count(), lastPath.Size().iHeight,
+					lastPath.Color().Red(), lastPath.Color().Green(),
+					lastPath.Color().Blue());
 
-            RDrawPath newPath;
-            User::LeaveIfError( iPaths.Append( newPath ) );             
-            }   		
-        else if( token.Compare( _L("done") ) == 0 )
-            {
-            LoadFrameL();
-            iReadyToRender = ETrue;
-            } 				
+			RDrawPath newPath;
+			User::LeaveIfError(iPaths.Append(newPath));
+			}
+		else if (token.Compare(_L("done")) == 0)
+			{
+			LoadFrameL();
+			iReadyToRender = ETrue;
+			}
+		//Undo functionality
+		else if (token.Compare(_L("Undo")) == 0)
+			{
+			TInt count(0);
+			count = iPaths.Count();
+			count = iUndoPaths.Count();
+			
+			if (iPaths.Count() > 1)
+				{
+				TInt count = iPaths.Count();
+				iUndoPaths.Append(iPaths[iPaths.Count() - 2]);
+				iPaths.Remove(iPaths.Count() - 2);
+				iCanRedo = ETrue;
+				}
+			count = iPaths.Count();
+			count = iUndoPaths.Count();
+			}
+		//Redo functionality
+		else if (token.Compare(_L("redone")) == 0)
+			{
+			TInt count(0);
+			count = iPaths.Count();
+			count = iUndoPaths.Count();
+
+			if (iCanRedo)
+				{
+				if (iUndoPaths.Count())
+					{
+					if (iPaths.Count() >= 1)
+						{
+						iPaths.Insert(iUndoPaths[iUndoPaths.Count() - 1],iPaths.Count() - 1);
+						iUndoPaths.Remove(iUndoPaths.Count() - 1);
+						}
+					}
+				}
+			count = iPaths.Count();
+			count = iUndoPaths.Count();
+			}
 		}
-
-    return KErrNone;
+	return KErrNone;
 	}
 
 // ---------------------------------------------------------------------------
@@ -295,131 +368,129 @@
 // ---------------------------------------------------------------------------
 //
 void CFilterDraw::LoadFrameL()
-	{ 
-    RDebug::Print(_L("CFilterDraw::LoadFrameL w:%d h:%d"), 
-        iBitmapSize.iWidth,
-        iBitmapSize.iHeight);  
+	{
+	RDebug::Print(_L("CFilterDraw::LoadFrameL w:%d h:%d"), iBitmapSize.iWidth,
+			iBitmapSize.iHeight);
+	
+	TInt xxx(0);
+	xxx = iPaths.Count();
+	//  Create a bitmap big enough to hold the drawed lines
+	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
+	CleanupStack::PushL(bitmap);
+	User::LeaveIfError(bitmap->Create(iBitmapSize, EColor16MA));
 
-    //  Create a bitmap big enough to hold the drawed lines
-	CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
-	CleanupStack::PushL( bitmap );
-    User::LeaveIfError( bitmap->Create( iBitmapSize, EColor16MA ) );
-    
 	// create mask
-	CFbsBitmap* mask = new (ELeave) CFbsBitmap();	
-	CleanupStack::PushL( mask );
-	User::LeaveIfError( mask->Create(iBitmapSize,EColor16MA) );
+	CFbsBitmap* mask = new (ELeave) CFbsBitmap();
+	CleanupStack::PushL(mask);
+	User::LeaveIfError(mask->Create(iBitmapSize, EColor16MA));
 
-	CFbsBitmapDevice* maskDevice = CFbsBitmapDevice::NewL( mask );
-	CleanupStack::PushL( maskDevice );
+	CFbsBitmapDevice* maskDevice = CFbsBitmapDevice::NewL(mask);
+	CleanupStack::PushL(maskDevice);
 
-    CFbsBitGc * maskContext(NULL);
-    User::LeaveIfError( maskDevice->CreateContext(maskContext) );
-    CleanupStack::PushL(maskContext);
-    maskContext->SetPenStyle(CGraphicsContext::ESolidPen);
+	CFbsBitGc * maskContext(NULL);
+	User::LeaveIfError(maskDevice->CreateContext(maskContext));
+	CleanupStack::PushL(maskContext);
+	maskContext->SetPenStyle(CGraphicsContext::ESolidPen);
 	maskContext->SetBrushStyle(CGraphicsContext::ESolidBrush);
 	maskContext->SetBrushColor(KRgbBlack);
-    
-    //  Create bitmap device and context
-    CFbsBitmapDevice * bitmapDevice = CFbsBitmapDevice::NewL (bitmap); 
-    CleanupStack::PushL (bitmapDevice);
+
+	//  Create bitmap device and context
+	CFbsBitmapDevice * bitmapDevice = CFbsBitmapDevice::NewL(bitmap);
+	CleanupStack::PushL(bitmapDevice);
 
 	//	Create bitmap graphics context
-    CFbsBitGc * bitmapContext(NULL);
-    User::LeaveIfError (bitmapDevice->CreateContext (bitmapContext));
-    CleanupStack::PushL (bitmapContext);
-      	
+	CFbsBitGc * bitmapContext(NULL);
+	User::LeaveIfError(bitmapDevice->CreateContext(bitmapContext));
+	CleanupStack::PushL(bitmapContext);
+
 	TDisplayMode dmode = bitmap->DisplayMode();
-   		
-	for(TInt pathNumber(0); pathNumber<iPaths.Count(); pathNumber++)
-   		{
-   		RDrawPath path = iPaths[pathNumber];
-		bitmapContext->SetPenStyle (CGraphicsContext::ESolidPen);
-		bitmapContext->SetBrushStyle (CGraphicsContext::ESolidBrush);
+
+	for (TInt pathNumber(0); pathNumber < iPaths.Count(); pathNumber++)
+		{
+		RDrawPath path = iPaths[pathNumber];
+		bitmapContext->SetPenStyle(CGraphicsContext::ESolidPen);
+		bitmapContext->SetBrushStyle(CGraphicsContext::ESolidBrush);
 		bitmapContext->SetPenColor(path.Color());
 		bitmapContext->SetPenSize(path.Size());
-		maskContext->SetPenSize(path.Size());   		
+		maskContext->SetPenSize(path.Size());
 
-	    RDebug::Print(_L("CFilterDraw::LoadFrameL ps:%dx%d S:%g"), 
-            path.Size().iWidth,
-            path.Size().iHeight,
-            Scale());  
-	    
+		RDebug::Print(_L("CFilterDraw::LoadFrameL ps:%dx%d S:%g"),
+				path.Size().iWidth, path.Size().iHeight, Scale());
+
 		CArrayFix<TPoint>* pointArray = NULL;
 		RDrawPath2PointArray(path, pointArray);
-		bitmapContext->DrawPolyLine( pointArray );
-		maskContext->DrawPolyLine( pointArray );
+		bitmapContext->DrawPolyLine(pointArray);
+		maskContext->DrawPolyLine(pointArray);
 
 		delete pointArray;
-   		}
-		
-	//	Create memory buffer to hold rendered image data
-
-    if( !iData )
-        {
-        iData = new (ELeave) TUint32 [iBitmapSize.iWidth * iBitmapSize.iHeight];
-        }
-    Mem::FillZ(iData, 
-            iBitmapSize.iWidth * iBitmapSize.iHeight * sizeof (TUint32));
+		}
 
-    TBitmapUtil bm (bitmap);
-    bm.Begin(TPoint(0,0));
-    TBitmapUtil maskbm (mask);
-    maskbm.Begin(TPoint(0,0));    
-    TRgb rgb(0);
-    // Find drawed lines from bitmap    
-    for (TInt y(0); y < iBitmapSize.iHeight - 1; y++ )
-    	{
-    	for (TInt x(0); x < iBitmapSize.iWidth - 1; x++ )
-    		{
-    		// Check mask first
-    		maskbm.SetPos(TPoint(x,y));
-    		if( maskbm.GetPixel() == KRgbBlack.Internal() )
-    			{     			
-    			bm.SetPos(TPoint(x,y));
-    			rgb = bm.GetPixel();
-       			iData[(iBitmapSize.iWidth*y)+x] = 
-       				( rgb.Red() << 16 ) + ( rgb.Green() << 8 ) + rgb.Blue() | 
-       				0xff000000;
-    			}
-    		}
-    	}
+	//	Create memory buffer to hold rendered image data
+    
+	if (!iData)
+		{		
+		iData = new (ELeave) TUint32[iBitmapSize.iWidth * iBitmapSize.iHeight];
+		Mem::FillZ(iData, iBitmapSize.iWidth * iBitmapSize.iHeight
+								* sizeof(TUint32));
+		}
+	
+	TBitmapUtil bm(bitmap);
+	bm.Begin(TPoint(0, 0));
+	TBitmapUtil maskbm(mask);
+	maskbm.Begin(TPoint(0, 0));
+	TRgb rgb(0);
+	
+	// Find drawed lines from bitmap    
+	for (TInt y(0); y < iBitmapSize.iHeight - 1; y++)
+		{
+		for (TInt x(0); x < iBitmapSize.iWidth - 1; x++)
+			{
+			// Check mask first
+			maskbm.SetPos(TPoint(x, y));
+			if (maskbm.GetPixel() == KRgbBlack.Internal())
+				{
+				bm.SetPos(TPoint(x, y));
+				rgb = bm.GetPixel();
+				iData[(iBitmapSize.iWidth * y) + x] = (rgb.Red() << 16)
+						+ (rgb.Green() << 8) + rgb.Blue() | 0xff000000;
+				}
+			}
+		}
+	
 	bm.End();
 	maskbm.End();
 	// bitmapContext, bitmapDevice, maskContext, maskDevice, mask, bitmap
-	CleanupStack::PopAndDestroy(6, bitmap); 
-    RDebug::Print(_L("CFilterDraw::LoadFrameL - end"));  	
+	CleanupStack::PopAndDestroy(6, bitmap);
+	RDebug::Print(_L("CFilterDraw::LoadFrameL - end"));
 	}
-	
+
 // ---------------------------------------------------------------------------
 // RDrawPath2PointArray
 // ---------------------------------------------------------------------------
 //
-void CFilterDraw::RDrawPath2PointArray( 
-	const RDrawPath& aPath, CArrayFix<TPoint>*& aArrayPtr) const
-    {   
-    // if allocation fails just do nothing. +1 if count is zero
-    aArrayPtr = new CArrayFixFlat<TPoint> ( aPath.Count() + 1 );
-    if (aArrayPtr)
-    	{
-    	for( TInt i(0); i<aPath.Count(); i++ )
-    		{
-    		TPoint item = aPath[i];
-    		TRAP_IGNORE( aArrayPtr->AppendL( item ) );
-    		}
-    	}
-    }
+void CFilterDraw::RDrawPath2PointArray(const RDrawPath& aPath,
+		CArrayFix<TPoint>*& aArrayPtr) const
+	{
+	// if allocation fails just do nothing. +1 if count is zero
+	aArrayPtr = new CArrayFixFlat<TPoint> (aPath.Count() + 1);
+	if (aArrayPtr)
+		{
+		for (TInt i(0); i < aPath.Count(); i++)
+			{
+			TPoint item = aPath[i];
+			TRAP_IGNORE( aArrayPtr->AppendL( item ) );
+			}
+		}
+	}
 
 // ---------------------------------------------------------------------------
 // RealToViewedFactories
 // ---------------------------------------------------------------------------
 //
 void CFilterDraw::RealToViewedFactories(TReal& aWidth, TReal& aHeight)
-    {
-    // Factor between real and viewed image
-    aWidth = TReal(ViewPortSize().iWidth) / 
-        TReal(iBitmapSize.iWidth);
-    aHeight = TReal(ViewPortSize().iHeight) / 
-        TReal(iBitmapSize.iHeight);    
-    }
+	{
+	// Factor between real and viewed image
+	aWidth = TReal(ViewPortSize().iWidth) / TReal(iBitmapSize.iWidth);
+	aHeight = TReal(ViewPortSize().iHeight) / TReal(iBitmapSize.iHeight);
+	}
 
--- a/imageeditorengine/filters/FilterDraw/Src/drawpath.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditorengine/filters/FilterDraw/Src/drawpath.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -27,5 +27,6 @@
 //
 RDrawPath::RDrawPath():iColor(KRgbWhite)
     {
+    iBuf.Append(_L("UnInitialize"));
     }
 
--- a/imageeditorengine/group/bld.inf	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditorengine/group/bld.inf	Thu Jun 03 18:57:10 2010 +0800
@@ -40,9 +40,7 @@
 #include "../filters/FilterSepia/group/bld.inf"
 #include "../filters/FilterSharpness/group/bld.inf"
 #include "../filters/FilterText/group/bld.inf"
-#ifdef RD_IE_DRAW_PLUGIN
 #include "../filters/FilterDraw/group/bld.inf"
-#endif // RD_IE_DRAW_PLUGIN
 // Image Editor Utilitties
 #include "../ImageEditorUtils/group/bld.inf"