CAknEnumeratedTextSettingItem Class Reference

API published in: S60 1st Ed

Link against: avkon.lib

Capability Information

Required Capabilities

None


#include <aknsettingitemlist.h>

Inherits CAknSettingItem.

Inherited by CAknEnumeratedTextPopupSettingItem.


Detailed Description

CAknEnumeratedTextSettingItem.

Abstract Base class for deriving listbox setting page related setting items

The class provides standard array support for these setting items and their listboxes. Then approach is centred upon the CAknEnumeratedText type.

The texts are exposed to the user, and appear in two versions, if desired - the text shown in the setting list when not being edited, and the "popped-up" version of the texts.


Public Member Functions

IMPORT_C  CAknEnumeratedTextSettingItem (TInt aResourceId)
  Constructor.
IMPORT_C  ~CAknEnumeratedTextSettingItem ()
  Destructor.
IMPORT_C CArrayPtr< CAknEnumeratedText > *  EnumeratedTextArray () const
  Access to the enumerated text array.
IMPORT_C CArrayPtr< HBufC > *  PoppedUpTextArray () const
  Access to the "popped up" array of texts.
IMPORT_C void  SetEnumeratedTextArrays (CArrayPtr< CAknEnumeratedText > *aEnumeratedTextArray, CArrayPtr< HBufC > *PoppedUpTextArray)
  Set the enumerated arrays.
virtual IMPORT_C void  HandleTextArrayUpdateL ()
  Called to execute any code that might need to run when the text arrays are replaced.
IMPORT_C TInt  NumberOfItems () const
  Access to the number of items in the arrays.
IMPORT_C TInt  IndexFromValue (TInt aInputValue) const
  Routine to find the index in the enumerated text list that corresponds to the value passed in.

Protected Member Functions

IMPORT_C void  CompleteConstructionL ()
  Virtual method called by framework to complete the construction.
IMPORT_C void  SetSettingPageTextL ()
  Implementors of subclasses can call this non-virtual method to set up the list of texts to be used for the setting page.
IMPORT_C CDesCArray *  SettingPageTextArray () const
  Accessor for the setting page text array.

Constructor & Destructor Documentation

IMPORT_C CAknEnumeratedTextSettingItem::CAknEnumeratedTextSettingItem TInt  aResourceId  ) 
 

Constructor.

Resource Id for the setting item

IMPORT_C CAknEnumeratedTextSettingItem::~CAknEnumeratedTextSettingItem  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CAknEnumeratedTextSettingItem::CompleteConstructionL  )  [protected, virtual]
 

Virtual method called by framework to complete the construction.

In this class, the two arrays, pointers to which can be obtained by calling EnumeratedTextArray() and PoppedUpTextArray() are created.

Reimplemented from CAknSettingItem.

Reimplemented in CAknEnumeratedTextPopupSettingItem, and CAknBinaryPopupSettingItem.

IMPORT_C CArrayPtr<CAknEnumeratedText>* CAknEnumeratedTextSettingItem::EnumeratedTextArray  )  const
 

Access to the enumerated text array.

Texts here are used in the setting item list display. No ownership of the array or its contents is transferred

Returns:
a pointer to an array of HBufC*s

Reimplemented in CAknEnumeratedTextPopupSettingItem.

virtual IMPORT_C void CAknEnumeratedTextSettingItem::HandleTextArrayUpdateL  )  [virtual]
 

Called to execute any code that might need to run when the text arrays are replaced.

This class has a null implementation

IMPORT_C TInt CAknEnumeratedTextSettingItem::IndexFromValue TInt  aInputValue  )  const
 

Routine to find the index in the enumerated text list that corresponds to the value passed in.

Parameters:
aInputValue  value to search for in the enumerated items
Returns:
0 - based index in the item found. -1 if not found.

Reimplemented in CAknEnumeratedTextPopupSettingItem.

IMPORT_C TInt CAknEnumeratedTextSettingItem::NumberOfItems  )  const
 

Access to the number of items in the arrays.

Returns:
The number of items in the array returned by EnumeratedTextArray()
IMPORT_C CArrayPtr<HBufC>* CAknEnumeratedTextSettingItem::PoppedUpTextArray  )  const
 

Access to the "popped up" array of texts.

They may be defined differently from those in the enumerated text array so that the setting page items can be different from those displayed in the setting item editing list No ownership of the array or its contents is transferred

Returns:
a pointer to an array of HBufC*s

Reimplemented in CAknEnumeratedTextPopupSettingItem.

IMPORT_C void CAknEnumeratedTextSettingItem::SetEnumeratedTextArrays CArrayPtr< CAknEnumeratedText > *  aEnumeratedTextArray,
CArrayPtr< HBufC > *  PoppedUpTextArray
 

Set the enumerated arrays.

Ownership of these arrays and their contents is wholly given over to the setting item object. The client must call HandleTextArrayUpdateL() after making this call.

After calling SetEnumeratedTextArrays(), it is the client code's responsibility to ensure that the current value of the external Tint value corresponds to one of the enumerated texts. This can be done, for instance, after calling SetEnumeratedTextArrays() by calling IndexFromValue() and ensuring a return value of a valid index (not -1 ). Otherwise, there will be a panic in HandleTextArrayUpdateL() when it is called.

This call transfers the ownership of the arrays, and the items pointed to by the arrays

Parameters:
aEnumeratedTextArray  array of Integer-Text pairs to be the new basis for display This is the master array, and its Count() determines the number of entries to display
aPoppedUpTextArray  array of Text descriptors that provide versions of the text to display in the setting page listbox. The array pointer must be valid, but the array need not contain any entries. Only those entries that need to be different from those in aEnumeratedTextArray needs be present;
IMPORT_C void CAknEnumeratedTextSettingItem::SetSettingPageTextL  )  [protected]
 

Implementors of subclasses can call this non-virtual method to set up the list of texts to be used for the setting page.

(Although it is not useful for CAknCheckBoxSettingPage) The list is constructed from the contents of the two text arrays, EnumeratedTextArray() and PoppedUpTextArray(). This is usually to be done "On the fly" immediately prior to the raising of a setting page.

IMPORT_C CDesCArray* CAknEnumeratedTextSettingItem::SettingPageTextArray  )  const [protected]
 

Accessor for the setting page text array.


The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top