CAknSettingItem Class Reference

class CAknSettingItem : public CBase

CAknSettingItem is the base class for all setting items. The abstracted functionality is implemented in this class if possible.

All array of setting items is held in CAknSettingItemArray , which in turn is owned by CAknSettingItemList , a listbox type.

Inherits from

Public Member Functions
CAknSettingItem ( TInt )
~CAknSettingItem ()
IMPORT_C void ConstructL (const TBool , const TInt , const TDesC &, CArrayPtr < CGulIcon > *, const TInt , const TInt , const TInt , const TInt )
IMPORT_C void EditItemL ( TBool )
IMPORT_C void HandleSettingPageEventL ( CAknSettingPage *, TAknSettingPageEvent)
IMPORT_C TBool HasIcon ()
IMPORT_C TInt Identifier ()
IMPORT_C TBool IsHidden ()
IMPORT_C TBool IsNumberedStyle ()
IMPORT_C HBufC * ListBoxText ()
IMPORT_C void LoadL ()
IMPORT_C CAknSettingItem::TSettingItemProtection ProtectionState ()
IMPORT_C void SetCompulsoryIndTextL (const TDesC &)
IMPORT_C void SetEmptyItemTextL (const TDesC &)
IMPORT_C void SetHidden ( TBool )
void SetParentListBox (const CEikFormattedCellListBox *)
IMPORT_C void SetProtectionState ( CAknSettingItem::TSettingItemProtection )
IMPORT_C void SetSettingPageFlags ( TInt )
IMPORT_C TPtrC SettingName ()
IMPORT_C TInt SettingNumber ()
IMPORT_C TInt SettingPageFlags ()
IMPORT_C const TDesC & SettingTextL ()
IMPORT_C void StoreL ()
IMPORT_C void UpdateListBoxTextL ()
IMPORT_C TInt VisibleIndex ()
Protected Member Functions
IMPORT_C TInt AssociatedResourceId ()
IMPORT_C void CompleteConstructionL ()
IMPORT_C CFbsBitmap * CreateBitmapL ()
TInt EditorControlType ()
IMPORT_C TDesC & EmptyItemText ()
IMPORT_C TBool SetIconMask ( CFbsBitmap *)
CFbsBitmap * SetIconMaskAndReturnBitmap ( CGulIcon *)
IMPORT_C void SetSettingPage ( CAknSettingPage *)
IMPORT_C void SetUpStandardSettingPageL ()
IMPORT_C TInt SettingEditorResourceId ()
IMPORT_C CAknSettingPage * SettingPage ()
IMPORT_C TInt SettingPageResourceId ()
Private Member Functions
IMPORT_C void CAknSettingItem_Reserved ()
TPtrC ReplaceNonPrintingCharacters ( TDes &)
void SetOrdinal ( TInt )
void SetVisibleIndex ( TInt )
void UpdateBitmapL ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enum TFlags {
EIsHidden  = 0x1, EHasIcon  = 0x2, EIsNumberedStyle  = 0x4, ENoProtection  = 0x8, EViewOnly  = 0x10, EProtected  = 0x20
}
enum TSettingItemProtection { ENoSettingItemProtection , ESettingItemViewOnly , ESettingItemProtected }
Private Attributes
TInt iAssociatedResourceId
HBufC * iCompulsoryText
TInt iEditorControlType
HBufC * iEmptyItemText
CAknSettingItemExtension * iExtension
TUint iFlags
CArrayPtr < CGulIcon > * iIconArray
TInt iIconIndex
TInt iIdentifier
HBufC * iListBoxText
TInt iOrdinal
const CEikFormattedCellListBox * iParentListBox
TInt iSettingEditorResourceId
TInt iSettingIdentifier
HBufC * iSettingName
CAknSettingPage * iSettingPage
TInt iSettingPageFlags
TInt iSettingPageResourceId
TInt iVisibleIndex

Constructor & Destructor Documentation

CAknSettingItem(TInt)

IMPORT_C CAknSettingItem ( TInt identifier )

Constructor

Parameters

TInt identifier

~CAknSettingItem()

IMPORT_C ~CAknSettingItem ( )

Destructor

Member Functions Documentation

AssociatedResourceId()

IMPORT_C TInt AssociatedResourceId ( ) const [protected]

Returns the associate editor resource. This is an LLINK in the seting item resource that subclasses can use in CompleteContstructionL

CAknSettingItem_Reserved()

IMPORT_C void CAknSettingItem_Reserved ( ) [private]

CompleteConstructionL()

IMPORT_C void CompleteConstructionL ( ) [protected, virtual]

Method called by framework to complete the construction. Extra allocations of memory or extra resource reading can happen here.

ConstructL(const TBool, const TInt, const TDesC &, CArrayPtr< CGulIcon > *, const TInt, const TInt, const TInt, const TInt)

IMPORT_C void ConstructL ( const TBool aIsNumberedStyle,
const TInt aOrdinal,
const TDesC & aSettingTitle,
CArrayPtr < CGulIcon > * aIconArray,
const TInt aSettingPageResource,
const TInt aEditorControlType,
const TInt aSettingEditorResource = 0,
const TInt aAssociatedResource = 0
)

