CAknSettingItem Class Reference

API published in: S60 1st Ed

Link against: avkon.lib

Capability Information

Required Capabilities

None


#include <aknsettingitemlist.h>

Inherits MAknSettingPageObserver.

Inherited by CAknBigSettingItemBase, CAknEnumeratedTextSettingItem, CAknIntegerSettingItem, CAknIpFieldSettingItem, CAknMemorySelectionSettingItem, CAknSliderSettingItem, CAknTextSettingItem, CAknTimeOffsetSettingItem, CAknTimeOrDateSettingItem, and CAknVolumeSettingItem.


Detailed Description

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.


Public Types

enum   TFlags {
  EIsHidden = 0x1, EHasIcon = 0x2, EIsNumberedStyle = 0x4, ENoProtection = 0x8,
  EViewOnly = 0x10, EProtected = 0x20
}
enum   TSettingItemProtection { ENoSettingItemProtection, ESettingItemViewOnly, ESettingItemProtected }

Public Member Functions

IMPORT_C  CAknSettingItem (TInt identifier)
  Constructor.
IMPORT_C  ~CAknSettingItem ()
  Destructor.
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.
virtual IMPORT_C void  StoreL ()
  This command externalizes the current setting.
virtual IMPORT_C void  LoadL ()
virtual IMPORT_C void  EditItemL (TBool aCalledFromMenu)
  This launches the setting page.
virtual IMPORT_C void  UpdateListBoxTextL ()
  This method is called by framework in order to update the text in the setting item.
IMPORT_C TPtrC  SettingName ()
  Access to the setting Name
IMPORT_C TInt  SettingNumber () const
  Access to the setting number.
IMPORT_C TBool  IsHidden () const
  Access to the setting visibility.
IMPORT_C TBool  IsNumberedStyle () const
  Access to the numbering style of the setting item.
IMPORT_C void  SetHidden (TBool aHidden)
  Set the visibility.
virtual IMPORT_C const TDesC &  SettingTextL ()
IMPORT_C HBufC *  ListBoxText ()
  This gives access to the listbox text content at this item (fully decorated).
IMPORT_C TInt  Identifier () const
  Access to the setting item's identifier.
IMPORT_C TBool  HasIcon () const
  Checks if the setting item has a bitmap in its setting contents.
IMPORT_C void  SetEmptyItemTextL (const TDesC &aEmptyItemText)
  This sets the text to display if the current setting is empty.
IMPORT_C void  SetCompulsoryIndTextL (const TDesC &aCompulsoryInd)
virtual IMPORT_C void  HandleSettingPageEventL (CAknSettingPage *aSettingPage, TAknSettingPageEvent aEventType)
IMPORT_C TInt  VisibleIndex ()
  Get the index at which this item appears in the listbox.
IMPORT_C void  SetSettingPageFlags (TInt aFlagPattern)
  Set the flags that are required for some of the setting page constructors.
IMPORT_C TInt  SettingPageFlags () const
  Access method for the setting page specific flags.
void  SetParentListBox (const CEikFormattedCellListBox *aListBox)
  Set the parent lisbox into the setting item.
IMPORT_C void  SetProtectionState (CAknSettingItem::TSettingItemProtection aProtected)
  Set the protection state of the setting item.
IMPORT_C CAknSettingItem::TSettingItemProtection  ProtectionState ()
  Get the protection state.

Protected Member Functions

virtual IMPORT_C void  CompleteConstructionL ()
  Method called by framework to complete the construction.
virtual IMPORT_C CFbsBitmap *  CreateBitmapL ()
  Method to obtain a new bitmap for the setting content.
IMPORT_C void  SetSettingPage (CAknSettingPage *aSettingPage)
  A setting page should know when it is "Editing".
IMPORT_C CAknSettingPage SettingPage () const
IMPORT_C void  SetUpStandardSettingPageL ()
  Performs standard setup on a setting page.
IMPORT_C TDesC &  EmptyItemText () const
  Access to the empty text that has been set, or is default.
IMPORT_C TInt  SettingPageResourceId () const
  Access to the setting page resource id that might have been read by the setting item resource.
IMPORT_C TInt  SettingEditorResourceId () const
  Access to the setting page editor's resource id that might have been read by the setting item resource.
IMPORT_C TInt  AssociatedResourceId () const
  Returns the associate editor resource.
