diff -r 000000000000 -r 4e91876724a2 photosgallery/viewframework/plugins/gridviewplugin/src/glxtaggridviewplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photosgallery/viewframework/plugins/gridviewplugin/src/glxtaggridviewplugin.cpp Thu Dec 17 08:45:44 2009 +0200 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: +* +* Description: Implementation +* +*/ + + + + +// INCLUDE FILES + +#include "glxtaggridviewplugin.h" +#include "glxgridviewplugin.hrh" // KGlxTagGridViewPluginImplementationUid + +#include + +#include //BaflUtils +#include //KDC_APP_RESOURCE_DIR +#include //CGlxCommandHandlerRemoveFrom +#include +#include +#include + +#include // for CGlxResourceUtilities + + + +_LIT(KGlxGridResource,"glxgridviewdata.rsc"); //TagGridView Resource File + +/** + * @internal reviewed 12/06/2007 by Alex Birkett + */ + +// --------------------------------------------------------------------------- +// C++ default constructor can NOT contain any code, that +// might leave. +// --------------------------------------------------------------------------- +CGlxTagGridViewPlugin::CGlxTagGridViewPlugin() + { + TRACER("CGlxTagGridViewPlugin::CGlxTagGridViewPlugin()"); + + iResourceIds.iViewId = R_TAGGRID_VIEW; + iResourceIds.iMenuId = R_TAGGRID_MENU; + iResourceIds.iCbaId = R_GRID_SOFTKEYS; + iResourceIds.iEmptyViewTextId = R_GRID_EMPTY_VIEW_TEXT; + iResourceIds.iOkOptionsMenuId = R_GRID_OK_MENUBAR_TAG_GRIDVIEW; + iViewUID = KGlxTagGridViewPluginImplementationUid; + + + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------------------------- +void CGlxTagGridViewPlugin::ConstructL() + { + TRACER("CGlxTagGridViewPlugin::CGlxTagGridViewPlugin()"); + // Do nothing + } + + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- + CGlxTagGridViewPlugin* CGlxTagGridViewPlugin::NewL() + { + + TRACER( "CGlxTagGridViewPlugin::NewL"); + + CGlxTagGridViewPlugin* self = new ( ELeave ) CGlxTagGridViewPlugin(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +CGlxTagGridViewPlugin::~CGlxTagGridViewPlugin() + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// Adds Command Handlers to the view +//----------------------------------------------------------------------------- +void CGlxTagGridViewPlugin::AddCommandHandlersL() + { + TRACER( "CGlxTagGridViewPlugin::AddCommandHandlersL"); + + CGlxGridViewPluginBase::AddCommandHandlersL(); + + //For tag Grid view + GLX_LOG_INFO("Adding CGlxCommandHandlerRemoveFrom"); + iGridView->AddCommandHandlerL(CGlxCommandHandlerRemoveFrom::NewL(iGridView, EMPXTag)); + + // set up help context info + TGlxHelpContext helpInfo; + helpInfo.iBrowseContext = LGAL_HLP_TAGS_GRID; + helpInfo.iViewContext = LGAL_HLP_TAGS_FULLSCREEN; + + iGridView->AddCommandHandlerL(CGlxCommandHandlerHelp::NewL(helpInfo)); + } + +//----------------------------------------------------------------------------- +// Get the Resource File Name +//----------------------------------------------------------------------------- + +void CGlxTagGridViewPlugin::GetResourceFilenameL(TFileName& aResFile) + { + TRACER( "CGlxTagGridViewPlugin::GetResourceFilenameL"); //Logging + TParse parse; + parse.Set(KGlxGridResource, &KDC_APP_RESOURCE_DIR, NULL); + aResFile.Append(parse.FullName()); + CGlxResourceUtilities::GetResourceFilenameL(aResFile); + } + +//End Of File