2nd-stage constuctor. Resource for setting item is read externally in setting item list and the values are passed here.

Parameters

const TBool aIsNumberedStyle
const TInt aOrdinal
const TDesC & aSettingTitle
CArrayPtr < CGulIcon > * aIconArray
const TInt aSettingPageResource
const TInt aEditorControlType
const TInt aSettingEditorResource = 0
const TInt aAssociatedResource = 0

CreateBitmapL()

IMPORT_C CFbsBitmap * CreateBitmapL ( ) [protected, virtual]

Method to obtain a new bitmap for the setting content

This method is usually empty in setting items classes except for volume and slider. Any derived implementations of this method should call SetIconMask() .

EditItemL(TBool)

IMPORT_C void EditItemL ( TBool aCalledFromMenu ) [virtual]

This launches the setting page

Parameters

TBool aCalledFromMenu - ignored in this class

EditorControlType()

TInt EditorControlType ( ) const [protected]

EmptyItemText()

IMPORT_C TDesC & EmptyItemText ( ) const [protected]

Access to the empty text that has been set, or is default

HandleSettingPageEventL(CAknSettingPage *, TAknSettingPageEvent)

IMPORT_C void HandleSettingPageEventL ( CAknSettingPage * aSettingPage,
TAknSettingPageEvent aEventType
) [virtual]

Parameters

CAknSettingPage * aSettingPage
TAknSettingPageEvent aEventType

HasIcon()

IMPORT_C TBool HasIcon ( ) const

Checks if the setting item has a bitmap in its setting contents

Identifier()

IMPORT_C TInt Identifier ( ) const

Access to the setting item's identifier. This is set in the setting item's constructor but usually comes via resource in the setting item list read of its resource structure

IsHidden()

IMPORT_C TBool IsHidden ( ) const

Access to the setting visibility

IsNumberedStyle()

IMPORT_C TBool IsNumberedStyle ( ) const

Access to the numbering style of the setting item

ListBoxText()

IMPORT_C HBufC * ListBoxText ( )

This gives access to the listbox text content at this item (fully decorated)

LoadL()

IMPORT_C void LoadL ( ) [virtual]

ProtectionState()

IMPORT_C CAknSettingItem::TSettingItemProtection ProtectionState ( )

Get the protection state

See SetProtected for details for the different states.

Since
3.1

ReplaceNonPrintingCharacters(TDes &)

TPtrC ReplaceNonPrintingCharacters ( TDes & aTextToClean ) [private]

Clean up a setting text for display by replacing all non printing characters by spaces

Parameters

TDes & aTextToClean

SetCompulsoryIndTextL(const TDesC &)

IMPORT_C void SetCompulsoryIndTextL ( const TDesC & aCompulsoryInd )

Parameters

const TDesC & aCompulsoryInd

SetEmptyItemTextL(const TDesC &)

IMPORT_C void SetEmptyItemTextL ( const TDesC & aEmptyItemText )

This sets the text to display if the current setting is empty.

Parameters

const TDesC & aEmptyItemText

SetHidden(TBool)

IMPORT_C void SetHidden ( TBool aHidden )

Set the visibility Note that the setting item array must have be notified of this by calling CAknSettingItemList::HandleChangeInItemArrayOrVisibility

Parameters

TBool aHidden

SetIconMask(CFbsBitmap *)

IMPORT_C TBool SetIconMask ( CFbsBitmap * aMask ) [protected]

This sets the mask of this setting item's icon array, if it exists. The normal usage of this routine is inside a re-implementation of CAknSettingItem::CreateBitmapL . It is used to set the mask of the setting item's setting icon as a side effect of a framework call to CreateBitmapL

The return value may need to be looked at to decide how to dispose of, for example, an a CGulIcon that may be holding the mask.

Since
2.0

Parameters

CFbsBitmap * aMask bitmap to set as a mask for the CGulIcon in the setting listbox's icon array

SetIconMaskAndReturnBitmap(CGulIcon *)

CFbsBitmap * SetIconMaskAndReturnBitmap ( CGulIcon * aIcon ) [protected]

This sets the mask of this setting item's icon array, if it exists, using the mask from the passed icon. It returns the bitmap from the aIcon. The method also takes ownership of aIcon and may delete it (but not its bitmap).

Since
2.0

Parameters

CGulIcon * aIcon icon of which the mask is passed through to SetIconMask() and bitmap is returned

SetOrdinal(TInt)

void SetOrdinal ( TInt aOrdinal ) [private]

Set the ordinal value. This is used for dynamic changing of the ordinal by CAknSettingItemArray

Parameters

TInt aOrdinal

SetParentListBox(const CEikFormattedCellListBox *)

void SetParentListBox ( const CEikFormattedCellListBox * aListBox )

Set the parent lisbox into the setting item

Since
2.0

Parameters

