gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPlugin.cpp
branchRCL_3
changeset 25 7e0eff37aedb
equal deleted inserted replaced
24:8ee96d21d9bf 25:7e0eff37aedb
       
     1 /*
       
     2 * Copyright (c) 2007 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:  GSInstallationsPlugin source code.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // Includes
       
    20 #include "GSInstallationsPlugin.h"
       
    21 #include "GsLogger.h"
       
    22 #include <gsfwviewuids.h>
       
    23 #include <GSInstallationsPlugin.mbg> // Icons
       
    24 #include <gsinstallationspluginrsc.rsg>
       
    25 #include <gsmainview.h>
       
    26 #include <gsprivatepluginproviderids.h>
       
    27 #include <csxhelp/cp.hlp.hrh>
       
    28 #include <aknViewAppUi.h>
       
    29 #include <ConeResLoader.h>
       
    30 #include <StringLoader.h>
       
    31 #include <barsread.h> // For TResourceReader
       
    32 
       
    33 
       
    34 // Constants
       
    35 
       
    36 
       
    37 // ========================= MEMBER FUNCTIONS ================================
       
    38 
       
    39 
       
    40 // ---------------------------------------------------------------------------
       
    41 // CGSInstallationsPlugin::CGSInstallationsPlugin()
       
    42 //
       
    43 //
       
    44 // ---------------------------------------------------------------------------
       
    45 //
       
    46 CGSInstallationsPlugin::CGSInstallationsPlugin()
       
    47     : CGSParentPlugin(), iResourceLoader( *iCoeEnv )
       
    48     {
       
    49     __GSLOGSTRING( "[CGSInstallationsPlugin] CGSInstallationsPlugin()" );
       
    50 
       
    51     }
       
    52 
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // CGSInstallationsPlugin::~CGSInstallationsPlugin()
       
    56 //
       
    57 //
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 CGSInstallationsPlugin::~CGSInstallationsPlugin()
       
    61     {
       
    62     __GSLOGSTRING( "[CGSInstallationsPlugin] ~CGSInstallationsPlugin()|->" );
       
    63     iResourceLoader.Close();
       
    64     __GSLOGSTRING( "[CGSInstallationsPlugin] ~CGSInstallationsPlugin()-|" );
       
    65     }
       
    66 
       
    67 
       
    68 // ---------------------------------------------------------------------------
       
    69 // CGSInstallationsPlugin::ConstructL()
       
    70 //
       
    71 //
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 void CGSInstallationsPlugin::ConstructL()
       
    75     {
       
    76     __GSLOGSTRING( "[CGSInstallationsPlugin] ConstructL()|->" );
       
    77     OpenLocalizedResourceFileL( KGSInstallationsPluginResourceFileName,
       
    78                                 iResourceLoader );
       
    79     BaseConstructL( R_GS_INSTALLATIONS_VIEW, R_GS_INSTALLATIONS_VIEW_TITLE );
       
    80     __GSLOGSTRING( "[CGSInstallationsPlugin] ConstructL()-|" );
       
    81     }
       
    82 
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // CGSInstallationsPlugin::NewL()
       
    86 //
       
    87 //
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 CGSInstallationsPlugin* CGSInstallationsPlugin::NewL( TAny* /*aInitParams*/ )
       
    91     {
       
    92     __GSLOGSTRING( "[CGSInstallationsPlugin] NewL()" );
       
    93 
       
    94     CGSInstallationsPlugin* self = new(ELeave) CGSInstallationsPlugin();
       
    95     CleanupStack::PushL(self);
       
    96     self->ConstructL();
       
    97     CleanupStack::Pop(self);
       
    98     return self;
       
    99     }
       
   100 
       
   101 
       
   102 // ---------------------------------------------------------------------------
       
   103 // CGSParentPlugin::Id()
       
   104 //
       
   105 //
       
   106 // ---------------------------------------------------------------------------
       
   107 //
       
   108 TUid CGSInstallationsPlugin::Id() const
       
   109     {
       
   110     __GSLOGSTRING1( "[CGSInstallationsPlugin] Id():0x%X", KGSInstallationsPluginUid.iUid );
       
   111     return KGSInstallationsPluginUid;
       
   112     }
       
   113 
       
   114 
       
   115 // ---------------------------------------------------------------------------
       
   116 // CGSParentPlugin::DoActivateL()
       
   117 //
       
   118 //
       
   119 // ---------------------------------------------------------------------------
       
   120 //
       
   121 void CGSInstallationsPlugin::DoActivateL
       
   122     ( const TVwsViewId& aPrevViewId,
       
   123       TUid aCustomMessageId,
       
   124       const TDesC8& aCustomMessage )
       
   125     {
       
   126     __GSLOGSTRING( "[CGSInstallationsPlugin] DoActivateL()|->" );
       
   127     CGSParentPlugin::DoActivateL( aPrevViewId,
       
   128                                   aCustomMessageId,
       
   129                                   aCustomMessage );
       
   130     CGSMainView* parent =
       
   131         static_cast<CGSMainView*> ( AppUi()->View( KGSMainViewUid ) );
       
   132 
       
   133     // Create tab group for this view (do only if casting parent succeeds):
       
   134     __GSLOGSTRING( "[CGSInstallationsPlugin] DoActivateL()-|" );
       
   135     }
       
   136 
       
   137 
       
   138 // ---------------------------------------------------------------------------
       
   139 // CGSParentPlugin::DoDeactivate()
       
   140 //
       
   141 //
       
   142 // ---------------------------------------------------------------------------
       
   143 //
       
   144 void CGSInstallationsPlugin::DoDeactivate()
       
   145     {
       
   146     __GSLOGSTRING( "[CGSInstallationsPlugin] DoDeactivate()|->" );
       
   147     CGSParentPlugin::DoDeactivate();
       
   148     __GSLOGSTRING( "[CGSInstallationsPlugin] DoDeactivate()-|" );
       
   149     }
       
   150 
       
   151 
       
   152 // ========================= From CGSParentPlugin =====================
       
   153 
       
   154 
       
   155 // ---------------------------------------------------------------------------
       
   156 // CGSInstallationsPlugin::UpperLevelViewUid()
       
   157 //
       
   158 //
       
   159 // ---------------------------------------------------------------------------
       
   160 //
       
   161 TUid CGSInstallationsPlugin::UpperLevelViewUid()
       
   162     {
       
   163     return KGSMainViewUid;
       
   164     }
       
   165 
       
   166 
       
   167 // ========================= From CGSPluginInterface ==================
       
   168 
       
   169 
       
   170 // ---------------------------------------------------------------------------
       
   171 // CGSInstallationsPlugin::GetCaptionL()
       
   172 //
       
   173 //
       
   174 // ---------------------------------------------------------------------------
       
   175 //
       
   176 void CGSInstallationsPlugin::GetCaptionL( TDes& aCaption ) const
       
   177     {
       
   178     __GSLOGSTRING( "[CGSInstallationsPlugin] GetCaptionL()|->" );
       
   179     // The resource file is already opened by iResourceLoader.
       
   180     HBufC* result = StringLoader::LoadL( R_GS_INSTALLATIONS_VIEW_CAPTION );
       
   181     aCaption.Copy( *result );
       
   182     delete result;
       
   183     __GSLOGSTRING( "[CGSInstallationsPlugin] GetCaptionL()-|" );
       
   184     }
       
   185 
       
   186 
       
   187 // ---------------------------------------------------------------------------
       
   188 // CGSInstallationsPlugin::PluginProviderCategory()
       
   189 //
       
   190 //
       
   191 // ---------------------------------------------------------------------------
       
   192 //
       
   193 TInt CGSInstallationsPlugin::PluginProviderCategory() const
       
   194     {
       
   195     return KGSPluginProviderInternal;
       
   196     }
       
   197 
       
   198 
       
   199 // -----------------------------------------------------------------------------
       
   200 // CGSInstallationsPlugin::GetHelpContext()
       
   201 //
       
   202 //
       
   203 // -----------------------------------------------------------------------------
       
   204 //
       
   205 void CGSInstallationsPlugin::GetHelpContext( TCoeHelpContext& aContext )
       
   206     {
       
   207     aContext.iMajor = KUidGS;
       
   208     aContext.iContext = KCP_HLP_INSTALLATIONS;
       
   209     }
       
   210 
       
   211 
       
   212 // -----------------------------------------------------------------------------
       
   213 // CGSInstallationsPlugin::CreateIconL()
       
   214 //
       
   215 //
       
   216 // -----------------------------------------------------------------------------
       
   217 //
       
   218 CGulIcon* CGSInstallationsPlugin::CreateIconL( const TUid aIconType )
       
   219     {
       
   220 
       
   221     //EMbm<Mbm_file_name><Bitmap_name>
       
   222     CGulIcon* icon;
       
   223     TParse* fp = new( ELeave ) TParse();
       
   224     CleanupStack::PushL( fp );
       
   225     fp->Set( KGSInstallationsPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
       
   226 
       
   227     if( aIconType == KGSIconTypeLbxItem )
       
   228         {
       
   229         icon = AknsUtils::CreateGulIconL(
       
   230         AknsUtils::SkinInstance(),
       
   231         KAknsIIDQgnPropCpInst,
       
   232         fp->FullName(),
       
   233         EMbmGsinstallationspluginQgn_prop_cp_inst,
       
   234         EMbmGsinstallationspluginQgn_prop_cp_inst_mask );
       
   235         }
       
   236        else
       
   237         {
       
   238         icon = CGSPluginInterface::CreateIconL( aIconType );
       
   239         }
       
   240 
       
   241     CleanupStack::PopAndDestroy( fp );
       
   242 
       
   243     return icon;
       
   244     }
       
   245 
       
   246 // End of File