TInt  EditorControlType () const
IMPORT_C TBool  SetIconMask (CFbsBitmap *aMask)
  This sets the mask of this setting item's icon array, if it exists.
CFbsBitmap *  SetIconMaskAndReturnBitmap (CGulIcon *aIcon)
  This sets the mask of this setting item's icon array, if it exists, using the mask from the passed icon.

Friends

class  CAknSettingItemArray

Member Enumeration Documentation

enum CAknSettingItem::TFlags
 
Enumerator:
EIsHidden 
EHasIcon 
EIsNumberedStyle 
ENoProtection 
EViewOnly 
EProtected 
enum CAknSettingItem::TSettingItemProtection
 
Enumerator:
ENoSettingItemProtection 
ESettingItemViewOnly 
ESettingItemProtected 

Constructor & Destructor Documentation

IMPORT_C CAknSettingItem::CAknSettingItem TInt  identifier  ) 
 

Constructor.

Parameters:
the  unique identifier fo the setting item (not its number)
IMPORT_C CAknSettingItem::~CAknSettingItem  ) 
 

Destructor.


Member Function Documentation

IMPORT_C TInt CAknSettingItem::AssociatedResourceId  )  const [protected]
 

Returns the associate editor resource.

This is an LLINK in the seting item resource that subclasses can use in CompleteContstructionL

Returns:
0 or the extra resource id
virtual IMPORT_C void CAknSettingItem::CompleteConstructionL  )  [protected, virtual]
 

Method called by framework to complete the construction.

Extra allocations of memory or extra resource reading can happen here.

Reimplemented in CAknIntegerSettingItem, CAknPasswordSettingItem, CAknTimeOrDateSettingItem, CAknTimeOffsetSettingItem, CAknIpFieldSettingItem, CAknEnumeratedTextSettingItem, CAknEnumeratedTextPopupSettingItem, CAknBinaryPopupSettingItem, and CAknMemorySelectionSettingItem.

IMPORT_C void CAknSettingItem::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.

virtual IMPORT_C CFbsBitmap* CAknSettingItem::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().

Reimplemented in CAknVolumeSettingItem, and CAknSliderSettingItem.

virtual IMPORT_C void CAknSettingItem::EditItemL TBool  aCalledFromMenu  )  [virtual]
 

This launches the setting page.

Parameters:
aCalledFromMenu  - ignored in this class

Reimplemented in CAknTextSettingItem, CAknIntegerSettingItem, CAknIntegerEdwinSettingItem, CAknPasswordSettingItem, CAknVolumeSettingItem, CAknSliderSettingItem, CAknTimeOrDateSettingItem, CAknTimeOffsetSettingItem, CAknIpFieldSettingItem, CAknEnumeratedTextPopupSettingItem, CAknBinaryPopupSettingItem, and CAknMemorySelectionSettingItem.

TInt CAknSettingItem::EditorControlType  )  const [protected]
 
Returns:
the control type of the settin page editor
IMPORT_C TDesC& CAknSettingItem::EmptyItemText  )  const [protected]
 

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

Returns:
ref to empty text descriptor
virtual IMPORT_C void CAknSettingItem::HandleSettingPageEventL CAknSettingPage aSettingPage,
TAknSettingPageEvent  aEventType
[virtual]
 
IMPORT_C TBool CAknSettingItem::HasIcon  )  const
 

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

Returns:
ETrue if it has a bitmap
IMPORT_C TInt CAknSettingItem::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

Returns:
The identifier of this setting item
IMPORT_C TBool CAknSettingItem::IsHidden  )  const
 

Access to the setting visibility.

Returns:
ETrue if the setting item is hidden
IMPORT_C TBool CAknSettingItem::IsNumberedStyle  )  const
 

Access to the numbering style of the setting item.

Returns:
ETrue if it is numbered
IMPORT_C HBufC* CAknSettingItem::ListBoxText  ) 
 

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

Returns:
pointer to listboxtext. No allocation is performed and no change of ownership
virtual IMPORT_C void CAknSettingItem::LoadL  )  [virtual]
 

Reimplemented in CAknTextSettingItem, CAknIntegerSettingItem, CAknVolumeSettingItem, CAknSliderSettingItem, CAknTimeOrDateSettingItem, CAknTimeOffsetSettingItem, CAknIpFieldSettingItem, CAknEnumeratedTextPopupSettingItem, CAknBinaryPopupSettingItem, and CAknMemorySelectionSettingItem.