const CEikFormattedCellListBox * aListBox listbox with which the setting item is associated.

SetProtectionState(CAknSettingItem::TSettingItemProtection)

IMPORT_C void SetProtectionState ( CAknSettingItem::TSettingItemProtection aProtected )

Set the protection state of the setting item

The protection state is for protecting selected settings from editing. The protection can be set to:
  • prohibit opening of the setting page

  • allow access to the setting page, but prohibit editing of it

The protected item is indicated in the setting item list with a lock icon. If a user tries to open a protected setting item, a notification is shown to the user.

The "view only" -mode is only possible for pop-up setting page.

Since
3.1

Parameters

CAknSettingItem::TSettingItemProtection aProtected Sets the protection state of the setting item

SetSettingPage(CAknSettingPage *)

IMPORT_C void SetSettingPage ( CAknSettingPage * aSettingPage ) [protected]

A setting page should know when it is "Editing". This is set in EditItemL and cleared to 0 when the dialog is finished.

Parameters

CAknSettingPage * aSettingPage

SetSettingPageFlags(TInt)

IMPORT_C void SetSettingPageFlags ( TInt aFlagPattern )

Set the flags that are required for some of the setting page constructors

Parameters

TInt aFlagPattern Flag pattern to set

SetUpStandardSettingPageL()

IMPORT_C void SetUpStandardSettingPageL ( ) [protected]

Performs standard setup on a setting page

SetVisibleIndex(TInt)

void SetVisibleIndex ( TInt aVisibleIndex ) [private]

Set the index at which the item is to appear in the setting item list Only needed by CAknSettingItemArray

Parameters

TInt aVisibleIndex

SettingEditorResourceId()

IMPORT_C TInt SettingEditorResourceId ( ) const [protected]

Access to the setting page editor's resource id that might have been read by the setting item resource.

SettingName()

IMPORT_C TPtrC SettingName ( )

Access to the setting Name .

SettingNumber()

IMPORT_C TInt SettingNumber ( ) const

Access to the setting number

SettingPage()

IMPORT_C CAknSettingPage * SettingPage ( ) const [protected]

SettingPageFlags()

IMPORT_C TInt SettingPageFlags ( ) const

Access method for the setting page specific flags

SettingPageResourceId()

IMPORT_C TInt SettingPageResourceId ( ) const [protected]

Access to the setting page resource id that might have been read by the setting item resource.

SettingTextL()

IMPORT_C const TDesC & SettingTextL ( ) [virtual]

StoreL()

IMPORT_C void StoreL ( ) [virtual]

This command externalizes the current setting. The displayed (internal) copy is transferred to the external copy (the one referenced in the constructor).

This must be called by the client if he wants this to happen. Note that StoreAllL() on the setting item list will call this for each setting item.

UpdateBitmapL()

void UpdateBitmapL ( ) [private]

This routine causes any bitmaps that are extracted from setting pages to be updated according to the current (internal) setting value

UpdateListBoxTextL()

IMPORT_C void UpdateListBoxTextL ( ) [virtual]

This method is called by framework in order to update the text in the setting item. It may be called by the client.

VisibleIndex()

IMPORT_C TInt VisibleIndex ( )

Get the index at which this item appears in the listbox

Member Enumerations Documentation

Enum TFlags

Enumerators

EIsHidden = 0x1
EHasIcon = 0x2
EIsNumberedStyle = 0x4
ENoProtection = 0x8
EViewOnly = 0x10
EProtected = 0x20

Enum TSettingItemProtection

Enumerators

ENoSettingItemProtection
ESettingItemViewOnly
ESettingItemProtected

Member Data Documentation

TInt iAssociatedResourceId

TInt iAssociatedResourceId [private]

HBufC * iCompulsoryText

HBufC * iCompulsoryText [private]

TInt iEditorControlType

TInt iEditorControlType [private]

HBufC * iEmptyItemText

HBufC * iEmptyItemText [private]

CAknSettingItemExtension * iExtension

CAknSettingItemExtension * iExtension [private]

TUint iFlags

TUint iFlags [private]

CArrayPtr< CGulIcon > * iIconArray

CArrayPtr < CGulIcon > * iIconArray [private]

TInt iIconIndex

TInt iIconIndex [private]

TInt iIdentifier

TInt iIdentifier [private]

HBufC * iListBoxText

HBufC * iListBoxText [private]

TInt iOrdinal

TInt iOrdinal [private]

const CEikFormattedCellListBox * iParentListBox

const CEikFormattedCellListBox * iParentListBox [private]

TInt iSettingEditorResourceId

TInt iSettingEditorResourceId [private]

TInt iSettingIdentifier

TInt iSettingIdentifier [private]

HBufC * iSettingName

HBufC * iSettingName [private]

CAknSettingPage * iSettingPage

CAknSettingPage * iSettingPage [private]

TInt iSettingPageFlags

TInt iSettingPageFlags [private]

TInt iSettingPageResourceId

TInt iSettingPageResourceId [private]

TInt iVisibleIndex

TInt iVisibleIndex [private]