idlehomescreen/widgetmanager/inc/wmconfiguration.h
branchRCL_3
changeset 102 ba63c83f4716
parent 93 b01126ce0bec
equal deleted inserted replaced
93:b01126ce0bec 102:ba63c83f4716
    19 #ifndef WMCONFIGURATION_H
    19 #ifndef WMCONFIGURATION_H
    20 #define WMCONFIGURATION_H
    20 #define WMCONFIGURATION_H
    21 
    21 
    22 // INCLUDE FILES
    22 // INCLUDE FILES
    23 #include <e32base.h>
    23 #include <e32base.h>
    24 #include "wmstore.h"
       
    25 
    24 
    26 // FORWARD DECLARATIONS
    25 // FORWARD DECLARATIONS
    27 class CRepository;
    26 class CRepository;
    28 class CWmResourceLoader;
    27 class CWmResourceLoader;
    29 
    28 
    35 NONSHARABLE_CLASS( CWmConfiguration ) : public CBase
    34 NONSHARABLE_CLASS( CWmConfiguration ) : public CBase
    36 	{
    35 	{
    37 	
    36 	
    38 public: // constructors and destructor
    37 public: // constructors and destructor
    39 
    38 
    40     /** Store's Application type */
    39     /** Operator Application type */
    41     enum TStoreAppType
    40     enum TOpAppType
    42         {
    41         {
    43         EUnknown,
    42         EUnknown,
    44         EOviCwrt,
       
    45         ES60,
    43         ES60,
    46         ECwrt,
    44         ECwrt,
    47         EWrt,
    45         EWrt,
    48         EJava,
    46         EJava,
    49         EQt,
    47         EQt,
    64     
    62     
    65     /** 2nd phase constructor */
    63     /** 2nd phase constructor */
    66     void ConstructL();
    64     void ConstructL();
    67 
    65 
    68 public: // API
    66 public: // API
    69         
    67     
    70     /**
    68     /**
    71      * Number of Stores
    69      * Number of portal buttons (1 or more)
    72      */
    70      */
    73     TInt StoreCount();
    71     TInt PortalButtonCount();
    74     
    72 
    75     /**
    73     /**
    76      * Returns Store configuration array ref
    74      * Label text to be displayed on a portal button
    77      */
    75      * @param aIndex index of the button, starting at 0
    78     const RPointerArray<CWmConfItem>& StoreConfArray();
    76      */
    79     
    77     const TDesC& PortalButtonText( TInt aIndex );
    80     /**
    78     
    81 	 * To compare orders
    79     /**
    82 	 */
    80      * Icon to be displayed on a portal button
    83     static TInt CompareStoreOrder( 
    81      * Logo syntax follows the widget icon syntax in CWmImageConverter
    84             const CWmConfItem& aItemOne, const CWmConfItem& aItemTwo );
    82      * @param aIndex index of the button, starting at 0
       
    83      */
       
    84     const TDesC& PortalButtonIcon( TInt aIndex );
       
    85     
       
    86     /**
       
    87      * Returns url to for browser by button index
       
    88      * @param aIndex index of the button, starting at 0
       
    89      */
       
    90     const TDesC& PortalButtonBrowserUrl( TInt aIndex );
       
    91     
       
    92     /**
       
    93      * Returns client uid by button index 
       
    94      * @param aIndex index of the button, starting at 0
       
    95      */
       
    96     TUid PortalButtonClientUid( TInt aIndex );
       
    97     
       
    98     /**
       
    99      * Returns client parameter by button index 
       
   100      * @param aIndex index of the button, starting at 0
       
   101      */
       
   102     const TDesC& PortalButtonClientParam( TInt aIndex );
       
   103     
       
   104     /**
       
   105      * Returns bool if buttons are mirrored.
       
   106      * @return true when operator button on left on portraid and 
       
   107      * on top on landscape.
       
   108      */
       
   109     TBool PortalButtonsMirrored();
       
   110     
       
   111     /**
       
   112      * Returns application type by button index
       
   113      * @param aIndex button index
       
   114      * @return application type
       
   115      */
       
   116     TOpAppType PortalButtonApplicationType( TInt aIndex );
       
   117     
       
   118     /**
       
   119      * Returns application id as string
       
   120      * @param aIndex button index
       
   121      * @param aOperatorAppId string to get app id
       
   122      */
       
   123     void PortalButtonApplicationId( TInt aIndex, TDes& aOperatorAppId );
       
   124     
       
   125     /**
       
   126      * Returns application id as uid
       
   127      * @param aIndex button index
       
   128      * @param aOperatorAppId uid to get app id
       
   129      */
       
   130     void PortalButtonApplicationId( TInt aIndex, TUid& aOperatorAppId );
    85     
   131     
    86 private: // New functions
   132 private: // New functions
    87     
   133     
    88     void LoadConfigurationL();
   134     void LoadConfigurationL();
    89     TInt FindCorrectLanguageId();
   135     TInt FindCorrectLanguageId();
    90     HBufC* ReadDescParameterL( TInt aKey );
   136     HBufC* ReadDescParameterL( TInt aKey );
    91     void ReadInt32Parameter( TInt aKey, TInt32& aValue );
   137     void ReadInt32Parameter( TInt aKey, TInt32& aValue );
    92     void ReadIntParameter( TInt aKey, TInt& aValue );
   138     void ReadIntParameter( TInt aKey, TInt& aValue );
    93     HBufC* ReadLocalisedParameterL( TInt aOffset );
   139     HBufC* ReadLocalisedParameterL( TInt aOffset );
    94     void ReadApplicationInfoL( TInt aKey, CWmConfItem& aConfItem );
   140     void ReadOperatorApplicationInfoL();
    95     TUid StringToUid( const TDesC& aStr );
   141     TUid StringToUid( const TDesC& aStr );
    96     
   142     
    97     /** Returns uid of the widget with a particular bundle identifier. */
   143     /** Returns uid of the widget with a particular bundle identifier. */
    98     TUid FetchWidgetUidFromRegistryL( const TDesC& aBundleId );
   144     TUid FetchWidgetUidFromRegistryL( const TDesC& aBundleId );
    99     
   145     
   100     /** sets Store icon to  if not already defined */
   146     /** sets operator icon to button if not already defined */
   101     void SetStoreIconL( CWmConfItem& aConfItem );
   147     void SetOperatorIconL( TUid aUid );
   102 
   148 	
   103 private:
   149 private:
   104 
   150 
   105     /**
   151     /**
   106      * the central repository
   152      * the central repository
   107      */
   153      */
   115     /**
   161     /**
   116      * The index in cenrep that matches current
   162      * The index in cenrep that matches current
   117      * system language
   163      * system language
   118      */
   164      */
   119     TInt                    iLanguageIndex;
   165     TInt                    iLanguageIndex;
   120     
   166 
   121     /**
   167     /**
   122      * Array of configuration items. Array is in order as they should appear in UI
   168      * OVI store button text
   123      */    
   169      */
   124     RPointerArray<CWmConfItem> iConfItems;
   170     HBufC*                  iOviButtonTitle;
       
   171     
       
   172     /**
       
   173      * OVI store button icon
       
   174      */
       
   175     HBufC*                  iOviButtonIcon;
       
   176     
       
   177     /**
       
   178      * OVI store button widget client param
       
   179      */
       
   180     HBufC*                  iOviStoreClientParam;
       
   181     
       
   182     /**
       
   183      * OVI store laucher uid
       
   184      */
       
   185     TUid                    iOviStoreUid;
       
   186     
       
   187     /**
       
   188      * OPERATOR button text
       
   189      */
       
   190     HBufC*                  iOperatorButtonTitle;
       
   191     
       
   192     /**
       
   193      * OPERATOR store icon
       
   194      */
       
   195     HBufC*                  iOperatorButtonIcon;
       
   196     
       
   197     /**
       
   198      * OPERATOR store button browser Url
       
   199      */
       
   200     HBufC*                  iOperatorButtonUrl;
       
   201     
       
   202     /**
       
   203      * OPERATOR store button application parameter
       
   204      */
       
   205     HBufC*                  iOperatorParam;
       
   206     
       
   207     /**
       
   208      * OPERATOR store application id as string. Used for java
       
   209      */
       
   210     HBufC*                  iOperatorAppIdStr;
       
   211     
       
   212     /**
       
   213      * OPERATOR store application id as uid.
       
   214      */
       
   215     TUid                    iOperatorAppIdUid;
       
   216         
       
   217     /**
       
   218      * OPERATOR store application type
       
   219      */
       
   220     TOpAppType              iOperatorAppType;
       
   221         
       
   222     /**
       
   223      * Tells if operator button is enabled. 
       
   224      */
       
   225     TBool                   iOperatorButtonEnabled;
       
   226         
       
   227     /**
       
   228      * Tells if buttons need to be mirrored for operator. 
       
   229      */
       
   230     TBool                   iButtonsMirrored;
   125 	};
   231 	};
   126 
   232 
   127 
       
   128 /**
       
   129  * Configuration item class for Widget Manager
       
   130  * 
       
   131  * @class CWmConfiguration
       
   132  */
       
   133 NONSHARABLE_CLASS( CWmConfItem ) : public CBase
       
   134     {
       
   135     public: // constructors and destructor
       
   136 
       
   137         /** Two-phased constructors. */
       
   138         static CWmConfItem* NewL();
       
   139 
       
   140         static CWmConfItem* NewLC();
       
   141         
       
   142         /** Destructor */
       
   143         ~CWmConfItem();
       
   144         
       
   145     private:
       
   146         /** constructor */
       
   147         CWmConfItem();
       
   148         
       
   149         /** 2nd phase constructor */
       
   150         void ConstructL();
       
   151         
       
   152 public: // API
       
   153     /**
       
   154      * Returns Store id
       
   155      */
       
   156     CWmStore::TStoreId Id();
       
   157     
       
   158     /**
       
   159      * Returns Label text to be displayed on a Store 
       
   160      */
       
   161     const TDesC& Title();
       
   162     
       
   163     /**
       
   164      * Returns Icon to be displayed on a Store 
       
   165      * Logo syntax follows the widget icon syntax in CWmImageConverter
       
   166      */
       
   167     const TDesC& Icon();  
       
   168 
       
   169     /**
       
   170      * Returns Order of Store
       
   171      */
       
   172     TInt Order();
       
   173     
       
   174     /**
       
   175      * Returns url to for browser
       
   176      */
       
   177     const TDesC& BrowserUrl();   
       
   178    
       
   179     /**
       
   180      * Returns application type
       
   181      */
       
   182     CWmConfiguration::TStoreAppType AppType();
       
   183     
       
   184     /**
       
   185      * Returns application uid 
       
   186      */
       
   187     TUid AppUid();
       
   188     
       
   189     /**
       
   190      * Returns application parameter by index 
       
   191      */
       
   192     const TDesC& AppParam();
       
   193     
       
   194 private:    
       
   195     /**
       
   196      * Store Id
       
   197      */
       
   198     CWmStore::TStoreId      iId;
       
   199     
       
   200     /**
       
   201      * Store text
       
   202      */
       
   203     HBufC*                  iTitle;
       
   204     
       
   205     /**
       
   206      * Store icon
       
   207      */
       
   208     HBufC*                  iIcon;
       
   209     
       
   210     /**
       
   211      * Store order
       
   212      */
       
   213     TInt                    iOrder;
       
   214             
       
   215     /**
       
   216      * Store browser Url
       
   217      */
       
   218     HBufC*                  iUrl;              
       
   219   
       
   220     /**
       
   221      * Application type
       
   222      */
       
   223     CWmConfiguration::TStoreAppType           iAppType;
       
   224     
       
   225     /**
       
   226      * Application uid
       
   227      */
       
   228     TUid                    iAppUid;
       
   229     
       
   230     /**
       
   231      * Application parameter
       
   232      */
       
   233     HBufC*                  iAppParam;
       
   234     
       
   235     friend class CWmConfiguration;
       
   236     };
       
   237 #endif // WMCONFIGURATION_H
   233 #endif // WMCONFIGURATION_H
   238 
   234 
   239 // End of File
   235 // End of File