photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp
changeset 0 4e91876724a2
child 2 7d9067c6fcb1
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    Delete command handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #include "glxcommandhandleraiwedit.h"
       
    22 
       
    23 #include <glxattributecontext.h>
       
    24 
       
    25 #include <glxcommandhandlers.hrh>
       
    26 #include <glxmedia.h>
       
    27 #include <glxuiutilities.rsg>
       
    28 
       
    29 #include "glxaiwservicehandler.h"
       
    30 #include <StringLoader.h>
       
    31 #include <glxmedialist.h> 
       
    32 #include <glxtracer.h>
       
    33 #include <glxlog.h>
       
    34 const TInt KGlxAiwEditCommandSpace = 0x00000200;
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // NewL
       
    38 // -----------------------------------------------------------------------------
       
    39 //	
       
    40 EXPORT_C CGlxCommandHandlerAiwEdit* CGlxCommandHandlerAiwEdit::NewL(
       
    41         MGlxMediaListProvider* aMediaListProvider, TInt aMenuResource)
       
    42     {
       
    43     CGlxCommandHandlerAiwEdit* self = new ( ELeave ) 
       
    44         CGlxCommandHandlerAiwEdit(aMediaListProvider, aMenuResource);
       
    45     CleanupStack::PushL( self );
       
    46     self->ConstructL();
       
    47     CleanupStack::Pop( self );
       
    48     return self;
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CGlxCommandHandlerAiwEdit::DoGetRequiredAttributesL
       
    53 // -----------------------------------------------------------------------------
       
    54 //	
       
    55 void CGlxCommandHandlerAiwEdit::DoGetRequiredAttributesL
       
    56 									(RArray<TMPXAttribute>& aAttributes, TBool aFilterUsingSelection) const
       
    57 	{
       
    58 	if (!aFilterUsingSelection || SelectionLength() <= MaxSelectedItems())
       
    59 		{
       
    60 		// Add filename attribute to fetch context
       
    61 		aAttributes.AppendL(KMPXMediaGeneralUri);
       
    62 		}
       
    63 	}
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // Constructor
       
    67 // -----------------------------------------------------------------------------
       
    68 //	
       
    69 CGlxCommandHandlerAiwEdit::CGlxCommandHandlerAiwEdit(
       
    70         MGlxMediaListProvider* aMediaListProvider, TInt aMenuResource)
       
    71 :   CGlxCommandHandlerAiwBase(aMediaListProvider, aMenuResource)
       
    72     {
       
    73     }
       
    74     
       
    75 // -----------------------------------------------------------------------------
       
    76 // CommandId
       
    77 // -----------------------------------------------------------------------------
       
    78 //	
       
    79 TInt CGlxCommandHandlerAiwEdit::CommandId() const
       
    80     {
       
    81     return EGlxCmdAiwEdit;
       
    82     }
       
    83     
       
    84 // -----------------------------------------------------------------------------
       
    85 // AiwCommandId
       
    86 // -----------------------------------------------------------------------------
       
    87 //	
       
    88 TInt CGlxCommandHandlerAiwEdit::AiwCommandId() const
       
    89     {
       
    90     return KAiwCmdEdit;
       
    91     }
       
    92     
       
    93 // -----------------------------------------------------------------------------
       
    94 // AiwInterestResource
       
    95 // -----------------------------------------------------------------------------
       
    96 //	
       
    97 TInt CGlxCommandHandlerAiwEdit::AiwInterestResource() const
       
    98     {
       
    99     return R_GLX_AIW_EDIT_INTEREST;
       
   100     }
       
   101         
       
   102 // -----------------------------------------------------------------------------
       
   103 // AppendAiwParameterL
       
   104 // -----------------------------------------------------------------------------
       
   105 //	
       
   106 TBool CGlxCommandHandlerAiwEdit::AppendAiwParameterL(const TGlxMedia& aItem, 
       
   107                                      CGlxAiwServiceHandler& aAiwServiceHandler)
       
   108     {
       
   109     return AppendDefaultAiwParameterL(  aItem, 
       
   110                                         aAiwServiceHandler, 
       
   111                                         ETrue,                  // Add the Uri
       
   112                                         EFalse);                // Don't add the Mime Type
       
   113     }
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // CommandSpace
       
   117 // -----------------------------------------------------------------------------
       
   118 //	
       
   119 TInt CGlxCommandHandlerAiwEdit::CommandSpace() const
       
   120     {
       
   121     return KGlxAiwEditCommandSpace;
       
   122     }
       
   123 	
       
   124 // -----------------------------------------------------------------------------
       
   125 // AiwDoDynInitMenuPaneL
       
   126 // -----------------------------------------------------------------------------
       
   127 //	
       
   128 void CGlxCommandHandlerAiwEdit::AiwDoDynInitMenuPaneL(TInt /*aResourceId*/, 
       
   129         CEikMenuPane* aMenuPane)
       
   130     {
       
   131     TRACER("CGlxCommandHandlerAiwEdit::AiwDoDynInitMenuPaneL()");
       
   132     HBufC* currentTitle = StringLoader::LoadLC( R_QTN_LGAL_OPTIONS_EDIT );
       
   133     TInt cmdId = AiwMenuCmdIdL( *currentTitle,aMenuPane ) ;
       
   134     CleanupStack::PopAndDestroy(currentTitle);
       
   135     if( KErrNotFound != cmdId )
       
   136         {
       
   137         if ((MediaList().SelectionCount() > 1))
       
   138             {
       
   139             aMenuPane->SetItemDimmed(cmdId,ETrue);    
       
   140             }
       
   141         }
       
   142     }