photosgallery/viewframework/views/cloudview/src/glxtagscontextmenucontrol.cpp
branchRCL_3
changeset 14 ce1c7ad1f18b
parent 13 71da52165949
child 22 2dac0fdba72b
equal deleted inserted replaced
13:71da52165949 14:ce1c7ad1f18b
    27 #include <alf/alfenv.h>
    27 #include <alf/alfenv.h>
    28 #include <alf/alfeventhandler.h>
    28 #include <alf/alfeventhandler.h>
    29 #include <alf/alfutil.h>
    29 #include <alf/alfutil.h>
    30 #include <alf/alftexture.h>
    30 #include <alf/alftexture.h>
    31 #include <alf/alfevent.h>
    31 #include <alf/alfevent.h>
    32 #include <alf/ialfwidgetfactory.h>
       
    33 #include <alf/ialfviewwidget.h>
       
    34 #include <alf/alfdisplay.h>
    32 #include <alf/alfdisplay.h>
    35 
    33 #include <alf/alfframebrush.h>
    36 #include <aknnotewrappers.h>
    34 
    37 #include <fbs.h>
       
    38 #include <StringLoader.h>
    35 #include <StringLoader.h>
    39 #include "utf.h"                    // UtfConverter
       
    40 
    36 
    41 // Photos Headers
    37 // Photos Headers
    42 #include "glxtagscontextmenucontrol.h"
    38 #include "glxtagscontextmenucontrol.h"
    43 #include "glxcommandfactory.h"
    39 #include "glxcommandfactory.h"
    44 #include <mglxmedialist.h>                          //for medialist
    40 #include <mglxmedialist.h>                          //for medialist
    70 const TInt KTimerDelay = 6000000;
    66 const TInt KTimerDelay = 6000000;
    71 //Control complete height
    67 //Control complete height
    72 const TInt KGridHeight = KReqHeightPerMenuItem * KNumofMenuItems;
    68 const TInt KGridHeight = KReqHeightPerMenuItem * KNumofMenuItems;
    73 //Text size for menu items
    69 //Text size for menu items
    74 const TInt KTextSizeInPixels = 20;
    70 const TInt KTextSizeInPixels = 20;
       
    71 //X shrink factor for stylus menu border to be drawn/visible
       
    72 const TInt KShrinkXCoord = 5;
       
    73 //Y shrink factor for stylus menu border to be drawn/visible
       
    74 const TInt KShrinkYCoord = 5;
    75 
    75 
    76 //For Tagging the visuals
    76 //For Tagging the visuals
    77 _LIT8(KTagSlideshow, "SS");
    77 _LIT8(KTagSlideshow, "SS");
    78 _LIT8(KTagRename, "Ren");
    78 _LIT8(KTagRename, "Ren");
    79 _LIT8(KTagDelete, "Del");
    79 _LIT8(KTagDelete, "Del");
   128     iMainVisual = CAlfAnchorLayout::AddNewL(*this);
   128     iMainVisual = CAlfAnchorLayout::AddNewL(*this);
   129     iMainVisual->SetFlag(EAlfVisualFlagManualLayout);
   129     iMainVisual->SetFlag(EAlfVisualFlagManualLayout);
   130     iMainVisual->SetSize(TSize(KReqWidth, KGridHeight));
   130     iMainVisual->SetSize(TSize(KReqWidth, KGridHeight));
   131     iMainVisual->SetPos(TAlfRealPoint(KDummyPoint));
   131     iMainVisual->SetPos(TAlfRealPoint(KDummyPoint));
   132     
   132     
   133     CFbsBitmap* bitmap = AknsUtils::GetCachedBitmap(
   133     iMainVisual->EnableBrushesL(ETrue);
   134             AknsUtils::SkinInstance(), KAknsIIDQsnFrPopupCenter);
   134     
   135     CleanupStack::PushL(bitmap);
   135     TRect outerRect(TRect(TPoint(KDummyPoint),TSize(KReqWidth, KGridHeight)));
   136     
   136     TRect innerRect(outerRect);
   137     CAlfTexture& backgroundAvkonTexture = 
   137     innerRect.Shrink(KShrinkXCoord,KShrinkYCoord);
   138 		iUiUtility->GlxTextureManager().CreateColorAvkonIconTextureL( 
   138 
   139 				KAknsIIDQsnFrPopupCenter, bitmap->Handle(), KRgbTransparent) ;
   139     CAlfFrameBrush* frameBrush = CAlfFrameBrush::NewLC(*(iUiUtility->Env()),
   140     
   140                                         KAknsIIDQsnFrPopupSub );
   141     CleanupStack::Pop(bitmap);
   141     frameBrush->SetFrameRectsL(innerRect, outerRect);
   142     
   142    
   143     // BackGround Border Image Visual
   143     iMainVisual->Brushes()->AppendL(frameBrush,EAlfHasOwnership);
   144     iBackgroundBorderImageVisual = CAlfImageVisual::AddNewL(*this,iMainVisual);
   144     CleanupStack::Pop(frameBrush);
   145     iBackgroundBorderImageVisual->SetImage(TAlfImage(backgroundAvkonTexture));
   145     
   146 
       
   147     // Create a new 3x1 grid layout visual.
   146     // Create a new 3x1 grid layout visual.
   148     iGrid = CAlfGridLayout::AddNewL(*this, KNoOfColumns, KNumofMenuItems , 
   147     iGrid = CAlfGridLayout::AddNewL(*this, KNoOfColumns, KNumofMenuItems , 
   149 			iMainVisual);//columns, rows
   148 			iMainVisual);//columns, rows
   150 
   149 
   151     //Finally create the menu list that will appear in screen
   150     //Finally create the menu list that will appear in screen
   210     TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::CreateMenuList");
   209     TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::CreateMenuList");
   211     
   210     
   212     TRgb color;
   211     TRgb color;
   213     //Gets the color of the text specific to skin 
   212     //Gets the color of the text specific to skin 
   214     AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
   213     AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
   215             color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 );
   214             color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG20 );
   216     
   215     
   217     //Loading the strings from rss
   216     //Loading the strings from rss
   218     HBufC* renameTitle = StringLoader::LoadLC( R_GLX_TAGS_RENAME_TITLE );
   217     HBufC* renameTitle = StringLoader::LoadLC( R_GLX_TAGS_RENAME_TITLE );
   219     HBufC* slideshowTitle = StringLoader::LoadLC( R_GLX_TAGS_SLIDESHOW_TITLE );
   218     HBufC* slideshowTitle = StringLoader::LoadLC( R_GLX_TAGS_SLIDESHOW_TITLE );
   220     HBufC* deleteTitle = StringLoader::LoadLC( R_GLX_TAGS_DELETE_TITLE );
   219     HBufC* deleteTitle = StringLoader::LoadLC( R_GLX_TAGS_DELETE_TITLE );
   301         {
   300         {
   302         iMainVisual->SetOpacity(KOpacityTransparent);
   301         iMainVisual->SetOpacity(KOpacityTransparent);
   303         iItemMenuVisibility = EFalse;
   302         iItemMenuVisibility = EFalse;
   304         }
   303         }
   305     }
   304     }
       
   305 
       
   306 // --------------------------------------------------------------------------- 
       
   307 // ItemMenuVisibility()
       
   308 // --------------------------------------------------------------------------- 
       
   309 //
       
   310 TBool CGlxTagsContextMenuControl::ItemMenuVisibility()
       
   311     {
       
   312     return iItemMenuVisibility;
       
   313     }
       
   314 
   306 // --------------------------------------------------------------------------- 
   315 // --------------------------------------------------------------------------- 
   307 // OfferEventL()
   316 // OfferEventL()
   308 // --------------------------------------------------------------------------- 
   317 // --------------------------------------------------------------------------- 
   309 //
   318 //
   310 TBool CGlxTagsContextMenuControl::OfferEventL(const TAlfEvent& aEvent)
   319 TBool CGlxTagsContextMenuControl::OfferEventL(const TAlfEvent& aEvent)