textinput/GSLangPlugin/inc/PredictiveSettingList.h
branchRCL_3
changeset 44 ecbabf52600f
parent 0 eb1f2e154e89
equal deleted inserted replaced
43:ebd48d2de13c 44:ecbabf52600f
       
     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 *
       
    16 */
       
    17 /*
       
    18  * ============================================================================
       
    19  *  Name     : CGSPredictiveSettingList from SettingExampleSettingList.h
       
    20  * ============================================================================
       
    21  */
       
    22 
       
    23 #ifndef __GSPREDICTIVESETTING_LIST_H
       
    24 #define __GSPREDICTIVESETTING_LIST_H
       
    25 
       
    26 
       
    27 #include <coecntrl.h>
       
    28 #include <aknsettingitemlist.h> 
       
    29 #include <akncheckboxsettingpage.h>
       
    30 
       
    31 
       
    32 //class CGSPredictiveSettingData;
       
    33 #include "PredictiveSettingData.h"
       
    34 
       
    35 class CGSPredictiveSettingDialog;
       
    36 
       
    37 /**
       
    38  * Class: CGSMultiSelectionSettingItem
       
    39  *
       
    40  * Discussion:  An implementation of CAknBigSettingItemBase, providing a 
       
    41  *              big setting item that opens a multiselection (checkbox)
       
    42  *              setting page. Specialized implementation to show
       
    43  *              word autocompletion settings.
       
    44  * 
       
    45  */
       
    46 class CGSMultiSelectionSettingItem : public CAknBigSettingItemBase
       
    47     {
       
    48 public:
       
    49     CGSMultiSelectionSettingItem( TInt aResourceId, CGSPredictiveSettingData &aData,
       
    50             CCoeEnv* aCoeEnv );
       
    51     ~CGSMultiSelectionSettingItem();
       
    52     virtual void EditItemL( TBool aCalledFromMenu );
       
    53     virtual void StoreL();
       
    54     virtual void LoadL();
       
    55     
       
    56 private:
       
    57     CSelectionItemList* CreateSelectionItemListL();
       
    58     
       
    59     CGSPredictiveSettingData &iData; // not owned
       
    60     CSelectionItemList* iSelection;
       
    61     CCoeEnv* iCoeEnv;
       
    62     TInt iItutIndex;
       
    63     TInt iHalfQwertyIndex;
       
    64     TInt iQwertyIndex;
       
    65     };
       
    66 
       
    67 /**
       
    68  * Class: CGSPredictiveSettingList
       
    69  *
       
    70  * Discussion: 	A specialised subclass of CAknSettingItemList. This class is
       
    71  *				the control used to both display the current values of the
       
    72  *				settings and to launch the relevant editor for those items.
       
    73  *
       
    74  */
       
    75 class CGSPredictiveSettingList : public CAknSettingItemList
       
    76 	{
       
    77 public:
       
    78 	/**
       
    79  	* Function: 	NewL
       
    80 	*
       
    81  	* Discussion:	Factory function used to create a new instance of
       
    82  	* 				CGSPredictiveSettingList
       
    83 	*
       
    84 	* Params:		aData - reference to the data to be displayed and edited.
       
    85 	*
       
    86  	* Returns:		A newly created instance of CGSPredictiveSettingList
       
    87 	*/
       
    88 	static CGSPredictiveSettingList* NewL(CGSPredictiveSettingData &aData, CGSPredictiveSettingDialog &aDialog);
       
    89 
       
    90 	/**
       
    91  	* Function: 	NewLC
       
    92 	*
       
    93  	* Discussion:	Factory function used to create a new instance of
       
    94  	* 				CGSPredictiveSettingList and leave a pointer to it on the
       
    95  	*				cleanup	stack.
       
    96 	*
       
    97 	* Params:		aData - reference to the data to be displayed and edited.
       
    98 	*
       
    99  	* Returns:		A newly created instance of CGSPredictiveSettingList
       
   100 	*/
       
   101 	static CGSPredictiveSettingList* NewLC(CGSPredictiveSettingData &aData, CGSPredictiveSettingDialog &aDialog);
       
   102 
       
   103 	/**
       
   104 	* Function:		~CGSPredictiveSettingList
       
   105 	*
       
   106 	* Discussion: 	Virtual destructor for CGSPredictiveSettingList. Ensures that
       
   107 	*				all	allocated memory is returned to the heap before
       
   108 	*				deletion of object.
       
   109 	*
       
   110 	*/
       
   111 	virtual ~CGSPredictiveSettingList();
       
   112 
       
   113 
       
   114 	/**
       
   115 	* Function:		SizeChanged
       
   116 	*
       
   117 	* Discussion: 	Inherited from CCoeControl. Calculates size based on
       
   118 	*				contained control required sizes.
       
   119 	*
       
   120 	*/
       
   121 	void SizeChanged();
       
   122 
       
   123 	/**
       
   124 	 * Function:	EditCurrentItemL
       
   125      * Params:		aCalledFromMenu - ETrue if called from menu, EFalse otherwise.
       
   126 	 *
       
   127  	 *
       
   128 	 * Discussion:	Starts the setting page for the currently selected item 
       
   129 	 *				in the list.
       
   130 	 */
       
   131 	void EditCurrentItemL(TBool aCalledFromMenu);
       
   132 	
       
   133     TBool DeviceHasMultipleKeyboards();
       
   134     TBool DeviceHasQwertyKeyboard(); 
       
   135     TBool DeviceHasNonHalfQwertyKeyboard();	
       
   136 	
       
   137 private:
       
   138 	/**
       
   139 	* Function:		CGSPredictiveSettingList
       
   140 	*
       
   141 	* Discussion: 	Hidden, first-stage non-leaving constructor.
       
   142 	*
       
   143 	* Params:		aData - reference to the data to be displayed and edited.
       
   144 	*
       
   145 	*/
       
   146 	CGSPredictiveSettingList(CGSPredictiveSettingData &aData, CGSPredictiveSettingDialog &aDialog);
       
   147 
       
   148 	/**
       
   149 	* Function:		CreateSettingItemL
       
   150 	*
       
   151 	* Discussion: 	Factory function for creating CAknSettingItem derived
       
   152 	*				SettingItem classes used t display current values
       
   153 	*
       
   154 	* Params:		aSettingId - the id of the control which should be created
       
   155 	*
       
   156 	*/
       
   157 	CAknSettingItem* CreateSettingItemL (TInt aSettingId);
       
   158 	
       
   159 	void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   160 	void HandleResourceChange(TInt aType);
       
   161 
       
   162 private:
       
   163 	CGSPredictiveSettingData &iSettingsData;		/* Reference to data owned by Dialog */
       
   164 	CGSPredictiveSettingDialog &iSettingsDialog;
       
   165 	};
       
   166 
       
   167 #endif // __GSPREDICTIVESETTING_LIST_H
       
   168