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