devicediagnostics/diagsuites/diagservicessuiteplugin/src/diagservicessuiteplugin.cpp
changeset 0 3ce708148e4d
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     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:  This is the implementation of the Services Diagnostics
       
    15 *                Suite, which is used to contain all tests and suites.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // System Include Files
       
    21 #include <DiagFrameworkDebug.h>             // Debugging Macros
       
    22 #include <StringLoader.h>                   // StringLoader
       
    23 #include <gulicon.h>                        // CGulIcon
       
    24 #include <AknIconUtils.h>                   // AknIconUtils
       
    25 #include <devdiagservicessuitepluginrsc.rsg>   // Resource Definitions
       
    26 #include <devdiagservicessuiteplugin.mbg>      // Icon Indices
       
    27 
       
    28 // User Include Files
       
    29 #include "diagservicessuiteplugin.h"        // CDiagServicesSuitePlugin
       
    30 #include "diagservicessuiteplugin.hrh"      // UID definition
       
    31 #include "diagservicessuiteplugin.pan"      // Panic
       
    32 
       
    33 // Local Constants
       
    34 _LIT( KDiagServicesSuitePluginResourceFileName,
       
    35       "z:devdiagservicessuitepluginrsc.rsc" );
       
    36 const TUid KDiagServicesSuitePluginUid = { _UID3 };
       
    37 
       
    38 
       
    39 // ============================ GLOBAL FUNCTIONS =============================
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // Static two-phase constructor.
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 MDiagPlugin* CDiagServicesSuitePlugin::NewL( TAny* aInitParams )
       
    46     {
       
    47     LOGSTRING2( "CDiagServicesSuitePlugin::NewL( 0x%x )", aInitParams )
       
    48 
       
    49     __ASSERT_ALWAYS( aInitParams,
       
    50                      Panic( EDiagServicesSuitePluginConstruction ) );
       
    51 
       
    52     // Construct the plugin.  The base class will take ownership of the
       
    53     // initialization parameters.
       
    54     CDiagPluginConstructionParam* param =
       
    55             static_cast< CDiagPluginConstructionParam* >( aInitParams );
       
    56 
       
    57     CleanupStack::PushL( param );
       
    58     CDiagServicesSuitePlugin* self =
       
    59         new( ELeave ) CDiagServicesSuitePlugin( param );
       
    60     CleanupStack::Pop( param );
       
    61 
       
    62     CleanupStack::PushL( self );
       
    63     self->ConstructL();
       
    64     CleanupStack::Pop( self );
       
    65 
       
    66     return self;
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // Destructor.
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 CDiagServicesSuitePlugin::~CDiagServicesSuitePlugin()
       
    74     {
       
    75     LOGSTRING( "CDiagServicesSuitePlugin::~CDiagServicesSuitePlugin()" )
       
    76 
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------------------------
       
    80 // The default constructor.
       
    81 // ---------------------------------------------------------------------------
       
    82 //
       
    83 CDiagServicesSuitePlugin::CDiagServicesSuitePlugin(
       
    84     CDiagPluginConstructionParam* aParam )
       
    85 :   CDiagSuitePluginBase( aParam )
       
    86     {
       
    87     LOGSTRING2(
       
    88         "CDiagServicesSuitePlugin::CDiagServicesSuitePlugin( 0x%x )",
       
    89         aParam )
       
    90 
       
    91     }
       
    92 
       
    93 // ---------------------------------------------------------------------------
       
    94 // The second phase constructor.
       
    95 // ---------------------------------------------------------------------------
       
    96 //
       
    97 void CDiagServicesSuitePlugin::ConstructL()
       
    98     {
       
    99     LOGSTRING( "CDiagServicesSuitePlugin::ConstructL()" );
       
   100     BaseConstructL ( KDiagServicesSuitePluginResourceFileName );
       
   101     }
       
   102 
       
   103 // ---------------------------------------------------------------------------
       
   104 // From class MDiagPlugin.
       
   105 // Returns whether the plugin should be displayed or not.
       
   106 // ---------------------------------------------------------------------------
       
   107 TBool CDiagServicesSuitePlugin::IsVisible() const
       
   108     {
       
   109     return ETrue;
       
   110     }
       
   111 
       
   112 // ---------------------------------------------------------------------------
       
   113 // From class MDiagPlugin.
       
   114 // Returns the plugin name.
       
   115 // ---------------------------------------------------------------------------
       
   116 HBufC* CDiagServicesSuitePlugin::GetPluginNameL(
       
   117     TNameLayoutType aLayoutType ) const
       
   118     {
       
   119     switch ( aLayoutType )
       
   120         {
       
   121         case ENameLayoutListLargeGraphic:
       
   122             return StringLoader::LoadL( R_DIAG_SERVICES_SUITE_LIST_LARGE_GRAPHIC );
       
   123 
       
   124         case ENameLayoutHeadingPane:
       
   125             return StringLoader::LoadL( R_DIAG_SERVICES_SUITE_HEADING_PANE );
       
   126 
       
   127         case ENameLayoutPopupInfoPane:
       
   128             return StringLoader::LoadL( R_DIAG_SERVICES_SUITE_POPUP_INFO_PANE );
       
   129 
       
   130         case ENameLayoutTitlePane:
       
   131             return StringLoader::LoadL( R_DIAG_SERVICES_SUITE_TITLE_PANE );
       
   132 
       
   133         case ENameLayoutListSingleGraphic:
       
   134             return StringLoader::LoadL( R_DIAG_SERVICES_SUITE_LIST_SINGLE_GRAPHIC );
       
   135 
       
   136         case ENameLayoutListSingle:
       
   137             return StringLoader::LoadL( R_DIAG_SERVICES_SUITE_LIST_SINGLE );
       
   138 
       
   139         default:
       
   140             __ASSERT_DEBUG( EFalse,
       
   141                             Panic( EDiagServicesSuitePluginBadArgument ) );
       
   142             return StringLoader::LoadL( R_DIAG_SERVICES_SUITE_LIST_LARGE_GRAPHIC );
       
   143         }
       
   144     }
       
   145 
       
   146 // ---------------------------------------------------------------------------
       
   147 // From class MDiagPlugin.
       
   148 // Returns the plugin's UID.
       
   149 // ---------------------------------------------------------------------------
       
   150 TUid CDiagServicesSuitePlugin::Uid() const
       
   151     {
       
   152     return KDiagServicesSuitePluginUid;
       
   153     }
       
   154 
       
   155 // ---------------------------------------------------------------------------
       
   156 // From class MDiagPlugin.
       
   157 // Load the plugin's icon.
       
   158 // ---------------------------------------------------------------------------
       
   159 //
       
   160 CGulIcon* CDiagServicesSuitePlugin::CreateIconL() const
       
   161     {
       
   162     LOGSTRING( "CDiagServicesSuitePlugin::CreateIconL()" )
       
   163 
       
   164     _LIT( KDiagServicesSuitePluginIconFile,
       
   165           "\\resource\\apps\\devdiagservicessuiteplugin.mif" );
       
   166 
       
   167     // Load the icon.
       
   168     CFbsBitmap* bitmap;
       
   169     CFbsBitmap* mask;
       
   170     AknIconUtils::CreateIconL(
       
   171         bitmap,
       
   172         mask,
       
   173         KDiagServicesSuitePluginIconFile(),
       
   174         EMbmDevdiagservicessuitepluginQgn_prop_cp_diag_service,
       
   175         EMbmDevdiagservicessuitepluginQgn_prop_cp_diag_service_mask );
       
   176 
       
   177     // Create the icon.
       
   178     return CGulIcon::NewL( bitmap, mask );
       
   179     }
       
   180 
       
   181 // ---------------------------------------------------------------------------
       
   182 // From class CActive.
       
   183 // Active object run handler.
       
   184 // ---------------------------------------------------------------------------
       
   185 void CDiagServicesSuitePlugin::RunL()
       
   186     {
       
   187     }
       
   188 
       
   189 // ---------------------------------------------------------------------------
       
   190 // From class CActive.
       
   191 // Active object cancel.
       
   192 // ---------------------------------------------------------------------------
       
   193 void CDiagServicesSuitePlugin::DoCancel()
       
   194     {
       
   195     }
       
   196 
       
   197 // End of File
       
   198