photosgallery/viewframework/plugins/gridviewplugin/src/glxmaingridviewplugin.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:    Implementation 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include "glxmaingridviewplugin.h"
       
    24 #include "glxgridviewplugin.hrh"
       
    25 
       
    26 #include <data_caging_path_literals.hrh>
       
    27 
       
    28 #include <glxgridviewdata.rsg>
       
    29 #include <glxresourceutilities.h>                // for CGlxResourceUtilities
       
    30 
       
    31 #include <glxcommandhandlerhelp.h>
       
    32 
       
    33 #include <AknUtils.h>
       
    34 #include <avkon.hrh>
       
    35 #include <bautils.h>
       
    36 
       
    37 #include <glxgridview.h>
       
    38 #include <glxcommandhandlerslideshow.h>
       
    39 #include <glxtracer.h>
       
    40 #include <glxlog.h>
       
    41 
       
    42 
       
    43 _LIT(KGlxGridResource,"glxGridviewdata.rsc");
       
    44 
       
    45 
       
    46 // ---------------------------------------------------------------------------
       
    47 // C++ default constructor can NOT contain any code, that
       
    48 // might leave.
       
    49 // ---------------------------------------------------------------------------
       
    50 //
       
    51 CGlxMainGridViewPlugin::CGlxMainGridViewPlugin()
       
    52 
       
    53     {
       
    54     TRACER("CGlxMainGridViewPlugin::CGlxMainGridViewPlugin()");
       
    55     iResourceIds.iMenuId = R_GLX_GRID_MENU;
       
    56     iResourceIds.iViewId = R_GRID_VIEW;
       
    57     iResourceIds.iCbaId = R_GRID_SOFTKEYS;
       
    58     iResourceIds.iEmptyViewTextId = R_GRID_EMPTY_VIEW_TEXT;
       
    59     iResourceIds.iOkOptionsMenuId = R_GRID_OK_MENUBAR;
       
    60     iViewUID = KGlxMainGridViewImplementationId;
       
    61     
       
    62                 
       
    63     }
       
    64 
       
    65 // ---------------------------------------------------------------------------
       
    66 // Symbian 2nd phase constructor can leave.
       
    67 // ---------------------------------------------------------------------------
       
    68 //
       
    69 void CGlxMainGridViewPlugin::ConstructL()
       
    70     {
       
    71     GLX_LOG_INFO("CGlxMainGridViewPlugin::ConstructL()");
       
    72     // Do nothing
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // Two-phased constructor.
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 CGlxMainGridViewPlugin* CGlxMainGridViewPlugin::NewL()
       
    80     {
       
    81     TRACER("CGlxMainGridViewPlugin::NewL()");
       
    82     CGlxMainGridViewPlugin* self = 
       
    83         new ( ELeave ) CGlxMainGridViewPlugin();
       
    84     CleanupStack::PushL( self );
       
    85     self->ConstructL();
       
    86     CleanupStack::Pop( self );
       
    87     return self;
       
    88     }
       
    89 
       
    90 // ---------------------------------------------------------------------------
       
    91 // Destructor
       
    92 // ---------------------------------------------------------------------------
       
    93 //
       
    94 CGlxMainGridViewPlugin::~CGlxMainGridViewPlugin()
       
    95     {
       
    96     TRACER("CGlxMainGridViewPlugin::~CGlxMainGridViewPlugin()");
       
    97     // Do nothing
       
    98     }
       
    99 
       
   100 // ---------------------------------------------------------------------------
       
   101 // AddCommandHandlersL
       
   102 // ---------------------------------------------------------------------------
       
   103 //
       
   104 void CGlxMainGridViewPlugin::AddCommandHandlersL()
       
   105     {
       
   106     CGlxGridViewPluginBase::AddCommandHandlersL();
       
   107 
       
   108     TGlxHelpContext helpInfo;
       
   109     helpInfo.iBrowseContext = LGAL_HLP_ALL_GRID;
       
   110     helpInfo.iViewContext = LGAL_HLP_ALL_FULLSCREEN;
       
   111     GLX_LOG_INFO( "Adding CGlxCommandHandlerSlideshow" );
       
   112     iGridView->AddCommandHandlerL(
       
   113                     CGlxCommandHandlerSlideshow::NewL( iGridView, ETrue , EFalse ) );
       
   114     iGridView->AddCommandHandlerL(CGlxCommandHandlerHelp::NewL(helpInfo));
       
   115     }
       
   116 
       
   117 // ---------------------------------------------------------------------------
       
   118 // GetResourceFilenameL
       
   119 // ---------------------------------------------------------------------------
       
   120 //
       
   121 void CGlxMainGridViewPlugin::GetResourceFilenameL(TFileName& aResFile)
       
   122     {
       
   123     TRACER("CGlxMainGridViewPlugin::GetResourceFilenameL()");
       
   124     TParse parse;
       
   125     parse.Set(KGlxGridResource, &KDC_APP_RESOURCE_DIR, NULL);
       
   126     aResFile.Append(parse.FullName()); 
       
   127     CGlxResourceUtilities::GetResourceFilenameL(aResFile);  
       
   128     }
       
   129 
       
   130 //  End of File