idlehomescreen/widgetmanager/inc/wmconfiguration.h
changeset 2 08c6ee43b396
child 4 4d54b72983ae
equal deleted inserted replaced
1:5315654608de 2:08c6ee43b396
       
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 * WidgetManager configuration class
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef WMCONFIGURATION_H
       
    20 #define WMCONFIGURATION_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CRepository;
       
    27 class CWmResourceLoader;
       
    28 
       
    29 /**
       
    30  * Configuration class for Widget Manager
       
    31  * 
       
    32  * @class CWmConfiguration
       
    33  */
       
    34 NONSHARABLE_CLASS( CWmConfiguration ) : public CBase
       
    35 	{
       
    36 	
       
    37 public: // constructors and destructor
       
    38 	
       
    39     /** Two-phased constructor. */
       
    40 	static CWmConfiguration* NewL(
       
    41 	        CWmResourceLoader& aResourceLoader );
       
    42 
       
    43 	/** Destructor */
       
    44 	virtual ~CWmConfiguration();
       
    45 	
       
    46 private:
       
    47     /** constructor */
       
    48     CWmConfiguration(
       
    49             CWmResourceLoader& aResourceLoader );
       
    50     
       
    51     /** 2nd phase constructor */
       
    52     void ConstructL();
       
    53 
       
    54 public: // API
       
    55 
       
    56     /**
       
    57      * portal button methods
       
    58      */
       
    59     enum TMethod
       
    60         {
       
    61         ENone = 0, // no method
       
    62         EHttp, // open browser to a certain page
       
    63         EWidget // open given widget with params
       
    64         };
       
    65 
       
    66     /**
       
    67      * Number of portal buttons (1 or more)
       
    68      */
       
    69     TInt PortalButtonCount();
       
    70 
       
    71     /**
       
    72      * Label text to be displayed on a portal button
       
    73      * @param aIndex index of the button, starting at 0
       
    74      */
       
    75     const TDesC& PortalButtonText( TInt aIndex );
       
    76     
       
    77     /**
       
    78      * Icon to be displayed on a portal button
       
    79      * Logo syntax follows the widget icon syntax in MHsContentInfo
       
    80      * @param aIndex index of the button, starting at 0
       
    81      */
       
    82     const TDesC& PortalButtonIcon( TInt aIndex );
       
    83     
       
    84     /**
       
    85      * Bundle ID related to this button
       
    86      * parameter is valid if this button launches an application
       
    87      * @param aIndex index of the button, starting at 0
       
    88      */
       
    89     const TDesC& PortalButtonBundleId( TInt aIndex );
       
    90     
       
    91     /**
       
    92      * Portal button action method.
       
    93      * Defines what happens when the portal button is pressed.
       
    94      * @param aIndex index of the button, starting at 0
       
    95      */
       
    96     TMethod PortalButtonPrimaryMethod( TInt aIndex );
       
    97     
       
    98     /**
       
    99      * parameters related to the method.
       
   100      * For EHttp this is the HTTP address
       
   101      * for EWidget the parameters passed to the widget
       
   102      * @param aIndex index of the button, starting at 0
       
   103      */
       
   104     const TDesC& PortalButtonPrimaryParams( TInt aIndex );
       
   105     
       
   106     /**
       
   107      * Secondary method, which is excuted if
       
   108      * primary method fails.
       
   109      * Works like Primary method.
       
   110      * @param aIndex index of the button, starting at 0
       
   111      */
       
   112     TMethod PortalButtonSecondaryMethod( TInt aIndex );
       
   113     
       
   114     /**
       
   115      * Parameters for Secondary method. Like Primary method
       
   116      * Works like Primary params.
       
   117      * @param aIndex index of the button, starting at 0
       
   118      */
       
   119     const TDesC& PortalButtonSecondaryParams( TInt aIndex );
       
   120     
       
   121     
       
   122 private: // New functions
       
   123     
       
   124     TInt FindCorrectLanguageId();
       
   125     HBufC* ReadParameterL( TInt aKey );
       
   126     HBufC* ReadLocalisedParameterL( TInt aOffset );
       
   127 
       
   128 private:
       
   129 
       
   130     /**
       
   131      * the central repository
       
   132      */
       
   133     CRepository*            iRepository;
       
   134 
       
   135     /**
       
   136      * the resource loader
       
   137      */
       
   138     CWmResourceLoader&      iResourceLoader;
       
   139 
       
   140     /**
       
   141      * The index in cenrep that matches current
       
   142      * system language
       
   143      */
       
   144     TInt                    iLanguageIndex;
       
   145 
       
   146     /**
       
   147      * OviStore widget bundle ID
       
   148      */
       
   149     HBufC*                  iOviStoreBundleId;
       
   150     
       
   151     /**
       
   152      * OviStore widget client param
       
   153      */
       
   154     HBufC*                  iOviStoreClientParam;
       
   155     
       
   156     /**
       
   157      * Localized Url to start browser
       
   158      */
       
   159     HBufC*                  iOviStoreUrl;
       
   160     
       
   161     /**
       
   162      * Localised OVI store text
       
   163      */
       
   164     HBufC*                  iOviStoreText;
       
   165     
       
   166     /**
       
   167      * OVI store icon
       
   168      */
       
   169     HBufC*                  iOviStoreIcon;
       
   170     
       
   171     };
       
   172 
       
   173 #endif // WMCONFIGURATION_H
       
   174 
       
   175 // End of File