customization/isadapter/inc/UiSettingsUtil.h
changeset 0 3ce708148e4d
child 2 a5fecba4b1e4
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:  DM Idle SoftKey Adapter
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __UISETTINGSUTIL_H__
       
    20 #define __UISETTINGSUTIL_H__
       
    21 
       
    22 #include <FavouritesDb.h>           // Favourites Database
       
    23 #include <msvapi.h>
       
    24 #include <apgcli.h>
       
    25 #include <centralrepository.h>
       
    26 
       
    27 #include "javaregistry.h"
       
    28 #include "javaregistryentry.h"
       
    29 
       
    30 
       
    31 using namespace Java;
       
    32 
       
    33 class CUiSettingsUtil : public CBase, public MMsvSessionObserver
       
    34 {
       
    35 public:
       
    36 
       
    37     static CUiSettingsUtil* NewL( );
       
    38     static CUiSettingsUtil* NewLC( );
       
    39 
       
    40     ~CUiSettingsUtil();
       
    41     
       
    42     // Returns whether the uid is of an application or bookmark
       
    43   	void GetShortcutRtTypeL(TInt aUid, TInt &aRtType);
       
    44   	
       
    45   	// Returns the index of the matching uid Applications and WebTargets
       
    46     TInt GetShortcutTargetIndexL(TInt aUid, TInt& aIndex); 
       
    47     
       
    48     // returns the total number of Softkeys
       
    49 	
       
    50 	TInt GetSoftkeyCountL();
       
    51     
       
    52     // Application Target Functions
       
    53     
       
    54     // Initializes the Normal, Java, Mailbox and Static Applications
       
    55     void ReadTargetsL();    
       
    56     
       
    57     // Returns the index of the matching index for Normal and Java Applications
       
    58     TInt GetAppTargetCaptionL(TInt index, TDes& aBufferCaption);
       
    59     
       
    60     // Sets the Softkey Target, given the Softkey UID and the App Index
       
    61     TInt SetShortcutTargetAppIndexL( TInt aUid, TInt aIndex );
       
    62   	
       
    63   	// returns total number of applications
       
    64 	TInt GetNoOfTargetApps();	
       
    65 	
       
    66 	// Web Target Functions
       
    67 	
       
    68 	// Initializes the WebTarget List
       
    69 	void ReadBookmarksL();
       
    70 	
       
    71 	// returns the number of webtargets
       
    72 	TInt GetWebTargetsCount( TInt &aCount );
       
    73 	
       
    74 	// Returns the index of the matching uid for webtargets
       
    75 	TInt GetWebTargetAppUid( TInt aIndex, TInt& aUid );
       
    76 	
       
    77 	// Returns the caption of the matching index for webtargets
       
    78 	TInt GetWebTargetCaption( TInt aIndex, TDes& aCaption );
       
    79 	
       
    80 	// Get the wetarget index given the UID
       
    81 	TInt GetWebTargetIndex( TInt& aIndex, TInt& aUid );
       
    82 		
       
    83 	// Sets the Softkey Target, given the Softkey UID and the WebTarget Index
       
    84 	TInt SetShortcutTargetWebIndexL( TInt aUid, TInt aIndex );
       
    85   	
       
    86   	
       
    87   	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/);
       
    88   	
       
    89 private:	
       
    90 	
       
    91 	void ConstructL( );
       
    92     CUiSettingsUtil();
       
    93     	
       
    94 	// Following four functions initialize their respective lists
       
    95 	// Each is called from ReadTargetsL()
       
    96 	void ReadJavaTargetsL();
       
    97 	void ReadMailBoxesL();
       
    98 	void ReadAppTargetsL();
       
    99 	void ReadStaticAppTargetsL();
       
   100 	
       
   101 	// Checks if the java application is NonNative
       
   102 	TBool IsNonNativeL(const TUid& aUid) const ;
       
   103 	
       
   104 	// Gets the key value for a given Softkey node
       
   105 	void GetKeyValueL(TInt aUid, TDes16 &aValue);
       
   106 	
       
   107 	// Gets the Application Info at the given node
       
   108 	TBool GetAppInfoAtIndex(TInt aIndex, TApaAppInfo& aAppInfo);
       
   109 	
       
   110 	// Finds the matching app (normal and Java) in the list to the UID
       
   111   	TBool GetAppIndexToUID(TUid aUID, TInt& aIndex );
       
   112   	
       
   113 	// Finds the matching MailBox in the list to the name
       
   114   	TBool GetMailBoxTargetIndex(const TDesC& aName, TInt& aIndex );
       
   115   	
       
   116 	// Finds the matching static application in the list to the name
       
   117   	TBool GetStaticAppIndex(const TDesC& aKeyValue,TInt& aIndex) ;
       
   118   	    
       
   119 private:
       
   120 
       
   121 	CFavouritesItemList*				iFavList;    
       
   122     RArray<TUid> 						iJaveUids;
       
   123     RPointerArray<TApaAppInfo> 			iListItems;
       
   124 	CDesCArray* 						iMailBoxes;
       
   125 	CDesCArrayFlat*						iStaticAppParam ;
       
   126 	CDesCArrayFlat*						iStaticAppCaption ;
       
   127 };
       
   128 
       
   129 
       
   130 #endif // __UISETTINGSUTIL_H__