IMPORT_C CAknSettingItem::TSettingItemProtection CAknSettingItem::ProtectionState  ) 
 

Get the protection state.

See SetProtected for details for the different states.

Returns:
Protection state of the setting item
IMPORT_C void CAknSettingItem::SetCompulsoryIndTextL const TDesC &  aCompulsoryInd  ) 
 
IMPORT_C void CAknSettingItem::SetEmptyItemTextL const TDesC &  aEmptyItemText  ) 
 

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

Parameters:
text  to make display when there is empty setting. A copy is made in the setting item
IMPORT_C void CAknSettingItem::SetHidden TBool  aHidden  ) 
 

Set the visibility.

Parameters:
Set  to ETrue to hide the item; EFalse to make it visible
Note that the setting item array must have be notified of this by calling CAknSettingItemList::HandleChangeInItemArrayOrVisibility
IMPORT_C TBool CAknSettingItem::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.

Parameters:
aMask  bitmap to set as a mask for the CGulIcon in the setting listbox's icon array
Returns:
TBool ETrue if the ownership of aMask has been passed
CFbsBitmap* CAknSettingItem::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).

Parameters:
aIcon  icon of which the mask is passed through to SetIconMask() and bitmap is returned
Returns:
CFbsBitmap* bitmap from aIcon. Ownership of the bitmap is transfered to the caller
void CAknSettingItem::SetParentListBox const CEikFormattedCellListBox aListBox  ) 
 

Set the parent lisbox into the setting item.

Parameters:
aListBox  listbox with which the setting item is associated.
IMPORT_C void CAknSettingItem::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.

Parameters:
aProtected  Sets the protection state of the setting item
IMPORT_C void CAknSettingItem::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:
pointer  to the currently executing settting page dialog
IMPORT_C void CAknSettingItem::SetSettingPageFlags TInt  aFlagPattern  ) 
 

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

Parameters:
aFlagPattern  Flag pattern to set
IMPORT_C TInt CAknSettingItem::SettingEditorResourceId  )  const [protected]
 

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

Returns:
0 or the setting page editor's id
IMPORT_C TPtrC CAknSettingItem::SettingName  ) 
 

Access to the setting Name

Returns:
the setting name
IMPORT_C TInt CAknSettingItem::SettingNumber  )  const
 

Access to the setting number.

Returns:
the setting number
IMPORT_C CAknSettingPage* CAknSettingItem::SettingPage  )  const [protected]
 
IMPORT_C TInt CAknSettingItem::SettingPageFlags  )  const
 

Access method for the setting page specific flags.

Returns:
the flag pattern
IMPORT_C TInt CAknSettingItem::SettingPageResourceId  )  const [protected]
 

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

Returns:
0 or the setting page resource id
virtual IMPORT_C const TDesC& CAknSettingItem::SettingTextL  )  [virtual]
 

Reimplemented in CAknTextSettingItem, CAknIntegerSettingItem, CAknPasswordSettingItem, CAknVolumeSettingItem, CAknSliderSettingItem, CAknTimeOrDateSettingItem, CAknTimeOffsetSettingItem, CAknIpFieldSettingItem, CAknEnumeratedTextPopupSettingItem, CAknBigSettingItemBase, and CAknMemorySelectionSettingItem.

IMPORT_C void CAknSettingItem::SetUpStandardSettingPageL  )  [protected]
 

Performs standard setup on a setting page.

virtual IMPORT_C void CAknSettingItem::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.

Reimplemented in CAknTextSettingItem, CAknIntegerSettingItem, CAknVolumeSettingItem, CAknSliderSettingItem, CAknTimeOrDateSettingItem, CAknTimeOffsetSettingItem, CAknIpFieldSettingItem, CAknEnumeratedTextPopupSettingItem, CAknBinaryPopupSettingItem, and CAknMemorySelectionSettingItem.

virtual IMPORT_C void CAknSettingItem::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.

IMPORT_C TInt CAknSettingItem::VisibleIndex  ) 
 

Get the index at which this item appears in the listbox.

Returns:
index in listbox

Friends And Related Function Documentation

friend class CAknSettingItemArray [friend]
 

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

Copyright © Nokia Corporation 2001-2008
Back to top