devicediagnostics/devdiaggsplugin/inc/gsdevdiagplugin.h
changeset 0 3ce708148e4d
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     1 /*
       
     2 * Copyright (c) 2007-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:  Launch Diagnostics embedded application.
       
    15 *                 (DevDiagApp.exe) The UID3 is defined below.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef GSDDPLUGIN_H
       
    21 #define GSDDPLUGIN_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <gsplugininterface.h>
       
    25 #include <ConeResLoader.h>
       
    26 #include <AknServerApp.h>
       
    27 
       
    28 //CONSTANTS
       
    29 const TUid KGSDDPluginUid = { 0x2000E543 };
       
    30 const TUid KGsDiagnosticsAppUid  = { 0x2000E542 }; //app to be laucnhed 
       
    31 //_LIT( KGSDDPluginIconDirAndName, "z:GSDDPlugin.mbm"); // Use KDC_BITMAP_DIR
       
    32 _LIT( KGSDDPluginIconDirAndName, "z:GSDevDiagPlugin.mif"); // Use KDC_BITMAP_DIR or ?? KDC_APP_BITMAP_DIR
       
    33 _LIT( KGSDiagnosticsApp,    "z:\\sys\\bin\\DevDiagApp.exe" );
       
    34 
       
    35 
       
    36 // MACROS
       
    37 
       
    38 // DATA TYPES
       
    39 
       
    40 // FUNCTION PROTOTYPES
       
    41 
       
    42 // FORWARD DECLARATIONS
       
    43 class CAknNullService;
       
    44 
       
    45 
       
    46 // CLASS DEFINITION
       
    47 /**
       
    48 *  CGSDevDiagPlugin view class 
       
    49 *  @since S60 5.0
       
    50 *
       
    51 */
       
    52 class CGSDevDiagPlugin : public CGSPluginInterface,
       
    53                          public MAknServerAppExitObserver // Embedding
       
    54 
       
    55     {
       
    56     
       
    57     /**
       
    58     * Contains application information
       
    59     *
       
    60     *  @since S60 5.0
       
    61     **/
       
    62     class TAppInfo
       
    63      {
       
    64      public:
       
    65          TAppInfo( TUid aUid, const TDesC& aFile )
       
    66              : iUid( aUid ), iFile( aFile )
       
    67              {}
       
    68          TUid iUid; //Uid3
       
    69          TFileName iFile; //full filename of the app.
       
    70      };
       
    71 
       
    72     
       
    73 public: // Constructors and destructor
       
    74 
       
    75     /**
       
    76     * Symbian OS two-phased constructor
       
    77     * @return GS connection view.
       
    78     */
       
    79     static CGSDevDiagPlugin* NewL( TAny* aInitParams );
       
    80 
       
    81     /**
       
    82     * Destructor
       
    83     */
       
    84     ~CGSDevDiagPlugin();
       
    85     
       
    86 public: // From CGSPluginInterface
       
    87 
       
    88     /**
       
    89     * @see CGSPluginInterface header file.
       
    90     */
       
    91     void GetCaptionL( TDes& aCaption ) const;
       
    92 
       
    93     /**
       
    94     * See base class.
       
    95     */
       
    96     CGulIcon* CreateIconL( const TUid aIconType );
       
    97 
       
    98     /**
       
    99     * @see CGSPluginInterface header file.
       
   100     */
       
   101     TInt PluginProviderCategory() const;
       
   102     
       
   103     /**
       
   104     * GS framework calls this method when plug-in is opened.
       
   105     * The method launches the embedded application.
       
   106     **/
       
   107     void HandleSelection( const TGSSelectionTypes aSelectionType );
       
   108     
       
   109     /**
       
   110     * See base class.
       
   111     */
       
   112     TGSListboxItemTypes ItemType();
       
   113 
       
   114     /**
       
   115     * See base class.
       
   116     */
       
   117     void GetValue( const TGSPluginValueKeys aKey,
       
   118                        TDes& aValue );
       
   119 
       
   120 public: //from MAknServerAppExitObserver
       
   121     
       
   122     /**
       
   123     * Close the GS when embedded application is shutdown.
       
   124     **/
       
   125     virtual void HandleServerAppExit(TInt aReason);
       
   126 
       
   127     
       
   128 public: //From CAknView
       
   129 
       
   130     /**
       
   131     * From CAknView.
       
   132     * Returns views id.
       
   133     **/
       
   134     TUid Id() const;
       
   135 
       
   136 
       
   137 protected:
       
   138     /**
       
   139     * From CAknView Activates view.
       
   140     * @since Series 60 3.1
       
   141     * @param aPrevViewId Id of previous view.
       
   142     * @param aCustomMessageId Custom message id.
       
   143     * @param aCustomMessage Custom message.
       
   144     * @return None.
       
   145     */
       
   146     virtual void DoActivateL (const TVwsViewId &aPrevViewId, 
       
   147                                        TUid aCustomMessageId, 
       
   148                                        const TDesC8 &aCustomMessage);
       
   149     /**
       
   150     * From CAknView Deactivates view.        
       
   151     * @since Series 60 3.1
       
   152     * @param None.
       
   153     * @return None.
       
   154     */
       
   155     virtual void DoDeactivate();     
       
   156     
       
   157 private:
       
   158     
       
   159     /**
       
   160     * ConstructL
       
   161     **/
       
   162     void ConstructL();
       
   163     
       
   164     /**
       
   165     * Default constructor
       
   166     **/
       
   167     CGSDevDiagPlugin();
       
   168     
       
   169     /**
       
   170     * Open localised resource file.
       
   171     *
       
   172     * @aResourceFileName Full path name of the resource file.
       
   173     * @aRsourceLoader 
       
   174     **/
       
   175     void OpenLocalizedResourceFileL(
       
   176             const TDesC& aResourceFileName,
       
   177             RConeResourceLoader& aResourceLoader );
       
   178             
       
   179    /**
       
   180    * Launch DevDiagApp.exe as an embedded application 
       
   181    **/            
       
   182    void LaunchDiagnosticsAppL();
       
   183          
       
   184    /**
       
   185    * Calls null service to launch the application.
       
   186    *
       
   187    * @param aApp The application to be launched.
       
   188    **/      
       
   189    void EmbedAppL( const TAppInfo& aApp );      
       
   190             
       
   191 private:
       
   192                
       
   193      // resource loader
       
   194     RConeResourceLoader iResourceLoader;
       
   195     
       
   196     // Mysterious embedded app launcher.
       
   197     CAknNullService* iNullService;             
       
   198     };
       
   199 
       
   200 #endif //GSDDPLUGIN_H
       
   201 
       
   202 // End of File