commsconfig/cscgsplugin/inc/cscgsplugin.h
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     1 /*
       
     2 * Copyright (c) 2008-2008 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:  cscgsplugin implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CSCGSPLUGIN_H
       
    20 #define C_CSCGSPLUGIN_H
       
    21 
       
    22 #include <AknServerApp.h>
       
    23 #include <ConeResLoader.h>
       
    24 #include <gsplugininterface.h>
       
    25 
       
    26 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    27 #include "apadoc.h"
       
    28 #endif
       
    29 
       
    30 class CAknNullService;
       
    31 
       
    32 
       
    33 class TAppInfo
       
    34     {
       
    35     public:
       
    36         TAppInfo( TUid aUid, const TDesC& aFile )
       
    37             : iUid( aUid ), iFile( aFile )
       
    38             {}
       
    39         TUid iUid;
       
    40         TFileName iFile;
       
    41     };
       
    42 
       
    43 
       
    44 /**
       
    45  * Commsconfig GS plugin implementation. 
       
    46  * Launches CSC application from control panel.
       
    47  *
       
    48  * @code
       
    49  * @endcode
       
    50  *
       
    51  * @since S60 5.0
       
    52  */
       
    53 class CCscGsPlugin : public CGSPluginInterface,
       
    54                      public MAknServerAppExitObserver // Embedding
       
    55     {
       
    56     public: 
       
    57 
       
    58         static CCscGsPlugin* NewL( TAny* aInitParams );
       
    59 
       
    60         ~CCscGsPlugin();
       
    61         
       
    62         
       
    63         // from base class CAknView
       
    64 
       
    65         /**
       
    66          * From CAknView.
       
    67          *
       
    68          * @since S60 v3.0
       
    69          * @return The ID of view.
       
    70          */
       
    71         TUid Id() const;
       
    72 
       
    73         
       
    74         // from base class CGSPluginInterface
       
    75 
       
    76         /**
       
    77          * From CGSPluginInterface.
       
    78          */
       
    79         void GetCaptionL( TDes& aCaption ) const;
       
    80         
       
    81         /**
       
    82          * From CGSPluginInterface.
       
    83          */
       
    84         TInt PluginProviderCategory() const;
       
    85       
       
    86         /**
       
    87          * From CGSPluginInterface.
       
    88          */
       
    89         TGSListboxItemTypes ItemType();
       
    90      
       
    91         /**
       
    92          * From CGSPluginInterface.
       
    93          */
       
    94         void GetValue( 
       
    95             const TGSPluginValueKeys aKey,
       
    96             TDes& aValue );
       
    97 
       
    98         /**
       
    99          * From CGSPluginInterface.
       
   100          */
       
   101         void HandleSelection( const TGSSelectionTypes aSelectionType );
       
   102         
       
   103         /**
       
   104          * From CGSPluginInterface.
       
   105          */
       
   106         CGulIcon* CreateIconL( const TUid aIconType );
       
   107         
       
   108         /**
       
   109          * From CGSPluginInterface.
       
   110          */
       
   111         TBool Visible() const;
       
   112 
       
   113     protected:
       
   114 
       
   115 
       
   116         CCscGsPlugin();
       
   117 
       
   118         void ConstructL();
       
   119 
       
   120         
       
   121         // from base class CAknView
       
   122 
       
   123         /**
       
   124          * From CAknView.
       
   125          * Creates the Container class object.
       
   126          *
       
   127          * @param aPrevViewId is not used.
       
   128          * @param aCustomMessageId is not used.
       
   129          * @param aCustomMessage is not used.
       
   130          */
       
   131         void DoActivateL( 
       
   132             const TVwsViewId& aPrevViewId,
       
   133             TUid aCustomMessageId,
       
   134             const TDesC8& aCustomMessage );
       
   135 
       
   136         /**
       
   137          * From CAknView.
       
   138          * Deletes the Container class object.
       
   139          *
       
   140          */
       
   141         void DoDeactivate();
       
   142 
       
   143     private:
       
   144 
       
   145         /**
       
   146          * Opens localized resource file.
       
   147          *
       
   148          * @since S60 5.0
       
   149          * @param aResourceFileName resource file name
       
   150          * @param aResourceLoader resource loader
       
   151          */
       
   152         void OpenLocalizedResourceFileL(
       
   153             const TDesC& aResourceFileName,
       
   154             RConeResourceLoader& aResourceLoader );
       
   155 
       
   156         /**
       
   157          * Launches csc application.
       
   158          *
       
   159          * @since S60 5.0
       
   160          */
       
   161         void LaunchCscAppL();
       
   162         
       
   163         
       
   164         /**
       
   165          * Launches application as embedded.
       
   166          * 
       
   167          * @since S60 5.0
       
   168          */
       
   169         void EmbedAppL( const TAppInfo& aApp );
       
   170         
       
   171     protected:
       
   172 
       
   173         /**
       
   174          * Resource laoder.
       
   175          * Own.
       
   176          */
       
   177         RConeResourceLoader iResources;
       
   178         
       
   179         /**
       
   180          * Nullservice.
       
   181          * Own.
       
   182          */
       
   183         CAknNullService* iNullService;
       
   184         
       
   185         /**
       
   186          * ApaDocument.
       
   187          * Own.
       
   188          */
       
   189         CApaDocument* iEmbedded;
       
   190         
       
   191 #ifdef _DEBUG
       
   192     friend class ut_cscgsplugin;
       
   193 #endif 
       
   194     };
       
   195 
       
   196 #endif // C_CSCGSPLUGIN_H